From 159c097505dae655fc2c62e6625cdd65da53de83 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Mon, 21 Oct 2019 17:37:07 +0300 Subject: [PATCH 001/129] Created circleci config for starting environment --- .circleci/config.yml | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..7a0c6b2 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,40 @@ +version: 2.1 +orbs: + bridge: + executors: + node-dev: + docker: + - image: circleci/node:10.15 + environment: + TARGET_NETWORK: development +jobs: + prepare_test_environment: + executor: bridge/node-dev + steps: + - checkout + - run: git submodule update --init + - setup_remote_docker + - run: ./demo/start-environment.sh + - run: ./src/test-services/ethereumSend/run.sh 0x4db6b4bd0a3fdc03b027a60f1c48f05c572312aa 100 + - run: ./src/test-services/ethereumSend/run.sh 0xf7ca4aed1795e424433498cef43f6a3825c88731 100 + - run: ./src/test-services/ethereumSend/run.sh 0xad6c8127143032d843a260c5d379d8d9b3d51f15 100 + - run: docker kill ganache_side ganache_home + - persist_to_workspace: + root: . + paths: + ./demo/ganache_home_db + ./demo/ganache_side_db + run_tests: + executor: bridge/node-dev + steps: + - checkout + - run: git submodule update --init + - setup_remote_docker + - attach_workspace: + at: . + - ls ./demo/ganache_side_db +workflows: + version: 2 + main: + jobs: + - prepare_test_environment From 088aee652d394c7e7b5e7b51d5d9ea18a683800c Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Mon, 21 Oct 2019 21:43:31 +0300 Subject: [PATCH 002/129] Added more initialization of environment --- .circleci/config.yml | 47 ++++++++++++++++++++++++------------------ demo/validator-demo.sh | 2 +- tests/Dockerfile | 14 +++++++++++++ tests/config.json | 19 +++++++++++++++++ tests/package.json | 7 +++++++ tests/run.sh | 9 ++++++++ tests/test/index.js | 12 +++++++++++ 7 files changed, 89 insertions(+), 21 deletions(-) create mode 100644 tests/Dockerfile create mode 100644 tests/config.json create mode 100644 tests/package.json create mode 100755 tests/run.sh create mode 100644 tests/test/index.js diff --git a/.circleci/config.yml b/.circleci/config.yml index 7a0c6b2..bc74df0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,33 +8,40 @@ orbs: environment: TARGET_NETWORK: development jobs: - prepare_test_environment: - executor: bridge/node-dev - steps: - - checkout - - run: git submodule update --init - - setup_remote_docker - - run: ./demo/start-environment.sh - - run: ./src/test-services/ethereumSend/run.sh 0x4db6b4bd0a3fdc03b027a60f1c48f05c572312aa 100 - - run: ./src/test-services/ethereumSend/run.sh 0xf7ca4aed1795e424433498cef43f6a3825c88731 100 - - run: ./src/test-services/ethereumSend/run.sh 0xad6c8127143032d843a260c5d379d8d9b3d51f15 100 - - run: docker kill ganache_side ganache_home - - persist_to_workspace: - root: . - paths: - ./demo/ganache_home_db - ./demo/ganache_side_db run_tests: executor: bridge/node-dev steps: - checkout - run: git submodule update --init - setup_remote_docker - - attach_workspace: - at: . - - ls ./demo/ganache_side_db + - run: touch ./src/deploy/.keys.$TARGET_NETWORK + - run: ./demo/start-environment.sh + - run: touch ./src/test-services/.keys.$TARGET_NETWORK + - run: ./src/test-services/ethereumSend/run.sh 0x4db6b4bd0a3fdc03b027a60f1c48f05c572312aa 100 + - run: ./src/test-services/ethereumSend/run.sh 0xf7ca4aed1795e424433498cef43f6a3825c88731 100 + - run: ./src/test-services/ethereumSend/run.sh 0xad6c8127143032d843a260c5d379d8d9b3d51f15 100 + - run: ./src/test-services/binanceSend/run.sh tbnb14r3z8xk7qsar3vwj05w8cd8gqwk7g6gfurlt5l 100 0.1 + - run: ./src/test-services/binanceSend/run.sh tbnb1efjg7xt98t67ql2cmwjc5860lgayet9l8m55ym 100 0.1 + - run: ./src/test-services/binanceSend/run.sh tbnb12epcy4p7ktas0nlyrfuektcyh0e83dwzuq73f4 100 0.1 + - run: + command: ./demo/validator-demo.sh -d + environment: + N: 1 + - run: + command: ./demo/validator-demo.sh -d + environment: + N: 2 + - run: + command: ./demo/validator-demo.sh -d + environment: + N: 3 + - run: sleep 10 + - run: + command: ./tests/run.sh + environment: + HOME_RPC_URL: 'http://ganache_home:8545' workflows: version: 2 main: jobs: - - prepare_test_environment + - run_tests diff --git a/demo/validator-demo.sh b/demo/validator-demo.sh index 52e0592..5ea1730 100755 --- a/demo/validator-demo.sh +++ b/demo/validator-demo.sh @@ -23,4 +23,4 @@ fi # load env for particular environment source ".env.$TARGET_NETWORK" -docker-compose -p "$NAME" -f ../../src/oracle/docker-compose-test.yml up ${DCU_FLAGS} +docker-compose -p "$NAME" -f ../../src/oracle/docker-compose-test.yml up ${DCU_FLAGS} $@ diff --git a/tests/Dockerfile b/tests/Dockerfile new file mode 100644 index 0000000..8acf8e4 --- /dev/null +++ b/tests/Dockerfile @@ -0,0 +1,14 @@ +FROM node:10.16.0-alpine + +WORKDIR /tests + +RUN npm install -g mocha + +COPY ./package.json . + +RUN npm install + +COPY config.json ./ +COPY test ./test + +ENTRYPOINT ["mocha"] diff --git a/tests/config.json b/tests/config.json new file mode 100644 index 0000000..fa49f75 --- /dev/null +++ b/tests/config.json @@ -0,0 +1,19 @@ +{ + "users": [ + { + "privateKey": "7ed93ad7753e00b52265a73dfbbcd2296256772965323fcb9a6320b5cd084b89", + "ethAddress": "0x4db6b4bd0a3fdc03b027a60f1c48f05c572312aa", + "bncAddress": "tbnb14r3z8xk7qsar3vwj05w8cd8gqwk7g6gfurlt5l" + }, + { + "privateKey": "2ad6e3a232ad3ea058b61352302118a99085600ff8b6eec4ccf0066a33756231", + "ethAddress": "0xf7ca4aed1795e424433498cef43f6a3825c88731", + "bncAddress": "tbnb1efjg7xt98t67ql2cmwjc5860lgayet9l8m55ym" + }, + { + "privateKey": "eb6dd328677b3fa2822fb8e834507e569bda52e8ffa49266df0f2de239c4ec98", + "ethAddress": "0xad6c8127143032d843a260c5d379d8d9b3d51f15", + "bncAddress": "tbnb12epcy4p7ktas0nlyrfuektcyh0e83dwzuq73f4" + } + ] +} diff --git a/tests/package.json b/tests/package.json new file mode 100644 index 0000000..3941246 --- /dev/null +++ b/tests/package.json @@ -0,0 +1,7 @@ +{ + "name": "tests", + "version": "0.0.1", + "dependencies": { + "web3": "1.0.0-beta.55" + } +} diff --git a/tests/run.sh b/tests/run.sh new file mode 100755 index 0000000..7337fd2 --- /dev/null +++ b/tests/run.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e + +cd $(dirname "$0") + +docker build -t tests . > /dev/null + +docker run --network blockchain_home --rm -e HOME_RPC_URL tests $@ diff --git a/tests/test/index.js b/tests/test/index.js new file mode 100644 index 0000000..b6f7c8a --- /dev/null +++ b/tests/test/index.js @@ -0,0 +1,12 @@ +const Web3 = require('web3') +const { users } = require('../config') + +const web3 = new Web3(process.env.HOME_RPC_URL) + +describe('check balance', function () { + it('should have correct balance', async function () { + const balance = await web3.eth.getBalance(users[0].ethAddress) + console.log(balance.toNumber()) + return 0 + }) +}) From 44ae80b6ef4027bf5edd0e828e26e882db349d9f Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Mon, 21 Oct 2019 22:01:15 +0300 Subject: [PATCH 003/129] Made init script in tests --- .circleci/config.yml | 23 +---------------------- tests/init.sh | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 22 deletions(-) create mode 100755 tests/init.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index bc74df0..ae893e7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -14,28 +14,7 @@ jobs: - checkout - run: git submodule update --init - setup_remote_docker - - run: touch ./src/deploy/.keys.$TARGET_NETWORK - - run: ./demo/start-environment.sh - - run: touch ./src/test-services/.keys.$TARGET_NETWORK - - run: ./src/test-services/ethereumSend/run.sh 0x4db6b4bd0a3fdc03b027a60f1c48f05c572312aa 100 - - run: ./src/test-services/ethereumSend/run.sh 0xf7ca4aed1795e424433498cef43f6a3825c88731 100 - - run: ./src/test-services/ethereumSend/run.sh 0xad6c8127143032d843a260c5d379d8d9b3d51f15 100 - - run: ./src/test-services/binanceSend/run.sh tbnb14r3z8xk7qsar3vwj05w8cd8gqwk7g6gfurlt5l 100 0.1 - - run: ./src/test-services/binanceSend/run.sh tbnb1efjg7xt98t67ql2cmwjc5860lgayet9l8m55ym 100 0.1 - - run: ./src/test-services/binanceSend/run.sh tbnb12epcy4p7ktas0nlyrfuektcyh0e83dwzuq73f4 100 0.1 - - run: - command: ./demo/validator-demo.sh -d - environment: - N: 1 - - run: - command: ./demo/validator-demo.sh -d - environment: - N: 2 - - run: - command: ./demo/validator-demo.sh -d - environment: - N: 3 - - run: sleep 10 + - run: ./tests/init.sh - run: command: ./tests/run.sh environment: diff --git a/tests/init.sh b/tests/init.sh new file mode 100755 index 0000000..1ce0518 --- /dev/null +++ b/tests/init.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +docker build -t tss -f ./src/tss/Dockerfile-local ./src/tss +./demo/start-environment.sh +echo "FOREIGN_PRIVATE_KEY=$FOREIGN_PRIVATE_KEY" > ./src/test-services/.keys.$TARGET_NETWORK +./src/test-services/ethereumSend/run.sh 0x4db6b4bd0a3fdc03b027a60f1c48f05c572312aa 100 +./src/test-services/ethereumSend/run.sh 0xf7ca4aed1795e424433498cef43f6a3825c88731 100 +./src/test-services/ethereumSend/run.sh 0xad6c8127143032d843a260c5d379d8d9b3d51f15 100 +./src/test-services/binanceSend/run.sh tbnb14r3z8xk7qsar3vwj05w8cd8gqwk7g6gfurlt5l 100 0.1 +./src/test-services/binanceSend/run.sh tbnb1efjg7xt98t67ql2cmwjc5860lgayet9l8m55ym 100 0.1 +./src/test-services/binanceSend/run.sh tbnb12epcy4p7ktas0nlyrfuektcyh0e83dwzuq73f4 100 0.1 +N=1 ./demo/validator-demo.sh -d +N=2 ./demo/validator-demo.sh -d +N=3 ./demo/validator-demo.sh -d +sleep 10 From 80b4914d719c973e731ab0456ca799f31dff2a29 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Tue, 22 Oct 2019 14:52:24 +0300 Subject: [PATCH 004/129] Changed docker remote engine version --- .circleci/config.yml | 3 ++- tests/init.sh | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ae893e7..fe3d37c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -13,7 +13,8 @@ jobs: steps: - checkout - run: git submodule update --init - - setup_remote_docker + - setup_remote_docker: + version: 18.09.3 - run: ./tests/init.sh - run: command: ./tests/run.sh diff --git a/tests/init.sh b/tests/init.sh index 1ce0518..3604541 100755 --- a/tests/init.sh +++ b/tests/init.sh @@ -1,5 +1,7 @@ #!/bin/bash +set -e + docker build -t tss -f ./src/tss/Dockerfile-local ./src/tss ./demo/start-environment.sh echo "FOREIGN_PRIVATE_KEY=$FOREIGN_PRIVATE_KEY" > ./src/test-services/.keys.$TARGET_NETWORK From 83f9b1c2679d00f4c22554b94e477d4a07a96841 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Tue, 22 Oct 2019 15:13:06 +0300 Subject: [PATCH 005/129] Test remote docker engine --- src/tss/Dockerfile-local | 4 ++++ tests/init.sh | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/tss/Dockerfile-local b/src/tss/Dockerfile-local index 632aadf..f959c06 100644 --- a/src/tss/Dockerfile-local +++ b/src/tss/Dockerfile-local @@ -12,6 +12,10 @@ WORKDIR /tss COPY ./multi-party-ecdsa/Cargo.toml /tss/ COPY ./multi-party-ecdsa/src/lib.rs /tss/src/lib.rs +RUN ls / +RUN ls /tss +RUN ls /tss/src + RUN cargo build --release || true COPY ./multi-party-ecdsa /tss/ diff --git a/tests/init.sh b/tests/init.sh index 3604541..a19ff57 100755 --- a/tests/init.sh +++ b/tests/init.sh @@ -2,6 +2,10 @@ set -e +ls . +ls ./src/tss +ls ./src/tss/multi-party-ecdsa + docker build -t tss -f ./src/tss/Dockerfile-local ./src/tss ./demo/start-environment.sh echo "FOREIGN_PRIVATE_KEY=$FOREIGN_PRIVATE_KEY" > ./src/test-services/.keys.$TARGET_NETWORK From 061b69071d422e70b3d7b553262432b48a830d1c Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Tue, 22 Oct 2019 17:25:31 +0300 Subject: [PATCH 006/129] Test remote docker engine 2 --- src/tss/Dockerfile-local | 4 ++-- tests/init.sh | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/tss/Dockerfile-local b/src/tss/Dockerfile-local index f959c06..659c39f 100644 --- a/src/tss/Dockerfile-local +++ b/src/tss/Dockerfile-local @@ -12,9 +12,9 @@ WORKDIR /tss COPY ./multi-party-ecdsa/Cargo.toml /tss/ COPY ./multi-party-ecdsa/src/lib.rs /tss/src/lib.rs -RUN ls / RUN ls /tss -RUN ls /tss/src +RUN cat /tss/Cargo.toml +RUN cargo check RUN cargo build --release || true diff --git a/tests/init.sh b/tests/init.sh index a19ff57..ae70f62 100755 --- a/tests/init.sh +++ b/tests/init.sh @@ -2,9 +2,7 @@ set -e -ls . -ls ./src/tss -ls ./src/tss/multi-party-ecdsa +cat ./src/tss/multi-party-ecdsa/Cargo.toml docker build -t tss -f ./src/tss/Dockerfile-local ./src/tss ./demo/start-environment.sh From aed0f59097dae0169adc6bc1363140fe1111966b Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Wed, 23 Oct 2019 12:53:07 +0300 Subject: [PATCH 007/129] Test ls . in Dockerfile-local --- src/tss/Dockerfile-local | 4 ++-- tests/init.sh | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/tss/Dockerfile-local b/src/tss/Dockerfile-local index 659c39f..31e8515 100644 --- a/src/tss/Dockerfile-local +++ b/src/tss/Dockerfile-local @@ -13,8 +13,8 @@ COPY ./multi-party-ecdsa/Cargo.toml /tss/ COPY ./multi-party-ecdsa/src/lib.rs /tss/src/lib.rs RUN ls /tss -RUN cat /tss/Cargo.toml -RUN cargo check +RUN ls . +RUN pwd RUN cargo build --release || true diff --git a/tests/init.sh b/tests/init.sh index ae70f62..3604541 100755 --- a/tests/init.sh +++ b/tests/init.sh @@ -2,8 +2,6 @@ set -e -cat ./src/tss/multi-party-ecdsa/Cargo.toml - docker build -t tss -f ./src/tss/Dockerfile-local ./src/tss ./demo/start-environment.sh echo "FOREIGN_PRIVATE_KEY=$FOREIGN_PRIVATE_KEY" > ./src/test-services/.keys.$TARGET_NETWORK From 6d0d9f46178cbb6712b0b3af00edce369d88adc4 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Wed, 23 Oct 2019 12:58:32 +0300 Subject: [PATCH 008/129] Specified explicit manifest-path --- src/tss/Dockerfile-local | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/tss/Dockerfile-local b/src/tss/Dockerfile-local index 31e8515..b6fb7e0 100644 --- a/src/tss/Dockerfile-local +++ b/src/tss/Dockerfile-local @@ -12,14 +12,10 @@ WORKDIR /tss COPY ./multi-party-ecdsa/Cargo.toml /tss/ COPY ./multi-party-ecdsa/src/lib.rs /tss/src/lib.rs -RUN ls /tss -RUN ls . -RUN pwd - -RUN cargo build --release || true +RUN cargo build --manifest-path /tss/Cargo.toml --release || true COPY ./multi-party-ecdsa /tss/ -RUN cargo build --release +RUN cargo build --manifest-path /tss/Cargo.toml --release CMD echo Done From 0fa28f27a72dd7669dfb35a59e398a911314a536 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Wed, 23 Oct 2019 15:02:04 +0300 Subject: [PATCH 009/129] Moved to official rust nightly docker image --- src/tss/Dockerfile-local | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/tss/Dockerfile-local b/src/tss/Dockerfile-local index b6fb7e0..27bc344 100644 --- a/src/tss/Dockerfile-local +++ b/src/tss/Dockerfile-local @@ -1,21 +1,17 @@ -FROM ubuntu:19.10 +FROM rustlang/rust:nightly RUN apt-get update && \ apt-get install -y curl build-essential git openssl pkg-config libssl-dev libgmp3-dev -RUN curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly -y - -ENV PATH=/root/.cargo/bin:$PATH - WORKDIR /tss COPY ./multi-party-ecdsa/Cargo.toml /tss/ COPY ./multi-party-ecdsa/src/lib.rs /tss/src/lib.rs -RUN cargo build --manifest-path /tss/Cargo.toml --release || true +RUN cargo build --manifest-path /tss/Cargo.toml -vv --release || true COPY ./multi-party-ecdsa /tss/ -RUN cargo build --manifest-path /tss/Cargo.toml --release +RUN cargo build --manifest-path /tss/Cargo.toml -vv --release CMD echo Done From 437a70ae5b4e327172d5dc7648d590a5f3740339 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Wed, 23 Oct 2019 17:51:06 +0300 Subject: [PATCH 010/129] Added chmod 777 --- src/tss/Dockerfile-local | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/tss/Dockerfile-local b/src/tss/Dockerfile-local index 27bc344..2ebed37 100644 --- a/src/tss/Dockerfile-local +++ b/src/tss/Dockerfile-local @@ -1,6 +1,7 @@ FROM rustlang/rust:nightly -RUN apt-get update && \ +RUN cargo --version && \ + apt-get update && \ apt-get install -y curl build-essential git openssl pkg-config libssl-dev libgmp3-dev WORKDIR /tss @@ -8,6 +9,8 @@ WORKDIR /tss COPY ./multi-party-ecdsa/Cargo.toml /tss/ COPY ./multi-party-ecdsa/src/lib.rs /tss/src/lib.rs +RUN chmod 777 /tss/Cargo.toml + RUN cargo build --manifest-path /tss/Cargo.toml -vv --release || true COPY ./multi-party-ecdsa /tss/ From 128c986a277584ead21be1be314c9c9ca71c40e7 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Wed, 23 Oct 2019 17:57:33 +0300 Subject: [PATCH 011/129] Change rust image --- src/tss/Dockerfile-local | 2 +- tests/init.sh | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tss/Dockerfile-local b/src/tss/Dockerfile-local index 2ebed37..75a39dc 100644 --- a/src/tss/Dockerfile-local +++ b/src/tss/Dockerfile-local @@ -1,4 +1,4 @@ -FROM rustlang/rust:nightly +FROM rust:1.38 RUN cargo --version && \ apt-get update && \ diff --git a/tests/init.sh b/tests/init.sh index 3604541..94da659 100755 --- a/tests/init.sh +++ b/tests/init.sh @@ -1,6 +1,7 @@ #!/bin/bash set -e +set -v docker build -t tss -f ./src/tss/Dockerfile-local ./src/tss ./demo/start-environment.sh From f3278a9b1ca6782a7623829fe5433eb43e713fda Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Wed, 23 Oct 2019 18:09:49 +0300 Subject: [PATCH 012/129] Used 1.39 nightly rust --- src/tss/Dockerfile-local | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/tss/Dockerfile-local b/src/tss/Dockerfile-local index 75a39dc..9762de7 100644 --- a/src/tss/Dockerfile-local +++ b/src/tss/Dockerfile-local @@ -1,6 +1,7 @@ FROM rust:1.38 -RUN cargo --version && \ +RUN rustup default nightly-2019-08-28 && \ + cargo --version && \ apt-get update && \ apt-get install -y curl build-essential git openssl pkg-config libssl-dev libgmp3-dev @@ -9,12 +10,10 @@ WORKDIR /tss COPY ./multi-party-ecdsa/Cargo.toml /tss/ COPY ./multi-party-ecdsa/src/lib.rs /tss/src/lib.rs -RUN chmod 777 /tss/Cargo.toml - -RUN cargo build --manifest-path /tss/Cargo.toml -vv --release || true +RUN cargo build --release || true COPY ./multi-party-ecdsa /tss/ -RUN cargo build --manifest-path /tss/Cargo.toml -vv --release +RUN cargo build --release CMD echo Done From b5952ce02acec340a149fc3f11b89257dd4f80aa Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Wed, 23 Oct 2019 19:12:27 +0300 Subject: [PATCH 013/129] Correct dependency building. Moved building tss in separate job --- .circleci/config.yml | 30 ++++++++++++++++++++++++++---- src/tss/Dockerfile-local | 7 ++++++- tests/run.sh | 3 +-- 3 files changed, 33 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index fe3d37c..118a455 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,20 +8,42 @@ orbs: environment: TARGET_NETWORK: development jobs: - run_tests: + init: executor: bridge/node-dev steps: - checkout - run: git submodule update --init - setup_remote_docker: version: 18.09.3 - - run: ./tests/init.sh + docker_layer_caching: true + - run: docker build -t tss -f ./src/tss/Dockerfile-local ./src/tss + - run: docker save -o /home/tss.tar tss + - persist_to_workspace: + root: /home + paths: + - tss.tar + + run_tests: + executor: bridge/node-dev + steps: + - checkout + - run: git submodule update --init + - attach_workspace: + at: /home + - setup_remote_docker: + version: 18.09.3 + docker_layer_caching: true + - run: docker load -i /home/tss.tar + - run: docker images - run: - command: ./tests/run.sh + command: ./tests/init.sh environment: HOME_RPC_URL: 'http://ganache_home:8545' workflows: version: 2 main: jobs: - - run_tests + - init + - run_tests: + requires: + - init diff --git a/src/tss/Dockerfile-local b/src/tss/Dockerfile-local index 9762de7..b0770df 100644 --- a/src/tss/Dockerfile-local +++ b/src/tss/Dockerfile-local @@ -7,13 +7,18 @@ RUN rustup default nightly-2019-08-28 && \ WORKDIR /tss -COPY ./multi-party-ecdsa/Cargo.toml /tss/ +COPY ./multi-party-ecdsa/Cargo.lock ./multi-party-ecdsa/Cargo.toml /tss/ COPY ./multi-party-ecdsa/src/lib.rs /tss/src/lib.rs +# Download all dependencies +RUN cargo fetch + +# Build dependencies RUN cargo build --release || true COPY ./multi-party-ecdsa /tss/ +# Build final executables RUN cargo build --release CMD echo Done diff --git a/tests/run.sh b/tests/run.sh index 7337fd2..d49f770 100755 --- a/tests/run.sh +++ b/tests/run.sh @@ -1,8 +1,7 @@ #!/bin/bash set -e - -cd $(dirname "$0") +set -v docker build -t tests . > /dev/null From 2f241dffbea96ed048080f96a27e3b3fd00f2bf8 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Thu, 24 Oct 2019 16:05:33 +0300 Subject: [PATCH 014/129] Moved contracts deploy process in separate init job --- .circleci/config.yml | 48 +++++++++++++++++++++++++++++++-------- DEMO.md | 2 +- demo/start-environment.sh | 4 ++-- src/tss/Dockerfile | 22 +++++++++--------- src/tss/Dockerfile-local | 24 -------------------- tests/init.sh | 4 ---- 6 files changed, 53 insertions(+), 51 deletions(-) delete mode 100644 src/tss/Dockerfile-local diff --git a/.circleci/config.yml b/.circleci/config.yml index 118a455..1c46009 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,7 +8,7 @@ orbs: environment: TARGET_NETWORK: development jobs: - init: + init_tss: executor: bridge/node-dev steps: - checkout @@ -16,12 +16,36 @@ jobs: - setup_remote_docker: version: 18.09.3 docker_layer_caching: true - - run: docker build -t tss -f ./src/tss/Dockerfile-local ./src/tss - - run: docker save -o /home/tss.tar tss + - run: docker build -t tss ./src/tss + - run: docker save tss | gzip ./workspace/tss.tar.gz - persist_to_workspace: - root: /home + root: ./workspace paths: - - tss.tar + - tss.tar.gz + + init_blockchains: + executor: bridge/node-dev + steps: + - checkout + - run: git submodule update --init + - setup_remote_docker: + version: 18.09.3 + docker_layer_caching: true + - run: ./demo/start-environment.sh + - run: touch ./src/test-services/.keys.$TARGET_NETWORK + - run: ./src/test-services/ethereumSend/run.sh 0x4db6b4bd0a3fdc03b027a60f1c48f05c572312aa 100 + - run: ./src/test-services/ethereumSend/run.sh 0xf7ca4aed1795e424433498cef43f6a3825c88731 100 + - run: ./src/test-services/ethereumSend/run.sh 0xad6c8127143032d843a260c5d379d8d9b3d51f15 100 + - run: docker kill ganache_side ganache_home + - run: docker run --rm -v "ganache_side_data:/ganache_side_data" -v "ganache_home_data:/ganache_home_data" -d --name tmp alpine:3.9.4 + - run: docker cp "tmp:/ganache_side_data" "./workspace/ganache_side_data" + - run: docker cp "tmp:/ganache_home_data" "./workspace/ganache_home_data" + - run: docker kill tmp + - persist_to_workspace: + root: ./workspace + paths: + - ganache_side_data + - ganache_home_data run_tests: executor: bridge/node-dev @@ -29,12 +53,16 @@ jobs: - checkout - run: git submodule update --init - attach_workspace: - at: /home + at: ./workspace - setup_remote_docker: version: 18.09.3 docker_layer_caching: true - - run: docker load -i /home/tss.tar + - run: docker load -i ./workspace/tss.tar.gz - run: docker images + - run: docker run --rm -v "ganache_side_data:/ganache_side_data" -v "ganache_home_data:/ganache_home_data" -d --name tmp alpine:3.9.4 + - run: docker cp "./workspace/ganache_side_data" "tmp:/ganache_side_data" + - run: docker cp "./workspace/ganache_home_data" "tmp:/ganache_home_data" + - run: docker kill tmp - run: command: ./tests/init.sh environment: @@ -43,7 +71,9 @@ workflows: version: 2 main: jobs: - - init + - init_tss + - init_blockchains - run_tests: requires: - - init + - init_tss + - init_blockchains diff --git a/DEMO.md b/DEMO.md index 8f51cf2..6294efe 100644 --- a/DEMO.md +++ b/DEMO.md @@ -72,7 +72,7 @@ The public Binance Chain testnet will keep a BEP2 token. ``` * (1.10) Build TSS to be used in the bridge oracles: ``` - docker build -t tss -f ./src/tss/Dockerfile-local ./src/tss + docker build -t tss ./src/tss ``` 2. Run test environment * 2.1 Running in development mode (using local ganache networks): diff --git a/demo/start-environment.sh b/demo/start-environment.sh index 1cf6371..3747465 100755 --- a/demo/start-environment.sh +++ b/demo/start-environment.sh @@ -20,7 +20,7 @@ start_dev_blockchain_networks() { docker kill ganache_side > /dev/null 2>&1 || true docker network create blockchain_side > /dev/null 2>&1 || true - docker run -d --network blockchain_side --rm --name ganache_side -v "$SIDE_GANACHE_DB:/app/db" \ + docker run -d --network blockchain_side --rm --name ganache_side -v "ganache_side_data:/app/db" -v "$SIDE_GANACHE_DB:/app/db" \ -p "7545:8545" \ trufflesuite/ganache-cli:latest \ -m "shrug dwarf easily blade trigger lucky reopen cage lake scatter desk boat" -i 33 -q --db /app/db -b 3 --noVMErrorsOnRPCResponse @@ -29,7 +29,7 @@ start_dev_blockchain_networks() { docker kill ganache_home > /dev/null 2>&1 || true docker network create blockchain_home > /dev/null 2>&1 || true - docker run -d --network blockchain_home --rm --name ganache_home -v "$HOME_GANACHE_DB:/app/db" \ + docker run -d --network blockchain_home --rm --name ganache_home -v "ganache_home_data:/app/db" -v "$HOME_GANACHE_DB:/app/db" \ -p "8545:8545" \ trufflesuite/ganache-cli:latest \ -m "shrug dwarf easily blade trigger lucky reopen cage lake scatter desk boat" -i 44 -q --db /app/db -b 3 --noVMErrorsOnRPCResponse diff --git a/src/tss/Dockerfile b/src/tss/Dockerfile index 5921579..9b509e8 100644 --- a/src/tss/Dockerfile +++ b/src/tss/Dockerfile @@ -3,24 +3,24 @@ FROM ubuntu:19.10 RUN apt-get update && \ apt-get install -y curl build-essential git openssl pkg-config libssl-dev libgmp3-dev -RUN curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly -y - +RUN curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly-2019-08-28 -y ENV PATH=/root/.cargo/bin:$PATH - -WORKDIR /repo - -RUN git clone https://github.com/KZen-networks/multi-party-ecdsa.git . - -RUN mkdir -p /tss/src && \ - cp /repo/Cargo.toml /tss/ && \ - cp /repo/src/lib.rs /tss/src/ +RUN cargo --version WORKDIR /tss +COPY ./multi-party-ecdsa/Cargo.lock ./multi-party-ecdsa/Cargo.toml /tss/ +COPY ./multi-party-ecdsa/src/lib.rs /tss/src/lib.rs + +# Download all dependencies +RUN cargo fetch + +# Build dependencies RUN cargo build --release || true -RUN cp -Tr /repo /tss +COPY ./multi-party-ecdsa /tss/ +# Build final executables RUN cargo build --release CMD echo Done diff --git a/src/tss/Dockerfile-local b/src/tss/Dockerfile-local deleted file mode 100644 index b0770df..0000000 --- a/src/tss/Dockerfile-local +++ /dev/null @@ -1,24 +0,0 @@ -FROM rust:1.38 - -RUN rustup default nightly-2019-08-28 && \ - cargo --version && \ - apt-get update && \ - apt-get install -y curl build-essential git openssl pkg-config libssl-dev libgmp3-dev - -WORKDIR /tss - -COPY ./multi-party-ecdsa/Cargo.lock ./multi-party-ecdsa/Cargo.toml /tss/ -COPY ./multi-party-ecdsa/src/lib.rs /tss/src/lib.rs - -# Download all dependencies -RUN cargo fetch - -# Build dependencies -RUN cargo build --release || true - -COPY ./multi-party-ecdsa /tss/ - -# Build final executables -RUN cargo build --release - -CMD echo Done diff --git a/tests/init.sh b/tests/init.sh index 94da659..860ec1b 100755 --- a/tests/init.sh +++ b/tests/init.sh @@ -3,12 +3,8 @@ set -e set -v -docker build -t tss -f ./src/tss/Dockerfile-local ./src/tss ./demo/start-environment.sh echo "FOREIGN_PRIVATE_KEY=$FOREIGN_PRIVATE_KEY" > ./src/test-services/.keys.$TARGET_NETWORK -./src/test-services/ethereumSend/run.sh 0x4db6b4bd0a3fdc03b027a60f1c48f05c572312aa 100 -./src/test-services/ethereumSend/run.sh 0xf7ca4aed1795e424433498cef43f6a3825c88731 100 -./src/test-services/ethereumSend/run.sh 0xad6c8127143032d843a260c5d379d8d9b3d51f15 100 ./src/test-services/binanceSend/run.sh tbnb14r3z8xk7qsar3vwj05w8cd8gqwk7g6gfurlt5l 100 0.1 ./src/test-services/binanceSend/run.sh tbnb1efjg7xt98t67ql2cmwjc5860lgayet9l8m55ym 100 0.1 ./src/test-services/binanceSend/run.sh tbnb12epcy4p7ktas0nlyrfuektcyh0e83dwzuq73f4 100 0.1 From 312004128a66bf1b2aa3d77f28a695df718555de Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Thu, 24 Oct 2019 16:24:18 +0300 Subject: [PATCH 015/129] Updated scripts to store ganache data in docker volumes --- .circleci/config.yml | 4 ++++ demo/clean.sh | 6 ++---- demo/start-environment.sh | 23 +++++++---------------- 3 files changed, 13 insertions(+), 20 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1c46009..249ba35 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -17,6 +17,7 @@ jobs: version: 18.09.3 docker_layer_caching: true - run: docker build -t tss ./src/tss + - run: mkdir ./workspace - run: docker save tss | gzip ./workspace/tss.tar.gz - persist_to_workspace: root: ./workspace @@ -38,6 +39,7 @@ jobs: - run: ./src/test-services/ethereumSend/run.sh 0xad6c8127143032d843a260c5d379d8d9b3d51f15 100 - run: docker kill ganache_side ganache_home - run: docker run --rm -v "ganache_side_data:/ganache_side_data" -v "ganache_home_data:/ganache_home_data" -d --name tmp alpine:3.9.4 + - run: mkdir ./workspace - run: docker cp "tmp:/ganache_side_data" "./workspace/ganache_side_data" - run: docker cp "tmp:/ganache_home_data" "./workspace/ganache_home_data" - run: docker kill tmp @@ -59,6 +61,8 @@ jobs: docker_layer_caching: true - run: docker load -i ./workspace/tss.tar.gz - run: docker images + - run: docker volume create ganache_side_data + - run: docker volume create ganache_home_data - run: docker run --rm -v "ganache_side_data:/ganache_side_data" -v "ganache_home_data:/ganache_home_data" -d --name tmp alpine:3.9.4 - run: docker cp "./workspace/ganache_side_data" "tmp:/ganache_side_data" - run: docker cp "./workspace/ganache_home_data" "tmp:/ganache_home_data" diff --git a/demo/clean.sh b/demo/clean.sh index b6c7c54..1044917 100755 --- a/demo/clean.sh +++ b/demo/clean.sh @@ -10,10 +10,8 @@ TARGET_NETWORK=${TARGET_NETWORK:=development} echo "Cleaning $TARGET_NETWORK network" if [[ "$TARGET_NETWORK" == "development" ]]; then - rm -rf ganache_side_db - rm -rf ganache_home_db - mkdir ganache_side_db - mkdir ganache_home_db + docker volume rm ganache_side_data > /dev/null 2>&1 || true + docker volume rm ganache_home_data > /dev/null 2>&1 || true fi for (( I = 1; I < 4; ++I )); do diff --git a/demo/start-environment.sh b/demo/start-environment.sh index 3747465..788c5a1 100755 --- a/demo/start-environment.sh +++ b/demo/start-environment.sh @@ -12,15 +12,13 @@ DEPLOY_DIR="`pwd`/src/deploy" TEST_SERVICES_DIR="`pwd`/src/test-services" DEMO_DIR="`pwd`/demo" -SIDE_GANACHE_DB="$DEMO_DIR/ganache_side_db" -HOME_GANACHE_DB="$DEMO_DIR/ganache_home_db" - start_dev_blockchain_networks() { echo "Starting side test blockchain" docker kill ganache_side > /dev/null 2>&1 || true docker network create blockchain_side > /dev/null 2>&1 || true - docker run -d --network blockchain_side --rm --name ganache_side -v "ganache_side_data:/app/db" -v "$SIDE_GANACHE_DB:/app/db" \ + docker volume create ganache_side_data > /dev/null 2>&1 || true + docker run -d --network blockchain_side --rm --name ganache_side -v "ganache_side_data:/app/db" \ -p "7545:8545" \ trufflesuite/ganache-cli:latest \ -m "shrug dwarf easily blade trigger lucky reopen cage lake scatter desk boat" -i 33 -q --db /app/db -b 3 --noVMErrorsOnRPCResponse @@ -29,7 +27,8 @@ start_dev_blockchain_networks() { docker kill ganache_home > /dev/null 2>&1 || true docker network create blockchain_home > /dev/null 2>&1 || true - docker run -d --network blockchain_home --rm --name ganache_home -v "ganache_home_data:/app/db" -v "$HOME_GANACHE_DB:/app/db" \ + docker volume create ganache_home_data > /dev/null 2>&1 || true + docker run -d --network blockchain_home --rm --name ganache_home -v "ganache_home_data:/app/db" \ -p "8545:8545" \ trufflesuite/ganache-cli:latest \ -m "shrug dwarf easily blade trigger lucky reopen cage lake scatter desk boat" -i 44 -q --db /app/db -b 3 --noVMErrorsOnRPCResponse @@ -135,20 +134,12 @@ deploy_all() { if [[ "$TARGET_NETWORK" == "development" ]]; then - if [[ ! -d "$SIDE_GANACHE_DB" ]]; then - mkdir "$SIDE_GANACHE_DB" - fi - if [[ ! -d "$HOME_GANACHE_DB" ]]; then - mkdir "$HOME_GANACHE_DB" - fi - - - if [[ -z "$(ls -A "$SIDE_GANACHE_DB")" ]] || [[ -z "$(ls -A "$HOME_GANACHE_DB")" ]]; then + if [[ "$(docker volume ls | grep ganache_side_db)" ]] || [[ "$(docker volume ls | grep ganache_home_db)" ]]; then + echo "Restarting dev blockchain networks" + else echo "Starting dev blockchain networks and deploying contracts" need_to_deploy=true - else - echo "Restarting dev blockchain networks" fi start_dev_blockchain_networks From 0b3c1c851c900079d0d224b41b4b27502f3b70e6 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Thu, 24 Oct 2019 16:41:45 +0300 Subject: [PATCH 016/129] Small fixes in config --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 249ba35..2870f16 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -18,7 +18,7 @@ jobs: docker_layer_caching: true - run: docker build -t tss ./src/tss - run: mkdir ./workspace - - run: docker save tss | gzip ./workspace/tss.tar.gz + - run: docker save tss | gzip > ./workspace/tss.tar.gz - persist_to_workspace: root: ./workspace paths: @@ -38,7 +38,7 @@ jobs: - run: ./src/test-services/ethereumSend/run.sh 0xf7ca4aed1795e424433498cef43f6a3825c88731 100 - run: ./src/test-services/ethereumSend/run.sh 0xad6c8127143032d843a260c5d379d8d9b3d51f15 100 - run: docker kill ganache_side ganache_home - - run: docker run --rm -v "ganache_side_data:/ganache_side_data" -v "ganache_home_data:/ganache_home_data" -d --name tmp alpine:3.9.4 + - run: docker run --rm -v "ganache_side_data:/ganache_side_data" -v "ganache_home_data:/ganache_home_data" -itd --name tmp alpine:3.9.4 - run: mkdir ./workspace - run: docker cp "tmp:/ganache_side_data" "./workspace/ganache_side_data" - run: docker cp "tmp:/ganache_home_data" "./workspace/ganache_home_data" From 7aeaf94627ce1c363ff0630f125caf63cef4e92d Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Thu, 24 Oct 2019 23:45:25 +0300 Subject: [PATCH 017/129] Refactored config, tests scripts files --- .circleci/config.yml | 157 +++++++++++++++++++++++++++++-------------- tests/init.sh | 13 ++-- tests/run.sh | 2 +- 3 files changed, 117 insertions(+), 55 deletions(-) mode change 100755 => 100644 tests/init.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index 2870f16..e2d2e53 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,70 +7,129 @@ orbs: - image: circleci/node:10.15 environment: TARGET_NETWORK: development + commands: + fetch_repo: + description: "Checkout and init submodules" + steps: + - checkout + - run: + name: "Initializing submodules" + command: git submodule update --init + setup_docker: + description: "Set up remote docker engine" + steps: + - setup_remote_docker: + version: 18.09.3 + docker_layer_caching: true + save_ganache_data: + description: "Save dev environment in workspace" + steps: + - run: + name: "Backup blockchains data using temporary container" + command: | + mkdir ./workspace + docker run --rm -v "ganache_side_data:/ganache_side_data" -v "ganache_home_data:/ganache_home_data" -itd --name tmp alpine:3.9.4 + docker cp "tmp:/ganache_side_data" "./workspace/ganache_side_data" + docker cp "tmp:/ganache_home_data" "./workspace/ganache_home_data" + docker kill tmp + - persist_to_workspace: + root: ./workspace + paths: + - ganache_side_data + - ganache_home_data + restore_ganache_data: + description: "Restore dev environment from workspace" + steps: + - run: + name: "Restore blockchains data from backup using temporary container" + command: | + docker volume create ganache_side_data + docker volume create ganache_home_data + docker run --rm -v "ganache_side_data:/ganache_side_data" -v "ganache_home_data:/ganache_home_data" -itd --name tmp alpine:3.9.4 + docker cp "./workspace/ganache_side_data" "tmp:/ganache_side_data" + docker cp "./workspace/ganache_home_data" "tmp:/ganache_home_data" + docker kill tmp + save_tss: + description: "Save tss image to workspace" + steps: + - run: + name: "Save tss image to archive" + command: | + mkdir ./workspace + docker save tss | gzip > ./workspace/tss.tar.gz + - persist_to_workspace: + root: ./workspace + paths: + - tss.tar.gz + load_tss: + description: "Load tss image from workspace" + steps: + - run: + name: "Load tss image from archive" + command: docker load -i ./workspace/tss.tar.gz jobs: init_tss: executor: bridge/node-dev steps: - - checkout - - run: git submodule update --init - - setup_remote_docker: - version: 18.09.3 - docker_layer_caching: true - - run: docker build -t tss ./src/tss - - run: mkdir ./workspace - - run: docker save tss | gzip > ./workspace/tss.tar.gz - - persist_to_workspace: - root: ./workspace - paths: - - tss.tar.gz - + - bridge/fetch_repo + - bridge/setup_docker + - run: + name: "Build tss image" + command: docker build -t tss ./src/tss + - bridge/save_tss init_blockchains: executor: bridge/node-dev steps: - - checkout - - run: git submodule update --init - - setup_remote_docker: - version: 18.09.3 - docker_layer_caching: true - - run: ./demo/start-environment.sh - - run: touch ./src/test-services/.keys.$TARGET_NETWORK - - run: ./src/test-services/ethereumSend/run.sh 0x4db6b4bd0a3fdc03b027a60f1c48f05c572312aa 100 - - run: ./src/test-services/ethereumSend/run.sh 0xf7ca4aed1795e424433498cef43f6a3825c88731 100 - - run: ./src/test-services/ethereumSend/run.sh 0xad6c8127143032d843a260c5d379d8d9b3d51f15 100 - - run: docker kill ganache_side ganache_home - - run: docker run --rm -v "ganache_side_data:/ganache_side_data" -v "ganache_home_data:/ganache_home_data" -itd --name tmp alpine:3.9.4 - - run: mkdir ./workspace - - run: docker cp "tmp:/ganache_side_data" "./workspace/ganache_side_data" - - run: docker cp "tmp:/ganache_home_data" "./workspace/ganache_home_data" - - run: docker kill tmp - - persist_to_workspace: - root: ./workspace - paths: - - ganache_side_data - - ganache_home_data - + - bridge/fetch_repo + - bridge/setup_docker + - run: + name: "Stub .keys file" + command: touch ./src/test-services/.keys.$TARGET_NETWORK + - run: + name: "Run dev environment, deploy contracts, prefund accounts" + command: | + ./demo/start-environment.sh + cat ./tests/config.json | jq .users[].ethAddress | xargs -I {} ./src/test-services/ethereumSend/run.sh {} 100 + - run: + name: "Stop dev environment" + command: docker kill ganache_side ganache_home + - bridge/save_ganache_data run_tests: executor: bridge/node-dev steps: - - checkout - - run: git submodule update --init + - bridge/fetch_repo + - bridge/setup_docker - attach_workspace: at: ./workspace - - setup_remote_docker: - version: 18.09.3 - docker_layer_caching: true - - run: docker load -i ./workspace/tss.tar.gz - - run: docker images - - run: docker volume create ganache_side_data - - run: docker volume create ganache_home_data - - run: docker run --rm -v "ganache_side_data:/ganache_side_data" -v "ganache_home_data:/ganache_home_data" -d --name tmp alpine:3.9.4 - - run: docker cp "./workspace/ganache_side_data" "tmp:/ganache_side_data" - - run: docker cp "./workspace/ganache_home_data" "tmp:/ganache_home_data" - - run: docker kill tmp + - bridge/load_tss + - bridge/restore_ganache_data - run: - command: ./tests/init.sh + name: "Init tests environment" + command: | + ./demo/start-environment.sh + echo "FOREIGN_PRIVATE_KEY=$FOREIGN_PRIVATE_KEY" > ./src/test-services/.keys.$TARGET_NETWORK + cat ./tests/config.json | jq .users[].bncAddress | xargs -I {} ./src/test-services/binanceSend/run.sh {} 100 0.1 + N=1 ./demo/validator-demo.sh -d + N=2 ./demo/validator-demo.sh -d + N=3 ./demo/validator-demo.sh -d + - run: + name: "Wait until validator nodes are ready" + command: | + until curl -X GET http://localhost:5001 > /dev/null 2>&1; do sleep 1; done + until curl -X GET http://localhost:5002 > /dev/null 2>&1; do sleep 1; done + until curl -X GET http://localhost:5003 > /dev/null 2>&1; do sleep 1; done + - run: + name: "Build and prepare tests container" + command: | + docker build -t tests ./tests + docker create --rm -e HOME_RPC_URL --name tests tests $@ + docker network connect blockchain_side tests + docker network connect blockchain_home tests environment: HOME_RPC_URL: 'http://ganache_home:8545' + - run: + name: "Run tests" + command: docker start tests workflows: version: 2 main: diff --git a/tests/init.sh b/tests/init.sh old mode 100755 new mode 100644 index 860ec1b..35b7742 --- a/tests/init.sh +++ b/tests/init.sh @@ -1,14 +1,17 @@ #!/bin/bash set -e -set -v ./demo/start-environment.sh + echo "FOREIGN_PRIVATE_KEY=$FOREIGN_PRIVATE_KEY" > ./src/test-services/.keys.$TARGET_NETWORK -./src/test-services/binanceSend/run.sh tbnb14r3z8xk7qsar3vwj05w8cd8gqwk7g6gfurlt5l 100 0.1 -./src/test-services/binanceSend/run.sh tbnb1efjg7xt98t67ql2cmwjc5860lgayet9l8m55ym 100 0.1 -./src/test-services/binanceSend/run.sh tbnb12epcy4p7ktas0nlyrfuektcyh0e83dwzuq73f4 100 0.1 + +cat ./tests/config.json | jq .users[].bncAddress | xargs -I {} ./src/test-services/binanceSend/run.sh {} 100 0.1 + N=1 ./demo/validator-demo.sh -d N=2 ./demo/validator-demo.sh -d N=3 ./demo/validator-demo.sh -d -sleep 10 + +until curl -X GET http://localhost:5001 > /dev/null 2>&1; do sleep 1; done +until curl -X GET http://localhost:5002 > /dev/null 2>&1; do sleep 1; done +until curl -X GET http://localhost:5003 > /dev/null 2>&1; do sleep 1; done diff --git a/tests/run.sh b/tests/run.sh index d49f770..59fdd2f 100755 --- a/tests/run.sh +++ b/tests/run.sh @@ -3,6 +3,6 @@ set -e set -v -docker build -t tests . > /dev/null +docker build -t tests ./tests docker run --network blockchain_home --rm -e HOME_RPC_URL tests $@ From 13c073469177d722d1890f197cc55c8162a88dbf Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Sun, 27 Oct 2019 19:21:36 +0300 Subject: [PATCH 018/129] First wokring tests set --- .circleci/config.yml | 20 +++++++--- demo/start-environment.sh | 2 +- tests/.mocharc.yml | 3 ++ tests/Dockerfile | 6 ++- tests/init.sh | 4 +- tests/package.json | 5 ++- tests/run.sh | 25 +++++++++++- tests/test/ethToBnc.js | 51 +++++++++++++++++++++++++ tests/test/index.js | 36 ++++++++++++++---- tests/test/utils/bncClient.js | 42 ++++++++++++++++++++ tests/test/utils/bncController.js | 29 ++++++++++++++ tests/test/utils/homeContracts.js | 24 ++++++++++++ tests/test/utils/proxyController.js | 31 +++++++++++++++ tests/test/utils/user.js | 59 +++++++++++++++++++++++++++++ tests/test/utils/wait.js | 25 ++++++++++++ 15 files changed, 340 insertions(+), 22 deletions(-) create mode 100644 tests/.mocharc.yml mode change 100644 => 100755 tests/init.sh create mode 100644 tests/test/ethToBnc.js create mode 100644 tests/test/utils/bncClient.js create mode 100644 tests/test/utils/bncController.js create mode 100644 tests/test/utils/homeContracts.js create mode 100644 tests/test/utils/proxyController.js create mode 100644 tests/test/utils/user.js create mode 100644 tests/test/utils/wait.js diff --git a/.circleci/config.yml b/.circleci/config.yml index e2d2e53..5f30c5f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -94,6 +94,11 @@ jobs: name: "Stop dev environment" command: docker kill ganache_side ganache_home - bridge/save_ganache_data + - run: + name: "Prefund bnc addresses" + command: | + echo "FOREIGN_PRIVATE_KEY=$FOREIGN_PRIVATE_KEY" > ./src/test-services/.keys.$TARGET_NETWORK + cat ./tests/config.json | jq .users[].bncAddress | xargs -I {} ./src/test-services/binanceSend/run.sh {} 100 0.1 run_tests: executor: bridge/node-dev steps: @@ -107,17 +112,15 @@ jobs: name: "Init tests environment" command: | ./demo/start-environment.sh - echo "FOREIGN_PRIVATE_KEY=$FOREIGN_PRIVATE_KEY" > ./src/test-services/.keys.$TARGET_NETWORK - cat ./tests/config.json | jq .users[].bncAddress | xargs -I {} ./src/test-services/binanceSend/run.sh {} 100 0.1 N=1 ./demo/validator-demo.sh -d N=2 ./demo/validator-demo.sh -d N=3 ./demo/validator-demo.sh -d - run: name: "Wait until validator nodes are ready" command: | - until curl -X GET http://localhost:5001 > /dev/null 2>&1; do sleep 1; done - until curl -X GET http://localhost:5002 > /dev/null 2>&1; do sleep 1; done - until curl -X GET http://localhost:5003 > /dev/null 2>&1; do sleep 1; done + docker run --network validator1_test_network --entrypoint ash appropriate/curl:latest -c "until curl -X GET http://proxy:8002/info > /dev/null 2>&1; do sleep 1; done" + docker run --network validator2_test_network --entrypoint ash appropriate/curl:latest -c "until curl -X GET http://proxy:8002/info > /dev/null 2>&1; do sleep 1; done" + docker run --network validator3_test_network --entrypoint ash appropriate/curl:latest -c "until curl -X GET http://proxy:8002/info > /dev/null 2>&1; do sleep 1; done" - run: name: "Build and prepare tests container" command: | @@ -125,11 +128,16 @@ jobs: docker create --rm -e HOME_RPC_URL --name tests tests $@ docker network connect blockchain_side tests docker network connect blockchain_home tests + docker network connect validator1_test_network tests + docker network connect validator2_test_network tests + docker network connect validator3_test_network tests environment: HOME_RPC_URL: 'http://ganache_home:8545' - run: name: "Run tests" - command: docker start tests + command: | + docker start -a tests + docker cp "tests:/tests/results.xml" "./tests/results.xml" workflows: version: 2 main: diff --git a/demo/start-environment.sh b/demo/start-environment.sh index 788c5a1..111446d 100755 --- a/demo/start-environment.sh +++ b/demo/start-environment.sh @@ -135,7 +135,7 @@ deploy_all() { if [[ "$TARGET_NETWORK" == "development" ]]; then - if [[ "$(docker volume ls | grep ganache_side_db)" ]] || [[ "$(docker volume ls | grep ganache_home_db)" ]]; then + if [[ "$(docker volume ls | grep ganache_side_data)" ]] || [[ "$(docker volume ls | grep ganache_home_data)" ]]; then echo "Restarting dev blockchain networks" else echo "Starting dev blockchain networks and deploying contracts" diff --git a/tests/.mocharc.yml b/tests/.mocharc.yml new file mode 100644 index 0000000..82c1ba6 --- /dev/null +++ b/tests/.mocharc.yml @@ -0,0 +1,3 @@ +reporter: spec +reporter-option: + - mochaFile=./results.xml diff --git a/tests/Dockerfile b/tests/Dockerfile index 8acf8e4..2400a1b 100644 --- a/tests/Dockerfile +++ b/tests/Dockerfile @@ -2,13 +2,15 @@ FROM node:10.16.0-alpine WORKDIR /tests -RUN npm install -g mocha +RUN npm install -g mocha mocha-junit-reporter + +RUN apk update && apk add libssl1.1 eudev-dev libressl-dev curl build-base python linux-headers libusb-dev COPY ./package.json . RUN npm install -COPY config.json ./ +COPY config.json .mocharc.yml ./ COPY test ./test ENTRYPOINT ["mocha"] diff --git a/tests/init.sh b/tests/init.sh old mode 100644 new mode 100755 index 35b7742..e9831b3 --- a/tests/init.sh +++ b/tests/init.sh @@ -1,11 +1,11 @@ #!/bin/bash set -e +set -v ./demo/start-environment.sh -echo "FOREIGN_PRIVATE_KEY=$FOREIGN_PRIVATE_KEY" > ./src/test-services/.keys.$TARGET_NETWORK - +cat ./tests/config.json | jq .users[].ethAddress | xargs -I {} ./src/test-services/ethereumSend/run.sh {} 100 cat ./tests/config.json | jq .users[].bncAddress | xargs -I {} ./src/test-services/binanceSend/run.sh {} 100 0.1 N=1 ./demo/validator-demo.sh -d diff --git a/tests/package.json b/tests/package.json index 3941246..de759d4 100644 --- a/tests/package.json +++ b/tests/package.json @@ -2,6 +2,9 @@ "name": "tests", "version": "0.0.1", "dependencies": { - "web3": "1.0.0-beta.55" + "ethers": "4.0.38", + "axios": "0.19.0", + "@binance-chain/javascript-sdk": "2.16.1", + "bignumber.js": "9.0.0" } } diff --git a/tests/run.sh b/tests/run.sh index 59fdd2f..b78d747 100755 --- a/tests/run.sh +++ b/tests/run.sh @@ -1,8 +1,29 @@ #!/bin/bash set -e -set -v docker build -t tests ./tests -docker run --network blockchain_home --rm -e HOME_RPC_URL tests $@ +set -a +source ./demo/validator1/.env.development +set +a + +docker rm tests || true +docker create --name tests \ + -e HOME_RPC_URL \ + -e FOREIGN_URL \ + -e HOME_BRIDGE_ADDRESS \ + -e HOME_TOKEN_ADDRESS \ + -e FOREIGN_PRIVATE_KEY \ + -e FOREIGN_ASSET \ + tests $@ + +docker network connect blockchain_home tests +docker network connect validator1_test_network tests +docker network connect validator2_test_network tests +docker network connect validator3_test_network tests + +docker start -a tests || true + +docker cp "tests:/tests/results.xml" "./tests/results.xml" || true +docker rm tests || true diff --git a/tests/test/ethToBnc.js b/tests/test/ethToBnc.js new file mode 100644 index 0000000..09bc2c5 --- /dev/null +++ b/tests/test/ethToBnc.js @@ -0,0 +1,51 @@ +const assert = require('assert') +const createUser = require('./utils/user') +const { getSequence } = require('./utils/bncController') +const { waitPromise, delay } = require('./utils/wait') + +const usersConfig = require('../config').users + +const { HOME_BRIDGE_ADDRESS } = process.env + +module.exports = (foreignBridgeAddress) => { + describe('exchanges tokens in eth => bnc direction', function () { + let ethBalances + let bncBalances + let bncBridgeSequence + let users + + before(async function () { + this.timeout(60000) + users = await usersConfig.seqMap(user => createUser(user.privateKey)) + ethBalances = await Promise.all(users.map(user => user.getEthBalance())) + bncBalances = await users.seqMap(user => user.getBncBalance()) + + bncBridgeSequence = await getSequence(foreignBridgeAddress()) + await Promise.all(users.map((user, i) => user.approveEth(HOME_BRIDGE_ADDRESS, 5 + i))) + }) + + it('should accept exchange requests', async function () { + this.timeout(60000) + await Promise.all(users.map((user, i) => user.exchangeEth(5 + i))) + const newEthBalances = await Promise.all(users.map(user => user.getEthBalance())) + for (let i = 0; i < 3; i++) { + assert(newEthBalances[i] === ethBalances[i] - 5 - i, `Balance of ${usersConfig[i].ethAddress} did not updated as expected`) + } + ethBalances = newEthBalances + }) + + it('should make exchange transaction on bnc side', async function () { + this.timeout(300000) + await waitPromise(() => getSequence(foreignBridgeAddress()), sequence => sequence === bncBridgeSequence + 1) + }) + + it('should make correct exchange transaction', async function () { + this.timeout(60000) + const newBncBalances = await Promise.all(users.map(user => user.getBncBalance())) + for (let i = 0; i < 3; i++) { + assert(newBncBalances[i] === bncBalances[i] + 5 + i, `Balance of ${usersConfig[i].bncAddress} did not updated as expected`) + } + bncBalances = newBncBalances + }) + }) +} diff --git a/tests/test/index.js b/tests/test/index.js index b6f7c8a..6b8e518 100644 --- a/tests/test/index.js +++ b/tests/test/index.js @@ -1,12 +1,32 @@ -const Web3 = require('web3') -const { users } = require('../config') +const createController = require('./utils/proxyController') +const createUser = require('./utils/user') +const { waitPromise } = require('./utils/wait') -const web3 = new Web3(process.env.HOME_RPC_URL) +const testEthToBnc = require('./ethToBnc') -describe('check balance', function () { - it('should have correct balance', async function () { - const balance = await web3.eth.getBalance(users[0].ethAddress) - console.log(balance.toNumber()) - return 0 +const { FOREIGN_PRIVATE_KEY } = process.env + +let user + +let { getInfo } = createController(1) + +let info + +describe('generates initial epoch keys', function () { + before(async function () { + this.timeout(60000) + user = await createUser(FOREIGN_PRIVATE_KEY) + }) + + it('should generate keys in 2 min', async function () { + this.timeout(120000) + info = await waitPromise(getInfo, info => info.epoch === 1) + }) + + after(async function () { + this.timeout(60000) + await user.transferBnc(info.foreignBridgeAddress, 50, 0.1) }) }) + +testEthToBnc(() => info.foreignBridgeAddress) diff --git a/tests/test/utils/bncClient.js b/tests/test/utils/bncClient.js new file mode 100644 index 0000000..4396b53 --- /dev/null +++ b/tests/test/utils/bncClient.js @@ -0,0 +1,42 @@ +const Bnc = require('@binance-chain/javascript-sdk') + +const { delay } = require('./wait') + +const { FOREIGN_URL, FOREIGN_ASSET } = process.env + +module.exports = async function main (privateKey) { + const client = new Bnc(FOREIGN_URL) + client.chooseNetwork('testnet') + + await client.setPrivateKey(privateKey) + + await client.initChain() + const from = client.getClientKeyAddress() + + await delay(1000) + + return { + transfer: async function (to, tokens, bnbs) { + const outputs = [{ + to, + coins: [] + }] + if (tokens) { + outputs[0].coins.push({ + denom: FOREIGN_ASSET, + amount: tokens + }) + } + if (bnbs) { + outputs[0].coins.push({ + denom: 'BNB', + amount: bnbs + }) + } + await client.multiSend(from, outputs, 'funding') + }, + exchange: async function (to, value) { + await client.transfer(from, to, value.toString(), FOREIGN_ASSET, 'exchange') + } + } +} diff --git a/tests/test/utils/bncController.js b/tests/test/utils/bncController.js new file mode 100644 index 0000000..589b4a4 --- /dev/null +++ b/tests/test/utils/bncController.js @@ -0,0 +1,29 @@ +const axios = require('axios') + +const { FOREIGN_URL, FOREIGN_ASSET } = process.env + +const bnc = axios.create({ + baseURL: FOREIGN_URL, + timeout: 5000 +}) + +module.exports = { + getBalance: async function (address) { + try { + const response = await bnc.get(`/api/v1/account/${address}`) + + return parseFloat(response.data.balances.find(x => x.symbol === FOREIGN_ASSET).free) + } catch (e) { + return 0 + } + }, + getSequence: async function(address) { + try { + const response = await bnc.get(`/api/v1/account/${address}/sequence`) + + return response.data.sequence + } catch (e) { + return 0 + } + } +} diff --git a/tests/test/utils/homeContracts.js b/tests/test/utils/homeContracts.js new file mode 100644 index 0000000..6912273 --- /dev/null +++ b/tests/test/utils/homeContracts.js @@ -0,0 +1,24 @@ +const ethers = require('ethers') + +const { HOME_RPC_URL, HOME_TOKEN_ADDRESS, HOME_BRIDGE_ADDRESS } = process.env + +const abiToken = [ + 'function balanceOf(address account) view returns (uint)', + 'function transfer(address to, uint value)', + 'function approve(address to, uint value)', + 'function allowance(address owner, address spender) view returns (uint)' +] +const abiBridge = [ + 'function exchange(uint value)' +] + +const provider = new ethers.providers.JsonRpcProvider(HOME_RPC_URL) + +const tokenContract = new ethers.Contract(HOME_TOKEN_ADDRESS, abiToken, provider) +const bridgeContract = new ethers.Contract(HOME_BRIDGE_ADDRESS, abiBridge, provider) + +module.exports = { + tokenContract, + bridgeContract, + provider +} diff --git a/tests/test/utils/proxyController.js b/tests/test/utils/proxyController.js new file mode 100644 index 0000000..1000a5a --- /dev/null +++ b/tests/test/utils/proxyController.js @@ -0,0 +1,31 @@ +const axios = require('axios') + +module.exports = function (validatorId) { + const url = `http://validator${validatorId}_proxy_1:8002/` + + const proxy = axios.create({ + baseURL: url, + timeout: 5000 + }) + + return { + getInfo: async function () { + return (await proxy.get('/info')).data + }, + voteStartVoting: async function () { + return (await proxy.get('/vote/startVoting')).data + }, + voteStartKeygen: async function () { + return (await proxy.get('/vote/startKeygen')).data + }, + voteAddValidator: async function (validatorAddress) { + return (await proxy.get(`/vote/addValidator/${validatorAddress}`)).data + }, + voteRemoveValidator: async function (validatorAddress) { + return (await proxy.get(`/vote/removeValidator/${validatorAddress}`)).data + }, + voteChangeThreshold: async function (threshold) { + return (await proxy.get(`/vote/changeThreshold/${threshold}`)).data + } + } +} diff --git a/tests/test/utils/user.js b/tests/test/utils/user.js new file mode 100644 index 0000000..da7dde2 --- /dev/null +++ b/tests/test/utils/user.js @@ -0,0 +1,59 @@ +const ethers = require('ethers') +const BN = require('bignumber.js') +const { getAddressFromPrivateKey } = require('@binance-chain/javascript-sdk/lib/crypto') + +const createBncClient = require('./bncClient') +const { getBalance } = require('./bncController') +const { tokenContract, bridgeContract, provider } = require('./homeContracts') +const { delay } = require('./wait') + +const txOptions = { + gasLimit: 200000 +} + +module.exports = async function (privateKey) { + const wallet = new ethers.Wallet(privateKey, provider) + const ethAddress = wallet.address + const bncAddress = getAddressFromPrivateKey(privateKey) + const token = tokenContract.connect(wallet) + const bridge = bridgeContract.connect(wallet) + + const bncClient = await createBncClient(privateKey) + + return { + getEthBalance: async function () { + const balance = await token.balanceOf(ethAddress) + return parseFloat(new BN(balance).dividedBy(10 ** 18).toFixed(8, 3)) + }, + transferEth: async function (to, value) { + const tx = await token.transfer(to, '0x' + (new BN(value).multipliedBy(10 ** 18).toString(16)), txOptions) + await tx.wait() + }, + approveEth: async function (to, value) { + console.log('approving', to, value) + const tx = await token.approve(to, '0x' + (new BN(value).multipliedBy(10 ** 18).toString(16)), txOptions) + console.log('sent', tx) + await tx.wait() + console.log('done') + console.log(await token.allowance(ethAddress, to)) + }, + exchangeEth: async function (value) { + console.log(value) + const tx = await bridge.exchange('0x' + (new BN(value).multipliedBy(10 ** 18).toString(16)), txOptions) + console.log(tx) + await tx.wait() + console.log('done') + }, + getBncBalance: async function () { + const balance = await getBalance(bncAddress) + await delay(1000) + return balance + }, + transferBnc: async function (bridgeAddress, tokens, bnbs) { + return await bncClient.transfer(bridgeAddress, tokens, bnbs) + }, + exchangeBnc: async function (bridgeAddress, value) { + return await bncClient.exchange(bridgeAddress, value) + } + } +} diff --git a/tests/test/utils/wait.js b/tests/test/utils/wait.js new file mode 100644 index 0000000..733d9f4 --- /dev/null +++ b/tests/test/utils/wait.js @@ -0,0 +1,25 @@ +async function delay(ms) { + await new Promise(res => setTimeout(res, ms)) +} + +async function waitPromise (getPromise, checker) { + do { + const result = await getPromise() + if (checker(result)) + return result + await delay(1000) + } while (true) +} + +Array.prototype.seqMap = async function (transition) { + const results = [] + for (let i = 0; i < this.length; i++) { + results[i] = await transition(this[i]) + } + return results +} + +module.exports = { + waitPromise, + delay +} From 876f09f3126d21a167a23518018db717cdc4851d Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Mon, 28 Oct 2019 15:47:07 +0300 Subject: [PATCH 019/129] Bnc to eth tests, artifacts processing in circleci config --- .circleci/config.yml | 40 ++++++++++++++++++++++++++++++++----- .gitignore | 1 + demo/start-environment.sh | 5 +++-- tests/.env | 7 +++++++ tests/.mocharc.yml | 4 ++-- tests/Dockerfile | 4 ++-- tests/reportersConfig.json | 6 ++++++ tests/run.sh | 16 ++++----------- tests/test/bncToEth.js | 32 +++++++++++++++++++++++++++++ tests/test/ethToBnc.js | 19 +++++++++--------- tests/test/index.js | 41 ++++++++++++++++++++++++-------------- tests/test/utils/user.js | 7 ------- 12 files changed, 127 insertions(+), 55 deletions(-) create mode 100644 tests/.env create mode 100644 tests/reportersConfig.json create mode 100644 tests/test/bncToEth.js diff --git a/.circleci/config.yml b/.circleci/config.yml index 5f30c5f..ae86bb8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -67,6 +67,22 @@ orbs: - run: name: "Load tss image from archive" command: docker load -i ./workspace/tss.tar.gz + save_docker_logs: + description: "A very simple command for demonstration purposes" + parameters: + validator: + type: integer + default: 1 + steps: + - run: | + mkdir -p ./artifacts/logs/validator<< parameters.validator >> + docker logs validator<< parameters.validator >>_rabbitmq_1 ./artifacts/logs/validator<< parameters.validator >>/rabbitmq.log + docker logs validator<< parameters.validator >>_redis_1 ./artifacts/logs/validator<< parameters.validator >>/redis.log + docker logs validator<< parameters.validator >>_proxy_1 ./artifacts/logs/validator<< parameters.validator >>/proxy.log + docker logs validator<< parameters.validator >>_eth-watcher_1 ./artifacts/logs/validator<< parameters.validator >>/eth-watcher.log + docker logs validator<< parameters.validator >>_bnc-watcher_1 ./artifacts/logs/validator<< parameters.validator >>/bnc-watcher.log + docker logs validator<< parameters.validator >>_signer_1 ./artifacts/logs/validator<< parameters.validator >>/signer.log + docker logs validator<< parameters.validator >>_keygen_1 ./artifacts/logs/validator<< parameters.validator >>/keygen.log jobs: init_tss: executor: bridge/node-dev @@ -88,7 +104,7 @@ jobs: - run: name: "Run dev environment, deploy contracts, prefund accounts" command: | - ./demo/start-environment.sh + BLOCK_TIME=1 ./demo/start-environment.sh cat ./tests/config.json | jq .users[].ethAddress | xargs -I {} ./src/test-services/ethereumSend/run.sh {} 100 - run: name: "Stop dev environment" @@ -111,7 +127,7 @@ jobs: - run: name: "Init tests environment" command: | - ./demo/start-environment.sh + BLOCK_TIME=3 ./demo/start-environment.sh N=1 ./demo/validator-demo.sh -d N=2 ./demo/validator-demo.sh -d N=3 ./demo/validator-demo.sh -d @@ -125,7 +141,7 @@ jobs: name: "Build and prepare tests container" command: | docker build -t tests ./tests - docker create --rm -e HOME_RPC_URL --name tests tests $@ + docker create --rm --env-file ./tests/.env -e FOREIGN_PRIVATE_KEY --name tests tests docker network connect blockchain_side tests docker network connect blockchain_home tests docker network connect validator1_test_network tests @@ -135,9 +151,23 @@ jobs: HOME_RPC_URL: 'http://ganache_home:8545' - run: name: "Run tests" + command: docker start -a tests + - run: + name: "Save tests results" command: | - docker start -a tests - docker cp "tests:/tests/results.xml" "./tests/results.xml" + mkdir -p ./artifacts/test_results/mocha + docker cp "tests:/tests/results.xml" "./artifacts/test_results/mocha/results.xml" + when: always + - store_test_results: + path: ./artifacts/test_results/mocha + - bridge/save_docker_logs: + validator: 1 + - bridge/save_docker_logs: + validator: 2 + - bridge/save_docker_logs: + validator: 3 + - store_artifacts: + path: ./artifacts workflows: version: 2 main: diff --git a/.gitignore b/.gitignore index 1c85941..5d2cec0 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,4 @@ src/deploy/.keys.staging src/test-services/.keys.staging src/test-services/.keys.development test.js +tests/results.xml diff --git a/demo/start-environment.sh b/demo/start-environment.sh index 111446d..2a3b775 100755 --- a/demo/start-environment.sh +++ b/demo/start-environment.sh @@ -7,6 +7,7 @@ cd .. # either development or staging TARGET_NETWORK=${TARGET_NETWORK:=development} +BLOCK_TIME=${BLOCK_TIME:=3} DEPLOY_DIR="`pwd`/src/deploy" TEST_SERVICES_DIR="`pwd`/src/test-services" @@ -21,7 +22,7 @@ start_dev_blockchain_networks() { docker run -d --network blockchain_side --rm --name ganache_side -v "ganache_side_data:/app/db" \ -p "7545:8545" \ trufflesuite/ganache-cli:latest \ - -m "shrug dwarf easily blade trigger lucky reopen cage lake scatter desk boat" -i 33 -q --db /app/db -b 3 --noVMErrorsOnRPCResponse + -m "shrug dwarf easily blade trigger lucky reopen cage lake scatter desk boat" -i 33 -q --db /app/db -b "$BLOCK_TIME" --noVMErrorsOnRPCResponse echo "Starting home test blockchain" @@ -31,7 +32,7 @@ start_dev_blockchain_networks() { docker run -d --network blockchain_home --rm --name ganache_home -v "ganache_home_data:/app/db" \ -p "8545:8545" \ trufflesuite/ganache-cli:latest \ - -m "shrug dwarf easily blade trigger lucky reopen cage lake scatter desk boat" -i 44 -q --db /app/db -b 3 --noVMErrorsOnRPCResponse + -m "shrug dwarf easily blade trigger lucky reopen cage lake scatter desk boat" -i 44 -q --db /app/db -b "$BLOCK_TIME" --noVMErrorsOnRPCResponse sleep 4 } diff --git a/tests/.env b/tests/.env new file mode 100644 index 0000000..004c1d0 --- /dev/null +++ b/tests/.env @@ -0,0 +1,7 @@ +HOME_RPC_URL=http://ganache_home:8545 +HOME_BRIDGE_ADDRESS=0x44c158FE850821ae69DaF37AADF5c539e9d0025B +HOME_TOKEN_ADDRESS=0xd5fE0D28e058D375b0b038fFbB446Da37E85fFdc + +FOREIGN_URL=https://testnet-dex.binance.org/ +FOREIGN_CHAIN_ID=Binance-Chain-Nile +FOREIGN_ASSET=KFT-94F diff --git a/tests/.mocharc.yml b/tests/.mocharc.yml index 82c1ba6..b43d42d 100644 --- a/tests/.mocharc.yml +++ b/tests/.mocharc.yml @@ -1,3 +1,3 @@ -reporter: spec +reporter: mocha-multi-reporters reporter-option: - - mochaFile=./results.xml + - configFile=./reportersConfig.json diff --git a/tests/Dockerfile b/tests/Dockerfile index 2400a1b..118d266 100644 --- a/tests/Dockerfile +++ b/tests/Dockerfile @@ -2,7 +2,7 @@ FROM node:10.16.0-alpine WORKDIR /tests -RUN npm install -g mocha mocha-junit-reporter +RUN npm install -g mocha mocha-junit-reporter mocha-multi-reporters RUN apk update && apk add libssl1.1 eudev-dev libressl-dev curl build-base python linux-headers libusb-dev @@ -10,7 +10,7 @@ COPY ./package.json . RUN npm install -COPY config.json .mocharc.yml ./ +COPY config.json .mocharc.yml reportersConfig.json ./ COPY test ./test ENTRYPOINT ["mocha"] diff --git a/tests/reportersConfig.json b/tests/reportersConfig.json new file mode 100644 index 0000000..47582db --- /dev/null +++ b/tests/reportersConfig.json @@ -0,0 +1,6 @@ +{ + "reporterEnabled": "spec, mocha-junit-reporter", + "mochaJunitReporterReporterOptions": { + "mochaFile": "./results.xml" + } +} diff --git a/tests/run.sh b/tests/run.sh index b78d747..a4f7090 100755 --- a/tests/run.sh +++ b/tests/run.sh @@ -4,18 +4,10 @@ set -e docker build -t tests ./tests -set -a -source ./demo/validator1/.env.development -set +a - -docker rm tests || true +docker rm tests > /dev/null 2>&1 || true docker create --name tests \ - -e HOME_RPC_URL \ - -e FOREIGN_URL \ - -e HOME_BRIDGE_ADDRESS \ - -e HOME_TOKEN_ADDRESS \ + --env-file ./tests/.env \ -e FOREIGN_PRIVATE_KEY \ - -e FOREIGN_ASSET \ tests $@ docker network connect blockchain_home tests @@ -25,5 +17,5 @@ docker network connect validator3_test_network tests docker start -a tests || true -docker cp "tests:/tests/results.xml" "./tests/results.xml" || true -docker rm tests || true +docker cp "tests:/tests/results.xml" "./tests/results.xml" > /dev/null 2>&1 || true +docker rm tests > /dev/null 2>&1 || true diff --git a/tests/test/bncToEth.js b/tests/test/bncToEth.js new file mode 100644 index 0000000..303ce4e --- /dev/null +++ b/tests/test/bncToEth.js @@ -0,0 +1,32 @@ +const { delay } = require('./utils/wait') + +module.exports = (usersFunc, foreignBridgeAddressFunc) => { + describe('exchange of tokens in bnc => eth direction', function () { + let users + let foreignBridgeAddress + let ethBalances + + before(async function () { + this.timeout(60000) + users = usersFunc() + foreignBridgeAddress = foreignBridgeAddressFunc() + ethBalances = await Promise.all(users.map(user => user.getEthBalance())) + + await Promise.all(users.map((user, i) => user.exchangeBnc(foreignBridgeAddress, 3 + i))) + }) + + it('should make coorect exchange transactions on eth side', async function () { + this.timeout(60000) + for (let i = 0; i < 3; i++) { + do { + const user = users[i] + const newEthBalance = await user.getEthBalance() + if (newEthBalance === ethBalances[i] + 3 + i) { + break + } + delay(500) + } while (true) + } + }) + }) +} diff --git a/tests/test/ethToBnc.js b/tests/test/ethToBnc.js index 09bc2c5..25a7fd3 100644 --- a/tests/test/ethToBnc.js +++ b/tests/test/ethToBnc.js @@ -1,26 +1,27 @@ const assert = require('assert') -const createUser = require('./utils/user') const { getSequence } = require('./utils/bncController') -const { waitPromise, delay } = require('./utils/wait') +const { waitPromise } = require('./utils/wait') const usersConfig = require('../config').users const { HOME_BRIDGE_ADDRESS } = process.env -module.exports = (foreignBridgeAddress) => { - describe('exchanges tokens in eth => bnc direction', function () { +module.exports = (usersFunc, foreignBridgeAddressFunc) => { + describe('exchange of tokens in eth => bnc direction', function () { + let users + let foreignBridgeAddress let ethBalances let bncBalances let bncBridgeSequence - let users before(async function () { this.timeout(60000) - users = await usersConfig.seqMap(user => createUser(user.privateKey)) + users = usersFunc() + foreignBridgeAddress = foreignBridgeAddressFunc() ethBalances = await Promise.all(users.map(user => user.getEthBalance())) bncBalances = await users.seqMap(user => user.getBncBalance()) - bncBridgeSequence = await getSequence(foreignBridgeAddress()) + bncBridgeSequence = await getSequence(foreignBridgeAddress) await Promise.all(users.map((user, i) => user.approveEth(HOME_BRIDGE_ADDRESS, 5 + i))) }) @@ -31,12 +32,11 @@ module.exports = (foreignBridgeAddress) => { for (let i = 0; i < 3; i++) { assert(newEthBalances[i] === ethBalances[i] - 5 - i, `Balance of ${usersConfig[i].ethAddress} did not updated as expected`) } - ethBalances = newEthBalances }) it('should make exchange transaction on bnc side', async function () { this.timeout(300000) - await waitPromise(() => getSequence(foreignBridgeAddress()), sequence => sequence === bncBridgeSequence + 1) + await waitPromise(() => getSequence(foreignBridgeAddress), sequence => sequence === bncBridgeSequence + 1) }) it('should make correct exchange transaction', async function () { @@ -45,7 +45,6 @@ module.exports = (foreignBridgeAddress) => { for (let i = 0; i < 3; i++) { assert(newBncBalances[i] === bncBalances[i] + 5 + i, `Balance of ${usersConfig[i].bncAddress} did not updated as expected`) } - bncBalances = newBncBalances }) }) } diff --git a/tests/test/index.js b/tests/test/index.js index 6b8e518..a6dafec 100644 --- a/tests/test/index.js +++ b/tests/test/index.js @@ -3,30 +3,41 @@ const createUser = require('./utils/user') const { waitPromise } = require('./utils/wait') const testEthToBnc = require('./ethToBnc') +const testBncToEth = require('./bncToEth') + +const usersConfig = require('../config').users const { FOREIGN_PRIVATE_KEY } = process.env -let user - let { getInfo } = createController(1) -let info +describe('bridge tests', function () { + let users + let foreignPrefundedUser + let info -describe('generates initial epoch keys', function () { - before(async function () { + before(async function() { this.timeout(60000) - user = await createUser(FOREIGN_PRIVATE_KEY) + users = await usersConfig.seqMap(user => createUser(user.privateKey)) }) - it('should generate keys in 2 min', async function () { - this.timeout(120000) - info = await waitPromise(getInfo, info => info.epoch === 1) + describe('generation of initial epoch keys', function () { + before(async function () { + this.timeout(60000) + foreignPrefundedUser = await createUser(FOREIGN_PRIVATE_KEY) + }) + + it('should generate keys', async function () { + this.timeout(120000) + info = await waitPromise(getInfo, info => info.epoch === 1) + }) + + after(async function () { + this.timeout(60000) + await foreignPrefundedUser.transferBnc(info.foreignBridgeAddress, 50, 0.1) + }) }) - after(async function () { - this.timeout(60000) - await user.transferBnc(info.foreignBridgeAddress, 50, 0.1) - }) + testEthToBnc(() => users, () => info.foreignBridgeAddress) + testBncToEth(() => users, () => info.foreignBridgeAddress) }) - -testEthToBnc(() => info.foreignBridgeAddress) diff --git a/tests/test/utils/user.js b/tests/test/utils/user.js index da7dde2..c2889a3 100644 --- a/tests/test/utils/user.js +++ b/tests/test/utils/user.js @@ -30,19 +30,12 @@ module.exports = async function (privateKey) { await tx.wait() }, approveEth: async function (to, value) { - console.log('approving', to, value) const tx = await token.approve(to, '0x' + (new BN(value).multipliedBy(10 ** 18).toString(16)), txOptions) - console.log('sent', tx) await tx.wait() - console.log('done') - console.log(await token.allowance(ethAddress, to)) }, exchangeEth: async function (value) { - console.log(value) const tx = await bridge.exchange('0x' + (new BN(value).multipliedBy(10 ** 18).toString(16)), txOptions) - console.log(tx) await tx.wait() - console.log('done') }, getBncBalance: async function () { const balance = await getBalance(bncAddress) From 927332634cfc5b9f8597b60388164d049bc22816 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Mon, 28 Oct 2019 16:49:32 +0300 Subject: [PATCH 020/129] Updated config. Decreased no_output_timout for curl wait of validator --- .circleci/config.yml | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ae86bb8..77ffdbb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -74,15 +74,18 @@ orbs: type: integer default: 1 steps: - - run: | - mkdir -p ./artifacts/logs/validator<< parameters.validator >> - docker logs validator<< parameters.validator >>_rabbitmq_1 ./artifacts/logs/validator<< parameters.validator >>/rabbitmq.log - docker logs validator<< parameters.validator >>_redis_1 ./artifacts/logs/validator<< parameters.validator >>/redis.log - docker logs validator<< parameters.validator >>_proxy_1 ./artifacts/logs/validator<< parameters.validator >>/proxy.log - docker logs validator<< parameters.validator >>_eth-watcher_1 ./artifacts/logs/validator<< parameters.validator >>/eth-watcher.log - docker logs validator<< parameters.validator >>_bnc-watcher_1 ./artifacts/logs/validator<< parameters.validator >>/bnc-watcher.log - docker logs validator<< parameters.validator >>_signer_1 ./artifacts/logs/validator<< parameters.validator >>/signer.log - docker logs validator<< parameters.validator >>_keygen_1 ./artifacts/logs/validator<< parameters.validator >>/keygen.log + - run: + name: "Saving validator<< parameters.validator >> logs" + command: | + mkdir -p ./artifacts/logs/validator<< parameters.validator >> + docker logs validator<< parameters.validator >>_rabbitmq_1 ./artifacts/logs/validator<< parameters.validator >>/rabbitmq.log + docker logs validator<< parameters.validator >>_redis_1 ./artifacts/logs/validator<< parameters.validator >>/redis.log + docker logs validator<< parameters.validator >>_proxy_1 ./artifacts/logs/validator<< parameters.validator >>/proxy.log + docker logs validator<< parameters.validator >>_eth-watcher_1 ./artifacts/logs/validator<< parameters.validator >>/eth-watcher.log + docker logs validator<< parameters.validator >>_bnc-watcher_1 ./artifacts/logs/validator<< parameters.validator >>/bnc-watcher.log + docker logs validator<< parameters.validator >>_signer_1 ./artifacts/logs/validator<< parameters.validator >>/signer.log + docker logs validator<< parameters.validator >>_keygen_1 ./artifacts/logs/validator<< parameters.validator >>/keygen.log + when: always jobs: init_tss: executor: bridge/node-dev @@ -137,6 +140,7 @@ jobs: docker run --network validator1_test_network --entrypoint ash appropriate/curl:latest -c "until curl -X GET http://proxy:8002/info > /dev/null 2>&1; do sleep 1; done" docker run --network validator2_test_network --entrypoint ash appropriate/curl:latest -c "until curl -X GET http://proxy:8002/info > /dev/null 2>&1; do sleep 1; done" docker run --network validator3_test_network --entrypoint ash appropriate/curl:latest -c "until curl -X GET http://proxy:8002/info > /dev/null 2>&1; do sleep 1; done" + no_output_timeout: 3m - run: name: "Build and prepare tests container" command: | @@ -147,8 +151,6 @@ jobs: docker network connect validator1_test_network tests docker network connect validator2_test_network tests docker network connect validator3_test_network tests - environment: - HOME_RPC_URL: 'http://ganache_home:8545' - run: name: "Run tests" command: docker start -a tests @@ -160,6 +162,7 @@ jobs: when: always - store_test_results: path: ./artifacts/test_results/mocha + when: always - bridge/save_docker_logs: validator: 1 - bridge/save_docker_logs: @@ -168,6 +171,7 @@ jobs: validator: 3 - store_artifacts: path: ./artifacts + when: always workflows: version: 2 main: From 8c2864bac3e852f938da4426530730bdd0fe4966 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Mon, 28 Oct 2019 17:23:16 +0300 Subject: [PATCH 021/129] Trying to find out why curl wait does not work on circleci --- .circleci/config.yml | 68 +++++++++++++++++++++++++------------------- 1 file changed, 39 insertions(+), 29 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 77ffdbb..b99109b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -68,7 +68,7 @@ orbs: name: "Load tss image from archive" command: docker load -i ./workspace/tss.tar.gz save_docker_logs: - description: "A very simple command for demonstration purposes" + description: "Save docker logs" parameters: validator: type: integer @@ -78,13 +78,34 @@ orbs: name: "Saving validator<< parameters.validator >> logs" command: | mkdir -p ./artifacts/logs/validator<< parameters.validator >> - docker logs validator<< parameters.validator >>_rabbitmq_1 ./artifacts/logs/validator<< parameters.validator >>/rabbitmq.log - docker logs validator<< parameters.validator >>_redis_1 ./artifacts/logs/validator<< parameters.validator >>/redis.log - docker logs validator<< parameters.validator >>_proxy_1 ./artifacts/logs/validator<< parameters.validator >>/proxy.log - docker logs validator<< parameters.validator >>_eth-watcher_1 ./artifacts/logs/validator<< parameters.validator >>/eth-watcher.log - docker logs validator<< parameters.validator >>_bnc-watcher_1 ./artifacts/logs/validator<< parameters.validator >>/bnc-watcher.log - docker logs validator<< parameters.validator >>_signer_1 ./artifacts/logs/validator<< parameters.validator >>/signer.log - docker logs validator<< parameters.validator >>_keygen_1 ./artifacts/logs/validator<< parameters.validator >>/keygen.log + docker logs validator<< parameters.validator >>_rabbitmq_1 > ./artifacts/logs/validator<< parameters.validator >>/rabbitmq.log + docker logs validator<< parameters.validator >>_redis_1 > ./artifacts/logs/validator<< parameters.validator >>/redis.log + docker logs validator<< parameters.validator >>_proxy_1 >./artifacts/logs/validator<< parameters.validator >>/proxy.log + docker logs validator<< parameters.validator >>_eth-watcher_1 > ./artifacts/logs/validator<< parameters.validator >>/eth-watcher.log + docker logs validator<< parameters.validator >>_bnc-watcher_1 > ./artifacts/logs/validator<< parameters.validator >>/bnc-watcher.log + docker logs validator<< parameters.validator >>_signer_1 > ./artifacts/logs/validator<< parameters.validator >>/signer.log + docker logs validator<< parameters.validator >>_keygen_1 > ./artifacts/logs/validator<< parameters.validator >>/keygen.log + when: always + save_artifacts: + description: "Save and upload tests results, save validator logs to artifacts" + steps: + - run: + name: "Save tests results" + command: | + mkdir -p ./artifacts/test_results/mocha + docker cp "tests:/tests/results.xml" "./artifacts/test_results/mocha/results.xml" + when: always + - store_test_results: + path: ./artifacts/test_results/mocha + when: always + - save_docker_logs: + validator: 1 + - save_docker_logs: + validator: 2 + - save_docker_logs: + validator: 3 + - store_artifacts: + path: ./artifacts when: always jobs: init_tss: @@ -134,13 +155,19 @@ jobs: N=1 ./demo/validator-demo.sh -d N=2 ./demo/validator-demo.sh -d N=3 ./demo/validator-demo.sh -d + docker ps - run: name: "Wait until validator nodes are ready" command: | - docker run --network validator1_test_network --entrypoint ash appropriate/curl:latest -c "until curl -X GET http://proxy:8002/info > /dev/null 2>&1; do sleep 1; done" - docker run --network validator2_test_network --entrypoint ash appropriate/curl:latest -c "until curl -X GET http://proxy:8002/info > /dev/null 2>&1; do sleep 1; done" - docker run --network validator3_test_network --entrypoint ash appropriate/curl:latest -c "until curl -X GET http://proxy:8002/info > /dev/null 2>&1; do sleep 1; done" + mkdir ./clogs + docker run --network validator1_test_network --entrypoint ash appropriate/curl:latest -c "until curl -X GET http://proxy:8002/info > ./clogs/clog1 2>&1; do sleep 1; done" + docker run --network validator2_test_network --entrypoint ash appropriate/curl:latest -c "until curl -X GET http://proxy:8002/info > ./clogs/clog2 2>&1; do sleep 1; done" + docker run --network validator3_test_network --entrypoint ash appropriate/curl:latest -c "until curl -X GET http://proxy:8002/info > ./clogs/clog3 2>&1; do sleep 1; done" no_output_timeout: 3m + - store_artifacts: + path: ./clogs + destination: curl-logs + when: always - run: name: "Build and prepare tests container" command: | @@ -154,24 +181,7 @@ jobs: - run: name: "Run tests" command: docker start -a tests - - run: - name: "Save tests results" - command: | - mkdir -p ./artifacts/test_results/mocha - docker cp "tests:/tests/results.xml" "./artifacts/test_results/mocha/results.xml" - when: always - - store_test_results: - path: ./artifacts/test_results/mocha - when: always - - bridge/save_docker_logs: - validator: 1 - - bridge/save_docker_logs: - validator: 2 - - bridge/save_docker_logs: - validator: 3 - - store_artifacts: - path: ./artifacts - when: always + - bridge/save_artifacts workflows: version: 2 main: From 23ba4e86f69eddc1f5b55406a792e2a0cc3af802 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Mon, 28 Oct 2019 17:55:47 +0300 Subject: [PATCH 022/129] Added saving of ganache logs into artifacts --- .circleci/config.yml | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b99109b..c3c0b12 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -49,6 +49,12 @@ orbs: docker cp "./workspace/ganache_side_data" "tmp:/ganache_side_data" docker cp "./workspace/ganache_home_data" "tmp:/ganache_home_data" docker kill tmp + restore_tss_image: + description: "Restores tss image from cache" + steps: + - restore_cache: + name: "Restore tss image from cache" + key: "tss-v1-{{ .Branch }}" save_tss: description: "Save tss image to workspace" steps: @@ -58,9 +64,15 @@ orbs: mkdir ./workspace docker save tss | gzip > ./workspace/tss.tar.gz - persist_to_workspace: + name: "Save tss image to workspace" root: ./workspace paths: - tss.tar.gz + - save_cache: + name: "Save tss image to cache" + paths: + - ./workspace/tss.tar.gz + key: "tss-v1-{{ .Branch }}" load_tss: description: "Load tss image from workspace" steps: @@ -104,6 +116,13 @@ orbs: validator: 2 - save_docker_logs: validator: 3 + - run: + name: "Save ganache logs" + command: | + mkdir -p ./artifacts/logs/ganache + docker logs ganache_home > ./artifacts/logs/ganache/home.log + docker logs ganache_side > ./artifacts/logs/ganache/side.log + when: always - store_artifacts: path: ./artifacts when: always @@ -113,9 +132,10 @@ jobs: steps: - bridge/fetch_repo - bridge/setup_docker + - bridge/restore_tss_image - run: name: "Build tss image" - command: docker build -t tss ./src/tss + command: docker build --cache-from tss -t tss ./src/tss || docker build -t tss ./src/tss - bridge/save_tss init_blockchains: executor: bridge/node-dev @@ -159,15 +179,10 @@ jobs: - run: name: "Wait until validator nodes are ready" command: | - mkdir ./clogs - docker run --network validator1_test_network --entrypoint ash appropriate/curl:latest -c "until curl -X GET http://proxy:8002/info > ./clogs/clog1 2>&1; do sleep 1; done" - docker run --network validator2_test_network --entrypoint ash appropriate/curl:latest -c "until curl -X GET http://proxy:8002/info > ./clogs/clog2 2>&1; do sleep 1; done" - docker run --network validator3_test_network --entrypoint ash appropriate/curl:latest -c "until curl -X GET http://proxy:8002/info > ./clogs/clog3 2>&1; do sleep 1; done" + docker run --network validator1_test_network --entrypoint ash appropriate/curl:latest -c "until curl -X GET http://proxy:8002/info > /dev/null 2>&1; do sleep 1; done" + docker run --network validator2_test_network --entrypoint ash appropriate/curl:latest -c "until curl -X GET http://proxy:8002/info > /dev/null 2>&1; do sleep 1; done" + docker run --network validator3_test_network --entrypoint ash appropriate/curl:latest -c "until curl -X GET http://proxy:8002/info > /dev/null 2>&1; do sleep 1; done" no_output_timeout: 3m - - store_artifacts: - path: ./clogs - destination: curl-logs - when: always - run: name: "Build and prepare tests container" command: | From f8e8ea8fe57ead4c662f81691caaa4ce1f1a3603 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Mon, 28 Oct 2019 18:55:09 +0300 Subject: [PATCH 023/129] Get rid of bind mounts in docker-compose for contracts --- .circleci/config.yml | 2 +- src/oracle/docker-compose-test.yml | 13 +- src/oracle/docker-compose.yml | 13 +- src/oracle/ethWatcher/Bridge.json | 35243 +++++++++++++++++++++ src/oracle/ethWatcher/Dockerfile | 1 + src/oracle/proxy/Bridge.json | 35243 +++++++++++++++++++++ src/oracle/proxy/Dockerfile | 1 + src/oracle/proxy/IERC20.json | 1884 ++ src/oracle/proxy/SharedDB.json | 6274 ++++ src/oracle/redis/Dockerfile | 5 + src/oracle/{configs => redis}/redis.conf | 0 11 files changed, 78660 insertions(+), 19 deletions(-) create mode 100644 src/oracle/ethWatcher/Bridge.json create mode 100644 src/oracle/proxy/Bridge.json create mode 100644 src/oracle/proxy/IERC20.json create mode 100644 src/oracle/proxy/SharedDB.json create mode 100644 src/oracle/redis/Dockerfile rename src/oracle/{configs => redis}/redis.conf (100%) diff --git a/.circleci/config.yml b/.circleci/config.yml index c3c0b12..24d16e7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -92,7 +92,7 @@ orbs: mkdir -p ./artifacts/logs/validator<< parameters.validator >> docker logs validator<< parameters.validator >>_rabbitmq_1 > ./artifacts/logs/validator<< parameters.validator >>/rabbitmq.log docker logs validator<< parameters.validator >>_redis_1 > ./artifacts/logs/validator<< parameters.validator >>/redis.log - docker logs validator<< parameters.validator >>_proxy_1 >./artifacts/logs/validator<< parameters.validator >>/proxy.log + docker logs validator<< parameters.validator >>_proxy_1 > ./artifacts/logs/validator<< parameters.validator >>/proxy.log docker logs validator<< parameters.validator >>_eth-watcher_1 > ./artifacts/logs/validator<< parameters.validator >>/eth-watcher.log docker logs validator<< parameters.validator >>_bnc-watcher_1 > ./artifacts/logs/validator<< parameters.validator >>/bnc-watcher.log docker logs validator<< parameters.validator >>_signer_1 > ./artifacts/logs/validator<< parameters.validator >>/signer.log diff --git a/src/oracle/docker-compose-test.yml b/src/oracle/docker-compose-test.yml index afa2c00..91845c1 100644 --- a/src/oracle/docker-compose-test.yml +++ b/src/oracle/docker-compose-test.yml @@ -19,10 +19,6 @@ services: - LOG_LEVEL - "GAS_LIMIT_FACTOR=3" - "MAX_GAS_LIMIT=6000000" - volumes: - - '../deploy/deploy-test/build/contracts/IERC20.json:/proxy/contracts_data/IERC20.json' - - '../deploy/deploy-home/build/contracts/Bridge.json:/proxy/contracts_data/Bridge.json' - - '../deploy/deploy-side/build/contracts/SharedDB.json:/proxy/contracts_data/SharedDB.json' ports: - '${VOTES_PROXY_PORT}:8002' networks: @@ -61,11 +57,12 @@ services: networks: - test_network redis: - image: redis:5.0.5-alpine + image: redis + build: + dockerfile: redis/Dockerfile + context: . volumes: - '${PWD}/${TARGET_NETWORK}/db:/data' - - './configs/redis.conf:/usr/local/etc/redis/redis.conf' - command: ["redis-server", "/usr/local/etc/redis/redis.conf"] networks: - test_network rabbitmq: @@ -92,8 +89,6 @@ services: - VALIDATOR_PRIVATE_KEY - 'RABBITMQ_URL=amqp://rabbitmq:5672' - LOG_LEVEL - volumes: - - '../deploy/deploy-home/build/contracts/Bridge.json:/watcher/contracts_data/Bridge.json' networks: - test_network - blockchain_home diff --git a/src/oracle/docker-compose.yml b/src/oracle/docker-compose.yml index a79b816..499e9f7 100644 --- a/src/oracle/docker-compose.yml +++ b/src/oracle/docker-compose.yml @@ -19,10 +19,6 @@ services: - LOG_LEVEL - "GAS_LIMIT_FACTOR=3" - "MAX_GAS_LIMIT=6000000" - volumes: - - '../deploy/deploy-test/build/contracts/IERC20.json:/proxy/contracts_data/IERC20.json' - - '../deploy/deploy-home/build/contracts/Bridge.json:/proxy/contracts_data/Bridge.json' - - '../deploy/deploy-side/build/contracts/SharedDB.json:/proxy/contracts_data/SharedDB.json' ports: - '${VOTES_PROXY_PORT}:8002' networks: @@ -65,11 +61,12 @@ services: - rabbit-signer-net - redis-signer-net redis: - image: redis:5.0.5-alpine + image: redis + build: + dockerfile: redis/Dockerfile + context: . volumes: - '${PWD}/${TARGET_NETWORK}/db:/data' - - './configs/redis.conf:/usr/local/etc/redis/redis.conf' - command: ["redis-server", "/usr/local/etc/redis/redis.conf"] networks: - redis-signer-net - redis-keygen-net @@ -101,8 +98,6 @@ services: - VALIDATOR_PRIVATE_KEY - 'RABBITMQ_URL=amqp://rabbitmq:5672' - LOG_LEVEL - volumes: - - '../deploy/deploy-home/build/contracts/Bridge.json:/watcher/contracts_data/Bridge.json' networks: - rabbit-ethwatcher-net - redis-ethwatcher-net diff --git a/src/oracle/ethWatcher/Bridge.json b/src/oracle/ethWatcher/Bridge.json new file mode 100644 index 0000000..9eba79e --- /dev/null +++ b/src/oracle/ethWatcher/Bridge.json @@ -0,0 +1,35243 @@ +{ + "contractName": "Bridge", + "abi": [ + { + "constant": true, + "inputs": [], + "name": "status", + "outputs": [ + { + "name": "", + "type": "uint8" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "", + "type": "bytes32" + } + ], + "name": "usedRange", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "", + "type": "bytes32" + } + ], + "name": "votes", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "", + "type": "bytes32" + } + ], + "name": "dbTransfer", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "tokenContract", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "epoch", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "", + "type": "bytes32" + } + ], + "name": "votesCount", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "nextEpoch", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "", + "type": "bytes32" + } + ], + "name": "dbTransferCount", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "name": "threshold", + "type": "uint256" + }, + { + "name": "validators", + "type": "address[]" + }, + { + "name": "_tokenContract", + "type": "address" + }, + { + "name": "limits", + "type": "uint256[2]" + }, + { + "name": "rangeSize", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "value", + "type": "uint256" + }, + { + "indexed": false, + "name": "nonce", + "type": "uint256" + } + ], + "name": "ExchangeRequest", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "oldEpoch", + "type": "uint256" + }, + { + "indexed": true, + "name": "newEpoch", + "type": "uint256" + } + ], + "name": "NewEpoch", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "epoch", + "type": "uint256" + } + ], + "name": "NewEpochCancelled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "oldEpoch", + "type": "uint256" + }, + { + "indexed": true, + "name": "newEpoch", + "type": "uint256" + } + ], + "name": "NewFundsTransfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "epoch", + "type": "uint256" + }, + { + "indexed": false, + "name": "x", + "type": "uint256" + }, + { + "indexed": false, + "name": "y", + "type": "uint256" + } + ], + "name": "EpochStart", + "type": "event" + }, + { + "constant": false, + "inputs": [ + { + "name": "value", + "type": "uint256" + } + ], + "name": "exchange", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "hash", + "type": "bytes32" + }, + { + "name": "to", + "type": "address" + }, + { + "name": "value", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "x", + "type": "uint256" + }, + { + "name": "y", + "type": "uint256" + } + ], + "name": "confirmKeygen", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "confirmFundsTransfer", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getNextParties", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getParties", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_epoch", + "type": "uint256" + } + ], + "name": "getParties", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getNextThreshold", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getThreshold", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_epoch", + "type": "uint256" + } + ], + "name": "getThreshold", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getStartBlock", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_epoch", + "type": "uint256" + } + ], + "name": "getStartBlock", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getNextRangeSize", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_epoch", + "type": "uint256" + } + ], + "name": "getRangeSize", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getRangeSize", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_epoch", + "type": "uint256" + } + ], + "name": "getNonce", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getNonce", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getX", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getY", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getPartyId", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "a", + "type": "address" + } + ], + "name": "getNextPartyId", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getValidators", + "outputs": [ + { + "name": "", + "type": "address[]" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getNextValidators", + "outputs": [ + { + "name": "", + "type": "address[]" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "startVoting", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "validator", + "type": "address" + } + ], + "name": "voteAddValidator", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "validator", + "type": "address" + } + ], + "name": "voteRemoveValidator", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "threshold", + "type": "uint256" + } + ], + "name": "voteChangeThreshold", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "rangeSize", + "type": "uint256" + } + ], + "name": "voteChangeRangeSize", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "voteStartKeygen", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "voteCancelKeygen", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + } + ], + "metadata": "{\"compiler\":{\"version\":\"0.5.9+commit.e560f70d\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":true,\"inputs\":[{\"name\":\"_epoch\",\"type\":\"uint256\"}],\"name\":\"getStartBlock\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getNextParties\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getY\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"a\",\"type\":\"address\"}],\"name\":\"getNextPartyId\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"startVoting\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"status\",\"outputs\":[{\"name\":\"\",\"type\":\"uint8\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"rangeSize\",\"type\":\"uint256\"}],\"name\":\"voteChangeRangeSize\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"usedRange\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getRangeSize\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"votes\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getPartyId\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"voteCancelKeygen\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_epoch\",\"type\":\"uint256\"}],\"name\":\"getNonce\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"hash\",\"type\":\"bytes32\"},{\"name\":\"to\",\"type\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getNextValidators\",\"outputs\":[{\"name\":\"\",\"type\":\"address[]\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_epoch\",\"type\":\"uint256\"}],\"name\":\"getParties\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_epoch\",\"type\":\"uint256\"}],\"name\":\"getThreshold\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"dbTransfer\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getX\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"exchange\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"tokenContract\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"validator\",\"type\":\"address\"}],\"name\":\"voteAddValidator\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getNextThreshold\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"epoch\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"voteStartKeygen\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"validator\",\"type\":\"address\"}],\"name\":\"voteRemoveValidator\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getStartBlock\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"x\",\"type\":\"uint256\"},{\"name\":\"y\",\"type\":\"uint256\"}],\"name\":\"confirmKeygen\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getParties\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"votesCount\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"nextEpoch\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getValidators\",\"outputs\":[{\"name\":\"\",\"type\":\"address[]\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getNextRangeSize\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_epoch\",\"type\":\"uint256\"}],\"name\":\"getRangeSize\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"threshold\",\"type\":\"uint256\"}],\"name\":\"voteChangeThreshold\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getNonce\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"dbTransferCount\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"confirmFundsTransfer\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getThreshold\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"threshold\",\"type\":\"uint256\"},{\"name\":\"validators\",\"type\":\"address[]\"},{\"name\":\"_tokenContract\",\"type\":\"address\"},{\"name\":\"limits\",\"type\":\"uint256[2]\"},{\"name\":\"rangeSize\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"value\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"ExchangeRequest\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"oldEpoch\",\"type\":\"uint256\"},{\"indexed\":true,\"name\":\"newEpoch\",\"type\":\"uint256\"}],\"name\":\"NewEpoch\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"epoch\",\"type\":\"uint256\"}],\"name\":\"NewEpochCancelled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"oldEpoch\",\"type\":\"uint256\"},{\"indexed\":true,\"name\":\"newEpoch\",\"type\":\"uint256\"}],\"name\":\"NewFundsTransfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"epoch\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"x\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"y\",\"type\":\"uint256\"}],\"name\":\"EpochStart\",\"type\":\"event\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/build/contracts/Bridge.sol\":\"Bridge\"},\"evmVersion\":\"petersburg\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":3},\"remappings\":[]},\"sources\":{\"/build/contracts/Bridge.sol\":{\"keccak256\":\"0xedcf62b24f2b47b0e83af55ca6471e82e301f8287aa78e7c41bbca2d3ddc4155\",\"urls\":[\"bzzr://84b325be5714e21d85966ce976f9996d2f7d2305b467c191d37f6e91bb1901fb\",\"dweb:/ipfs/QmY1RVRv3H9E9T2VwmSdyKxAfQFMd7t9yYjcVFVpox9Lf8\"]},\"/build/contracts/openzeppelin-solidity/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0x90e8c2521653bbb1768b05889c5760031e688d9cd361f167489b89215e201b95\",\"urls\":[\"bzzr://aa8b45b57edafc3d67bc5d916327ea16807fae33f753ca163ae0c4061b789766\",\"dweb:/ipfs/QmP5NaEwZthQeM2ESz4WTT3osrP7jhbvu7ocbttBi2JAw6\"]}},\"version\":1}", + "bytecode": "0x60806040523480156200001157600080fd5b5060405162001f4838038062001f48833981810160405260c08110156200003757600080fd5b8151602083018051919392830192916401000000008111156200005957600080fd5b820160208101848111156200006d57600080fd5b81518560208202830111640100000000821117156200008b57600080fd5b505060208201516080830151825192955090935060409092019190620000b057600080fd5b83518510620000be57600080fd5b600b80546001600160a01b0385166001600160a01b0319909116179055600060078190556006805460ff19166002179055600160088190556040805160e08101825287815260208082018a905291810185905260608101849052600019608082015260a0810184905260c081018490529183529182528051805191927fada5013122d395ba3c54772283fb069b10426056ef8ca54750cb9bb552a59e7d926200016b9284920190620001f9565b506020820151600182015560408201516002820155606082015160038201556080820151600482015560a0820151600582015560c09091015160069091015581600060200201516009558160016020020151600a556040516001906000907f3ef85928df9ae51bdb3eb4c00ec73b92b82307f319ac1b029de14796a0972609908290a350505050506200028d565b82805482825590600052602060002090810192821562000251579160200282015b828111156200025157825182546001600160a01b0319166001600160a01b039091161782556020909201916001909101906200021a565b506200025f92915062000263565b5090565b6200028a91905b808211156200025f5780546001600160a01b03191681556001016200026a565b90565b611cab806200029d6000396000f3fe608060405234801561001057600080fd5b50600436106101cd5760003560e01c806301b2320e146101d2578063073ce82d146102015780630b7f166514610209578063197d6ca4146102115780631ec6b60a14610237578063200d2ed2146102415780632493b9fc1461026d5780632a2acafa1461028a5780632a4b93af146102bb5780632b38cd96146102c35780632fb0fc6f146102e057806339f0ebb1146102e85780633d46b819146102f05780633feb1bd81461030d57806340cddab31461033f578063447fe289146103975780634615d5e9146103b457806349f92f63146103d15780635197c7aa146103ee57806353556559146103f657806355a373d61461041357806357456f22146104375780638199d3fd1461045d578063900cf0cf14610465578063915eb0e71461046d5780639bf6a74a14610475578063a5f18c011461049b578063a7699d02146104a3578063a8311aa8146104c6578063aae46bab146104ce578063aea0e78b146104eb578063b7ab4db5146104f3578063c2668caf146104fb578063c3e3a45c14610503578063cc8ee06514610520578063d087d2881461053d578063d09fc00414610545578063df78523014610562578063e75235b81461056a575b600080fd5b6101ef600480360360208110156101e857600080fd5b5035610572565b60408051918252519081900360200190f35b6101ef61058a565b6101ef61059d565b6101ef6004803603602081101561022757600080fd5b50356001600160a01b03166105b5565b61023f610620565b005b610249610778565b6040518082600381111561025957fe5b60ff16815260200191505060405180910390f35b61023f6004803603602081101561028357600080fd5b5035610781565b6102a7600480360360208110156102a057600080fd5b5035610846565b604080519115158252519081900360200190f35b6101ef61085b565b6102a7600480360360208110156102d957600080fd5b5035610868565b6101ef61087d565b61023f6108e7565b6101ef6004803603602081101561030657600080fd5b50356109d3565b61023f6004803603606081101561032357600080fd5b508035906001600160a01b0360208201351690604001356109e8565b610347610b48565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561038357818101518382015260200161036b565b505050509050019250505060405180910390f35b6101ef600480360360208110156103ad57600080fd5b5035610bb3565b6101ef600480360360208110156103ca57600080fd5b5035610bc5565b6102a7600480360360208110156103e757600080fd5b5035610bda565b6101ef610bef565b61023f6004803603602081101561040c57600080fd5b5035610c07565b61041b610e1c565b604080516001600160a01b039092168252519081900360200190f35b61023f6004803603602081101561044d57600080fd5b50356001600160a01b0316610e2b565b6101ef610f63565b6101ef610f70565b61023f610f76565b61023f6004803603602081101561048b57600080fd5b50356001600160a01b031661105d565b6101ef611164565b61023f600480360360408110156104b957600080fd5b5080359060200135611171565b6101ef611304565b6101ef600480360360208110156104e457600080fd5b5035611311565b6101ef611323565b610347611329565b6101ef611392565b6101ef6004803603602081101561051957600080fd5b503561139b565b61023f6004803603602081101561053657600080fd5b50356113b0565b6101ef611471565b6101ef6004803603602081101561055b57600080fd5b503561147e565b61023f611490565b6101ef6115fc565b6000818152602081905260409020600301545b919050565b6000610597600854610bb3565b90505b90565b60075460009081526020819052604090206006015490565b600060606105c1610b48565b905060005b6105ce61058a565b81101561061657836001600160a01b03168282815181106105eb57fe5b60200260200101516001600160a01b0316141561060e5760010191506105859050565b6001016105c6565b5060009392505050565b600060065460ff16600381111561063357fe5b148061064f5750600160065460ff16600381111561064d57fe5b145b61069f576040805162461bcd60e51b815260206004820152601c60248201527b4e6f7420696e207265616479206f7220766f74696e6720737461746560201b604482015290519081900360640190fd5b6106a761087d565b6106e6576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b6106f06002611609565b15610776576008805460019081019091556006805460ff191690911790556107166115fc565b600854600090815260208190526040902060010155610733611329565b60085460009081526020818152604090912082516107579391929190910190611b27565b5061076061085b565b6008546000908152602081905260409020600201555b565b60065460ff1681565b600160065460ff16600381111561079457fe5b146107d4576040805162461bcd60e51b81526020600482015260136024820152600080516020611c0f833981519152604482015290519081900360640190fd5b6107dc61087d565b61081b576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b610826600682611660565b156108435760085460009081526020819052604090206002018190555b50565b60056020526000908152604090205460ff1681565b600061059760075461139b565b60046020526000908152604090205460ff1681565b60006060610889611329565b905060005b610896611304565b8110156108de57336001600160a01b03168282815181106108b357fe5b60200260200101516001600160a01b031614156108d657600101915061059a9050565b60010161088e565b50600091505090565b600260065460ff1660038111156108fa57fe5b14610942576040805162461bcd60e51b81526020600482015260136024820152724e6f7420696e206b657967656e20737461746560681b604482015290519081900360640190fd5b61094a61087d565b610989576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b6109936008611609565b15610776576006805460ff191660011790556008546040517fddbb65cfe1ae4aec03cef0f9667c6d7ba3740927d0c60f4dd4d7104cc31d180a90600090a2565b60009081526020819052604090206004015490565b600060065460ff1660038111156109fb57fe5b1480610a175750600160065460ff166003811115610a1557fe5b145b610a67576040805162461bcd60e51b815260206004820152601c60248201527b4e6f7420696e207265616479206f7220766f74696e6720737461746560201b604482015290519081900360640190fd5b610a6f61087d565b610aae576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b610abb60098484846116c0565b15610b4357600b546040805163a9059cbb60e01b81526001600160a01b038581166004830152602482018590529151919092169163a9059cbb9160448083019260209291908290030181600087803b158015610b1657600080fd5b505af1158015610b2a573d6000803e3d6000fd5b505050506040513d6020811015610b4057600080fd5b50505b505050565b60085460009081526020818152604091829020805483518184028101840190945280845260609392830182828015610ba957602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610b8b575b5050505050905090565b60009081526020819052604090205490565b60009081526020819052604090206001015490565b60026020526000908152604090205460ff1681565b60075460009081526020819052604090206005015490565b600060065460ff166003811115610c1a57fe5b14610c61576040805162461bcd60e51b81526020600482015260126024820152714e6f7420696e20726561647920737461746560701b604482015290519081900360640190fd5b6009548110158015610c7857506402540be4008110155b8015610c865750600a548111155b610c8f57600080fd5b6000610c9961085b565b610ca1611164565b430381610caa57fe5b60075460408051939092046020808501829052848401929092528251808503840181526060909401835283519382019390932060009081526005909152205490915060ff16610d4f57600780546040805160208082018690528183019390935281518082038301815260609091018252805190830120600090815260058352818120805460ff1916600190811790915593548152918290529020600401805490910190555b600b54604080516323b872dd60e01b81523360048201523060248201526044810185905290516001600160a01b03909216916323b872dd916064808201926020929091908290030181600087803b158015610da957600080fd5b505af1158015610dbd573d6000803e3d6000fd5b505050506040513d6020811015610dd357600080fd5b507f9273b6f22cee1ef3d7cdc2a9c031936003526bae368886259511f7dd40044b02905082610e00611471565b6040805192835260208301919091528051918290030190a15050565b600b546001600160a01b031681565b600160065460ff166003811115610e3e57fe5b14610e7e576040805162461bcd60e51b81526020600482015260136024820152600080516020611c0f833981519152604482015290519081900360640190fd5b610e8661087d565b610ec5576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b610ece816105b5565b15610f16576040805162461bcd60e51b815260206004820152601360248201527220b63932b0b23c9030903b30b634b230ba37b960691b604482015290519081900360640190fd5b610f2160038261173d565b15610843576008546000908152602081815260408220805460018101825590835291200180546001600160a01b0383166001600160a01b031990911617905550565b6000610597600854610bc5565b60075481565b600160065460ff166003811115610f8957fe5b14610fc9576040805162461bcd60e51b81526020600482015260136024820152600080516020611c0f833981519152604482015290519081900360640190fd5b610fd161087d565b611010576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b61101a6007611609565b15610776576006805460ff191660021790556008546007546040517f3ef85928df9ae51bdb3eb4c00ec73b92b82307f319ac1b029de14796a097260990600090a3565b600160065460ff16600381111561107057fe5b146110b0576040805162461bcd60e51b81526020600482015260136024820152600080516020611c0f833981519152604482015290519081900360640190fd5b6110b861087d565b6110f7576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b611100816105b5565b61114b576040805162461bcd60e51b815260206004820152601760248201527620b63932b0b23c903737ba1030903b30b634b230ba37b960491b604482015290519081900360640190fd5b61115660048261173d565b1561084357610843816117aa565b6000610597600754610572565b600260065460ff16600381111561118457fe5b146111cc576040805162461bcd60e51b81526020600482015260136024820152724e6f7420696e206b657967656e20737461746560681b604482015290519081900360640190fd5b6111d5336105b5565b61121d576040805162461bcd60e51b81526020600482015260146024820152732737ba1030903732bc3a103b30b634b230ba37b960611b604482015290519081900360640190fd5b611229600083836118e4565b15611300576008805460009081526020819052604080822060050185905582548252902060060182905554600114156112c3576006805460ff191690556008805460009081526020818152604080832043600390910155835483529182902060001960049091015591546007819055815185815292830184905281519092600080516020611bef83398151915292908290030190a2611300565b6006805460ff191660031790556008546007546040517ff4735b85cc98f9a712832825ecab4cfb1649d658f9a73c57a00ea7dde735c79b90600090a35b5050565b6000610597600754610bb3565b60036020526000908152604090205481565b60085481565b60075460009081526020818152604091829020805483518184028101840190945280845260609392830182828015610ba9576020028201919060005260206000209081546001600160a01b03168152600190910190602001808311610b8b575050505050905090565b60006105976008545b60009081526020819052604090206002015490565b600160065460ff1660038111156113c357fe5b14611403576040805162461bcd60e51b81526020600482015260136024820152600080516020611c0f833981519152604482015290519081900360640190fd5b61140b61087d565b61144a576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b611455600582611660565b1561084357600854600090815260208190526040902060010155565b60006105976007546109d3565b60016020526000908152604090205481565b600360065460ff1660038111156114a357fe5b146114f3576040805162461bcd60e51b815260206004820152601b60248201527a4e6f7420696e2066756e6473207472616e7366657220737461746560281b604482015290519081900360640190fd5b6114fb61087d565b61153a576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b60006007541161157b5760405162461bcd60e51b8152600401808060200182810382526028815260200180611c2f6028913960400191505060405180910390fd5b611585600161194d565b15610776576006805460ff191690556008805460009081526020819052604080822043600390910155825482529020600019600490910155546007819055600080516020611bef8339815191526115da610bef565b6115e261059d565b6040805192835260208301919091528051918290030190a2565b6000610597600754610bc5565b600080826008546040516020018083600981111561162357fe5b60ff1660f81b8152600101828152602001925050506040516020818303038152906040528051906020012090506116598161199d565b9392505050565b60008083600854846040516020018084600981111561167b57fe5b60ff1660f81b815260010183815260200182815260200193505050506040516020818303038152906040528051906020012090506116b88161199d565b949350505050565b60008085858585604051602001808560098111156116da57fe5b60ff1660f81b8152600101848152602001836001600160a01b03166001600160a01b031660601b81526014018281526020019450505050506040516020818303038152906040528051906020012090506117338161199d565b9695505050505050565b60008083600854846040516020018084600981111561175857fe5b60ff1660f81b8152600101838152602001826001600160a01b03166001600160a01b031660601b815260140193505050506040516020818303038152906040528051906020012090506116b88161199d565b60005b60016117b761058a565b0381101561188557600854600090815260208190526040902080546001600160a01b0384169190839081106117e857fe5b6000918252602090912001546001600160a01b0316141561187d5761180b610b48565b600161181561058a565b038151811061182057fe5b60200260200101516000806008548152602001908152602001600020600001828154811061184a57fe5b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550611885565b6001016117ad565b50600854600090815260208190526040902060016118a161058a565b03815481106118ac57fe5b6000918252602080832090910180546001600160a01b0319169055600854825281905260409020805490611300906000198301611b8c565b6000808460085485856040516020018085600981111561190057fe5b60ff1660f81b815260010184815260200183815260200182815260200194505050505060405160208183030381529060405280519060200120905061194481611a70565b95945050505050565b600080826008546040516020018083600981111561196757fe5b60ff1660f81b81526001018281526020019250505060405160208183030381529060405280519060200120905061165981611a70565b6000806119a983611af8565b60008181526004602052604090205490915060ff1615611a00576040805162461bcd60e51b815260206004820152600d60248201526c566f74656420616c726561647960981b604482015290519081900360640190fd5b6000818152600460205260409020805460ff19166001179055611a216115fc565b6000848152600360205260409020541415611a545750506000818152600360205260409020600160ff1b90556001610585565b5050600081815260036020526040812080546001019055610585565b600080611a7c83611af8565b60008181526004602052604090205490915060ff1615611ad7576040805162461bcd60e51b8152602060048201526011602482015270436f6e6669726d656420616c726561647960781b604482015290519081900360640190fd5b6000818152600460205260409020805460ff19166001179055611a21610f63565b604080516020808201939093523360601b81830152815180820360340181526054909101909152805191012090565b828054828255906000526020600020908101928215611b7c579160200282015b82811115611b7c57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190611b47565b50611b88929150611bb0565b5090565b815481835581811115610b4357600083815260209020610b43918101908301611bd4565b61059a91905b80821115611b885780546001600160a01b0319168155600101611bb6565b61059a91905b80821115611b885760008155600101611bda56fec33272939f066c227e913a4b3434d860794f185c551685c29451a3a38b9b259c4e6f7420696e20766f74696e672073746174650000000000000000000000000046697273742065706f636820646f6573206e6f74206e6565642066756e6473207472616e736665724e6f7420612063757272656e742076616c696461746f72000000000000000000a265627a7a72305820dfb70a1c283919f9128aabe00d30be35942e7ded3ecf2eb30af4168b8b02e15a64736f6c63430005090032", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101cd5760003560e01c806301b2320e146101d2578063073ce82d146102015780630b7f166514610209578063197d6ca4146102115780631ec6b60a14610237578063200d2ed2146102415780632493b9fc1461026d5780632a2acafa1461028a5780632a4b93af146102bb5780632b38cd96146102c35780632fb0fc6f146102e057806339f0ebb1146102e85780633d46b819146102f05780633feb1bd81461030d57806340cddab31461033f578063447fe289146103975780634615d5e9146103b457806349f92f63146103d15780635197c7aa146103ee57806353556559146103f657806355a373d61461041357806357456f22146104375780638199d3fd1461045d578063900cf0cf14610465578063915eb0e71461046d5780639bf6a74a14610475578063a5f18c011461049b578063a7699d02146104a3578063a8311aa8146104c6578063aae46bab146104ce578063aea0e78b146104eb578063b7ab4db5146104f3578063c2668caf146104fb578063c3e3a45c14610503578063cc8ee06514610520578063d087d2881461053d578063d09fc00414610545578063df78523014610562578063e75235b81461056a575b600080fd5b6101ef600480360360208110156101e857600080fd5b5035610572565b60408051918252519081900360200190f35b6101ef61058a565b6101ef61059d565b6101ef6004803603602081101561022757600080fd5b50356001600160a01b03166105b5565b61023f610620565b005b610249610778565b6040518082600381111561025957fe5b60ff16815260200191505060405180910390f35b61023f6004803603602081101561028357600080fd5b5035610781565b6102a7600480360360208110156102a057600080fd5b5035610846565b604080519115158252519081900360200190f35b6101ef61085b565b6102a7600480360360208110156102d957600080fd5b5035610868565b6101ef61087d565b61023f6108e7565b6101ef6004803603602081101561030657600080fd5b50356109d3565b61023f6004803603606081101561032357600080fd5b508035906001600160a01b0360208201351690604001356109e8565b610347610b48565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561038357818101518382015260200161036b565b505050509050019250505060405180910390f35b6101ef600480360360208110156103ad57600080fd5b5035610bb3565b6101ef600480360360208110156103ca57600080fd5b5035610bc5565b6102a7600480360360208110156103e757600080fd5b5035610bda565b6101ef610bef565b61023f6004803603602081101561040c57600080fd5b5035610c07565b61041b610e1c565b604080516001600160a01b039092168252519081900360200190f35b61023f6004803603602081101561044d57600080fd5b50356001600160a01b0316610e2b565b6101ef610f63565b6101ef610f70565b61023f610f76565b61023f6004803603602081101561048b57600080fd5b50356001600160a01b031661105d565b6101ef611164565b61023f600480360360408110156104b957600080fd5b5080359060200135611171565b6101ef611304565b6101ef600480360360208110156104e457600080fd5b5035611311565b6101ef611323565b610347611329565b6101ef611392565b6101ef6004803603602081101561051957600080fd5b503561139b565b61023f6004803603602081101561053657600080fd5b50356113b0565b6101ef611471565b6101ef6004803603602081101561055b57600080fd5b503561147e565b61023f611490565b6101ef6115fc565b6000818152602081905260409020600301545b919050565b6000610597600854610bb3565b90505b90565b60075460009081526020819052604090206006015490565b600060606105c1610b48565b905060005b6105ce61058a565b81101561061657836001600160a01b03168282815181106105eb57fe5b60200260200101516001600160a01b0316141561060e5760010191506105859050565b6001016105c6565b5060009392505050565b600060065460ff16600381111561063357fe5b148061064f5750600160065460ff16600381111561064d57fe5b145b61069f576040805162461bcd60e51b815260206004820152601c60248201527b4e6f7420696e207265616479206f7220766f74696e6720737461746560201b604482015290519081900360640190fd5b6106a761087d565b6106e6576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b6106f06002611609565b15610776576008805460019081019091556006805460ff191690911790556107166115fc565b600854600090815260208190526040902060010155610733611329565b60085460009081526020818152604090912082516107579391929190910190611b27565b5061076061085b565b6008546000908152602081905260409020600201555b565b60065460ff1681565b600160065460ff16600381111561079457fe5b146107d4576040805162461bcd60e51b81526020600482015260136024820152600080516020611c0f833981519152604482015290519081900360640190fd5b6107dc61087d565b61081b576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b610826600682611660565b156108435760085460009081526020819052604090206002018190555b50565b60056020526000908152604090205460ff1681565b600061059760075461139b565b60046020526000908152604090205460ff1681565b60006060610889611329565b905060005b610896611304565b8110156108de57336001600160a01b03168282815181106108b357fe5b60200260200101516001600160a01b031614156108d657600101915061059a9050565b60010161088e565b50600091505090565b600260065460ff1660038111156108fa57fe5b14610942576040805162461bcd60e51b81526020600482015260136024820152724e6f7420696e206b657967656e20737461746560681b604482015290519081900360640190fd5b61094a61087d565b610989576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b6109936008611609565b15610776576006805460ff191660011790556008546040517fddbb65cfe1ae4aec03cef0f9667c6d7ba3740927d0c60f4dd4d7104cc31d180a90600090a2565b60009081526020819052604090206004015490565b600060065460ff1660038111156109fb57fe5b1480610a175750600160065460ff166003811115610a1557fe5b145b610a67576040805162461bcd60e51b815260206004820152601c60248201527b4e6f7420696e207265616479206f7220766f74696e6720737461746560201b604482015290519081900360640190fd5b610a6f61087d565b610aae576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b610abb60098484846116c0565b15610b4357600b546040805163a9059cbb60e01b81526001600160a01b038581166004830152602482018590529151919092169163a9059cbb9160448083019260209291908290030181600087803b158015610b1657600080fd5b505af1158015610b2a573d6000803e3d6000fd5b505050506040513d6020811015610b4057600080fd5b50505b505050565b60085460009081526020818152604091829020805483518184028101840190945280845260609392830182828015610ba957602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610b8b575b5050505050905090565b60009081526020819052604090205490565b60009081526020819052604090206001015490565b60026020526000908152604090205460ff1681565b60075460009081526020819052604090206005015490565b600060065460ff166003811115610c1a57fe5b14610c61576040805162461bcd60e51b81526020600482015260126024820152714e6f7420696e20726561647920737461746560701b604482015290519081900360640190fd5b6009548110158015610c7857506402540be4008110155b8015610c865750600a548111155b610c8f57600080fd5b6000610c9961085b565b610ca1611164565b430381610caa57fe5b60075460408051939092046020808501829052848401929092528251808503840181526060909401835283519382019390932060009081526005909152205490915060ff16610d4f57600780546040805160208082018690528183019390935281518082038301815260609091018252805190830120600090815260058352818120805460ff1916600190811790915593548152918290529020600401805490910190555b600b54604080516323b872dd60e01b81523360048201523060248201526044810185905290516001600160a01b03909216916323b872dd916064808201926020929091908290030181600087803b158015610da957600080fd5b505af1158015610dbd573d6000803e3d6000fd5b505050506040513d6020811015610dd357600080fd5b507f9273b6f22cee1ef3d7cdc2a9c031936003526bae368886259511f7dd40044b02905082610e00611471565b6040805192835260208301919091528051918290030190a15050565b600b546001600160a01b031681565b600160065460ff166003811115610e3e57fe5b14610e7e576040805162461bcd60e51b81526020600482015260136024820152600080516020611c0f833981519152604482015290519081900360640190fd5b610e8661087d565b610ec5576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b610ece816105b5565b15610f16576040805162461bcd60e51b815260206004820152601360248201527220b63932b0b23c9030903b30b634b230ba37b960691b604482015290519081900360640190fd5b610f2160038261173d565b15610843576008546000908152602081815260408220805460018101825590835291200180546001600160a01b0383166001600160a01b031990911617905550565b6000610597600854610bc5565b60075481565b600160065460ff166003811115610f8957fe5b14610fc9576040805162461bcd60e51b81526020600482015260136024820152600080516020611c0f833981519152604482015290519081900360640190fd5b610fd161087d565b611010576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b61101a6007611609565b15610776576006805460ff191660021790556008546007546040517f3ef85928df9ae51bdb3eb4c00ec73b92b82307f319ac1b029de14796a097260990600090a3565b600160065460ff16600381111561107057fe5b146110b0576040805162461bcd60e51b81526020600482015260136024820152600080516020611c0f833981519152604482015290519081900360640190fd5b6110b861087d565b6110f7576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b611100816105b5565b61114b576040805162461bcd60e51b815260206004820152601760248201527620b63932b0b23c903737ba1030903b30b634b230ba37b960491b604482015290519081900360640190fd5b61115660048261173d565b1561084357610843816117aa565b6000610597600754610572565b600260065460ff16600381111561118457fe5b146111cc576040805162461bcd60e51b81526020600482015260136024820152724e6f7420696e206b657967656e20737461746560681b604482015290519081900360640190fd5b6111d5336105b5565b61121d576040805162461bcd60e51b81526020600482015260146024820152732737ba1030903732bc3a103b30b634b230ba37b960611b604482015290519081900360640190fd5b611229600083836118e4565b15611300576008805460009081526020819052604080822060050185905582548252902060060182905554600114156112c3576006805460ff191690556008805460009081526020818152604080832043600390910155835483529182902060001960049091015591546007819055815185815292830184905281519092600080516020611bef83398151915292908290030190a2611300565b6006805460ff191660031790556008546007546040517ff4735b85cc98f9a712832825ecab4cfb1649d658f9a73c57a00ea7dde735c79b90600090a35b5050565b6000610597600754610bb3565b60036020526000908152604090205481565b60085481565b60075460009081526020818152604091829020805483518184028101840190945280845260609392830182828015610ba9576020028201919060005260206000209081546001600160a01b03168152600190910190602001808311610b8b575050505050905090565b60006105976008545b60009081526020819052604090206002015490565b600160065460ff1660038111156113c357fe5b14611403576040805162461bcd60e51b81526020600482015260136024820152600080516020611c0f833981519152604482015290519081900360640190fd5b61140b61087d565b61144a576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b611455600582611660565b1561084357600854600090815260208190526040902060010155565b60006105976007546109d3565b60016020526000908152604090205481565b600360065460ff1660038111156114a357fe5b146114f3576040805162461bcd60e51b815260206004820152601b60248201527a4e6f7420696e2066756e6473207472616e7366657220737461746560281b604482015290519081900360640190fd5b6114fb61087d565b61153a576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b60006007541161157b5760405162461bcd60e51b8152600401808060200182810382526028815260200180611c2f6028913960400191505060405180910390fd5b611585600161194d565b15610776576006805460ff191690556008805460009081526020819052604080822043600390910155825482529020600019600490910155546007819055600080516020611bef8339815191526115da610bef565b6115e261059d565b6040805192835260208301919091528051918290030190a2565b6000610597600754610bc5565b600080826008546040516020018083600981111561162357fe5b60ff1660f81b8152600101828152602001925050506040516020818303038152906040528051906020012090506116598161199d565b9392505050565b60008083600854846040516020018084600981111561167b57fe5b60ff1660f81b815260010183815260200182815260200193505050506040516020818303038152906040528051906020012090506116b88161199d565b949350505050565b60008085858585604051602001808560098111156116da57fe5b60ff1660f81b8152600101848152602001836001600160a01b03166001600160a01b031660601b81526014018281526020019450505050506040516020818303038152906040528051906020012090506117338161199d565b9695505050505050565b60008083600854846040516020018084600981111561175857fe5b60ff1660f81b8152600101838152602001826001600160a01b03166001600160a01b031660601b815260140193505050506040516020818303038152906040528051906020012090506116b88161199d565b60005b60016117b761058a565b0381101561188557600854600090815260208190526040902080546001600160a01b0384169190839081106117e857fe5b6000918252602090912001546001600160a01b0316141561187d5761180b610b48565b600161181561058a565b038151811061182057fe5b60200260200101516000806008548152602001908152602001600020600001828154811061184a57fe5b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550611885565b6001016117ad565b50600854600090815260208190526040902060016118a161058a565b03815481106118ac57fe5b6000918252602080832090910180546001600160a01b0319169055600854825281905260409020805490611300906000198301611b8c565b6000808460085485856040516020018085600981111561190057fe5b60ff1660f81b815260010184815260200183815260200182815260200194505050505060405160208183030381529060405280519060200120905061194481611a70565b95945050505050565b600080826008546040516020018083600981111561196757fe5b60ff1660f81b81526001018281526020019250505060405160208183030381529060405280519060200120905061165981611a70565b6000806119a983611af8565b60008181526004602052604090205490915060ff1615611a00576040805162461bcd60e51b815260206004820152600d60248201526c566f74656420616c726561647960981b604482015290519081900360640190fd5b6000818152600460205260409020805460ff19166001179055611a216115fc565b6000848152600360205260409020541415611a545750506000818152600360205260409020600160ff1b90556001610585565b5050600081815260036020526040812080546001019055610585565b600080611a7c83611af8565b60008181526004602052604090205490915060ff1615611ad7576040805162461bcd60e51b8152602060048201526011602482015270436f6e6669726d656420616c726561647960781b604482015290519081900360640190fd5b6000818152600460205260409020805460ff19166001179055611a21610f63565b604080516020808201939093523360601b81830152815180820360340181526054909101909152805191012090565b828054828255906000526020600020908101928215611b7c579160200282015b82811115611b7c57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190611b47565b50611b88929150611bb0565b5090565b815481835581811115610b4357600083815260209020610b43918101908301611bd4565b61059a91905b80821115611b885780546001600160a01b0319168155600101611bb6565b61059a91905b80821115611b885760008155600101611bda56fec33272939f066c227e913a4b3434d860794f185c551685c29451a3a38b9b259c4e6f7420696e20766f74696e672073746174650000000000000000000000000046697273742065706f636820646f6573206e6f74206e6565642066756e6473207472616e736665724e6f7420612063757272656e742076616c696461746f72000000000000000000a265627a7a72305820dfb70a1c283919f9128aabe00d30be35942e7ded3ecf2eb30af4168b8b02e15a64736f6c63430005090032", + "sourceMap": "93:11259:0:-;;;1516:530;8:9:-1;5:2;;;30:1;27;20:12;5:2;1516:530:0;;;;;;;;;;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;1516:530:0;;;;;;;;;;;;;;19:11:-1;11:20;;8:2;;;44:1;41;34:12;8:2;62:21;;123:4;114:14;;138:31;;;135:2;;;182:1;179;172:12;135:2;219:3;213:10;331:9;325:2;311:12;307:21;289:16;285:44;282:59;261:11;247:12;244:29;233:116;230:2;;;362:1;359;352:12;230:2;-1:-1;;1516:530:0;;;;;;;;1661:17;;1516:530;;-1:-1:-1;1516:530:0;;-1:-1:-1;1516:530:0;;;;;;1653:30;;;;;;1713:10;:17;1701:9;:29;1693:38;;;;;;1742:13;:38;;-1:-1:-1;;;;;1742:38:0;;-1:-1:-1;;;;;;1742:38:0;;;;;;-1:-1:-1;1791:5:0;:9;;;1810:6;:22;;-1:-1:-1;;1810:22:0;1819:13;1810:22;;;-1:-1:-1;1842:9:0;:13;;;1886:58;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;1886:58:0;;;;;;;;;;;;;;;;1866:17;;;;;;:78;;;;1886:58;;1866:17;;:78;;:17;;:78;;;:::i;:::-;-1:-1:-1;1866:78:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1968:6;-1:-1:-1;1968:9:0;;;;1955:10;:22;2000:6;2007:1;2000:9;;;;1987:10;:22;2025:14;;2037:1;;2034;;2025:14;;2034:1;;2025:14;1516:530;;;;;93:11259;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;93:11259:0;-1:-1:-1;;;;;93:11259:0;;;;;;;;;;;-1:-1:-1;93:11259:0;;;;;;;-1:-1:-1;93:11259:0;;;-1:-1:-1;93:11259:0;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;-1:-1:-1;;;;;;93:11259:0;;;;;;;;;:::o;:::-;;;;;;;", + "deployedSourceMap": "93:11259:0:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;93:11259:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5418:112;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;5418:112:0;;:::i;:::-;;;;;;;;;;;;;;;;4766:98;;;:::i;6148:82::-;;;:::i;6506:276::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;6506:276:0;-1:-1:-1;;;;;6506:276:0;;:::i;7032:357::-;;;:::i;:::-;;1395:20;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8607:204;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;8607:204:0;;:::i;1347:41::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1347:41:0;;:::i;:::-;;;;;;;;;;;;;;;;;;5536:94;;;:::i;1304:37::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1304:37:0;;:::i;6236:264::-;;;:::i;9022:203::-;;;:::i;5952:102::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;5952:102:0;;:::i;3310:213::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;3310:213:0;;;-1:-1:-1;;;;;3310:213:0;;;;;;;;;;:::i;6906:120::-;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:100:-1;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;6906:120:0;;;;;;;;;;;;;;;;;4870:116;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;4870:116:0;;:::i;5200:110::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;5200:110:0;;:::i;1208:42::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1208:42:0;;:::i;6060:82::-;;;:::i;2786:518::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;2786:518:0;;:::i;2052:27::-;;;:::i;:::-;;;;-1:-1:-1;;;;;2052:27:0;;;;;;;;;;;;;;7395:278;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;7395:278:0;-1:-1:-1;;;;;7395:278:0;;:::i;5092:102::-;;;:::i;1422:17::-;;;:::i;8817:199::-;;;:::i;7679:271::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;7679:271:0;-1:-1:-1;;;;;7679:271:0;;:::i;5316:96::-;;;:::i;3529:691::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;3529:691:0;;;;;;;:::i;4670:90::-;;;:::i;1256:42::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1256:42:0;;:::i;1445:21::-;;;:::i;6788:112::-;;;:::i;5636:102::-;;;:::i;5744:110::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;5744:110:0;;:::i;8398:203::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;8398:203:0;;:::i;5860:86::-;;;:::i;1155:47::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1155:47:0;;:::i;4226:438::-;;;:::i;4992:94::-;;;:::i;5418:112::-;5475:4;5498:14;;;;;;;;;;:25;;;5418:112;;;;:::o;4766:98::-;4813:4;4836:21;4847:9;;4836:10;:21::i;:::-;4829:28;;4766:98;;:::o;6148:82::-;6215:5;;6185:4;6208:13;;;;;;;;;;:15;;;6148:82;:::o;6506:276::-;6562:4;6578:27;6608:19;:17;:19::i;:::-;6578:49;-1:-1:-1;6642:6:0;6637:121;6658:16;:14;:16::i;:::-;6654:1;:20;6637:121;;;6716:1;-1:-1:-1;;;;;6699:18:0;:10;6710:1;6699:13;;;;;;;;;;;;;;-1:-1:-1;;;;;6699:18:0;;6695:52;;;6746:1;6742:5;;-1:-1:-1;6735:12:0;;-1:-1:-1;6735:12:0;6695:52;6676:3;;6637:121;;;-1:-1:-1;6774:1:0;;6506:276;-1:-1:-1;;;6506:276:0:o;7032:357::-;2239:12;2229:6;;;;:22;;;;;;;;;:49;;;-1:-1:-1;2265:13:0;2255:6;;;;:23;;;;;;;;;2229:49;2221:90;;;;;-1:-1:-1;;;2221:90:0;;;;;;;;;;;;-1:-1:-1;;;2221:90:0;;;;;;;;;;;;;;;2717:12;:10;:12::i;:::-;2709:53;;;;;-1:-1:-1;;;2709:53:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2709:53:0;;;;;;;;;;;;;;;7107:26;7115:17;7107:7;:26::i;:::-;7103:280;;;7149:9;:11;;;;;;;;;7174:6;:22;;-1:-1:-1;;7174:22:0;;;;;;7240:14;:12;:14::i;:::-;7217:9;;7210:6;:17;;;;;;;;;;:27;;:44;7299:15;:13;:15::i;:::-;7275:9;;7268:6;:17;;;;;;;;;;;:46;;;;:17;;:46;;;;;;:::i;:::-;;7358:14;:12;:14::i;:::-;7335:9;;7328:6;:17;;;;;;;;;;:27;;:44;7103:280;7032:357::o;1395:20::-;;;;;;:::o;8607:204::-;2379:13;2369:6;;;;:23;;;;;;;;;2361:55;;;;;-1:-1:-1;;;2361:55:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2361:55:0;;;;;;;;;;;;;;;2717:12;:10;:12::i;:::-;2709:53;;;;;-1:-1:-1;;;2709:53:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2709:53:0;;;;;;;;;;;;;;;8697:42;8705:22;8729:9;8697:7;:42::i;:::-;8693:112;;;8762:9;;8755:6;:17;;;;;;;;;;:27;;:39;;;8693:112;8607:204;:::o;1347:41::-;;;;;;;;;;;;;;;:::o;5536:94::-;5581:4;5604:19;5617:5;;5604:12;:19::i;1304:37::-;;;;;;;;;;;;;;;:::o;6236:264::-;6279:4;6295:27;6325:15;:13;:15::i;:::-;6295:45;-1:-1:-1;6355:6:0;6350:126;6371:12;:10;:12::i;:::-;6367:1;:16;6350:126;;;6425:10;-1:-1:-1;;;;;6408:27:0;:10;6419:1;6408:13;;;;;;;;;;;;;;-1:-1:-1;;;;;6408:27:0;;6404:61;;;6464:1;6460:5;;-1:-1:-1;6453:12:0;;-1:-1:-1;6453:12:0;6404:61;6385:3;;6350:126;;;;6492:1;6485:8;;;6236:264;:::o;9022:203::-;2484:13;2474:6;;;;:23;;;;;;;;;2466:55;;;;;-1:-1:-1;;;2466:55:0;;;;;;;;;;;;-1:-1:-1;;;2466:55:0;;;;;;;;;;;;;;;2717:12;:10;:12::i;:::-;2709:53;;;;;-1:-1:-1;;;2709:53:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2709:53:0;;;;;;;;;;;;;;;9095:27;9103:18;9095:7;:27::i;:::-;9091:128;;;9138:6;:22;;-1:-1:-1;;9138:22:0;9147:13;9138:22;;;9198:9;;9180:28;;;;-1:-1:-1;;9180:28:0;9022:203::o;5952:102::-;6004:4;6027:14;;;;;;;;;;:20;;;;5952:102::o;3310:213::-;2239:12;2229:6;;;;:22;;;;;;;;;:49;;;-1:-1:-1;2265:13:0;2255:6;;;;:23;;;;;;;;;2229:49;2221:90;;;;;-1:-1:-1;;;2221:90:0;;;;;;;;;;;;-1:-1:-1;;;2221:90:0;;;;;;;;;;;;;;;2717:12;:10;:12::i;:::-;2709:53;;;;;-1:-1:-1;;;2709:53:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2709:53:0;;;;;;;;;;;;;;;3418:39;3426:13;3441:4;3447:2;3451:5;3418:7;:39::i;:::-;3414:103;;;3473:13;;:33;;;-1:-1:-1;;;3473:33:0;;-1:-1:-1;;;;;3473:33:0;;;;;;;;;;;;;;;:13;;;;;:22;;:33;;;;;;;;;;;;;;:13;;:33;;;5:2:-1;;;;30:1;27;20:12;5:2;3473:33:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3473:33:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;3414:103:0;3310:213;;;:::o;6906:120::-;6998:9;;6991:6;:17;;;;;;;;;;;;6984:35;;;;;;;;;;;;;;;;;6956:16;;6984:35;;;6991:17;6984:35;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;6984:35:0;;;;;;;;;;;;;;;;;;;;;;;6906:120;:::o;4870:116::-;4924:4;4947:14;;;;;;;;;;:32;;4870:116::o;5200:110::-;5256:4;5279:14;;;;;;;;;;:24;;;;5200:110::o;1208:42::-;;;;;;;;;;;;;;;:::o;6060:82::-;6127:5;;6097:4;6120:13;;;;;;;;;;:15;;;6060:82;:::o;2786:518::-;2129:12;2119:6;;;;:22;;;;;;;;;2111:53;;;;;-1:-1:-1;;;2111:53:0;;;;;;;;;;;;-1:-1:-1;;;2111:53:0;;;;;;;;;;;;;;;2856:10;;2847:5;:19;;:40;;;;;2879:8;2870:5;:17;;2847:40;:63;;;;;2900:10;;2891:5;:19;;2847:63;2839:72;;;;;;2922:12;2972:14;:12;:14::i;:::-;2953:15;:13;:15::i;:::-;2938:12;:30;2937:49;;;;;3047:5;;3021:32;;;2937:49;;;;3021:32;;;;;;;;;;;;;;;;26:21:-1;;;22:32;;6:49;;3021:32:0;;;;;;3011:43;;;;;;;;;3001:54;;;;:9;:54;;;;;2937:49;;-1:-1:-1;3001:54:0;;2996:182;;3117:5;;;3091:32;;;;;;;;;;;;;;;;;;;26:21:-1;;;22:32;;6:49;;3091:32:0;;;;;;3081:43;;;;;;3071:54;;;;:9;:54;;;;;:61;;-1:-1:-1;;3071:61:0;3128:4;3071:61;;;;;;3153:5;;3146:13;;;;;;;;:19;;:21;;;;;;;2996:182;3188:13;;:60;;;-1:-1:-1;;;3188:60:0;;3215:10;3188:60;;;;3235:4;3188:60;;;;;;;;;;;;-1:-1:-1;;;;;3188:13:0;;;;:26;;:60;;;;;;;;;;;;;;;:13;;:60;;;5:2:-1;;;;30:1;27;20:12;5:2;3188:60:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3188:60:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;3263:34:0;;-1:-1:-1;3279:5:0;3286:10;:8;:10::i;:::-;3263:34;;;;;;;;;;;;;;;;;;;;;;2174:1;2786:518;:::o;2052:27::-;;;-1:-1:-1;;;;;2052:27:0;;:::o;7395:278::-;2379:13;2369:6;;;;:23;;;;;;;;;2361:55;;;;;-1:-1:-1;;;2361:55:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2361:55:0;;;;;;;;;;;;;;;2717:12;:10;:12::i;:::-;2709:53;;;;;-1:-1:-1;;;2709:53:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2709:53:0;;;;;;;;;;;;;;;7489:25;7504:9;7489:14;:25::i;:::-;:30;7481:62;;;;;-1:-1:-1;;;7481:62:0;;;;;;;;;;;;-1:-1:-1;;;7481:62:0;;;;;;;;;;;;;;;7558:38;7566:18;7586:9;7558:7;:38::i;:::-;7554:113;;;7619:9;;7612:6;:17;;;;;;;;;;27:10:-1;;39:1;23:18;;45:23;;7612:44:0;;;;;;;;-1:-1:-1;;;;;7612:44:0;;-1:-1:-1;;;;;;7612:44:0;;;;;;7395:278;:::o;5092:102::-;5141:4;5164:23;5177:9;;5164:12;:23::i;1422:17::-;;;;:::o;8817:199::-;2379:13;2369:6;;;;:23;;;;;;;;;2361:55;;;;;-1:-1:-1;;;2361:55:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2361:55:0;;;;;;;;;;;;;;;2717:12;:10;:12::i;:::-;2709:53;;;;;-1:-1:-1;;;2709:53:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2709:53:0;;;;;;;;;;;;;;;8889:26;8897:17;8889:7;:26::i;:::-;8885:125;;;8931:6;:22;;-1:-1:-1;;8931:22:0;8940:13;8931:22;;;8989:9;;8982:5;;8973:26;;;;-1:-1:-1;;8973:26:0;8817:199::o;7679:271::-;2379:13;2369:6;;;;:23;;;;;;;;;2361:55;;;;;-1:-1:-1;;;2361:55:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2361:55:0;;;;;;;;;;;;;;;2717:12;:10;:12::i;:::-;2709:53;;;;;-1:-1:-1;;;2709:53:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2709:53:0;;;;;;;;;;;;;;;7776:25;7791:9;7776:14;:25::i;:::-;7768:66;;;;;-1:-1:-1;;;7768:66:0;;;;;;;;;;;;-1:-1:-1;;;7768:66:0;;;;;;;;;;;;;;;7849:41;7857:21;7880:9;7849:7;:41::i;:::-;7845:99;;;7906:27;7923:9;7906:16;:27::i;5316:96::-;5362:4;5385:20;5399:5;;5385:13;:20::i;3529:691::-;2484:13;2474:6;;;;:23;;;;;;;;;2466:55;;;;;-1:-1:-1;;;2466:55:0;;;;;;;;;;;;-1:-1:-1;;;2466:55:0;;;;;;;;;;;;;;;3600:26;3615:10;3600:14;:26::i;:::-;3592:64;;;;;-1:-1:-1;;;3592:64:0;;;;;;;;;;;;-1:-1:-1;;;3592:64:0;;;;;;;;;;;;;;;3671:37;3682:19;3703:1;3706;3671:10;:37::i;:::-;3667:547;;;3731:9;;;3724:6;:17;;;;;;;;;;;:19;;:23;;;3768:9;;3761:17;;;;:19;;:23;;;3802:9;3815:1;3802:14;3798:406;;;3836:6;:21;;-1:-1:-1;;3836:21:0;;;3882:9;;;3845:12;3875:17;;;;;;;;;;;3906:12;3875:28;;;;:43;3943:9;;3936:17;;;;;;-1:-1:-1;;3936:23:0;;;;:34;3996:9;;3988:5;:17;;;4028:23;;;;;;;;;;;;;3996:9;;-1:-1:-1;;;;;;;;;;;4028:23:0;;;;;;;;3798:406;;;4102:6;:30;;-1:-1:-1;;4102:30:0;4111:21;4102:30;;;4179:9;;4172:5;;4155:34;;;;-1:-1:-1;;4155:34:0;3798:406;3529:691;;:::o;4670:90::-;4713:4;4736:17;4747:5;;4736:10;:17::i;1256:42::-;;;;;;;;;;;;;:::o;1445:21::-;;;;:::o;6788:112::-;6876:5;;6869:6;:13;;;;;;;;;;;;6862:31;;;;;;;;;;;;;;;;;6834:16;;6862:31;;;6869:13;6862:31;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;6862:31:0;;;;;;;;;;;;;;;;;;;;;;6788:112;:::o;5636:102::-;5685:4;5708:23;5721:9;;5744:110;5800:4;5823:14;;;;;;;;;;:24;;;;5744:110::o;8398:203::-;2379:13;2369:6;;;;:23;;;;;;;;;2361:55;;;;;-1:-1:-1;;;2361:55:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2361:55:0;;;;;;;;;;;;;;;2717:12;:10;:12::i;:::-;2709:53;;;;;-1:-1:-1;;;2709:53:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2709:53:0;;;;;;;;;;;;;;;8488:41;8496:21;8519:9;8488:7;:41::i;:::-;8484:111;;;8552:9;;8545:6;:17;;;;;;;;;;:27;;:39;8398:203::o;5860:86::-;5901:4;5924:15;5933:5;;5924:8;:15::i;1155:47::-;;;;;;;;;;;;;:::o;4226:438::-;2596:21;2586:6;;;;:31;;;;;;;;;2578:71;;;;;-1:-1:-1;;;2578:71:0;;;;;;;;;;;;-1:-1:-1;;;2578:71:0;;;;;;;;;;;;;;;2717:12;:10;:12::i;:::-;2709:53;;;;;-1:-1:-1;;;2709:53:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2709:53:0;;;;;;;;;;;;;;;4322:1;4314:5;;:9;4306:62;;;;-1:-1:-1;;;4306:62:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4383:39;4394:27;4383:10;:39::i;:::-;4379:279;;;4438:6;:21;;-1:-1:-1;;4438:21:0;;;4480:9;;;4447:12;4473:17;;;;;;;;;;;4504:12;4473:28;;;;:43;4537:9;;4530:17;;;;-1:-1:-1;;4530:23:0;;;;:34;4586:9;4578:5;:17;;;-1:-1:-1;;;;;;;;;;;4632:6:0;:4;:6::i;:::-;4640;:4;:6::i;:::-;4614:33;;;;;;;;;;;;;;;;;;;;;;4226:438::o;4992:94::-;5037:4;5060:19;5073:5;;5060:12;:19::i;9231:165::-;9280:4;9296:12;9338:8;9348:9;;9321:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;9321:37:0;;;9311:48;;;;;;9296:63;;9376:13;9384:4;9376:7;:13::i;:::-;9369:20;9231:165;-1:-1:-1;;;9231:165:0:o;9593:180::-;9652:4;9668:12;9710:8;9720:9;;9731:3;9693:42;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;9693:42:0;;;9683:53;;;;;;9668:68;;9753:13;9761:4;9753:7;:13::i;:::-;9746:20;9593:180;-1:-1:-1;;;;9593:180:0:o;9779:209::-;9866:4;9882:12;9924:8;9934:4;9940:2;9944:5;9907:43;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;9907:43:0;-1:-1:-1;;;;;9907:43:0;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;9907:43:0;;;9897:54;;;;;;9882:69;;9968:13;9976:4;9968:7;:13::i;:::-;9961:20;9779:209;-1:-1:-1;;;;;;9779:209:0:o;9402:185::-;9465:4;9481:12;9523:8;9533:9;;9544:4;9506:43;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;9506:43:0;-1:-1:-1;;;;;9506:43:0;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;9506:43:0;;;9496:54;;;;;;9481:69;;9567:13;9575:4;9567:7;:13::i;7956:436::-;8024:6;8019:253;8059:1;8040:16;:14;:16::i;:::-;:20;8036:1;:24;8019:253;;;8092:9;;8085:6;:17;;;;;;;;;;:31;;-1:-1:-1;;;;;8085:44:0;;;:17;8114:1;;8085:31;;;;;;;;;;;;;;;;-1:-1:-1;;;;;8085:31:0;:44;8081:181;;;8183:19;:17;:19::i;:::-;8222:1;8203:16;:14;:16::i;:::-;:20;8183:41;;;;;;;;;;;;;;8149:6;:17;8156:9;;8149:17;;;;;;;;;;;:28;;8178:1;8149:31;;;;;;;;;;;;;;;;:75;;;;;-1:-1:-1;;;;;8149:75:0;;;;;-1:-1:-1;;;;;8149:75:0;;;;;;8242:5;;8081:181;8062:3;;8019:253;;;-1:-1:-1;8295:9:0;;8288:6;:17;;;;;;;;;;8336:1;8317:16;:14;:16::i;:::-;:20;8288:50;;;;;;;;;;;;;;;;;;;8281:57;;-1:-1:-1;;;;;;8281:57:0;;;8355:9;;8348:17;;;;;;;;:37;;;;;-1:-1:-1;;8348:37:0;;;:::i;10171:193::-;10239:4;10255:12;10297:8;10307:9;;10318:1;10321;10280:43;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;10280:43:0;;;10270:54;;;;;;10255:69;;10341:16;10352:4;10341:10;:16::i;:::-;10334:23;10171:193;-1:-1:-1;;;;;10171:193:0:o;9994:171::-;10046:4;10062:12;10104:8;10114:9;;10087:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;10087:37:0;;;10077:48;;;;;;10062:63;;10142:16;10153:4;10142:10;:16::i;10370:409::-;10418:4;10434:20;10457:21;10473:4;10457:15;:21::i;:::-;10497:19;;;;:5;:19;;;;;;10434:44;;-1:-1:-1;10497:19:0;;10496:20;10488:46;;;;;-1:-1:-1;;;10488:46:0;;;;;;;;;;;;-1:-1:-1;;;10488:46:0;;;;;;;;;;;;;;;10545:19;;;;:5;:19;;;;;:26;;-1:-1:-1;;10545:26:0;10567:4;10545:26;;;10605:14;:12;:14::i;:::-;10585:16;;;;:10;:16;;;;;;:34;10581:192;;;-1:-1:-1;;10635:16:0;;;;:10;:16;;;;;-1:-1:-1;;;10635:27:0;;10683:4;10676:11;;10581:192;-1:-1:-1;;10718:16:0;;;;:10;:16;;;;;:18;;;;;;10750:12;;10785:420;10836:4;10852:20;10875:21;10891:4;10875:15;:21::i;:::-;10915:19;;;;:5;:19;;;;;;10852:44;;-1:-1:-1;10915:19:0;;10914:20;10906:50;;;;;-1:-1:-1;;;10906:50:0;;;;;;;;;;;;-1:-1:-1;;;10906:50:0;;;;;;;;;;;;;;;10967:19;;;;:5;:19;;;;;:26;;-1:-1:-1;;10967:26:0;10989:4;10967:26;;;11027:18;:16;:18::i;11211:139::-;11308:34;;;;;;;;;;;11331:10;11308:34;;;;;;;;26:21:-1;;;22:32;;6:49;;11308:34:0;;;;;;;11298:45;;;;;;11211:139::o;93:11259::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;93:11259:0;-1:-1:-1;;;;;93:11259:0;;;;;;;;;;;-1:-1:-1;93:11259:0;;;;;;;-1:-1:-1;93:11259:0;;;-1:-1:-1;93:11259:0;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;-1:-1:-1;;;;;;93:11259:0;;;;;;;;;;;;;;;;;;;;;;;;", + "source": "pragma solidity ^0.5.0;\n\nimport './openzeppelin-solidity/contracts/token/ERC20/IERC20.sol';\n\ncontract Bridge {\n event ExchangeRequest(uint value, uint nonce);\n event NewEpoch(uint indexed oldEpoch, uint indexed newEpoch);\n event NewEpochCancelled(uint indexed epoch);\n event NewFundsTransfer(uint indexed oldEpoch, uint indexed newEpoch);\n event EpochStart(uint indexed epoch, uint x, uint y);\n\n struct State {\n address[] validators;\n uint threshold;\n uint rangeSize;\n uint startBlock;\n uint nonce;\n uint x;\n uint y;\n }\n\n enum Status {\n READY, // bridge is in ready to perform operations\n VOTING, // voting for changing in next epoch, but still ready\n KEYGEN, //keygen, can be cancelled\n FUNDS_TRANSFER // funds transfer, cannot be cancelled\n }\n\n enum Vote {\n CONFIRM_KEYGEN,\n CONFIRM_FUNDS_TRANSFER,\n START_VOTING,\n ADD_VALIDATOR,\n REMOVE_VALIDATOR,\n CHANGE_THRESHOLD,\n CHANGE_RANGE_SIZE,\n START_KEYGEN,\n CANCEL_KEYGEN,\n TRANSFER\n }\n\n mapping(uint => State) states;\n\n mapping(bytes32 => uint) public dbTransferCount;\n mapping(bytes32 => bool) public dbTransfer;\n mapping(bytes32 => uint) public votesCount;\n mapping(bytes32 => bool) public votes;\n mapping(bytes32 => bool) public usedRange;\n\n Status public status;\n\n uint public epoch;\n uint public nextEpoch;\n\n uint minTxLimit;\n uint maxTxLimit;\n\n constructor(uint threshold, address[] memory validators, address _tokenContract, uint[2] memory limits, uint rangeSize) public {\n require(validators.length > 0);\n require(threshold < validators.length);\n\n tokenContract = IERC20(_tokenContract);\n\n epoch = 0;\n status = Status.KEYGEN;\n nextEpoch = 1;\n\n states[nextEpoch] = State(validators, threshold, rangeSize, 0, uint(-1), 0, 0);\n\n minTxLimit = limits[0];\n maxTxLimit = limits[1];\n\n emit NewEpoch(0, 1);\n }\n\n IERC20 public tokenContract;\n\n modifier ready {\n require(status == Status.READY, \"Not in ready state\");\n _;\n }\n\n modifier readyOrVoting {\n require(status == Status.READY || status == Status.VOTING, \"Not in ready or voting state\");\n _;\n }\n\n modifier voting {\n require(status == Status.VOTING, \"Not in voting state\");\n _;\n }\n\n modifier keygen {\n require(status == Status.KEYGEN, \"Not in keygen state\");\n _;\n }\n\n modifier fundsTransfer {\n require(status == Status.FUNDS_TRANSFER, \"Not in funds transfer state\");\n _;\n }\n\n modifier currentValidator {\n require(getPartyId() != 0, \"Not a current validator\");\n _;\n }\n\n function exchange(uint value) public ready {\n require(value >= minTxLimit && value >= 10 ** 10 && value <= maxTxLimit);\n\n uint txRange = (block.number - getStartBlock()) / getRangeSize();\n if (!usedRange[keccak256(abi.encodePacked(txRange, epoch))]) {\n usedRange[keccak256(abi.encodePacked(txRange, epoch))] = true;\n states[epoch].nonce++;\n }\n\n tokenContract.transferFrom(msg.sender, address(this), value);\n emit ExchangeRequest(value, getNonce());\n }\n\n function transfer(bytes32 hash, address to, uint value) public readyOrVoting currentValidator {\n if (tryVote(Vote.TRANSFER, hash, to, value)) {\n tokenContract.transfer(to, value);\n }\n }\n\n function confirmKeygen(uint x, uint y) public keygen {\n require(getNextPartyId(msg.sender) != 0, \"Not a next validator\");\n\n if (tryConfirm(Vote.CONFIRM_KEYGEN, x, y)) {\n states[nextEpoch].x = x;\n states[nextEpoch].y = y;\n if (nextEpoch == 1) {\n status = Status.READY;\n states[nextEpoch].startBlock = block.number;\n states[nextEpoch].nonce = uint(-1);\n epoch = nextEpoch;\n emit EpochStart(epoch, x, y);\n }\n else {\n status = Status.FUNDS_TRANSFER;\n emit NewFundsTransfer(epoch, nextEpoch);\n }\n }\n }\n\n function confirmFundsTransfer() public fundsTransfer currentValidator {\n require(epoch > 0, \"First epoch does not need funds transfer\");\n\n if (tryConfirm(Vote.CONFIRM_FUNDS_TRANSFER)) {\n status = Status.READY;\n states[nextEpoch].startBlock = block.number;\n states[nextEpoch].nonce = uint(-1);\n epoch = nextEpoch;\n emit EpochStart(epoch, getX(), getY());\n }\n }\n\n function getParties() view public returns (uint) {\n return getParties(epoch);\n }\n\n function getNextParties() view public returns (uint) {\n return getParties(nextEpoch);\n }\n\n function getParties(uint _epoch) view public returns (uint) {\n return states[_epoch].validators.length;\n }\n\n function getThreshold() view public returns (uint) {\n return getThreshold(epoch);\n }\n\n function getNextThreshold() view public returns (uint) {\n return getThreshold(nextEpoch);\n }\n\n function getThreshold(uint _epoch) view public returns (uint) {\n return states[_epoch].threshold;\n }\n\n function getStartBlock() view public returns (uint) {\n return getStartBlock(epoch);\n }\n\n function getStartBlock(uint _epoch) view public returns (uint) {\n return states[_epoch].startBlock;\n }\n\n function getRangeSize() view public returns (uint) {\n return getRangeSize(epoch);\n }\n\n function getNextRangeSize() view public returns (uint) {\n return getRangeSize(nextEpoch);\n }\n\n function getRangeSize(uint _epoch) view public returns (uint) {\n return states[_epoch].rangeSize;\n }\n\n function getNonce() view public returns (uint) {\n return getNonce(epoch);\n }\n\n function getNonce(uint _epoch) view public returns (uint) {\n return states[_epoch].nonce;\n }\n\n function getX() view public returns (uint) {\n return states[epoch].x;\n }\n\n function getY() view public returns (uint) {\n return states[epoch].y;\n }\n\n function getPartyId() view public returns (uint) {\n address[] memory validators = getValidators();\n for (uint i = 0; i < getParties(); i++) {\n if (validators[i] == msg.sender)\n return i + 1;\n }\n return 0;\n }\n\n function getNextPartyId(address a) view public returns (uint) {\n address[] memory validators = getNextValidators();\n for (uint i = 0; i < getNextParties(); i++) {\n if (validators[i] == a)\n return i + 1;\n }\n return 0;\n }\n\n function getValidators() view public returns (address[] memory) {\n return states[epoch].validators;\n }\n\n function getNextValidators() view public returns (address[] memory) {\n return states[nextEpoch].validators;\n }\n\n function startVoting() public readyOrVoting currentValidator {\n if (tryVote(Vote.START_VOTING)) {\n nextEpoch++;\n status = Status.VOTING;\n states[nextEpoch].threshold = getThreshold();\n states[nextEpoch].validators = getValidators();\n states[nextEpoch].rangeSize = getRangeSize();\n }\n }\n\n function voteAddValidator(address validator) public voting currentValidator {\n require(getNextPartyId(validator) == 0, \"Already a validator\");\n\n if (tryVote(Vote.ADD_VALIDATOR, validator)) {\n states[nextEpoch].validators.push(validator);\n }\n }\n\n function voteRemoveValidator(address validator) public voting currentValidator {\n require(getNextPartyId(validator) != 0, \"Already not a validator\");\n\n if (tryVote(Vote.REMOVE_VALIDATOR, validator)) {\n _removeValidator(validator);\n }\n }\n\n function _removeValidator(address validator) private {\n for (uint i = 0; i < getNextParties() - 1; i++) {\n if (states[nextEpoch].validators[i] == validator) {\n states[nextEpoch].validators[i] = getNextValidators()[getNextParties() - 1];\n break;\n }\n }\n delete states[nextEpoch].validators[getNextParties() - 1];\n states[nextEpoch].validators.length--;\n }\n\n function voteChangeThreshold(uint threshold) public voting currentValidator {\n if (tryVote(Vote.CHANGE_THRESHOLD, threshold)) {\n states[nextEpoch].threshold = threshold;\n }\n }\n\n function voteChangeRangeSize(uint rangeSize) public voting currentValidator {\n if (tryVote(Vote.CHANGE_RANGE_SIZE, rangeSize)) {\n states[nextEpoch].rangeSize = rangeSize;\n }\n }\n\n function voteStartKeygen() public voting currentValidator {\n if (tryVote(Vote.START_KEYGEN)) {\n status = Status.KEYGEN;\n\n emit NewEpoch(epoch, nextEpoch);\n }\n }\n\n function voteCancelKeygen() public keygen currentValidator {\n if (tryVote(Vote.CANCEL_KEYGEN)) {\n status = Status.VOTING;\n\n emit NewEpochCancelled(nextEpoch);\n }\n }\n\n function tryVote(Vote voteType) private returns (bool) {\n bytes32 vote = keccak256(abi.encodePacked(voteType, nextEpoch));\n return putVote(vote);\n }\n\n function tryVote(Vote voteType, address addr) private returns (bool) {\n bytes32 vote = keccak256(abi.encodePacked(voteType, nextEpoch, addr));\n return putVote(vote);\n }\n\n function tryVote(Vote voteType, uint num) private returns (bool) {\n bytes32 vote = keccak256(abi.encodePacked(voteType, nextEpoch, num));\n return putVote(vote);\n }\n\n function tryVote(Vote voteType, bytes32 hash, address to, uint value) private returns (bool) {\n bytes32 vote = keccak256(abi.encodePacked(voteType, hash, to, value));\n return putVote(vote);\n }\n\n function tryConfirm(Vote voteType) private returns (bool) {\n bytes32 vote = keccak256(abi.encodePacked(voteType, nextEpoch));\n return putConfirm(vote);\n }\n\n function tryConfirm(Vote voteType, uint x, uint y) private returns (bool) {\n bytes32 vote = keccak256(abi.encodePacked(voteType, nextEpoch, x, y));\n return putConfirm(vote);\n }\n\n function putVote(bytes32 vote) private returns (bool) {\n bytes32 personalVote = personalizeVote(vote);\n require(!votes[personalVote], \"Voted already\");\n\n votes[personalVote] = true;\n if (votesCount[vote] == getThreshold()) {\n votesCount[vote] = 2 ** 255;\n return true;\n } else {\n votesCount[vote]++;\n return false;\n }\n }\n\n function putConfirm(bytes32 vote) private returns (bool) {\n bytes32 personalVote = personalizeVote(vote);\n require(!votes[personalVote], \"Confirmed already\");\n\n votes[personalVote] = true;\n if (votesCount[vote] == getNextThreshold()) {\n votesCount[vote] = 2 ** 255;\n return true;\n } else {\n votesCount[vote]++;\n return false;\n }\n }\n\n function personalizeVote(bytes32 vote) private view returns (bytes32) {\n return keccak256(abi.encodePacked(vote, msg.sender));\n }\n}\n", + "sourcePath": "/build/contracts/Bridge.sol", + "ast": { + "absolutePath": "/build/contracts/Bridge.sol", + "exportedSymbols": { + "Bridge": [ + 1340 + ] + }, + "id": 1341, + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 1, + "literals": [ + "solidity", + "^", + "0.5", + ".0" + ], + "nodeType": "PragmaDirective", + "src": "0:23:0" + }, + { + "absolutePath": "/build/contracts/openzeppelin-solidity/contracts/token/ERC20/IERC20.sol", + "file": "./openzeppelin-solidity/contracts/token/ERC20/IERC20.sol", + "id": 2, + "nodeType": "ImportDirective", + "scope": 1341, + "sourceUnit": 10033, + "src": "25:66:0", + "symbolAliases": [], + "unitAlias": "" + }, + { + "baseContracts": [], + "contractDependencies": [], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "id": 1340, + "linearizedBaseContracts": [ + 1340 + ], + "name": "Bridge", + "nodeType": "ContractDefinition", + "nodes": [ + { + "anonymous": false, + "documentation": null, + "id": 8, + "name": "ExchangeRequest", + "nodeType": "EventDefinition", + "parameters": { + "id": 7, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4, + "indexed": false, + "name": "value", + "nodeType": "VariableDeclaration", + "scope": 8, + "src": "137:10:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "137:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 6, + "indexed": false, + "name": "nonce", + "nodeType": "VariableDeclaration", + "scope": 8, + "src": "149:10:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 5, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "149:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "136:24:0" + }, + "src": "115:46:0" + }, + { + "anonymous": false, + "documentation": null, + "id": 14, + "name": "NewEpoch", + "nodeType": "EventDefinition", + "parameters": { + "id": 13, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10, + "indexed": true, + "name": "oldEpoch", + "nodeType": "VariableDeclaration", + "scope": 14, + "src": "181:21:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 9, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "181:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 12, + "indexed": true, + "name": "newEpoch", + "nodeType": "VariableDeclaration", + "scope": 14, + "src": "204:21:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 11, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "204:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "180:46:0" + }, + "src": "166:61:0" + }, + { + "anonymous": false, + "documentation": null, + "id": 18, + "name": "NewEpochCancelled", + "nodeType": "EventDefinition", + "parameters": { + "id": 17, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 16, + "indexed": true, + "name": "epoch", + "nodeType": "VariableDeclaration", + "scope": 18, + "src": "256:18:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 15, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "256:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "255:20:0" + }, + "src": "232:44:0" + }, + { + "anonymous": false, + "documentation": null, + "id": 24, + "name": "NewFundsTransfer", + "nodeType": "EventDefinition", + "parameters": { + "id": 23, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 20, + "indexed": true, + "name": "oldEpoch", + "nodeType": "VariableDeclaration", + "scope": 24, + "src": "304:21:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 19, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "304:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 22, + "indexed": true, + "name": "newEpoch", + "nodeType": "VariableDeclaration", + "scope": 24, + "src": "327:21:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 21, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "327:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "303:46:0" + }, + "src": "281:69:0" + }, + { + "anonymous": false, + "documentation": null, + "id": 32, + "name": "EpochStart", + "nodeType": "EventDefinition", + "parameters": { + "id": 31, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 26, + "indexed": true, + "name": "epoch", + "nodeType": "VariableDeclaration", + "scope": 32, + "src": "372:18:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 25, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "372:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 28, + "indexed": false, + "name": "x", + "nodeType": "VariableDeclaration", + "scope": 32, + "src": "392:6:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 27, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "392:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 30, + "indexed": false, + "name": "y", + "nodeType": "VariableDeclaration", + "scope": 32, + "src": "400:6:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 29, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "400:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "371:36:0" + }, + "src": "355:53:0" + }, + { + "canonicalName": "Bridge.State", + "id": 48, + "members": [ + { + "constant": false, + "id": 35, + "name": "validators", + "nodeType": "VariableDeclaration", + "scope": 48, + "src": "437:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + }, + "typeName": { + "baseType": { + "id": 33, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "437:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 34, + "length": null, + "nodeType": "ArrayTypeName", + "src": "437:9:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 37, + "name": "threshold", + "nodeType": "VariableDeclaration", + "scope": 48, + "src": "467:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 36, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "467:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 39, + "name": "rangeSize", + "nodeType": "VariableDeclaration", + "scope": 48, + "src": "491:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 38, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "491:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 41, + "name": "startBlock", + "nodeType": "VariableDeclaration", + "scope": 48, + "src": "515:15:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 40, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "515:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 43, + "name": "nonce", + "nodeType": "VariableDeclaration", + "scope": 48, + "src": "540:10:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 42, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "540:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 45, + "name": "x", + "nodeType": "VariableDeclaration", + "scope": 48, + "src": "560:6:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 44, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "560:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 47, + "name": "y", + "nodeType": "VariableDeclaration", + "scope": 48, + "src": "576:6:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 46, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "576:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "name": "State", + "nodeType": "StructDefinition", + "scope": 1340, + "src": "414:175:0", + "visibility": "public" + }, + { + "canonicalName": "Bridge.Status", + "id": 53, + "members": [ + { + "id": 49, + "name": "READY", + "nodeType": "EnumValue", + "src": "617:5:0" + }, + { + "id": 50, + "name": "VOTING", + "nodeType": "EnumValue", + "src": "676:6:0" + }, + { + "id": 51, + "name": "KEYGEN", + "nodeType": "EnumValue", + "src": "746:6:0" + }, + { + "id": 52, + "name": "FUNDS_TRANSFER", + "nodeType": "EnumValue", + "src": "789:14:0" + } + ], + "name": "Status", + "nodeType": "EnumDefinition", + "src": "595:253:0" + }, + { + "canonicalName": "Bridge.Vote", + "id": 64, + "members": [ + { + "id": 54, + "name": "CONFIRM_KEYGEN", + "nodeType": "EnumValue", + "src": "874:14:0" + }, + { + "id": 55, + "name": "CONFIRM_FUNDS_TRANSFER", + "nodeType": "EnumValue", + "src": "898:22:0" + }, + { + "id": 56, + "name": "START_VOTING", + "nodeType": "EnumValue", + "src": "930:12:0" + }, + { + "id": 57, + "name": "ADD_VALIDATOR", + "nodeType": "EnumValue", + "src": "952:13:0" + }, + { + "id": 58, + "name": "REMOVE_VALIDATOR", + "nodeType": "EnumValue", + "src": "975:16:0" + }, + { + "id": 59, + "name": "CHANGE_THRESHOLD", + "nodeType": "EnumValue", + "src": "1001:16:0" + }, + { + "id": 60, + "name": "CHANGE_RANGE_SIZE", + "nodeType": "EnumValue", + "src": "1027:17:0" + }, + { + "id": 61, + "name": "START_KEYGEN", + "nodeType": "EnumValue", + "src": "1054:12:0" + }, + { + "id": 62, + "name": "CANCEL_KEYGEN", + "nodeType": "EnumValue", + "src": "1076:13:0" + }, + { + "id": 63, + "name": "TRANSFER", + "nodeType": "EnumValue", + "src": "1099:8:0" + } + ], + "name": "Vote", + "nodeType": "EnumDefinition", + "src": "854:259:0" + }, + { + "constant": false, + "id": 68, + "name": "states", + "nodeType": "VariableDeclaration", + "scope": 1340, + "src": "1119:29:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State)" + }, + "typeName": { + "id": 67, + "keyType": { + "id": 65, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1127:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Mapping", + "src": "1119:22:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State)" + }, + "valueType": { + "contractScope": null, + "id": 66, + "name": "State", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 48, + "src": "1135:5:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage_ptr", + "typeString": "struct Bridge.State" + } + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 72, + "name": "dbTransferCount", + "nodeType": "VariableDeclaration", + "scope": 1340, + "src": "1155:47:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + }, + "typeName": { + "id": 71, + "keyType": { + "id": 69, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1163:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "Mapping", + "src": "1155:24:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + }, + "valueType": { + "id": 70, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1174:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + }, + "value": null, + "visibility": "public" + }, + { + "constant": false, + "id": 76, + "name": "dbTransfer", + "nodeType": "VariableDeclaration", + "scope": 1340, + "src": "1208:42:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", + "typeString": "mapping(bytes32 => bool)" + }, + "typeName": { + "id": 75, + "keyType": { + "id": 73, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1216:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "Mapping", + "src": "1208:24:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", + "typeString": "mapping(bytes32 => bool)" + }, + "valueType": { + "id": 74, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "1227:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + }, + "value": null, + "visibility": "public" + }, + { + "constant": false, + "id": 80, + "name": "votesCount", + "nodeType": "VariableDeclaration", + "scope": 1340, + "src": "1256:42:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + }, + "typeName": { + "id": 79, + "keyType": { + "id": 77, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1264:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "Mapping", + "src": "1256:24:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + }, + "valueType": { + "id": 78, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1275:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + }, + "value": null, + "visibility": "public" + }, + { + "constant": false, + "id": 84, + "name": "votes", + "nodeType": "VariableDeclaration", + "scope": 1340, + "src": "1304:37:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", + "typeString": "mapping(bytes32 => bool)" + }, + "typeName": { + "id": 83, + "keyType": { + "id": 81, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1312:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "Mapping", + "src": "1304:24:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", + "typeString": "mapping(bytes32 => bool)" + }, + "valueType": { + "id": 82, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "1323:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + }, + "value": null, + "visibility": "public" + }, + { + "constant": false, + "id": 88, + "name": "usedRange", + "nodeType": "VariableDeclaration", + "scope": 1340, + "src": "1347:41:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", + "typeString": "mapping(bytes32 => bool)" + }, + "typeName": { + "id": 87, + "keyType": { + "id": 85, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1355:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "Mapping", + "src": "1347:24:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", + "typeString": "mapping(bytes32 => bool)" + }, + "valueType": { + "id": 86, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "1366:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + }, + "value": null, + "visibility": "public" + }, + { + "constant": false, + "id": 90, + "name": "status", + "nodeType": "VariableDeclaration", + "scope": 1340, + "src": "1395:20:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + }, + "typeName": { + "contractScope": null, + "id": 89, + "name": "Status", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 53, + "src": "1395:6:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "value": null, + "visibility": "public" + }, + { + "constant": false, + "id": 92, + "name": "epoch", + "nodeType": "VariableDeclaration", + "scope": 1340, + "src": "1422:17:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 91, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1422:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "public" + }, + { + "constant": false, + "id": 94, + "name": "nextEpoch", + "nodeType": "VariableDeclaration", + "scope": 1340, + "src": "1445:21:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 93, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1445:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "public" + }, + { + "constant": false, + "id": 96, + "name": "minTxLimit", + "nodeType": "VariableDeclaration", + "scope": 1340, + "src": "1473:15:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 95, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1473:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 98, + "name": "maxTxLimit", + "nodeType": "VariableDeclaration", + "scope": 1340, + "src": "1494:15:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 97, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1494:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "body": { + "id": 181, + "nodeType": "Block", + "src": "1643:403:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 118, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 115, + "name": "validators", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 103, + "src": "1661:10:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "id": 116, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "1661:17:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 117, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1681:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "1661:21:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 114, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 13091, + 13092 + ], + "referencedDeclaration": 13091, + "src": "1653:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 119, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1653:30:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 120, + "nodeType": "ExpressionStatement", + "src": "1653:30:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 125, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 122, + "name": "threshold", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 100, + "src": "1701:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 123, + "name": "validators", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 103, + "src": "1713:10:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "id": 124, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "1713:17:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1701:29:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 121, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 13091, + 13092 + ], + "referencedDeclaration": 13091, + "src": "1693:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 126, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1693:38:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 127, + "nodeType": "ExpressionStatement", + "src": "1693:38:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 132, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 128, + "name": "tokenContract", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 184, + "src": "1742:13:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IERC20_$10032", + "typeString": "contract IERC20" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 130, + "name": "_tokenContract", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 105, + "src": "1765:14:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 129, + "name": "IERC20", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10032, + "src": "1758:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IERC20_$10032_$", + "typeString": "type(contract IERC20)" + } + }, + "id": 131, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1758:22:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IERC20_$10032", + "typeString": "contract IERC20" + } + }, + "src": "1742:38:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IERC20_$10032", + "typeString": "contract IERC20" + } + }, + "id": 133, + "nodeType": "ExpressionStatement", + "src": "1742:38:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 136, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 134, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "1791:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "30", + "id": 135, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1799:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "1791:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 137, + "nodeType": "ExpressionStatement", + "src": "1791:9:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 141, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 138, + "name": "status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 90, + "src": "1810:6:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 139, + "name": "Status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "1819:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Status_$53_$", + "typeString": "type(enum Bridge.Status)" + } + }, + "id": 140, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "KEYGEN", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "1819:13:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "src": "1810:22:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "id": 142, + "nodeType": "ExpressionStatement", + "src": "1810:22:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 145, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 143, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "1842:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "31", + "id": 144, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1854:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "1842:13:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 146, + "nodeType": "ExpressionStatement", + "src": "1842:13:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 162, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 147, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "1866:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 149, + "indexExpression": { + "argumentTypes": null, + "id": 148, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "1873:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "1866:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 151, + "name": "validators", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 103, + "src": "1892:10:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + { + "argumentTypes": null, + "id": 152, + "name": "threshold", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 100, + "src": "1904:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 153, + "name": "rangeSize", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 111, + "src": "1915:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "hexValue": "30", + "id": 154, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1926:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 157, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "-", + "prefix": true, + "src": "1934:2:0", + "subExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 156, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1935:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "typeDescriptions": { + "typeIdentifier": "t_rational_minus_1_by_1", + "typeString": "int_const -1" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_minus_1_by_1", + "typeString": "int_const -1" + } + ], + "id": 155, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "1929:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": "uint" + }, + "id": 158, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1929:8:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "hexValue": "30", + "id": 159, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1939:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + { + "argumentTypes": null, + "hexValue": "30", + "id": 160, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1942:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 150, + "name": "State", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 48, + "src": "1886:5:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_struct$_State_$48_storage_ptr_$", + "typeString": "type(struct Bridge.State storage pointer)" + } + }, + "id": 161, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "structConstructorCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1886:58:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_memory", + "typeString": "struct Bridge.State memory" + } + }, + "src": "1866:78:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 163, + "nodeType": "ExpressionStatement", + "src": "1866:78:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 168, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 164, + "name": "minTxLimit", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 96, + "src": "1955:10:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 165, + "name": "limits", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 109, + "src": "1968:6:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$2_memory_ptr", + "typeString": "uint256[2] memory" + } + }, + "id": 167, + "indexExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 166, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1975:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "1968:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1955:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 169, + "nodeType": "ExpressionStatement", + "src": "1955:22:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 174, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 170, + "name": "maxTxLimit", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 98, + "src": "1987:10:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 171, + "name": "limits", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 109, + "src": "2000:6:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$2_memory_ptr", + "typeString": "uint256[2] memory" + } + }, + "id": 173, + "indexExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 172, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2007:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "2000:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1987:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 175, + "nodeType": "ExpressionStatement", + "src": "1987:22:0" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "hexValue": "30", + "id": 177, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2034:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + { + "argumentTypes": null, + "hexValue": "31", + "id": 178, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2037:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + } + ], + "id": 176, + "name": "NewEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14, + "src": "2025:8:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$returns$__$", + "typeString": "function (uint256,uint256)" + } + }, + "id": 179, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2025:14:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 180, + "nodeType": "EmitStatement", + "src": "2020:19:0" + } + ] + }, + "documentation": null, + "id": 182, + "implemented": true, + "kind": "constructor", + "modifiers": [], + "name": "", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 112, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 100, + "name": "threshold", + "nodeType": "VariableDeclaration", + "scope": 182, + "src": "1528:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 99, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1528:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 103, + "name": "validators", + "nodeType": "VariableDeclaration", + "scope": 182, + "src": "1544:27:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[]" + }, + "typeName": { + "baseType": { + "id": 101, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1544:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 102, + "length": null, + "nodeType": "ArrayTypeName", + "src": "1544:9:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 105, + "name": "_tokenContract", + "nodeType": "VariableDeclaration", + "scope": 182, + "src": "1573:22:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 104, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1573:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 109, + "name": "limits", + "nodeType": "VariableDeclaration", + "scope": 182, + "src": "1597:21:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$2_memory_ptr", + "typeString": "uint256[2]" + }, + "typeName": { + "baseType": { + "id": 106, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1597:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 108, + "length": { + "argumentTypes": null, + "hexValue": "32", + "id": 107, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1602:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" + }, + "nodeType": "ArrayTypeName", + "src": "1597:7:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$2_storage_ptr", + "typeString": "uint256[2]" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 111, + "name": "rangeSize", + "nodeType": "VariableDeclaration", + "scope": 182, + "src": "1620:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 110, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1620:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1527:108:0" + }, + "returnParameters": { + "id": 113, + "nodeType": "ParameterList", + "parameters": [], + "src": "1643:0:0" + }, + "scope": 1340, + "src": "1516:530:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "constant": false, + "id": 184, + "name": "tokenContract", + "nodeType": "VariableDeclaration", + "scope": 1340, + "src": "2052:27:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IERC20_$10032", + "typeString": "contract IERC20" + }, + "typeName": { + "contractScope": null, + "id": 183, + "name": "IERC20", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 10032, + "src": "2052:6:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IERC20_$10032", + "typeString": "contract IERC20" + } + }, + "value": null, + "visibility": "public" + }, + { + "body": { + "id": 195, + "nodeType": "Block", + "src": "2101:81:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + }, + "id": 190, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 187, + "name": "status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 90, + "src": "2119:6:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 188, + "name": "Status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "2129:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Status_$53_$", + "typeString": "type(enum Bridge.Status)" + } + }, + "id": 189, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "READY", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2129:12:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "src": "2119:22:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4e6f7420696e207265616479207374617465", + "id": 191, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2143:20:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_965c39c15b78dbcd8a954511641ca86e15fc1ae6d6c30a67536872ccde75b679", + "typeString": "literal_string \"Not in ready state\"" + }, + "value": "Not in ready state" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_965c39c15b78dbcd8a954511641ca86e15fc1ae6d6c30a67536872ccde75b679", + "typeString": "literal_string \"Not in ready state\"" + } + ], + "id": 186, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 13091, + 13092 + ], + "referencedDeclaration": 13092, + "src": "2111:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 192, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2111:53:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 193, + "nodeType": "ExpressionStatement", + "src": "2111:53:0" + }, + { + "id": 194, + "nodeType": "PlaceholderStatement", + "src": "2174:1:0" + } + ] + }, + "documentation": null, + "id": 196, + "name": "ready", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 185, + "nodeType": "ParameterList", + "parameters": [], + "src": "2101:0:0" + }, + "src": "2086:96:0", + "visibility": "internal" + }, + { + "body": { + "id": 212, + "nodeType": "Block", + "src": "2211:118:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 207, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + }, + "id": 202, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 199, + "name": "status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 90, + "src": "2229:6:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 200, + "name": "Status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "2239:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Status_$53_$", + "typeString": "type(enum Bridge.Status)" + } + }, + "id": 201, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "READY", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2239:12:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "src": "2229:22:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "||", + "rightExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + }, + "id": 206, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 203, + "name": "status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 90, + "src": "2255:6:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 204, + "name": "Status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "2265:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Status_$53_$", + "typeString": "type(enum Bridge.Status)" + } + }, + "id": 205, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "VOTING", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2265:13:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "src": "2255:23:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "2229:49:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4e6f7420696e207265616479206f7220766f74696e67207374617465", + "id": 208, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2280:30:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_7e3f7359baa731593d4e3921720b92600c22ed1d950d208e0c826ad2eddebe96", + "typeString": "literal_string \"Not in ready or voting state\"" + }, + "value": "Not in ready or voting state" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_7e3f7359baa731593d4e3921720b92600c22ed1d950d208e0c826ad2eddebe96", + "typeString": "literal_string \"Not in ready or voting state\"" + } + ], + "id": 198, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 13091, + 13092 + ], + "referencedDeclaration": 13092, + "src": "2221:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 209, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2221:90:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 210, + "nodeType": "ExpressionStatement", + "src": "2221:90:0" + }, + { + "id": 211, + "nodeType": "PlaceholderStatement", + "src": "2321:1:0" + } + ] + }, + "documentation": null, + "id": 213, + "name": "readyOrVoting", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 197, + "nodeType": "ParameterList", + "parameters": [], + "src": "2211:0:0" + }, + "src": "2188:141:0", + "visibility": "internal" + }, + { + "body": { + "id": 224, + "nodeType": "Block", + "src": "2351:83:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + }, + "id": 219, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 216, + "name": "status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 90, + "src": "2369:6:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 217, + "name": "Status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "2379:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Status_$53_$", + "typeString": "type(enum Bridge.Status)" + } + }, + "id": 218, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "VOTING", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2379:13:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "src": "2369:23:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4e6f7420696e20766f74696e67207374617465", + "id": 220, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2394:21:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_0cbee9834b110b21e0730bf5c3d2972fb9867ff221df239e7ae60883592f05d1", + "typeString": "literal_string \"Not in voting state\"" + }, + "value": "Not in voting state" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_0cbee9834b110b21e0730bf5c3d2972fb9867ff221df239e7ae60883592f05d1", + "typeString": "literal_string \"Not in voting state\"" + } + ], + "id": 215, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 13091, + 13092 + ], + "referencedDeclaration": 13092, + "src": "2361:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 221, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2361:55:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 222, + "nodeType": "ExpressionStatement", + "src": "2361:55:0" + }, + { + "id": 223, + "nodeType": "PlaceholderStatement", + "src": "2426:1:0" + } + ] + }, + "documentation": null, + "id": 225, + "name": "voting", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 214, + "nodeType": "ParameterList", + "parameters": [], + "src": "2351:0:0" + }, + "src": "2335:99:0", + "visibility": "internal" + }, + { + "body": { + "id": 236, + "nodeType": "Block", + "src": "2456:83:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + }, + "id": 231, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 228, + "name": "status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 90, + "src": "2474:6:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 229, + "name": "Status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "2484:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Status_$53_$", + "typeString": "type(enum Bridge.Status)" + } + }, + "id": 230, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "KEYGEN", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2484:13:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "src": "2474:23:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4e6f7420696e206b657967656e207374617465", + "id": 232, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2499:21:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_ed0fee6382e0651a224348a21558d03a4a439c3bd5edc24945894a3417c14010", + "typeString": "literal_string \"Not in keygen state\"" + }, + "value": "Not in keygen state" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_ed0fee6382e0651a224348a21558d03a4a439c3bd5edc24945894a3417c14010", + "typeString": "literal_string \"Not in keygen state\"" + } + ], + "id": 227, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 13091, + 13092 + ], + "referencedDeclaration": 13092, + "src": "2466:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 233, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2466:55:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 234, + "nodeType": "ExpressionStatement", + "src": "2466:55:0" + }, + { + "id": 235, + "nodeType": "PlaceholderStatement", + "src": "2531:1:0" + } + ] + }, + "documentation": null, + "id": 237, + "name": "keygen", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 226, + "nodeType": "ParameterList", + "parameters": [], + "src": "2456:0:0" + }, + "src": "2440:99:0", + "visibility": "internal" + }, + { + "body": { + "id": 248, + "nodeType": "Block", + "src": "2568:99:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + }, + "id": 243, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 240, + "name": "status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 90, + "src": "2586:6:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 241, + "name": "Status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "2596:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Status_$53_$", + "typeString": "type(enum Bridge.Status)" + } + }, + "id": 242, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "FUNDS_TRANSFER", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2596:21:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "src": "2586:31:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4e6f7420696e2066756e6473207472616e73666572207374617465", + "id": 244, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2619:29:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_6347c9fecd6f58520ad10dfd1347ce3dc42cc0eed7a4182ca64dd11c69fc3008", + "typeString": "literal_string \"Not in funds transfer state\"" + }, + "value": "Not in funds transfer state" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_6347c9fecd6f58520ad10dfd1347ce3dc42cc0eed7a4182ca64dd11c69fc3008", + "typeString": "literal_string \"Not in funds transfer state\"" + } + ], + "id": 239, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 13091, + 13092 + ], + "referencedDeclaration": 13092, + "src": "2578:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 245, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2578:71:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 246, + "nodeType": "ExpressionStatement", + "src": "2578:71:0" + }, + { + "id": 247, + "nodeType": "PlaceholderStatement", + "src": "2659:1:0" + } + ] + }, + "documentation": null, + "id": 249, + "name": "fundsTransfer", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 238, + "nodeType": "ParameterList", + "parameters": [], + "src": "2568:0:0" + }, + "src": "2545:122:0", + "visibility": "internal" + }, + { + "body": { + "id": 260, + "nodeType": "Block", + "src": "2699:81:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 255, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 252, + "name": "getPartyId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 728, + "src": "2717:10:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 253, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2717:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 254, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2733:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "2717:17:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4e6f7420612063757272656e742076616c696461746f72", + "id": 256, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2736:25:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_8dc18d5bb1361900b9758b388df331056e31071cae84b276c0f03794c4dc634a", + "typeString": "literal_string \"Not a current validator\"" + }, + "value": "Not a current validator" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_8dc18d5bb1361900b9758b388df331056e31071cae84b276c0f03794c4dc634a", + "typeString": "literal_string \"Not a current validator\"" + } + ], + "id": 251, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 13091, + 13092 + ], + "referencedDeclaration": 13092, + "src": "2709:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 257, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2709:53:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 258, + "nodeType": "ExpressionStatement", + "src": "2709:53:0" + }, + { + "id": 259, + "nodeType": "PlaceholderStatement", + "src": "2772:1:0" + } + ] + }, + "documentation": null, + "id": 261, + "name": "currentValidator", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 250, + "nodeType": "ParameterList", + "parameters": [], + "src": "2699:0:0" + }, + "src": "2673:107:0", + "visibility": "internal" + }, + { + "body": { + "id": 343, + "nodeType": "Block", + "src": "2829:475:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 281, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 277, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 271, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 269, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 263, + "src": "2847:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "id": 270, + "name": "minTxLimit", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 96, + "src": "2856:10:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "2847:19:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 276, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 272, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 263, + "src": "2870:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_rational_10000000000_by_1", + "typeString": "int_const 10000000000" + }, + "id": 275, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "hexValue": "3130", + "id": 273, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2879:2:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_10_by_1", + "typeString": "int_const 10" + }, + "value": "10" + }, + "nodeType": "BinaryOperation", + "operator": "**", + "rightExpression": { + "argumentTypes": null, + "hexValue": "3130", + "id": 274, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2885:2:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_10_by_1", + "typeString": "int_const 10" + }, + "value": "10" + }, + "src": "2879:8:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_10000000000_by_1", + "typeString": "int_const 10000000000" + } + }, + "src": "2870:17:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "2847:40:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 280, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 278, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 263, + "src": "2891:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "id": 279, + "name": "maxTxLimit", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 98, + "src": "2900:10:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "2891:19:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "2847:63:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 268, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 13091, + 13092 + ], + "referencedDeclaration": 13091, + "src": "2839:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 282, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2839:72:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 283, + "nodeType": "ExpressionStatement", + "src": "2839:72:0" + }, + { + "assignments": [ + 285 + ], + "declarations": [ + { + "constant": false, + "id": 285, + "name": "txRange", + "nodeType": "VariableDeclaration", + "scope": 343, + "src": "2922:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 284, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "2922:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 295, + "initialValue": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 294, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "components": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 290, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 286, + "name": "block", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13078, + "src": "2938:5:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_block", + "typeString": "block" + } + }, + "id": 287, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "number", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2938:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 288, + "name": "getStartBlock", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 598, + 611 + ], + "referencedDeclaration": 598, + "src": "2953:13:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 289, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2953:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "2938:30:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 291, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "2937:32:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "/", + "rightExpression": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 292, + "name": "getRangeSize", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 621, + 644 + ], + "referencedDeclaration": 621, + "src": "2972:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 293, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2972:14:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "2937:49:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "2922:64:0" + }, + { + "condition": { + "argumentTypes": null, + "id": 305, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "3000:55:0", + "subExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 296, + "name": "usedRange", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 88, + "src": "3001:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", + "typeString": "mapping(bytes32 => bool)" + } + }, + "id": 304, + "indexExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 300, + "name": "txRange", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 285, + "src": "3038:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 301, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "3047:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "id": 298, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13075, + "src": "3021:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 299, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3021:16:0", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 302, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3021:32:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 297, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13082, + "src": "3011:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 303, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3011:43:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3001:54:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 325, + "nodeType": "IfStatement", + "src": "2996:182:0", + "trueBody": { + "id": 324, + "nodeType": "Block", + "src": "3057:121:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 316, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 306, + "name": "usedRange", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 88, + "src": "3071:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", + "typeString": "mapping(bytes32 => bool)" + } + }, + "id": 314, + "indexExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 310, + "name": "txRange", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 285, + "src": "3108:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 311, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "3117:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "id": 308, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13075, + "src": "3091:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 309, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3091:16:0", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 312, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3091:32:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 307, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13082, + "src": "3081:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 313, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3081:43:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "3071:54:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "74727565", + "id": 315, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3128:4:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + "src": "3071:61:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 317, + "nodeType": "ExpressionStatement", + "src": "3071:61:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 322, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "3146:21:0", + "subExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 318, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "3146:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 320, + "indexExpression": { + "argumentTypes": null, + "id": 319, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "3153:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3146:13:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 321, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "nonce", + "nodeType": "MemberAccess", + "referencedDeclaration": 43, + "src": "3146:19:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 323, + "nodeType": "ExpressionStatement", + "src": "3146:21:0" + } + ] + } + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 329, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13088, + "src": "3215:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 330, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3215:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 332, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13104, + "src": "3235:4:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_Bridge_$1340", + "typeString": "contract Bridge" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_Bridge_$1340", + "typeString": "contract Bridge" + } + ], + "id": 331, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "3227:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 333, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3227:13:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 334, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 263, + "src": "3242:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "id": 326, + "name": "tokenContract", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 184, + "src": "3188:13:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IERC20_$10032", + "typeString": "contract IERC20" + } + }, + "id": 328, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "transferFrom", + "nodeType": "MemberAccess", + "referencedDeclaration": 10015, + "src": "3188:26:0", + "typeDescriptions": { + "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$_t_bool_$", + "typeString": "function (address,address,uint256) external returns (bool)" + } + }, + "id": 335, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3188:60:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 336, + "nodeType": "ExpressionStatement", + "src": "3188:60:0" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 338, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 263, + "src": "3279:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 339, + "name": "getNonce", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 654, + 667 + ], + "referencedDeclaration": 654, + "src": "3286:8:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 340, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3286:10:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 337, + "name": "ExchangeRequest", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8, + "src": "3263:15:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$returns$__$", + "typeString": "function (uint256,uint256)" + } + }, + "id": 341, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3263:34:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 342, + "nodeType": "EmitStatement", + "src": "3258:39:0" + } + ] + }, + "documentation": null, + "id": 344, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 266, + "modifierName": { + "argumentTypes": null, + "id": 265, + "name": "ready", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 196, + "src": "2823:5:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "2823:5:0" + } + ], + "name": "exchange", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 264, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 263, + "name": "value", + "nodeType": "VariableDeclaration", + "scope": 344, + "src": "2804:10:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 262, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "2804:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "2803:12:0" + }, + "returnParameters": { + "id": 267, + "nodeType": "ParameterList", + "parameters": [], + "src": "2829:0:0" + }, + "scope": 1340, + "src": "2786:518:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 373, + "nodeType": "Block", + "src": "3404:119:0", + "statements": [ + { + "condition": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 358, + "name": "Vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 64, + "src": "3426:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", + "typeString": "type(enum Bridge.Vote)" + } + }, + "id": 359, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "TRANSFER", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3426:13:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + { + "argumentTypes": null, + "id": 360, + "name": "hash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 346, + "src": "3441:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "argumentTypes": null, + "id": 361, + "name": "to", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 348, + "src": "3447:2:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 362, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 350, + "src": "3451:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 357, + "name": "tryVote", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 1084, + 1109, + 1134, + 1164 + ], + "referencedDeclaration": 1164, + "src": "3418:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$_t_bytes32_$_t_address_$_t_uint256_$returns$_t_bool_$", + "typeString": "function (enum Bridge.Vote,bytes32,address,uint256) returns (bool)" + } + }, + "id": 363, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3418:39:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 372, + "nodeType": "IfStatement", + "src": "3414:103:0", + "trueBody": { + "id": 371, + "nodeType": "Block", + "src": "3459:58:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 367, + "name": "to", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 348, + "src": "3496:2:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 368, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 350, + "src": "3500:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "id": 364, + "name": "tokenContract", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 184, + "src": "3473:13:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IERC20_$10032", + "typeString": "contract IERC20" + } + }, + "id": 366, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "transfer", + "nodeType": "MemberAccess", + "referencedDeclaration": 9986, + "src": "3473:22:0", + "typeDescriptions": { + "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$_t_bool_$", + "typeString": "function (address,uint256) external returns (bool)" + } + }, + "id": 369, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3473:33:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 370, + "nodeType": "ExpressionStatement", + "src": "3473:33:0" + } + ] + } + } + ] + }, + "documentation": null, + "id": 374, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 353, + "modifierName": { + "argumentTypes": null, + "id": 352, + "name": "readyOrVoting", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 213, + "src": "3373:13:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "3373:13:0" + }, + { + "arguments": null, + "id": 355, + "modifierName": { + "argumentTypes": null, + "id": 354, + "name": "currentValidator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 261, + "src": "3387:16:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "3387:16:0" + } + ], + "name": "transfer", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 351, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 346, + "name": "hash", + "nodeType": "VariableDeclaration", + "scope": 374, + "src": "3328:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 345, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "3328:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 348, + "name": "to", + "nodeType": "VariableDeclaration", + "scope": 374, + "src": "3342:10:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 347, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3342:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 350, + "name": "value", + "nodeType": "VariableDeclaration", + "scope": 374, + "src": "3354:10:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 349, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "3354:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "3327:38:0" + }, + "returnParameters": { + "id": 356, + "nodeType": "ParameterList", + "parameters": [], + "src": "3404:0:0" + }, + "scope": 1340, + "src": "3310:213:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 464, + "nodeType": "Block", + "src": "3582:638:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 389, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 385, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13088, + "src": "3615:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 386, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3615:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + ], + "id": 384, + "name": "getNextPartyId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 768, + "src": "3600:14:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_uint256_$", + "typeString": "function (address) view returns (uint256)" + } + }, + "id": 387, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3600:26:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 388, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3630:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "3600:31:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4e6f742061206e6578742076616c696461746f72", + "id": 390, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3633:22:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_44981c92ce908443b2fa5f878c54791e1a0c95d4cc04ea4f4d9224b3ec030922", + "typeString": "literal_string \"Not a next validator\"" + }, + "value": "Not a next validator" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_44981c92ce908443b2fa5f878c54791e1a0c95d4cc04ea4f4d9224b3ec030922", + "typeString": "literal_string \"Not a next validator\"" + } + ], + "id": 383, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 13091, + 13092 + ], + "referencedDeclaration": 13092, + "src": "3592:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 391, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3592:64:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 392, + "nodeType": "ExpressionStatement", + "src": "3592:64:0" + }, + { + "condition": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 394, + "name": "Vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 64, + "src": "3682:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", + "typeString": "type(enum Bridge.Vote)" + } + }, + "id": 395, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "CONFIRM_KEYGEN", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3682:19:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + { + "argumentTypes": null, + "id": 396, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 376, + "src": "3703:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 397, + "name": "y", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 378, + "src": "3706:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 393, + "name": "tryConfirm", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 1186, + 1214 + ], + "referencedDeclaration": 1214, + "src": "3671:10:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$_t_uint256_$_t_uint256_$returns$_t_bool_$", + "typeString": "function (enum Bridge.Vote,uint256,uint256) returns (bool)" + } + }, + "id": 398, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3671:37:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 463, + "nodeType": "IfStatement", + "src": "3667:547:0", + "trueBody": { + "id": 462, + "nodeType": "Block", + "src": "3710:504:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 404, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 399, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "3724:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 401, + "indexExpression": { + "argumentTypes": null, + "id": 400, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "3731:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3724:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 402, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "x", + "nodeType": "MemberAccess", + "referencedDeclaration": 45, + "src": "3724:19:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 403, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 376, + "src": "3746:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "3724:23:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 405, + "nodeType": "ExpressionStatement", + "src": "3724:23:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 411, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 406, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "3761:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 408, + "indexExpression": { + "argumentTypes": null, + "id": 407, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "3768:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3761:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 409, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "y", + "nodeType": "MemberAccess", + "referencedDeclaration": 47, + "src": "3761:19:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 410, + "name": "y", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 378, + "src": "3783:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "3761:23:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 412, + "nodeType": "ExpressionStatement", + "src": "3761:23:0" + }, + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 415, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 413, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "3802:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 414, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3815:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "3802:14:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "id": 460, + "nodeType": "Block", + "src": "4084:120:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 453, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 450, + "name": "status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 90, + "src": "4102:6:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 451, + "name": "Status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "4111:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Status_$53_$", + "typeString": "type(enum Bridge.Status)" + } + }, + "id": 452, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "FUNDS_TRANSFER", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "4111:21:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "src": "4102:30:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "id": 454, + "nodeType": "ExpressionStatement", + "src": "4102:30:0" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 456, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "4172:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 457, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "4179:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 455, + "name": "NewFundsTransfer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 24, + "src": "4155:16:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$returns$__$", + "typeString": "function (uint256,uint256)" + } + }, + "id": 458, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4155:34:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 459, + "nodeType": "EmitStatement", + "src": "4150:39:0" + } + ] + }, + "id": 461, + "nodeType": "IfStatement", + "src": "3798:406:0", + "trueBody": { + "id": 449, + "nodeType": "Block", + "src": "3818:248:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 419, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 416, + "name": "status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 90, + "src": "3836:6:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 417, + "name": "Status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "3845:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Status_$53_$", + "typeString": "type(enum Bridge.Status)" + } + }, + "id": 418, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "READY", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3845:12:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "src": "3836:21:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "id": 420, + "nodeType": "ExpressionStatement", + "src": "3836:21:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 427, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 421, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "3875:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 423, + "indexExpression": { + "argumentTypes": null, + "id": 422, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "3882:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3875:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 424, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "startBlock", + "nodeType": "MemberAccess", + "referencedDeclaration": 41, + "src": "3875:28:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 425, + "name": "block", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13078, + "src": "3906:5:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_block", + "typeString": "block" + } + }, + "id": 426, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "number", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3906:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "3875:43:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 428, + "nodeType": "ExpressionStatement", + "src": "3875:43:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 437, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 429, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "3936:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 431, + "indexExpression": { + "argumentTypes": null, + "id": 430, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "3943:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3936:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 432, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "nonce", + "nodeType": "MemberAccess", + "referencedDeclaration": 43, + "src": "3936:23:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 435, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "-", + "prefix": true, + "src": "3967:2:0", + "subExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 434, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3968:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "typeDescriptions": { + "typeIdentifier": "t_rational_minus_1_by_1", + "typeString": "int_const -1" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_minus_1_by_1", + "typeString": "int_const -1" + } + ], + "id": 433, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "3962:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": "uint" + }, + "id": 436, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3962:8:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "3936:34:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 438, + "nodeType": "ExpressionStatement", + "src": "3936:34:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 441, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 439, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "3988:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 440, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "3996:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "3988:17:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 442, + "nodeType": "ExpressionStatement", + "src": "3988:17:0" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 444, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "4039:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 445, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 376, + "src": "4046:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 446, + "name": "y", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 378, + "src": "4049:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 443, + "name": "EpochStart", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 32, + "src": "4028:10:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$_t_uint256_$returns$__$", + "typeString": "function (uint256,uint256,uint256)" + } + }, + "id": 447, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4028:23:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 448, + "nodeType": "EmitStatement", + "src": "4023:28:0" + } + ] + } + } + ] + } + } + ] + }, + "documentation": null, + "id": 465, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 381, + "modifierName": { + "argumentTypes": null, + "id": 380, + "name": "keygen", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 237, + "src": "3575:6:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "3575:6:0" + } + ], + "name": "confirmKeygen", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 379, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 376, + "name": "x", + "nodeType": "VariableDeclaration", + "scope": 465, + "src": "3552:6:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 375, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "3552:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 378, + "name": "y", + "nodeType": "VariableDeclaration", + "scope": 465, + "src": "3560:6:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 377, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "3560:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "3551:16:0" + }, + "returnParameters": { + "id": 382, + "nodeType": "ParameterList", + "parameters": [], + "src": "3582:0:0" + }, + "scope": 1340, + "src": "3529:691:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 520, + "nodeType": "Block", + "src": "4296:368:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 475, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 473, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "4314:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 474, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4322:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "4314:9:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "46697273742065706f636820646f6573206e6f74206e6565642066756e6473207472616e73666572", + "id": 476, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4325:42:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_8ddae2cc9da30ed8c59c39c6a950ef823ea484ac89ff6f37abb0317fb5f679a1", + "typeString": "literal_string \"First epoch does not need funds transfer\"" + }, + "value": "First epoch does not need funds transfer" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_8ddae2cc9da30ed8c59c39c6a950ef823ea484ac89ff6f37abb0317fb5f679a1", + "typeString": "literal_string \"First epoch does not need funds transfer\"" + } + ], + "id": 472, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 13091, + 13092 + ], + "referencedDeclaration": 13092, + "src": "4306:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 477, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4306:62:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 478, + "nodeType": "ExpressionStatement", + "src": "4306:62:0" + }, + { + "condition": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 480, + "name": "Vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 64, + "src": "4394:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", + "typeString": "type(enum Bridge.Vote)" + } + }, + "id": 481, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "CONFIRM_FUNDS_TRANSFER", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "4394:27:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + ], + "id": 479, + "name": "tryConfirm", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 1186, + 1214 + ], + "referencedDeclaration": 1186, + "src": "4383:10:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$returns$_t_bool_$", + "typeString": "function (enum Bridge.Vote) returns (bool)" + } + }, + "id": 482, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4383:39:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 519, + "nodeType": "IfStatement", + "src": "4379:279:0", + "trueBody": { + "id": 518, + "nodeType": "Block", + "src": "4424:234:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 486, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 483, + "name": "status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 90, + "src": "4438:6:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 484, + "name": "Status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "4447:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Status_$53_$", + "typeString": "type(enum Bridge.Status)" + } + }, + "id": 485, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "READY", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "4447:12:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "src": "4438:21:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "id": 487, + "nodeType": "ExpressionStatement", + "src": "4438:21:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 494, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 488, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "4473:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 490, + "indexExpression": { + "argumentTypes": null, + "id": 489, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "4480:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "4473:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 491, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "startBlock", + "nodeType": "MemberAccess", + "referencedDeclaration": 41, + "src": "4473:28:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 492, + "name": "block", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13078, + "src": "4504:5:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_block", + "typeString": "block" + } + }, + "id": 493, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "number", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "4504:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "4473:43:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 495, + "nodeType": "ExpressionStatement", + "src": "4473:43:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 504, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 496, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "4530:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 498, + "indexExpression": { + "argumentTypes": null, + "id": 497, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "4537:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "4530:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 499, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "nonce", + "nodeType": "MemberAccess", + "referencedDeclaration": 43, + "src": "4530:23:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 502, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "-", + "prefix": true, + "src": "4561:2:0", + "subExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 501, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4562:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "typeDescriptions": { + "typeIdentifier": "t_rational_minus_1_by_1", + "typeString": "int_const -1" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_minus_1_by_1", + "typeString": "int_const -1" + } + ], + "id": 500, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "4556:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": "uint" + }, + "id": 503, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4556:8:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "4530:34:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 505, + "nodeType": "ExpressionStatement", + "src": "4530:34:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 508, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 506, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "4578:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 507, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "4586:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "4578:17:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 509, + "nodeType": "ExpressionStatement", + "src": "4578:17:0" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 511, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "4625:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 512, + "name": "getX", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 678, + "src": "4632:4:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 513, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4632:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 514, + "name": "getY", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 689, + "src": "4640:4:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 515, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4640:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 510, + "name": "EpochStart", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 32, + "src": "4614:10:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$_t_uint256_$returns$__$", + "typeString": "function (uint256,uint256,uint256)" + } + }, + "id": 516, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4614:33:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 517, + "nodeType": "EmitStatement", + "src": "4609:38:0" + } + ] + } + } + ] + }, + "documentation": null, + "id": 521, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 468, + "modifierName": { + "argumentTypes": null, + "id": 467, + "name": "fundsTransfer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 249, + "src": "4265:13:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "4265:13:0" + }, + { + "arguments": null, + "id": 470, + "modifierName": { + "argumentTypes": null, + "id": 469, + "name": "currentValidator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 261, + "src": "4279:16:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "4279:16:0" + } + ], + "name": "confirmFundsTransfer", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 466, + "nodeType": "ParameterList", + "parameters": [], + "src": "4255:2:0" + }, + "returnParameters": { + "id": 471, + "nodeType": "ParameterList", + "parameters": [], + "src": "4296:0:0" + }, + "scope": 1340, + "src": "4226:438:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 530, + "nodeType": "Block", + "src": "4719:41:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 527, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "4747:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 526, + "name": "getParties", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 531, + 555 + ], + "referencedDeclaration": 555, + "src": "4736:10:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256) view returns (uint256)" + } + }, + "id": 528, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4736:17:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 525, + "id": 529, + "nodeType": "Return", + "src": "4729:24:0" + } + ] + }, + "documentation": null, + "id": 531, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getParties", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 522, + "nodeType": "ParameterList", + "parameters": [], + "src": "4689:2:0" + }, + "returnParameters": { + "id": 525, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 524, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 531, + "src": "4713:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 523, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "4713:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "4712:6:0" + }, + "scope": 1340, + "src": "4670:90:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 540, + "nodeType": "Block", + "src": "4819:45:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 537, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "4847:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 536, + "name": "getParties", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 531, + 555 + ], + "referencedDeclaration": 555, + "src": "4836:10:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256) view returns (uint256)" + } + }, + "id": 538, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4836:21:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 535, + "id": 539, + "nodeType": "Return", + "src": "4829:28:0" + } + ] + }, + "documentation": null, + "id": 541, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getNextParties", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 532, + "nodeType": "ParameterList", + "parameters": [], + "src": "4789:2:0" + }, + "returnParameters": { + "id": 535, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 534, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 541, + "src": "4813:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 533, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "4813:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "4812:6:0" + }, + "scope": 1340, + "src": "4766:98:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 554, + "nodeType": "Block", + "src": "4930:56:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 548, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "4947:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 550, + "indexExpression": { + "argumentTypes": null, + "id": 549, + "name": "_epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 543, + "src": "4954:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "4947:14:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 551, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "validators", + "nodeType": "MemberAccess", + "referencedDeclaration": 35, + "src": "4947:25:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 552, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "4947:32:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 547, + "id": 553, + "nodeType": "Return", + "src": "4940:39:0" + } + ] + }, + "documentation": null, + "id": 555, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getParties", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 544, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 543, + "name": "_epoch", + "nodeType": "VariableDeclaration", + "scope": 555, + "src": "4890:11:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 542, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "4890:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "4889:13:0" + }, + "returnParameters": { + "id": 547, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 546, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 555, + "src": "4924:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 545, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "4924:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "4923:6:0" + }, + "scope": 1340, + "src": "4870:116:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 564, + "nodeType": "Block", + "src": "5043:43:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 561, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "5073:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 560, + "name": "getThreshold", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 565, + 588 + ], + "referencedDeclaration": 588, + "src": "5060:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256) view returns (uint256)" + } + }, + "id": 562, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5060:19:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 559, + "id": 563, + "nodeType": "Return", + "src": "5053:26:0" + } + ] + }, + "documentation": null, + "id": 565, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getThreshold", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 556, + "nodeType": "ParameterList", + "parameters": [], + "src": "5013:2:0" + }, + "returnParameters": { + "id": 559, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 558, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 565, + "src": "5037:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 557, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5037:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5036:6:0" + }, + "scope": 1340, + "src": "4992:94:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 574, + "nodeType": "Block", + "src": "5147:47:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 571, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "5177:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 570, + "name": "getThreshold", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 565, + 588 + ], + "referencedDeclaration": 588, + "src": "5164:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256) view returns (uint256)" + } + }, + "id": 572, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5164:23:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 569, + "id": 573, + "nodeType": "Return", + "src": "5157:30:0" + } + ] + }, + "documentation": null, + "id": 575, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getNextThreshold", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 566, + "nodeType": "ParameterList", + "parameters": [], + "src": "5117:2:0" + }, + "returnParameters": { + "id": 569, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 568, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 575, + "src": "5141:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 567, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5141:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5140:6:0" + }, + "scope": 1340, + "src": "5092:102:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 587, + "nodeType": "Block", + "src": "5262:48:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 582, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "5279:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 584, + "indexExpression": { + "argumentTypes": null, + "id": 583, + "name": "_epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 577, + "src": "5286:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "5279:14:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 585, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "threshold", + "nodeType": "MemberAccess", + "referencedDeclaration": 37, + "src": "5279:24:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 581, + "id": 586, + "nodeType": "Return", + "src": "5272:31:0" + } + ] + }, + "documentation": null, + "id": 588, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getThreshold", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 578, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 577, + "name": "_epoch", + "nodeType": "VariableDeclaration", + "scope": 588, + "src": "5222:11:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 576, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5222:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5221:13:0" + }, + "returnParameters": { + "id": 581, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 580, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 588, + "src": "5256:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 579, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5256:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5255:6:0" + }, + "scope": 1340, + "src": "5200:110:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 597, + "nodeType": "Block", + "src": "5368:44:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 594, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "5399:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 593, + "name": "getStartBlock", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 598, + 611 + ], + "referencedDeclaration": 611, + "src": "5385:13:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256) view returns (uint256)" + } + }, + "id": 595, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5385:20:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 592, + "id": 596, + "nodeType": "Return", + "src": "5378:27:0" + } + ] + }, + "documentation": null, + "id": 598, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getStartBlock", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 589, + "nodeType": "ParameterList", + "parameters": [], + "src": "5338:2:0" + }, + "returnParameters": { + "id": 592, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 591, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 598, + "src": "5362:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 590, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5362:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5361:6:0" + }, + "scope": 1340, + "src": "5316:96:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 610, + "nodeType": "Block", + "src": "5481:49:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 605, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "5498:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 607, + "indexExpression": { + "argumentTypes": null, + "id": 606, + "name": "_epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 600, + "src": "5505:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "5498:14:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 608, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "startBlock", + "nodeType": "MemberAccess", + "referencedDeclaration": 41, + "src": "5498:25:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 604, + "id": 609, + "nodeType": "Return", + "src": "5491:32:0" + } + ] + }, + "documentation": null, + "id": 611, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getStartBlock", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 601, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 600, + "name": "_epoch", + "nodeType": "VariableDeclaration", + "scope": 611, + "src": "5441:11:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 599, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5441:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5440:13:0" + }, + "returnParameters": { + "id": 604, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 603, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 611, + "src": "5475:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 602, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5475:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5474:6:0" + }, + "scope": 1340, + "src": "5418:112:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 620, + "nodeType": "Block", + "src": "5587:43:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 617, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "5617:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 616, + "name": "getRangeSize", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 621, + 644 + ], + "referencedDeclaration": 644, + "src": "5604:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256) view returns (uint256)" + } + }, + "id": 618, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5604:19:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 615, + "id": 619, + "nodeType": "Return", + "src": "5597:26:0" + } + ] + }, + "documentation": null, + "id": 621, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getRangeSize", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 612, + "nodeType": "ParameterList", + "parameters": [], + "src": "5557:2:0" + }, + "returnParameters": { + "id": 615, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 614, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 621, + "src": "5581:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 613, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5581:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5580:6:0" + }, + "scope": 1340, + "src": "5536:94:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 630, + "nodeType": "Block", + "src": "5691:47:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 627, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "5721:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 626, + "name": "getRangeSize", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 621, + 644 + ], + "referencedDeclaration": 644, + "src": "5708:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256) view returns (uint256)" + } + }, + "id": 628, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5708:23:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 625, + "id": 629, + "nodeType": "Return", + "src": "5701:30:0" + } + ] + }, + "documentation": null, + "id": 631, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getNextRangeSize", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 622, + "nodeType": "ParameterList", + "parameters": [], + "src": "5661:2:0" + }, + "returnParameters": { + "id": 625, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 624, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 631, + "src": "5685:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 623, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5685:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5684:6:0" + }, + "scope": 1340, + "src": "5636:102:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 643, + "nodeType": "Block", + "src": "5806:48:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 638, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "5823:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 640, + "indexExpression": { + "argumentTypes": null, + "id": 639, + "name": "_epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 633, + "src": "5830:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "5823:14:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 641, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "rangeSize", + "nodeType": "MemberAccess", + "referencedDeclaration": 39, + "src": "5823:24:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 637, + "id": 642, + "nodeType": "Return", + "src": "5816:31:0" + } + ] + }, + "documentation": null, + "id": 644, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getRangeSize", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 634, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 633, + "name": "_epoch", + "nodeType": "VariableDeclaration", + "scope": 644, + "src": "5766:11:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 632, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5766:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5765:13:0" + }, + "returnParameters": { + "id": 637, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 636, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 644, + "src": "5800:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 635, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5800:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5799:6:0" + }, + "scope": 1340, + "src": "5744:110:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 653, + "nodeType": "Block", + "src": "5907:39:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 650, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "5933:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 649, + "name": "getNonce", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 654, + 667 + ], + "referencedDeclaration": 667, + "src": "5924:8:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256) view returns (uint256)" + } + }, + "id": 651, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5924:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 648, + "id": 652, + "nodeType": "Return", + "src": "5917:22:0" + } + ] + }, + "documentation": null, + "id": 654, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getNonce", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 645, + "nodeType": "ParameterList", + "parameters": [], + "src": "5877:2:0" + }, + "returnParameters": { + "id": 648, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 647, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 654, + "src": "5901:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 646, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5901:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5900:6:0" + }, + "scope": 1340, + "src": "5860:86:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 666, + "nodeType": "Block", + "src": "6010:44:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 661, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "6027:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 663, + "indexExpression": { + "argumentTypes": null, + "id": 662, + "name": "_epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 656, + "src": "6034:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "6027:14:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 664, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "nonce", + "nodeType": "MemberAccess", + "referencedDeclaration": 43, + "src": "6027:20:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 660, + "id": 665, + "nodeType": "Return", + "src": "6020:27:0" + } + ] + }, + "documentation": null, + "id": 667, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getNonce", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 657, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 656, + "name": "_epoch", + "nodeType": "VariableDeclaration", + "scope": 667, + "src": "5970:11:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 655, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5970:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5969:13:0" + }, + "returnParameters": { + "id": 660, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 659, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 667, + "src": "6004:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 658, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "6004:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "6003:6:0" + }, + "scope": 1340, + "src": "5952:102:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 677, + "nodeType": "Block", + "src": "6103:39:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 672, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "6120:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 674, + "indexExpression": { + "argumentTypes": null, + "id": 673, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "6127:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "6120:13:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 675, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "x", + "nodeType": "MemberAccess", + "referencedDeclaration": 45, + "src": "6120:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 671, + "id": 676, + "nodeType": "Return", + "src": "6113:22:0" + } + ] + }, + "documentation": null, + "id": 678, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getX", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 668, + "nodeType": "ParameterList", + "parameters": [], + "src": "6073:2:0" + }, + "returnParameters": { + "id": 671, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 670, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 678, + "src": "6097:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 669, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "6097:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "6096:6:0" + }, + "scope": 1340, + "src": "6060:82:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 688, + "nodeType": "Block", + "src": "6191:39:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 683, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "6208:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 685, + "indexExpression": { + "argumentTypes": null, + "id": 684, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "6215:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "6208:13:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 686, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "y", + "nodeType": "MemberAccess", + "referencedDeclaration": 47, + "src": "6208:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 682, + "id": 687, + "nodeType": "Return", + "src": "6201:22:0" + } + ] + }, + "documentation": null, + "id": 689, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getY", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 679, + "nodeType": "ParameterList", + "parameters": [], + "src": "6161:2:0" + }, + "returnParameters": { + "id": 682, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 681, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 689, + "src": "6185:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 680, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "6185:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "6184:6:0" + }, + "scope": 1340, + "src": "6148:82:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 727, + "nodeType": "Block", + "src": "6285:215:0", + "statements": [ + { + "assignments": [ + 697 + ], + "declarations": [ + { + "constant": false, + "id": 697, + "name": "validators", + "nodeType": "VariableDeclaration", + "scope": 727, + "src": "6295:27:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[]" + }, + "typeName": { + "baseType": { + "id": 695, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6295:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 696, + "length": null, + "nodeType": "ArrayTypeName", + "src": "6295:9:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 700, + "initialValue": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 698, + "name": "getValidators", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 780, + "src": "6325:13:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_array$_t_address_$dyn_memory_ptr_$", + "typeString": "function () view returns (address[] memory)" + } + }, + "id": 699, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6325:15:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "6295:45:0" + }, + { + "body": { + "id": 723, + "nodeType": "Block", + "src": "6390:86:0", + "statements": [ + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 717, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 712, + "name": "validators", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 697, + "src": "6408:10:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "id": 714, + "indexExpression": { + "argumentTypes": null, + "id": 713, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 702, + "src": "6419:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "6408:13:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 715, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13088, + "src": "6425:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 716, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "6425:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "src": "6408:27:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 722, + "nodeType": "IfStatement", + "src": "6404:61:0", + "trueBody": { + "expression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 720, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 718, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 702, + "src": "6460:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 719, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6464:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "6460:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 693, + "id": 721, + "nodeType": "Return", + "src": "6453:12:0" + } + } + ] + }, + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 708, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 705, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 702, + "src": "6367:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 706, + "name": "getParties", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 531, + 555 + ], + "referencedDeclaration": 531, + "src": "6371:10:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 707, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6371:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "6367:16:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 724, + "initializationExpression": { + "assignments": [ + 702 + ], + "declarations": [ + { + "constant": false, + "id": 702, + "name": "i", + "nodeType": "VariableDeclaration", + "scope": 724, + "src": "6355:6:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 701, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "6355:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 704, + "initialValue": { + "argumentTypes": null, + "hexValue": "30", + "id": 703, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6364:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "nodeType": "VariableDeclarationStatement", + "src": "6355:10:0" + }, + "loopExpression": { + "expression": { + "argumentTypes": null, + "id": 710, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "6385:3:0", + "subExpression": { + "argumentTypes": null, + "id": 709, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 702, + "src": "6385:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 711, + "nodeType": "ExpressionStatement", + "src": "6385:3:0" + }, + "nodeType": "ForStatement", + "src": "6350:126:0" + }, + { + "expression": { + "argumentTypes": null, + "hexValue": "30", + "id": 725, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6492:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "functionReturnParameters": 693, + "id": 726, + "nodeType": "Return", + "src": "6485:8:0" + } + ] + }, + "documentation": null, + "id": 728, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getPartyId", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 690, + "nodeType": "ParameterList", + "parameters": [], + "src": "6255:2:0" + }, + "returnParameters": { + "id": 693, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 692, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 728, + "src": "6279:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 691, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "6279:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "6278:6:0" + }, + "scope": 1340, + "src": "6236:264:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 767, + "nodeType": "Block", + "src": "6568:214:0", + "statements": [ + { + "assignments": [ + 738 + ], + "declarations": [ + { + "constant": false, + "id": 738, + "name": "validators", + "nodeType": "VariableDeclaration", + "scope": 767, + "src": "6578:27:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[]" + }, + "typeName": { + "baseType": { + "id": 736, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6578:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 737, + "length": null, + "nodeType": "ArrayTypeName", + "src": "6578:9:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 741, + "initialValue": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 739, + "name": "getNextValidators", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 792, + "src": "6608:17:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_array$_t_address_$dyn_memory_ptr_$", + "typeString": "function () view returns (address[] memory)" + } + }, + "id": 740, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6608:19:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "6578:49:0" + }, + { + "body": { + "id": 763, + "nodeType": "Block", + "src": "6681:77:0", + "statements": [ + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 757, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 753, + "name": "validators", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 738, + "src": "6699:10:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "id": 755, + "indexExpression": { + "argumentTypes": null, + "id": 754, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 743, + "src": "6710:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "6699:13:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 756, + "name": "a", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 730, + "src": "6716:1:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "6699:18:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 762, + "nodeType": "IfStatement", + "src": "6695:52:0", + "trueBody": { + "expression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 760, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 758, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 743, + "src": "6742:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 759, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6746:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "6742:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 734, + "id": 761, + "nodeType": "Return", + "src": "6735:12:0" + } + } + ] + }, + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 749, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 746, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 743, + "src": "6654:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 747, + "name": "getNextParties", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 541, + "src": "6658:14:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 748, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6658:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "6654:20:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 764, + "initializationExpression": { + "assignments": [ + 743 + ], + "declarations": [ + { + "constant": false, + "id": 743, + "name": "i", + "nodeType": "VariableDeclaration", + "scope": 764, + "src": "6642:6:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 742, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "6642:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 745, + "initialValue": { + "argumentTypes": null, + "hexValue": "30", + "id": 744, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6651:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "nodeType": "VariableDeclarationStatement", + "src": "6642:10:0" + }, + "loopExpression": { + "expression": { + "argumentTypes": null, + "id": 751, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "6676:3:0", + "subExpression": { + "argumentTypes": null, + "id": 750, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 743, + "src": "6676:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 752, + "nodeType": "ExpressionStatement", + "src": "6676:3:0" + }, + "nodeType": "ForStatement", + "src": "6637:121:0" + }, + { + "expression": { + "argumentTypes": null, + "hexValue": "30", + "id": 765, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6774:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "functionReturnParameters": 734, + "id": 766, + "nodeType": "Return", + "src": "6767:8:0" + } + ] + }, + "documentation": null, + "id": 768, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getNextPartyId", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 731, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 730, + "name": "a", + "nodeType": "VariableDeclaration", + "scope": 768, + "src": "6530:9:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 729, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6530:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "6529:11:0" + }, + "returnParameters": { + "id": 734, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 733, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 768, + "src": "6562:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 732, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "6562:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "6561:6:0" + }, + "scope": 1340, + "src": "6506:276:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 779, + "nodeType": "Block", + "src": "6852:48:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 774, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "6869:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 776, + "indexExpression": { + "argumentTypes": null, + "id": 775, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "6876:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "6869:13:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 777, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "validators", + "nodeType": "MemberAccess", + "referencedDeclaration": 35, + "src": "6869:24:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "functionReturnParameters": 773, + "id": 778, + "nodeType": "Return", + "src": "6862:31:0" + } + ] + }, + "documentation": null, + "id": 780, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getValidators", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 769, + "nodeType": "ParameterList", + "parameters": [], + "src": "6810:2:0" + }, + "returnParameters": { + "id": 773, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 772, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 780, + "src": "6834:16:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[]" + }, + "typeName": { + "baseType": { + "id": 770, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6834:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 771, + "length": null, + "nodeType": "ArrayTypeName", + "src": "6834:9:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "6833:18:0" + }, + "scope": 1340, + "src": "6788:112:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 791, + "nodeType": "Block", + "src": "6974:52:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 786, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "6991:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 788, + "indexExpression": { + "argumentTypes": null, + "id": 787, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "6998:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "6991:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 789, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "validators", + "nodeType": "MemberAccess", + "referencedDeclaration": 35, + "src": "6991:28:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "functionReturnParameters": 785, + "id": 790, + "nodeType": "Return", + "src": "6984:35:0" + } + ] + }, + "documentation": null, + "id": 792, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getNextValidators", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 781, + "nodeType": "ParameterList", + "parameters": [], + "src": "6932:2:0" + }, + "returnParameters": { + "id": 785, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 784, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 792, + "src": "6956:16:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[]" + }, + "typeName": { + "baseType": { + "id": 782, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6956:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 783, + "length": null, + "nodeType": "ArrayTypeName", + "src": "6956:9:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "6955:18:0" + }, + "scope": 1340, + "src": "6906:120:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 837, + "nodeType": "Block", + "src": "7093:296:0", + "statements": [ + { + "condition": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 800, + "name": "Vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 64, + "src": "7115:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", + "typeString": "type(enum Bridge.Vote)" + } + }, + "id": 801, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "START_VOTING", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "7115:17:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + ], + "id": 799, + "name": "tryVote", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 1084, + 1109, + 1134, + 1164 + ], + "referencedDeclaration": 1084, + "src": "7107:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$returns$_t_bool_$", + "typeString": "function (enum Bridge.Vote) returns (bool)" + } + }, + "id": 802, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7107:26:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 836, + "nodeType": "IfStatement", + "src": "7103:280:0", + "trueBody": { + "id": 835, + "nodeType": "Block", + "src": "7135:248:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 804, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "7149:11:0", + "subExpression": { + "argumentTypes": null, + "id": 803, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "7149:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 805, + "nodeType": "ExpressionStatement", + "src": "7149:11:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 809, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 806, + "name": "status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 90, + "src": "7174:6:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 807, + "name": "Status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "7183:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Status_$53_$", + "typeString": "type(enum Bridge.Status)" + } + }, + "id": 808, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "VOTING", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "7183:13:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "src": "7174:22:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "id": 810, + "nodeType": "ExpressionStatement", + "src": "7174:22:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 817, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 811, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "7210:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 813, + "indexExpression": { + "argumentTypes": null, + "id": 812, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "7217:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "7210:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 814, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "threshold", + "nodeType": "MemberAccess", + "referencedDeclaration": 37, + "src": "7210:27:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 815, + "name": "getThreshold", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 565, + 588 + ], + "referencedDeclaration": 565, + "src": "7240:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 816, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7240:14:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "7210:44:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 818, + "nodeType": "ExpressionStatement", + "src": "7210:44:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 825, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 819, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "7268:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 821, + "indexExpression": { + "argumentTypes": null, + "id": 820, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "7275:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "7268:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 822, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "validators", + "nodeType": "MemberAccess", + "referencedDeclaration": 35, + "src": "7268:28:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 823, + "name": "getValidators", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 780, + "src": "7299:13:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_array$_t_address_$dyn_memory_ptr_$", + "typeString": "function () view returns (address[] memory)" + } + }, + "id": 824, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7299:15:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "src": "7268:46:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 826, + "nodeType": "ExpressionStatement", + "src": "7268:46:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 833, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 827, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "7328:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 829, + "indexExpression": { + "argumentTypes": null, + "id": 828, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "7335:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "7328:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 830, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "rangeSize", + "nodeType": "MemberAccess", + "referencedDeclaration": 39, + "src": "7328:27:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 831, + "name": "getRangeSize", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 621, + 644 + ], + "referencedDeclaration": 621, + "src": "7358:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 832, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7358:14:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "7328:44:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 834, + "nodeType": "ExpressionStatement", + "src": "7328:44:0" + } + ] + } + } + ] + }, + "documentation": null, + "id": 838, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 795, + "modifierName": { + "argumentTypes": null, + "id": 794, + "name": "readyOrVoting", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 213, + "src": "7062:13:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "7062:13:0" + }, + { + "arguments": null, + "id": 797, + "modifierName": { + "argumentTypes": null, + "id": 796, + "name": "currentValidator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 261, + "src": "7076:16:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "7076:16:0" + } + ], + "name": "startVoting", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 793, + "nodeType": "ParameterList", + "parameters": [], + "src": "7052:2:0" + }, + "returnParameters": { + "id": 798, + "nodeType": "ParameterList", + "parameters": [], + "src": "7093:0:0" + }, + "scope": 1340, + "src": "7032:357:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 871, + "nodeType": "Block", + "src": "7471:202:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 852, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 849, + "name": "validator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 840, + "src": "7504:9:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 848, + "name": "getNextPartyId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 768, + "src": "7489:14:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_uint256_$", + "typeString": "function (address) view returns (uint256)" + } + }, + "id": 850, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7489:25:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 851, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7518:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "7489:30:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "416c726561647920612076616c696461746f72", + "id": 853, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7521:21:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_aeb0fe100da2796aa6136a3b1c66282f002b435141be331237dfa7127e6df6ff", + "typeString": "literal_string \"Already a validator\"" + }, + "value": "Already a validator" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_aeb0fe100da2796aa6136a3b1c66282f002b435141be331237dfa7127e6df6ff", + "typeString": "literal_string \"Already a validator\"" + } + ], + "id": 847, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 13091, + 13092 + ], + "referencedDeclaration": 13092, + "src": "7481:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 854, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7481:62:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 855, + "nodeType": "ExpressionStatement", + "src": "7481:62:0" + }, + { + "condition": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 857, + "name": "Vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 64, + "src": "7566:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", + "typeString": "type(enum Bridge.Vote)" + } + }, + "id": 858, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "ADD_VALIDATOR", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "7566:18:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + { + "argumentTypes": null, + "id": 859, + "name": "validator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 840, + "src": "7586:9:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 856, + "name": "tryVote", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 1084, + 1109, + 1134, + 1164 + ], + "referencedDeclaration": 1109, + "src": "7558:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$_t_address_$returns$_t_bool_$", + "typeString": "function (enum Bridge.Vote,address) returns (bool)" + } + }, + "id": 860, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7558:38:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 870, + "nodeType": "IfStatement", + "src": "7554:113:0", + "trueBody": { + "id": 869, + "nodeType": "Block", + "src": "7598:69:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 866, + "name": "validator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 840, + "src": "7646:9:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 861, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "7612:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 863, + "indexExpression": { + "argumentTypes": null, + "id": 862, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "7619:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "7612:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 864, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "validators", + "nodeType": "MemberAccess", + "referencedDeclaration": 35, + "src": "7612:28:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 865, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "push", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "7612:33:0", + "typeDescriptions": { + "typeIdentifier": "t_function_arraypush_nonpayable$_t_address_$returns$_t_uint256_$", + "typeString": "function (address) returns (uint256)" + } + }, + "id": 867, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7612:44:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 868, + "nodeType": "ExpressionStatement", + "src": "7612:44:0" + } + ] + } + } + ] + }, + "documentation": null, + "id": 872, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 843, + "modifierName": { + "argumentTypes": null, + "id": 842, + "name": "voting", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 225, + "src": "7447:6:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "7447:6:0" + }, + { + "arguments": null, + "id": 845, + "modifierName": { + "argumentTypes": null, + "id": 844, + "name": "currentValidator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 261, + "src": "7454:16:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "7454:16:0" + } + ], + "name": "voteAddValidator", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 841, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 840, + "name": "validator", + "nodeType": "VariableDeclaration", + "scope": 872, + "src": "7421:17:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 839, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7421:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "7420:19:0" + }, + "returnParameters": { + "id": 846, + "nodeType": "ParameterList", + "parameters": [], + "src": "7471:0:0" + }, + "scope": 1340, + "src": "7395:278:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 901, + "nodeType": "Block", + "src": "7758:192:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 886, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 883, + "name": "validator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 874, + "src": "7791:9:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 882, + "name": "getNextPartyId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 768, + "src": "7776:14:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_uint256_$", + "typeString": "function (address) view returns (uint256)" + } + }, + "id": 884, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7776:25:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 885, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7805:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "7776:30:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "416c7265616479206e6f7420612076616c696461746f72", + "id": 887, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7808:25:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_2332ed568e8af3d64f1f2b0b098c504cab97ba4128fb9f08cfa3f851ced05961", + "typeString": "literal_string \"Already not a validator\"" + }, + "value": "Already not a validator" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_2332ed568e8af3d64f1f2b0b098c504cab97ba4128fb9f08cfa3f851ced05961", + "typeString": "literal_string \"Already not a validator\"" + } + ], + "id": 881, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 13091, + 13092 + ], + "referencedDeclaration": 13092, + "src": "7768:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 888, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7768:66:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 889, + "nodeType": "ExpressionStatement", + "src": "7768:66:0" + }, + { + "condition": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 891, + "name": "Vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 64, + "src": "7857:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", + "typeString": "type(enum Bridge.Vote)" + } + }, + "id": 892, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "REMOVE_VALIDATOR", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "7857:21:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + { + "argumentTypes": null, + "id": 893, + "name": "validator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 874, + "src": "7880:9:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 890, + "name": "tryVote", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 1084, + 1109, + 1134, + 1164 + ], + "referencedDeclaration": 1109, + "src": "7849:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$_t_address_$returns$_t_bool_$", + "typeString": "function (enum Bridge.Vote,address) returns (bool)" + } + }, + "id": 894, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7849:41:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 900, + "nodeType": "IfStatement", + "src": "7845:99:0", + "trueBody": { + "id": 899, + "nodeType": "Block", + "src": "7892:52:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 896, + "name": "validator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 874, + "src": "7923:9:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 895, + "name": "_removeValidator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 967, + "src": "7906:16:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$", + "typeString": "function (address)" + } + }, + "id": 897, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7906:27:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 898, + "nodeType": "ExpressionStatement", + "src": "7906:27:0" + } + ] + } + } + ] + }, + "documentation": null, + "id": 902, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 877, + "modifierName": { + "argumentTypes": null, + "id": 876, + "name": "voting", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 225, + "src": "7734:6:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "7734:6:0" + }, + { + "arguments": null, + "id": 879, + "modifierName": { + "argumentTypes": null, + "id": 878, + "name": "currentValidator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 261, + "src": "7741:16:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "7741:16:0" + } + ], + "name": "voteRemoveValidator", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 875, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 874, + "name": "validator", + "nodeType": "VariableDeclaration", + "scope": 902, + "src": "7708:17:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 873, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7708:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "7707:19:0" + }, + "returnParameters": { + "id": 880, + "nodeType": "ParameterList", + "parameters": [], + "src": "7758:0:0" + }, + "scope": 1340, + "src": "7679:271:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 966, + "nodeType": "Block", + "src": "8009:383:0", + "statements": [ + { + "body": { + "id": 946, + "nodeType": "Block", + "src": "8067:205:0", + "statements": [ + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 927, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 920, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "8085:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 922, + "indexExpression": { + "argumentTypes": null, + "id": 921, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "8092:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "8085:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 923, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "validators", + "nodeType": "MemberAccess", + "referencedDeclaration": 35, + "src": "8085:28:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 925, + "indexExpression": { + "argumentTypes": null, + "id": 924, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 908, + "src": "8114:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "8085:31:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 926, + "name": "validator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 904, + "src": "8120:9:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "8085:44:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 945, + "nodeType": "IfStatement", + "src": "8081:181:0", + "trueBody": { + "id": 944, + "nodeType": "Block", + "src": "8131:131:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 941, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 928, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "8149:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 930, + "indexExpression": { + "argumentTypes": null, + "id": 929, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "8156:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "8149:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 931, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "validators", + "nodeType": "MemberAccess", + "referencedDeclaration": 35, + "src": "8149:28:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 933, + "indexExpression": { + "argumentTypes": null, + "id": 932, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 908, + "src": "8178:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "8149:31:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 934, + "name": "getNextValidators", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 792, + "src": "8183:17:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_array$_t_address_$dyn_memory_ptr_$", + "typeString": "function () view returns (address[] memory)" + } + }, + "id": 935, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8183:19:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "id": 940, + "indexExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 939, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 936, + "name": "getNextParties", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 541, + "src": "8203:14:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 937, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8203:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 938, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8222:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "8203:20:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "8183:41:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "8149:75:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 942, + "nodeType": "ExpressionStatement", + "src": "8149:75:0" + }, + { + "id": 943, + "nodeType": "Break", + "src": "8242:5:0" + } + ] + } + } + ] + }, + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 916, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 911, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 908, + "src": "8036:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 915, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 912, + "name": "getNextParties", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 541, + "src": "8040:14:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 913, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8040:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 914, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8059:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "8040:20:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "8036:24:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 947, + "initializationExpression": { + "assignments": [ + 908 + ], + "declarations": [ + { + "constant": false, + "id": 908, + "name": "i", + "nodeType": "VariableDeclaration", + "scope": 947, + "src": "8024:6:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 907, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "8024:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 910, + "initialValue": { + "argumentTypes": null, + "hexValue": "30", + "id": 909, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8033:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "nodeType": "VariableDeclarationStatement", + "src": "8024:10:0" + }, + "loopExpression": { + "expression": { + "argumentTypes": null, + "id": 918, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "8062:3:0", + "subExpression": { + "argumentTypes": null, + "id": 917, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 908, + "src": "8062:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 919, + "nodeType": "ExpressionStatement", + "src": "8062:3:0" + }, + "nodeType": "ForStatement", + "src": "8019:253:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 957, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "delete", + "prefix": true, + "src": "8281:57:0", + "subExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 948, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "8288:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 950, + "indexExpression": { + "argumentTypes": null, + "id": 949, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "8295:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "8288:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 951, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "validators", + "nodeType": "MemberAccess", + "referencedDeclaration": 35, + "src": "8288:28:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 956, + "indexExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 955, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 952, + "name": "getNextParties", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 541, + "src": "8317:14:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 953, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8317:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 954, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8336:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "8317:20:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "8288:50:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 958, + "nodeType": "ExpressionStatement", + "src": "8281:57:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 964, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "--", + "prefix": false, + "src": "8348:37:0", + "subExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 959, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "8348:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 961, + "indexExpression": { + "argumentTypes": null, + "id": 960, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "8355:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "8348:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 962, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "validators", + "nodeType": "MemberAccess", + "referencedDeclaration": 35, + "src": "8348:28:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 963, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "8348:35:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 965, + "nodeType": "ExpressionStatement", + "src": "8348:37:0" + } + ] + }, + "documentation": null, + "id": 967, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_removeValidator", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 905, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 904, + "name": "validator", + "nodeType": "VariableDeclaration", + "scope": 967, + "src": "7982:17:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 903, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7982:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "7981:19:0" + }, + "returnParameters": { + "id": 906, + "nodeType": "ParameterList", + "parameters": [], + "src": "8009:0:0" + }, + "scope": 1340, + "src": "7956:436:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "private" + }, + { + "body": { + "id": 990, + "nodeType": "Block", + "src": "8474:127:0", + "statements": [ + { + "condition": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 977, + "name": "Vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 64, + "src": "8496:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", + "typeString": "type(enum Bridge.Vote)" + } + }, + "id": 978, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "CHANGE_THRESHOLD", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "8496:21:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + { + "argumentTypes": null, + "id": 979, + "name": "threshold", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 969, + "src": "8519:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 976, + "name": "tryVote", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 1084, + 1109, + 1134, + 1164 + ], + "referencedDeclaration": 1134, + "src": "8488:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$_t_uint256_$returns$_t_bool_$", + "typeString": "function (enum Bridge.Vote,uint256) returns (bool)" + } + }, + "id": 980, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8488:41:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 989, + "nodeType": "IfStatement", + "src": "8484:111:0", + "trueBody": { + "id": 988, + "nodeType": "Block", + "src": "8531:64:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 986, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 981, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "8545:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 983, + "indexExpression": { + "argumentTypes": null, + "id": 982, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "8552:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "8545:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 984, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "threshold", + "nodeType": "MemberAccess", + "referencedDeclaration": 37, + "src": "8545:27:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 985, + "name": "threshold", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 969, + "src": "8575:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "8545:39:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 987, + "nodeType": "ExpressionStatement", + "src": "8545:39:0" + } + ] + } + } + ] + }, + "documentation": null, + "id": 991, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 972, + "modifierName": { + "argumentTypes": null, + "id": 971, + "name": "voting", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 225, + "src": "8450:6:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "8450:6:0" + }, + { + "arguments": null, + "id": 974, + "modifierName": { + "argumentTypes": null, + "id": 973, + "name": "currentValidator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 261, + "src": "8457:16:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "8457:16:0" + } + ], + "name": "voteChangeThreshold", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 970, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 969, + "name": "threshold", + "nodeType": "VariableDeclaration", + "scope": 991, + "src": "8427:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 968, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "8427:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "8426:16:0" + }, + "returnParameters": { + "id": 975, + "nodeType": "ParameterList", + "parameters": [], + "src": "8474:0:0" + }, + "scope": 1340, + "src": "8398:203:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 1014, + "nodeType": "Block", + "src": "8683:128:0", + "statements": [ + { + "condition": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1001, + "name": "Vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 64, + "src": "8705:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", + "typeString": "type(enum Bridge.Vote)" + } + }, + "id": 1002, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "CHANGE_RANGE_SIZE", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "8705:22:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + { + "argumentTypes": null, + "id": 1003, + "name": "rangeSize", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 993, + "src": "8729:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 1000, + "name": "tryVote", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 1084, + 1109, + 1134, + 1164 + ], + "referencedDeclaration": 1134, + "src": "8697:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$_t_uint256_$returns$_t_bool_$", + "typeString": "function (enum Bridge.Vote,uint256) returns (bool)" + } + }, + "id": 1004, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8697:42:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 1013, + "nodeType": "IfStatement", + "src": "8693:112:0", + "trueBody": { + "id": 1012, + "nodeType": "Block", + "src": "8741:64:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 1010, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1005, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "8755:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 1007, + "indexExpression": { + "argumentTypes": null, + "id": 1006, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "8762:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "8755:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 1008, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "rangeSize", + "nodeType": "MemberAccess", + "referencedDeclaration": 39, + "src": "8755:27:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 1009, + "name": "rangeSize", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 993, + "src": "8785:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "8755:39:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 1011, + "nodeType": "ExpressionStatement", + "src": "8755:39:0" + } + ] + } + } + ] + }, + "documentation": null, + "id": 1015, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 996, + "modifierName": { + "argumentTypes": null, + "id": 995, + "name": "voting", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 225, + "src": "8659:6:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "8659:6:0" + }, + { + "arguments": null, + "id": 998, + "modifierName": { + "argumentTypes": null, + "id": 997, + "name": "currentValidator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 261, + "src": "8666:16:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "8666:16:0" + } + ], + "name": "voteChangeRangeSize", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 994, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 993, + "name": "rangeSize", + "nodeType": "VariableDeclaration", + "scope": 1015, + "src": "8636:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 992, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "8636:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "8635:16:0" + }, + "returnParameters": { + "id": 999, + "nodeType": "ParameterList", + "parameters": [], + "src": "8683:0:0" + }, + "scope": 1340, + "src": "8607:204:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 1038, + "nodeType": "Block", + "src": "8875:141:0", + "statements": [ + { + "condition": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1023, + "name": "Vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 64, + "src": "8897:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", + "typeString": "type(enum Bridge.Vote)" + } + }, + "id": 1024, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "START_KEYGEN", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "8897:17:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + ], + "id": 1022, + "name": "tryVote", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 1084, + 1109, + 1134, + 1164 + ], + "referencedDeclaration": 1084, + "src": "8889:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$returns$_t_bool_$", + "typeString": "function (enum Bridge.Vote) returns (bool)" + } + }, + "id": 1025, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8889:26:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 1037, + "nodeType": "IfStatement", + "src": "8885:125:0", + "trueBody": { + "id": 1036, + "nodeType": "Block", + "src": "8917:93:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 1029, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 1026, + "name": "status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 90, + "src": "8931:6:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1027, + "name": "Status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "8940:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Status_$53_$", + "typeString": "type(enum Bridge.Status)" + } + }, + "id": 1028, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "KEYGEN", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "8940:13:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "src": "8931:22:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "id": 1030, + "nodeType": "ExpressionStatement", + "src": "8931:22:0" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1032, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "8982:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 1033, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "8989:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 1031, + "name": "NewEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14, + "src": "8973:8:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$returns$__$", + "typeString": "function (uint256,uint256)" + } + }, + "id": 1034, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8973:26:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1035, + "nodeType": "EmitStatement", + "src": "8968:31:0" + } + ] + } + } + ] + }, + "documentation": null, + "id": 1039, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 1018, + "modifierName": { + "argumentTypes": null, + "id": 1017, + "name": "voting", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 225, + "src": "8851:6:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "8851:6:0" + }, + { + "arguments": null, + "id": 1020, + "modifierName": { + "argumentTypes": null, + "id": 1019, + "name": "currentValidator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 261, + "src": "8858:16:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "8858:16:0" + } + ], + "name": "voteStartKeygen", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1016, + "nodeType": "ParameterList", + "parameters": [], + "src": "8841:2:0" + }, + "returnParameters": { + "id": 1021, + "nodeType": "ParameterList", + "parameters": [], + "src": "8875:0:0" + }, + "scope": 1340, + "src": "8817:199:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 1061, + "nodeType": "Block", + "src": "9081:144:0", + "statements": [ + { + "condition": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1047, + "name": "Vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 64, + "src": "9103:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", + "typeString": "type(enum Bridge.Vote)" + } + }, + "id": 1048, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "CANCEL_KEYGEN", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "9103:18:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + ], + "id": 1046, + "name": "tryVote", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 1084, + 1109, + 1134, + 1164 + ], + "referencedDeclaration": 1084, + "src": "9095:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$returns$_t_bool_$", + "typeString": "function (enum Bridge.Vote) returns (bool)" + } + }, + "id": 1049, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9095:27:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 1060, + "nodeType": "IfStatement", + "src": "9091:128:0", + "trueBody": { + "id": 1059, + "nodeType": "Block", + "src": "9124:95:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 1053, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 1050, + "name": "status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 90, + "src": "9138:6:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1051, + "name": "Status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "9147:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Status_$53_$", + "typeString": "type(enum Bridge.Status)" + } + }, + "id": 1052, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "VOTING", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "9147:13:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "src": "9138:22:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "id": 1054, + "nodeType": "ExpressionStatement", + "src": "9138:22:0" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1056, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "9198:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 1055, + "name": "NewEpochCancelled", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 18, + "src": "9180:17:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 1057, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9180:28:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1058, + "nodeType": "EmitStatement", + "src": "9175:33:0" + } + ] + } + } + ] + }, + "documentation": null, + "id": 1062, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 1042, + "modifierName": { + "argumentTypes": null, + "id": 1041, + "name": "keygen", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 237, + "src": "9057:6:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "9057:6:0" + }, + { + "arguments": null, + "id": 1044, + "modifierName": { + "argumentTypes": null, + "id": 1043, + "name": "currentValidator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 261, + "src": "9064:16:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "9064:16:0" + } + ], + "name": "voteCancelKeygen", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1040, + "nodeType": "ParameterList", + "parameters": [], + "src": "9047:2:0" + }, + "returnParameters": { + "id": 1045, + "nodeType": "ParameterList", + "parameters": [], + "src": "9081:0:0" + }, + "scope": 1340, + "src": "9022:203:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 1083, + "nodeType": "Block", + "src": "9286:110:0", + "statements": [ + { + "assignments": [ + 1070 + ], + "declarations": [ + { + "constant": false, + "id": 1070, + "name": "vote", + "nodeType": "VariableDeclaration", + "scope": 1083, + "src": "9296:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1069, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "9296:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1078, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1074, + "name": "voteType", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1064, + "src": "9338:8:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + { + "argumentTypes": null, + "id": 1075, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "9348:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "id": 1072, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13075, + "src": "9321:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 1073, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "9321:16:0", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 1076, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9321:37:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 1071, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13082, + "src": "9311:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 1077, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9311:48:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "9296:63:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1080, + "name": "vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1070, + "src": "9384:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 1079, + "name": "putVote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1268, + "src": "9376:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$_t_bool_$", + "typeString": "function (bytes32) returns (bool)" + } + }, + "id": 1081, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9376:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 1068, + "id": 1082, + "nodeType": "Return", + "src": "9369:20:0" + } + ] + }, + "documentation": null, + "id": 1084, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "tryVote", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1065, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1064, + "name": "voteType", + "nodeType": "VariableDeclaration", + "scope": 1084, + "src": "9248:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + "typeName": { + "contractScope": null, + "id": 1063, + "name": "Vote", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 64, + "src": "9248:4:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "9247:15:0" + }, + "returnParameters": { + "id": 1068, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1067, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 1084, + "src": "9280:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 1066, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "9280:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "9279:6:0" + }, + "scope": 1340, + "src": "9231:165:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "private" + }, + { + "body": { + "id": 1108, + "nodeType": "Block", + "src": "9471:116:0", + "statements": [ + { + "assignments": [ + 1094 + ], + "declarations": [ + { + "constant": false, + "id": 1094, + "name": "vote", + "nodeType": "VariableDeclaration", + "scope": 1108, + "src": "9481:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1093, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "9481:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1103, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1098, + "name": "voteType", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1086, + "src": "9523:8:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + { + "argumentTypes": null, + "id": 1099, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "9533:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 1100, + "name": "addr", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1088, + "src": "9544:4:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "expression": { + "argumentTypes": null, + "id": 1096, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13075, + "src": "9506:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 1097, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "9506:16:0", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 1101, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9506:43:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 1095, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13082, + "src": "9496:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 1102, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9496:54:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "9481:69:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1105, + "name": "vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1094, + "src": "9575:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 1104, + "name": "putVote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1268, + "src": "9567:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$_t_bool_$", + "typeString": "function (bytes32) returns (bool)" + } + }, + "id": 1106, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9567:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 1092, + "id": 1107, + "nodeType": "Return", + "src": "9560:20:0" + } + ] + }, + "documentation": null, + "id": 1109, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "tryVote", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1089, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1086, + "name": "voteType", + "nodeType": "VariableDeclaration", + "scope": 1109, + "src": "9419:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + "typeName": { + "contractScope": null, + "id": 1085, + "name": "Vote", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 64, + "src": "9419:4:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1088, + "name": "addr", + "nodeType": "VariableDeclaration", + "scope": 1109, + "src": "9434:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1087, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "9434:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "9418:29:0" + }, + "returnParameters": { + "id": 1092, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1091, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 1109, + "src": "9465:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 1090, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "9465:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "9464:6:0" + }, + "scope": 1340, + "src": "9402:185:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "private" + }, + { + "body": { + "id": 1133, + "nodeType": "Block", + "src": "9658:115:0", + "statements": [ + { + "assignments": [ + 1119 + ], + "declarations": [ + { + "constant": false, + "id": 1119, + "name": "vote", + "nodeType": "VariableDeclaration", + "scope": 1133, + "src": "9668:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1118, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "9668:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1128, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1123, + "name": "voteType", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1111, + "src": "9710:8:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + { + "argumentTypes": null, + "id": 1124, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "9720:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 1125, + "name": "num", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1113, + "src": "9731:3:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "id": 1121, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13075, + "src": "9693:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 1122, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "9693:16:0", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 1126, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9693:42:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 1120, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13082, + "src": "9683:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 1127, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9683:53:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "9668:68:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1130, + "name": "vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1119, + "src": "9761:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 1129, + "name": "putVote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1268, + "src": "9753:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$_t_bool_$", + "typeString": "function (bytes32) returns (bool)" + } + }, + "id": 1131, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9753:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 1117, + "id": 1132, + "nodeType": "Return", + "src": "9746:20:0" + } + ] + }, + "documentation": null, + "id": 1134, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "tryVote", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1114, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1111, + "name": "voteType", + "nodeType": "VariableDeclaration", + "scope": 1134, + "src": "9610:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + "typeName": { + "contractScope": null, + "id": 1110, + "name": "Vote", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 64, + "src": "9610:4:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1113, + "name": "num", + "nodeType": "VariableDeclaration", + "scope": 1134, + "src": "9625:8:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1112, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "9625:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "9609:25:0" + }, + "returnParameters": { + "id": 1117, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1116, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 1134, + "src": "9652:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 1115, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "9652:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "9651:6:0" + }, + "scope": 1340, + "src": "9593:180:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "private" + }, + { + "body": { + "id": 1163, + "nodeType": "Block", + "src": "9872:116:0", + "statements": [ + { + "assignments": [ + 1148 + ], + "declarations": [ + { + "constant": false, + "id": 1148, + "name": "vote", + "nodeType": "VariableDeclaration", + "scope": 1163, + "src": "9882:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1147, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "9882:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1158, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1152, + "name": "voteType", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1136, + "src": "9924:8:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + { + "argumentTypes": null, + "id": 1153, + "name": "hash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1138, + "src": "9934:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "argumentTypes": null, + "id": 1154, + "name": "to", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1140, + "src": "9940:2:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 1155, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1142, + "src": "9944:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "id": 1150, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13075, + "src": "9907:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 1151, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "9907:16:0", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 1156, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9907:43:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 1149, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13082, + "src": "9897:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 1157, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9897:54:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "9882:69:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1160, + "name": "vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1148, + "src": "9976:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 1159, + "name": "putVote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1268, + "src": "9968:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$_t_bool_$", + "typeString": "function (bytes32) returns (bool)" + } + }, + "id": 1161, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9968:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 1146, + "id": 1162, + "nodeType": "Return", + "src": "9961:20:0" + } + ] + }, + "documentation": null, + "id": 1164, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "tryVote", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1143, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1136, + "name": "voteType", + "nodeType": "VariableDeclaration", + "scope": 1164, + "src": "9796:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + "typeName": { + "contractScope": null, + "id": 1135, + "name": "Vote", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 64, + "src": "9796:4:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1138, + "name": "hash", + "nodeType": "VariableDeclaration", + "scope": 1164, + "src": "9811:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1137, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "9811:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1140, + "name": "to", + "nodeType": "VariableDeclaration", + "scope": 1164, + "src": "9825:10:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1139, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "9825:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1142, + "name": "value", + "nodeType": "VariableDeclaration", + "scope": 1164, + "src": "9837:10:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1141, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "9837:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "9795:53:0" + }, + "returnParameters": { + "id": 1146, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1145, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 1164, + "src": "9866:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 1144, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "9866:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "9865:6:0" + }, + "scope": 1340, + "src": "9779:209:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "private" + }, + { + "body": { + "id": 1185, + "nodeType": "Block", + "src": "10052:113:0", + "statements": [ + { + "assignments": [ + 1172 + ], + "declarations": [ + { + "constant": false, + "id": 1172, + "name": "vote", + "nodeType": "VariableDeclaration", + "scope": 1185, + "src": "10062:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1171, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "10062:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1180, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1176, + "name": "voteType", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1166, + "src": "10104:8:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + { + "argumentTypes": null, + "id": 1177, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "10114:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "id": 1174, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13075, + "src": "10087:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 1175, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "10087:16:0", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 1178, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10087:37:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 1173, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13082, + "src": "10077:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 1179, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10077:48:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "10062:63:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1182, + "name": "vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1172, + "src": "10153:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 1181, + "name": "putConfirm", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1322, + "src": "10142:10:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$_t_bool_$", + "typeString": "function (bytes32) returns (bool)" + } + }, + "id": 1183, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10142:16:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 1170, + "id": 1184, + "nodeType": "Return", + "src": "10135:23:0" + } + ] + }, + "documentation": null, + "id": 1186, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "tryConfirm", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1167, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1166, + "name": "voteType", + "nodeType": "VariableDeclaration", + "scope": 1186, + "src": "10014:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + "typeName": { + "contractScope": null, + "id": 1165, + "name": "Vote", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 64, + "src": "10014:4:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "10013:15:0" + }, + "returnParameters": { + "id": 1170, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1169, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 1186, + "src": "10046:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 1168, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "10046:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "10045:6:0" + }, + "scope": 1340, + "src": "9994:171:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "private" + }, + { + "body": { + "id": 1213, + "nodeType": "Block", + "src": "10245:119:0", + "statements": [ + { + "assignments": [ + 1198 + ], + "declarations": [ + { + "constant": false, + "id": 1198, + "name": "vote", + "nodeType": "VariableDeclaration", + "scope": 1213, + "src": "10255:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1197, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "10255:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1208, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1202, + "name": "voteType", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1188, + "src": "10297:8:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + { + "argumentTypes": null, + "id": 1203, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "10307:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 1204, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1190, + "src": "10318:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 1205, + "name": "y", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1192, + "src": "10321:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "id": 1200, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13075, + "src": "10280:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 1201, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "10280:16:0", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 1206, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10280:43:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 1199, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13082, + "src": "10270:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 1207, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10270:54:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "10255:69:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1210, + "name": "vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1198, + "src": "10352:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 1209, + "name": "putConfirm", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1322, + "src": "10341:10:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$_t_bool_$", + "typeString": "function (bytes32) returns (bool)" + } + }, + "id": 1211, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10341:16:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 1196, + "id": 1212, + "nodeType": "Return", + "src": "10334:23:0" + } + ] + }, + "documentation": null, + "id": 1214, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "tryConfirm", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1193, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1188, + "name": "voteType", + "nodeType": "VariableDeclaration", + "scope": 1214, + "src": "10191:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + "typeName": { + "contractScope": null, + "id": 1187, + "name": "Vote", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 64, + "src": "10191:4:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1190, + "name": "x", + "nodeType": "VariableDeclaration", + "scope": 1214, + "src": "10206:6:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1189, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "10206:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1192, + "name": "y", + "nodeType": "VariableDeclaration", + "scope": 1214, + "src": "10214:6:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1191, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "10214:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "10190:31:0" + }, + "returnParameters": { + "id": 1196, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1195, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 1214, + "src": "10239:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 1194, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "10239:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "10238:6:0" + }, + "scope": 1340, + "src": "10171:193:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "private" + }, + { + "body": { + "id": 1267, + "nodeType": "Block", + "src": "10424:355:0", + "statements": [ + { + "assignments": [ + 1222 + ], + "declarations": [ + { + "constant": false, + "id": 1222, + "name": "personalVote", + "nodeType": "VariableDeclaration", + "scope": 1267, + "src": "10434:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1221, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "10434:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1226, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1224, + "name": "vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1216, + "src": "10473:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 1223, + "name": "personalizeVote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1339, + "src": "10457:15:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_bytes32_$", + "typeString": "function (bytes32) view returns (bytes32)" + } + }, + "id": 1225, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10457:21:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "10434:44:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1231, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "10496:20:0", + "subExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1228, + "name": "votes", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 84, + "src": "10497:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", + "typeString": "mapping(bytes32 => bool)" + } + }, + "id": 1230, + "indexExpression": { + "argumentTypes": null, + "id": 1229, + "name": "personalVote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1222, + "src": "10503:12:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "10497:19:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "566f74656420616c7265616479", + "id": 1232, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10518:15:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_230c30109b60c15b21799291aaf5c571045da3dc3f224d8bbd2f2e688c149a47", + "typeString": "literal_string \"Voted already\"" + }, + "value": "Voted already" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_230c30109b60c15b21799291aaf5c571045da3dc3f224d8bbd2f2e688c149a47", + "typeString": "literal_string \"Voted already\"" + } + ], + "id": 1227, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 13091, + 13092 + ], + "referencedDeclaration": 13092, + "src": "10488:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1233, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10488:46:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1234, + "nodeType": "ExpressionStatement", + "src": "10488:46:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 1239, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1235, + "name": "votes", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 84, + "src": "10545:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", + "typeString": "mapping(bytes32 => bool)" + } + }, + "id": 1237, + "indexExpression": { + "argumentTypes": null, + "id": 1236, + "name": "personalVote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1222, + "src": "10551:12:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "10545:19:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "74727565", + "id": 1238, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10567:4:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + "src": "10545:26:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 1240, + "nodeType": "ExpressionStatement", + "src": "10545:26:0" + }, + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 1246, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1241, + "name": "votesCount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 80, + "src": "10585:10:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + } + }, + "id": 1243, + "indexExpression": { + "argumentTypes": null, + "id": 1242, + "name": "vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1216, + "src": "10596:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "10585:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 1244, + "name": "getThreshold", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 565, + 588 + ], + "referencedDeclaration": 565, + "src": "10605:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 1245, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10605:14:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "10585:34:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "id": 1265, + "nodeType": "Block", + "src": "10704:69:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 1261, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "10718:18:0", + "subExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1258, + "name": "votesCount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 80, + "src": "10718:10:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + } + }, + "id": 1260, + "indexExpression": { + "argumentTypes": null, + "id": 1259, + "name": "vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1216, + "src": "10729:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "10718:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 1262, + "nodeType": "ExpressionStatement", + "src": "10718:18:0" + }, + { + "expression": { + "argumentTypes": null, + "hexValue": "66616c7365", + "id": 1263, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10757:5:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + }, + "functionReturnParameters": 1220, + "id": 1264, + "nodeType": "Return", + "src": "10750:12:0" + } + ] + }, + "id": 1266, + "nodeType": "IfStatement", + "src": "10581:192:0", + "trueBody": { + "id": 1257, + "nodeType": "Block", + "src": "10621:77:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 1253, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1247, + "name": "votesCount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 80, + "src": "10635:10:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + } + }, + "id": 1249, + "indexExpression": { + "argumentTypes": null, + "id": 1248, + "name": "vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1216, + "src": "10646:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "10635:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_rational_57896044618658097711785492504343953926634992332820282019728792003956564819968_by_1", + "typeString": "int_const 5789...(69 digits omitted)...9968" + }, + "id": 1252, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "hexValue": "32", + "id": 1250, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10654:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" + }, + "nodeType": "BinaryOperation", + "operator": "**", + "rightExpression": { + "argumentTypes": null, + "hexValue": "323535", + "id": 1251, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10659:3:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_255_by_1", + "typeString": "int_const 255" + }, + "value": "255" + }, + "src": "10654:8:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_57896044618658097711785492504343953926634992332820282019728792003956564819968_by_1", + "typeString": "int_const 5789...(69 digits omitted)...9968" + } + }, + "src": "10635:27:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 1254, + "nodeType": "ExpressionStatement", + "src": "10635:27:0" + }, + { + "expression": { + "argumentTypes": null, + "hexValue": "74727565", + "id": 1255, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10683:4:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + "functionReturnParameters": 1220, + "id": 1256, + "nodeType": "Return", + "src": "10676:11:0" + } + ] + } + } + ] + }, + "documentation": null, + "id": 1268, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "putVote", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1217, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1216, + "name": "vote", + "nodeType": "VariableDeclaration", + "scope": 1268, + "src": "10387:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1215, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "10387:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "10386:14:0" + }, + "returnParameters": { + "id": 1220, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1219, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 1268, + "src": "10418:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 1218, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "10418:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "10417:6:0" + }, + "scope": 1340, + "src": "10370:409:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "private" + }, + { + "body": { + "id": 1321, + "nodeType": "Block", + "src": "10842:363:0", + "statements": [ + { + "assignments": [ + 1276 + ], + "declarations": [ + { + "constant": false, + "id": 1276, + "name": "personalVote", + "nodeType": "VariableDeclaration", + "scope": 1321, + "src": "10852:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1275, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "10852:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1280, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1278, + "name": "vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1270, + "src": "10891:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 1277, + "name": "personalizeVote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1339, + "src": "10875:15:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_bytes32_$", + "typeString": "function (bytes32) view returns (bytes32)" + } + }, + "id": 1279, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10875:21:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "10852:44:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1285, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "10914:20:0", + "subExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1282, + "name": "votes", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 84, + "src": "10915:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", + "typeString": "mapping(bytes32 => bool)" + } + }, + "id": 1284, + "indexExpression": { + "argumentTypes": null, + "id": 1283, + "name": "personalVote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1276, + "src": "10921:12:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "10915:19:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "436f6e6669726d656420616c7265616479", + "id": 1286, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10936:19:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_762a97ce67d271844ad9c09d89a5271fde7fe7537af208da055a904cd67ac7bc", + "typeString": "literal_string \"Confirmed already\"" + }, + "value": "Confirmed already" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_762a97ce67d271844ad9c09d89a5271fde7fe7537af208da055a904cd67ac7bc", + "typeString": "literal_string \"Confirmed already\"" + } + ], + "id": 1281, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 13091, + 13092 + ], + "referencedDeclaration": 13092, + "src": "10906:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1287, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10906:50:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1288, + "nodeType": "ExpressionStatement", + "src": "10906:50:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 1293, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1289, + "name": "votes", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 84, + "src": "10967:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", + "typeString": "mapping(bytes32 => bool)" + } + }, + "id": 1291, + "indexExpression": { + "argumentTypes": null, + "id": 1290, + "name": "personalVote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1276, + "src": "10973:12:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "10967:19:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "74727565", + "id": 1292, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10989:4:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + "src": "10967:26:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 1294, + "nodeType": "ExpressionStatement", + "src": "10967:26:0" + }, + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 1300, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1295, + "name": "votesCount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 80, + "src": "11007:10:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + } + }, + "id": 1297, + "indexExpression": { + "argumentTypes": null, + "id": 1296, + "name": "vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1270, + "src": "11018:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "11007:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 1298, + "name": "getNextThreshold", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 575, + "src": "11027:16:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 1299, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11027:18:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "11007:38:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "id": 1319, + "nodeType": "Block", + "src": "11130:69:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 1315, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "11144:18:0", + "subExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1312, + "name": "votesCount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 80, + "src": "11144:10:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + } + }, + "id": 1314, + "indexExpression": { + "argumentTypes": null, + "id": 1313, + "name": "vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1270, + "src": "11155:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "11144:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 1316, + "nodeType": "ExpressionStatement", + "src": "11144:18:0" + }, + { + "expression": { + "argumentTypes": null, + "hexValue": "66616c7365", + "id": 1317, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "11183:5:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + }, + "functionReturnParameters": 1274, + "id": 1318, + "nodeType": "Return", + "src": "11176:12:0" + } + ] + }, + "id": 1320, + "nodeType": "IfStatement", + "src": "11003:196:0", + "trueBody": { + "id": 1311, + "nodeType": "Block", + "src": "11047:77:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 1307, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1301, + "name": "votesCount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 80, + "src": "11061:10:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + } + }, + "id": 1303, + "indexExpression": { + "argumentTypes": null, + "id": 1302, + "name": "vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1270, + "src": "11072:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "11061:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_rational_57896044618658097711785492504343953926634992332820282019728792003956564819968_by_1", + "typeString": "int_const 5789...(69 digits omitted)...9968" + }, + "id": 1306, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "hexValue": "32", + "id": 1304, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "11080:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" + }, + "nodeType": "BinaryOperation", + "operator": "**", + "rightExpression": { + "argumentTypes": null, + "hexValue": "323535", + "id": 1305, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "11085:3:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_255_by_1", + "typeString": "int_const 255" + }, + "value": "255" + }, + "src": "11080:8:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_57896044618658097711785492504343953926634992332820282019728792003956564819968_by_1", + "typeString": "int_const 5789...(69 digits omitted)...9968" + } + }, + "src": "11061:27:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 1308, + "nodeType": "ExpressionStatement", + "src": "11061:27:0" + }, + { + "expression": { + "argumentTypes": null, + "hexValue": "74727565", + "id": 1309, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "11109:4:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + "functionReturnParameters": 1274, + "id": 1310, + "nodeType": "Return", + "src": "11102:11:0" + } + ] + } + } + ] + }, + "documentation": null, + "id": 1322, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "putConfirm", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1271, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1270, + "name": "vote", + "nodeType": "VariableDeclaration", + "scope": 1322, + "src": "10805:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1269, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "10805:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "10804:14:0" + }, + "returnParameters": { + "id": 1274, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1273, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 1322, + "src": "10836:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 1272, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "10836:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "10835:6:0" + }, + "scope": 1340, + "src": "10785:420:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "private" + }, + { + "body": { + "id": 1338, + "nodeType": "Block", + "src": "11281:69:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1332, + "name": "vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1324, + "src": "11325:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1333, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13088, + "src": "11331:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1334, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "11331:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + ], + "expression": { + "argumentTypes": null, + "id": 1330, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13075, + "src": "11308:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 1331, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "11308:16:0", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 1335, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11308:34:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 1329, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13082, + "src": "11298:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 1336, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11298:45:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "functionReturnParameters": 1328, + "id": 1337, + "nodeType": "Return", + "src": "11291:52:0" + } + ] + }, + "documentation": null, + "id": 1339, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "personalizeVote", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1325, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1324, + "name": "vote", + "nodeType": "VariableDeclaration", + "scope": 1339, + "src": "11236:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1323, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "11236:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "11235:14:0" + }, + "returnParameters": { + "id": 1328, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1327, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 1339, + "src": "11272:7:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1326, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "11272:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "11271:9:0" + }, + "scope": 1340, + "src": "11211:139:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "private" + } + ], + "scope": 1341, + "src": "93:11259:0" + } + ], + "src": "0:11353:0" + }, + "legacyAST": { + "absolutePath": "/build/contracts/Bridge.sol", + "exportedSymbols": { + "Bridge": [ + 1340 + ] + }, + "id": 1341, + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 1, + "literals": [ + "solidity", + "^", + "0.5", + ".0" + ], + "nodeType": "PragmaDirective", + "src": "0:23:0" + }, + { + "absolutePath": "/build/contracts/openzeppelin-solidity/contracts/token/ERC20/IERC20.sol", + "file": "./openzeppelin-solidity/contracts/token/ERC20/IERC20.sol", + "id": 2, + "nodeType": "ImportDirective", + "scope": 1341, + "sourceUnit": 10033, + "src": "25:66:0", + "symbolAliases": [], + "unitAlias": "" + }, + { + "baseContracts": [], + "contractDependencies": [], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "id": 1340, + "linearizedBaseContracts": [ + 1340 + ], + "name": "Bridge", + "nodeType": "ContractDefinition", + "nodes": [ + { + "anonymous": false, + "documentation": null, + "id": 8, + "name": "ExchangeRequest", + "nodeType": "EventDefinition", + "parameters": { + "id": 7, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4, + "indexed": false, + "name": "value", + "nodeType": "VariableDeclaration", + "scope": 8, + "src": "137:10:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "137:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 6, + "indexed": false, + "name": "nonce", + "nodeType": "VariableDeclaration", + "scope": 8, + "src": "149:10:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 5, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "149:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "136:24:0" + }, + "src": "115:46:0" + }, + { + "anonymous": false, + "documentation": null, + "id": 14, + "name": "NewEpoch", + "nodeType": "EventDefinition", + "parameters": { + "id": 13, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10, + "indexed": true, + "name": "oldEpoch", + "nodeType": "VariableDeclaration", + "scope": 14, + "src": "181:21:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 9, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "181:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 12, + "indexed": true, + "name": "newEpoch", + "nodeType": "VariableDeclaration", + "scope": 14, + "src": "204:21:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 11, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "204:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "180:46:0" + }, + "src": "166:61:0" + }, + { + "anonymous": false, + "documentation": null, + "id": 18, + "name": "NewEpochCancelled", + "nodeType": "EventDefinition", + "parameters": { + "id": 17, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 16, + "indexed": true, + "name": "epoch", + "nodeType": "VariableDeclaration", + "scope": 18, + "src": "256:18:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 15, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "256:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "255:20:0" + }, + "src": "232:44:0" + }, + { + "anonymous": false, + "documentation": null, + "id": 24, + "name": "NewFundsTransfer", + "nodeType": "EventDefinition", + "parameters": { + "id": 23, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 20, + "indexed": true, + "name": "oldEpoch", + "nodeType": "VariableDeclaration", + "scope": 24, + "src": "304:21:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 19, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "304:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 22, + "indexed": true, + "name": "newEpoch", + "nodeType": "VariableDeclaration", + "scope": 24, + "src": "327:21:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 21, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "327:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "303:46:0" + }, + "src": "281:69:0" + }, + { + "anonymous": false, + "documentation": null, + "id": 32, + "name": "EpochStart", + "nodeType": "EventDefinition", + "parameters": { + "id": 31, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 26, + "indexed": true, + "name": "epoch", + "nodeType": "VariableDeclaration", + "scope": 32, + "src": "372:18:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 25, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "372:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 28, + "indexed": false, + "name": "x", + "nodeType": "VariableDeclaration", + "scope": 32, + "src": "392:6:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 27, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "392:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 30, + "indexed": false, + "name": "y", + "nodeType": "VariableDeclaration", + "scope": 32, + "src": "400:6:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 29, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "400:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "371:36:0" + }, + "src": "355:53:0" + }, + { + "canonicalName": "Bridge.State", + "id": 48, + "members": [ + { + "constant": false, + "id": 35, + "name": "validators", + "nodeType": "VariableDeclaration", + "scope": 48, + "src": "437:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + }, + "typeName": { + "baseType": { + "id": 33, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "437:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 34, + "length": null, + "nodeType": "ArrayTypeName", + "src": "437:9:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 37, + "name": "threshold", + "nodeType": "VariableDeclaration", + "scope": 48, + "src": "467:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 36, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "467:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 39, + "name": "rangeSize", + "nodeType": "VariableDeclaration", + "scope": 48, + "src": "491:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 38, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "491:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 41, + "name": "startBlock", + "nodeType": "VariableDeclaration", + "scope": 48, + "src": "515:15:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 40, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "515:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 43, + "name": "nonce", + "nodeType": "VariableDeclaration", + "scope": 48, + "src": "540:10:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 42, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "540:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 45, + "name": "x", + "nodeType": "VariableDeclaration", + "scope": 48, + "src": "560:6:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 44, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "560:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 47, + "name": "y", + "nodeType": "VariableDeclaration", + "scope": 48, + "src": "576:6:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 46, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "576:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "name": "State", + "nodeType": "StructDefinition", + "scope": 1340, + "src": "414:175:0", + "visibility": "public" + }, + { + "canonicalName": "Bridge.Status", + "id": 53, + "members": [ + { + "id": 49, + "name": "READY", + "nodeType": "EnumValue", + "src": "617:5:0" + }, + { + "id": 50, + "name": "VOTING", + "nodeType": "EnumValue", + "src": "676:6:0" + }, + { + "id": 51, + "name": "KEYGEN", + "nodeType": "EnumValue", + "src": "746:6:0" + }, + { + "id": 52, + "name": "FUNDS_TRANSFER", + "nodeType": "EnumValue", + "src": "789:14:0" + } + ], + "name": "Status", + "nodeType": "EnumDefinition", + "src": "595:253:0" + }, + { + "canonicalName": "Bridge.Vote", + "id": 64, + "members": [ + { + "id": 54, + "name": "CONFIRM_KEYGEN", + "nodeType": "EnumValue", + "src": "874:14:0" + }, + { + "id": 55, + "name": "CONFIRM_FUNDS_TRANSFER", + "nodeType": "EnumValue", + "src": "898:22:0" + }, + { + "id": 56, + "name": "START_VOTING", + "nodeType": "EnumValue", + "src": "930:12:0" + }, + { + "id": 57, + "name": "ADD_VALIDATOR", + "nodeType": "EnumValue", + "src": "952:13:0" + }, + { + "id": 58, + "name": "REMOVE_VALIDATOR", + "nodeType": "EnumValue", + "src": "975:16:0" + }, + { + "id": 59, + "name": "CHANGE_THRESHOLD", + "nodeType": "EnumValue", + "src": "1001:16:0" + }, + { + "id": 60, + "name": "CHANGE_RANGE_SIZE", + "nodeType": "EnumValue", + "src": "1027:17:0" + }, + { + "id": 61, + "name": "START_KEYGEN", + "nodeType": "EnumValue", + "src": "1054:12:0" + }, + { + "id": 62, + "name": "CANCEL_KEYGEN", + "nodeType": "EnumValue", + "src": "1076:13:0" + }, + { + "id": 63, + "name": "TRANSFER", + "nodeType": "EnumValue", + "src": "1099:8:0" + } + ], + "name": "Vote", + "nodeType": "EnumDefinition", + "src": "854:259:0" + }, + { + "constant": false, + "id": 68, + "name": "states", + "nodeType": "VariableDeclaration", + "scope": 1340, + "src": "1119:29:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State)" + }, + "typeName": { + "id": 67, + "keyType": { + "id": 65, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1127:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Mapping", + "src": "1119:22:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State)" + }, + "valueType": { + "contractScope": null, + "id": 66, + "name": "State", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 48, + "src": "1135:5:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage_ptr", + "typeString": "struct Bridge.State" + } + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 72, + "name": "dbTransferCount", + "nodeType": "VariableDeclaration", + "scope": 1340, + "src": "1155:47:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + }, + "typeName": { + "id": 71, + "keyType": { + "id": 69, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1163:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "Mapping", + "src": "1155:24:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + }, + "valueType": { + "id": 70, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1174:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + }, + "value": null, + "visibility": "public" + }, + { + "constant": false, + "id": 76, + "name": "dbTransfer", + "nodeType": "VariableDeclaration", + "scope": 1340, + "src": "1208:42:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", + "typeString": "mapping(bytes32 => bool)" + }, + "typeName": { + "id": 75, + "keyType": { + "id": 73, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1216:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "Mapping", + "src": "1208:24:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", + "typeString": "mapping(bytes32 => bool)" + }, + "valueType": { + "id": 74, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "1227:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + }, + "value": null, + "visibility": "public" + }, + { + "constant": false, + "id": 80, + "name": "votesCount", + "nodeType": "VariableDeclaration", + "scope": 1340, + "src": "1256:42:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + }, + "typeName": { + "id": 79, + "keyType": { + "id": 77, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1264:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "Mapping", + "src": "1256:24:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + }, + "valueType": { + "id": 78, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1275:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + }, + "value": null, + "visibility": "public" + }, + { + "constant": false, + "id": 84, + "name": "votes", + "nodeType": "VariableDeclaration", + "scope": 1340, + "src": "1304:37:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", + "typeString": "mapping(bytes32 => bool)" + }, + "typeName": { + "id": 83, + "keyType": { + "id": 81, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1312:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "Mapping", + "src": "1304:24:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", + "typeString": "mapping(bytes32 => bool)" + }, + "valueType": { + "id": 82, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "1323:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + }, + "value": null, + "visibility": "public" + }, + { + "constant": false, + "id": 88, + "name": "usedRange", + "nodeType": "VariableDeclaration", + "scope": 1340, + "src": "1347:41:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", + "typeString": "mapping(bytes32 => bool)" + }, + "typeName": { + "id": 87, + "keyType": { + "id": 85, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1355:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "Mapping", + "src": "1347:24:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", + "typeString": "mapping(bytes32 => bool)" + }, + "valueType": { + "id": 86, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "1366:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + }, + "value": null, + "visibility": "public" + }, + { + "constant": false, + "id": 90, + "name": "status", + "nodeType": "VariableDeclaration", + "scope": 1340, + "src": "1395:20:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + }, + "typeName": { + "contractScope": null, + "id": 89, + "name": "Status", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 53, + "src": "1395:6:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "value": null, + "visibility": "public" + }, + { + "constant": false, + "id": 92, + "name": "epoch", + "nodeType": "VariableDeclaration", + "scope": 1340, + "src": "1422:17:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 91, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1422:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "public" + }, + { + "constant": false, + "id": 94, + "name": "nextEpoch", + "nodeType": "VariableDeclaration", + "scope": 1340, + "src": "1445:21:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 93, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1445:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "public" + }, + { + "constant": false, + "id": 96, + "name": "minTxLimit", + "nodeType": "VariableDeclaration", + "scope": 1340, + "src": "1473:15:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 95, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1473:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 98, + "name": "maxTxLimit", + "nodeType": "VariableDeclaration", + "scope": 1340, + "src": "1494:15:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 97, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1494:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "body": { + "id": 181, + "nodeType": "Block", + "src": "1643:403:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 118, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 115, + "name": "validators", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 103, + "src": "1661:10:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "id": 116, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "1661:17:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 117, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1681:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "1661:21:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 114, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 13091, + 13092 + ], + "referencedDeclaration": 13091, + "src": "1653:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 119, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1653:30:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 120, + "nodeType": "ExpressionStatement", + "src": "1653:30:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 125, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 122, + "name": "threshold", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 100, + "src": "1701:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 123, + "name": "validators", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 103, + "src": "1713:10:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "id": 124, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "1713:17:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1701:29:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 121, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 13091, + 13092 + ], + "referencedDeclaration": 13091, + "src": "1693:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 126, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1693:38:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 127, + "nodeType": "ExpressionStatement", + "src": "1693:38:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 132, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 128, + "name": "tokenContract", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 184, + "src": "1742:13:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IERC20_$10032", + "typeString": "contract IERC20" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 130, + "name": "_tokenContract", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 105, + "src": "1765:14:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 129, + "name": "IERC20", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10032, + "src": "1758:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IERC20_$10032_$", + "typeString": "type(contract IERC20)" + } + }, + "id": 131, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1758:22:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IERC20_$10032", + "typeString": "contract IERC20" + } + }, + "src": "1742:38:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IERC20_$10032", + "typeString": "contract IERC20" + } + }, + "id": 133, + "nodeType": "ExpressionStatement", + "src": "1742:38:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 136, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 134, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "1791:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "30", + "id": 135, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1799:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "1791:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 137, + "nodeType": "ExpressionStatement", + "src": "1791:9:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 141, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 138, + "name": "status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 90, + "src": "1810:6:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 139, + "name": "Status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "1819:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Status_$53_$", + "typeString": "type(enum Bridge.Status)" + } + }, + "id": 140, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "KEYGEN", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "1819:13:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "src": "1810:22:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "id": 142, + "nodeType": "ExpressionStatement", + "src": "1810:22:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 145, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 143, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "1842:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "31", + "id": 144, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1854:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "1842:13:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 146, + "nodeType": "ExpressionStatement", + "src": "1842:13:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 162, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 147, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "1866:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 149, + "indexExpression": { + "argumentTypes": null, + "id": 148, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "1873:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "1866:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 151, + "name": "validators", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 103, + "src": "1892:10:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + { + "argumentTypes": null, + "id": 152, + "name": "threshold", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 100, + "src": "1904:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 153, + "name": "rangeSize", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 111, + "src": "1915:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "hexValue": "30", + "id": 154, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1926:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 157, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "-", + "prefix": true, + "src": "1934:2:0", + "subExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 156, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1935:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "typeDescriptions": { + "typeIdentifier": "t_rational_minus_1_by_1", + "typeString": "int_const -1" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_minus_1_by_1", + "typeString": "int_const -1" + } + ], + "id": 155, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "1929:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": "uint" + }, + "id": 158, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1929:8:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "hexValue": "30", + "id": 159, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1939:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + { + "argumentTypes": null, + "hexValue": "30", + "id": 160, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1942:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 150, + "name": "State", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 48, + "src": "1886:5:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_struct$_State_$48_storage_ptr_$", + "typeString": "type(struct Bridge.State storage pointer)" + } + }, + "id": 161, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "structConstructorCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1886:58:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_memory", + "typeString": "struct Bridge.State memory" + } + }, + "src": "1866:78:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 163, + "nodeType": "ExpressionStatement", + "src": "1866:78:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 168, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 164, + "name": "minTxLimit", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 96, + "src": "1955:10:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 165, + "name": "limits", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 109, + "src": "1968:6:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$2_memory_ptr", + "typeString": "uint256[2] memory" + } + }, + "id": 167, + "indexExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 166, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1975:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "1968:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1955:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 169, + "nodeType": "ExpressionStatement", + "src": "1955:22:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 174, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 170, + "name": "maxTxLimit", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 98, + "src": "1987:10:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 171, + "name": "limits", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 109, + "src": "2000:6:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$2_memory_ptr", + "typeString": "uint256[2] memory" + } + }, + "id": 173, + "indexExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 172, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2007:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "2000:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1987:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 175, + "nodeType": "ExpressionStatement", + "src": "1987:22:0" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "hexValue": "30", + "id": 177, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2034:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + { + "argumentTypes": null, + "hexValue": "31", + "id": 178, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2037:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + } + ], + "id": 176, + "name": "NewEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14, + "src": "2025:8:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$returns$__$", + "typeString": "function (uint256,uint256)" + } + }, + "id": 179, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2025:14:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 180, + "nodeType": "EmitStatement", + "src": "2020:19:0" + } + ] + }, + "documentation": null, + "id": 182, + "implemented": true, + "kind": "constructor", + "modifiers": [], + "name": "", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 112, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 100, + "name": "threshold", + "nodeType": "VariableDeclaration", + "scope": 182, + "src": "1528:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 99, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1528:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 103, + "name": "validators", + "nodeType": "VariableDeclaration", + "scope": 182, + "src": "1544:27:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[]" + }, + "typeName": { + "baseType": { + "id": 101, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1544:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 102, + "length": null, + "nodeType": "ArrayTypeName", + "src": "1544:9:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 105, + "name": "_tokenContract", + "nodeType": "VariableDeclaration", + "scope": 182, + "src": "1573:22:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 104, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1573:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 109, + "name": "limits", + "nodeType": "VariableDeclaration", + "scope": 182, + "src": "1597:21:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$2_memory_ptr", + "typeString": "uint256[2]" + }, + "typeName": { + "baseType": { + "id": 106, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1597:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 108, + "length": { + "argumentTypes": null, + "hexValue": "32", + "id": 107, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1602:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" + }, + "nodeType": "ArrayTypeName", + "src": "1597:7:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$2_storage_ptr", + "typeString": "uint256[2]" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 111, + "name": "rangeSize", + "nodeType": "VariableDeclaration", + "scope": 182, + "src": "1620:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 110, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1620:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1527:108:0" + }, + "returnParameters": { + "id": 113, + "nodeType": "ParameterList", + "parameters": [], + "src": "1643:0:0" + }, + "scope": 1340, + "src": "1516:530:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "constant": false, + "id": 184, + "name": "tokenContract", + "nodeType": "VariableDeclaration", + "scope": 1340, + "src": "2052:27:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IERC20_$10032", + "typeString": "contract IERC20" + }, + "typeName": { + "contractScope": null, + "id": 183, + "name": "IERC20", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 10032, + "src": "2052:6:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IERC20_$10032", + "typeString": "contract IERC20" + } + }, + "value": null, + "visibility": "public" + }, + { + "body": { + "id": 195, + "nodeType": "Block", + "src": "2101:81:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + }, + "id": 190, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 187, + "name": "status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 90, + "src": "2119:6:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 188, + "name": "Status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "2129:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Status_$53_$", + "typeString": "type(enum Bridge.Status)" + } + }, + "id": 189, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "READY", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2129:12:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "src": "2119:22:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4e6f7420696e207265616479207374617465", + "id": 191, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2143:20:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_965c39c15b78dbcd8a954511641ca86e15fc1ae6d6c30a67536872ccde75b679", + "typeString": "literal_string \"Not in ready state\"" + }, + "value": "Not in ready state" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_965c39c15b78dbcd8a954511641ca86e15fc1ae6d6c30a67536872ccde75b679", + "typeString": "literal_string \"Not in ready state\"" + } + ], + "id": 186, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 13091, + 13092 + ], + "referencedDeclaration": 13092, + "src": "2111:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 192, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2111:53:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 193, + "nodeType": "ExpressionStatement", + "src": "2111:53:0" + }, + { + "id": 194, + "nodeType": "PlaceholderStatement", + "src": "2174:1:0" + } + ] + }, + "documentation": null, + "id": 196, + "name": "ready", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 185, + "nodeType": "ParameterList", + "parameters": [], + "src": "2101:0:0" + }, + "src": "2086:96:0", + "visibility": "internal" + }, + { + "body": { + "id": 212, + "nodeType": "Block", + "src": "2211:118:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 207, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + }, + "id": 202, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 199, + "name": "status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 90, + "src": "2229:6:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 200, + "name": "Status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "2239:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Status_$53_$", + "typeString": "type(enum Bridge.Status)" + } + }, + "id": 201, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "READY", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2239:12:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "src": "2229:22:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "||", + "rightExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + }, + "id": 206, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 203, + "name": "status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 90, + "src": "2255:6:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 204, + "name": "Status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "2265:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Status_$53_$", + "typeString": "type(enum Bridge.Status)" + } + }, + "id": 205, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "VOTING", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2265:13:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "src": "2255:23:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "2229:49:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4e6f7420696e207265616479206f7220766f74696e67207374617465", + "id": 208, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2280:30:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_7e3f7359baa731593d4e3921720b92600c22ed1d950d208e0c826ad2eddebe96", + "typeString": "literal_string \"Not in ready or voting state\"" + }, + "value": "Not in ready or voting state" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_7e3f7359baa731593d4e3921720b92600c22ed1d950d208e0c826ad2eddebe96", + "typeString": "literal_string \"Not in ready or voting state\"" + } + ], + "id": 198, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 13091, + 13092 + ], + "referencedDeclaration": 13092, + "src": "2221:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 209, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2221:90:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 210, + "nodeType": "ExpressionStatement", + "src": "2221:90:0" + }, + { + "id": 211, + "nodeType": "PlaceholderStatement", + "src": "2321:1:0" + } + ] + }, + "documentation": null, + "id": 213, + "name": "readyOrVoting", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 197, + "nodeType": "ParameterList", + "parameters": [], + "src": "2211:0:0" + }, + "src": "2188:141:0", + "visibility": "internal" + }, + { + "body": { + "id": 224, + "nodeType": "Block", + "src": "2351:83:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + }, + "id": 219, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 216, + "name": "status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 90, + "src": "2369:6:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 217, + "name": "Status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "2379:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Status_$53_$", + "typeString": "type(enum Bridge.Status)" + } + }, + "id": 218, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "VOTING", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2379:13:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "src": "2369:23:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4e6f7420696e20766f74696e67207374617465", + "id": 220, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2394:21:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_0cbee9834b110b21e0730bf5c3d2972fb9867ff221df239e7ae60883592f05d1", + "typeString": "literal_string \"Not in voting state\"" + }, + "value": "Not in voting state" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_0cbee9834b110b21e0730bf5c3d2972fb9867ff221df239e7ae60883592f05d1", + "typeString": "literal_string \"Not in voting state\"" + } + ], + "id": 215, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 13091, + 13092 + ], + "referencedDeclaration": 13092, + "src": "2361:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 221, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2361:55:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 222, + "nodeType": "ExpressionStatement", + "src": "2361:55:0" + }, + { + "id": 223, + "nodeType": "PlaceholderStatement", + "src": "2426:1:0" + } + ] + }, + "documentation": null, + "id": 225, + "name": "voting", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 214, + "nodeType": "ParameterList", + "parameters": [], + "src": "2351:0:0" + }, + "src": "2335:99:0", + "visibility": "internal" + }, + { + "body": { + "id": 236, + "nodeType": "Block", + "src": "2456:83:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + }, + "id": 231, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 228, + "name": "status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 90, + "src": "2474:6:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 229, + "name": "Status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "2484:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Status_$53_$", + "typeString": "type(enum Bridge.Status)" + } + }, + "id": 230, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "KEYGEN", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2484:13:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "src": "2474:23:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4e6f7420696e206b657967656e207374617465", + "id": 232, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2499:21:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_ed0fee6382e0651a224348a21558d03a4a439c3bd5edc24945894a3417c14010", + "typeString": "literal_string \"Not in keygen state\"" + }, + "value": "Not in keygen state" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_ed0fee6382e0651a224348a21558d03a4a439c3bd5edc24945894a3417c14010", + "typeString": "literal_string \"Not in keygen state\"" + } + ], + "id": 227, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 13091, + 13092 + ], + "referencedDeclaration": 13092, + "src": "2466:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 233, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2466:55:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 234, + "nodeType": "ExpressionStatement", + "src": "2466:55:0" + }, + { + "id": 235, + "nodeType": "PlaceholderStatement", + "src": "2531:1:0" + } + ] + }, + "documentation": null, + "id": 237, + "name": "keygen", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 226, + "nodeType": "ParameterList", + "parameters": [], + "src": "2456:0:0" + }, + "src": "2440:99:0", + "visibility": "internal" + }, + { + "body": { + "id": 248, + "nodeType": "Block", + "src": "2568:99:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + }, + "id": 243, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 240, + "name": "status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 90, + "src": "2586:6:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 241, + "name": "Status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "2596:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Status_$53_$", + "typeString": "type(enum Bridge.Status)" + } + }, + "id": 242, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "FUNDS_TRANSFER", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2596:21:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "src": "2586:31:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4e6f7420696e2066756e6473207472616e73666572207374617465", + "id": 244, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2619:29:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_6347c9fecd6f58520ad10dfd1347ce3dc42cc0eed7a4182ca64dd11c69fc3008", + "typeString": "literal_string \"Not in funds transfer state\"" + }, + "value": "Not in funds transfer state" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_6347c9fecd6f58520ad10dfd1347ce3dc42cc0eed7a4182ca64dd11c69fc3008", + "typeString": "literal_string \"Not in funds transfer state\"" + } + ], + "id": 239, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 13091, + 13092 + ], + "referencedDeclaration": 13092, + "src": "2578:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 245, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2578:71:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 246, + "nodeType": "ExpressionStatement", + "src": "2578:71:0" + }, + { + "id": 247, + "nodeType": "PlaceholderStatement", + "src": "2659:1:0" + } + ] + }, + "documentation": null, + "id": 249, + "name": "fundsTransfer", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 238, + "nodeType": "ParameterList", + "parameters": [], + "src": "2568:0:0" + }, + "src": "2545:122:0", + "visibility": "internal" + }, + { + "body": { + "id": 260, + "nodeType": "Block", + "src": "2699:81:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 255, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 252, + "name": "getPartyId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 728, + "src": "2717:10:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 253, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2717:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 254, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2733:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "2717:17:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4e6f7420612063757272656e742076616c696461746f72", + "id": 256, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2736:25:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_8dc18d5bb1361900b9758b388df331056e31071cae84b276c0f03794c4dc634a", + "typeString": "literal_string \"Not a current validator\"" + }, + "value": "Not a current validator" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_8dc18d5bb1361900b9758b388df331056e31071cae84b276c0f03794c4dc634a", + "typeString": "literal_string \"Not a current validator\"" + } + ], + "id": 251, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 13091, + 13092 + ], + "referencedDeclaration": 13092, + "src": "2709:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 257, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2709:53:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 258, + "nodeType": "ExpressionStatement", + "src": "2709:53:0" + }, + { + "id": 259, + "nodeType": "PlaceholderStatement", + "src": "2772:1:0" + } + ] + }, + "documentation": null, + "id": 261, + "name": "currentValidator", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 250, + "nodeType": "ParameterList", + "parameters": [], + "src": "2699:0:0" + }, + "src": "2673:107:0", + "visibility": "internal" + }, + { + "body": { + "id": 343, + "nodeType": "Block", + "src": "2829:475:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 281, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 277, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 271, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 269, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 263, + "src": "2847:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "id": 270, + "name": "minTxLimit", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 96, + "src": "2856:10:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "2847:19:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 276, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 272, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 263, + "src": "2870:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_rational_10000000000_by_1", + "typeString": "int_const 10000000000" + }, + "id": 275, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "hexValue": "3130", + "id": 273, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2879:2:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_10_by_1", + "typeString": "int_const 10" + }, + "value": "10" + }, + "nodeType": "BinaryOperation", + "operator": "**", + "rightExpression": { + "argumentTypes": null, + "hexValue": "3130", + "id": 274, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2885:2:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_10_by_1", + "typeString": "int_const 10" + }, + "value": "10" + }, + "src": "2879:8:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_10000000000_by_1", + "typeString": "int_const 10000000000" + } + }, + "src": "2870:17:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "2847:40:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 280, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 278, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 263, + "src": "2891:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "id": 279, + "name": "maxTxLimit", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 98, + "src": "2900:10:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "2891:19:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "2847:63:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 268, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 13091, + 13092 + ], + "referencedDeclaration": 13091, + "src": "2839:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 282, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2839:72:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 283, + "nodeType": "ExpressionStatement", + "src": "2839:72:0" + }, + { + "assignments": [ + 285 + ], + "declarations": [ + { + "constant": false, + "id": 285, + "name": "txRange", + "nodeType": "VariableDeclaration", + "scope": 343, + "src": "2922:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 284, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "2922:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 295, + "initialValue": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 294, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "components": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 290, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 286, + "name": "block", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13078, + "src": "2938:5:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_block", + "typeString": "block" + } + }, + "id": 287, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "number", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2938:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 288, + "name": "getStartBlock", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 598, + 611 + ], + "referencedDeclaration": 598, + "src": "2953:13:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 289, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2953:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "2938:30:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 291, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "2937:32:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "/", + "rightExpression": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 292, + "name": "getRangeSize", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 621, + 644 + ], + "referencedDeclaration": 621, + "src": "2972:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 293, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2972:14:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "2937:49:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "2922:64:0" + }, + { + "condition": { + "argumentTypes": null, + "id": 305, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "3000:55:0", + "subExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 296, + "name": "usedRange", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 88, + "src": "3001:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", + "typeString": "mapping(bytes32 => bool)" + } + }, + "id": 304, + "indexExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 300, + "name": "txRange", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 285, + "src": "3038:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 301, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "3047:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "id": 298, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13075, + "src": "3021:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 299, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3021:16:0", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 302, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3021:32:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 297, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13082, + "src": "3011:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 303, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3011:43:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3001:54:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 325, + "nodeType": "IfStatement", + "src": "2996:182:0", + "trueBody": { + "id": 324, + "nodeType": "Block", + "src": "3057:121:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 316, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 306, + "name": "usedRange", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 88, + "src": "3071:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", + "typeString": "mapping(bytes32 => bool)" + } + }, + "id": 314, + "indexExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 310, + "name": "txRange", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 285, + "src": "3108:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 311, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "3117:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "id": 308, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13075, + "src": "3091:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 309, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3091:16:0", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 312, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3091:32:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 307, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13082, + "src": "3081:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 313, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3081:43:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "3071:54:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "74727565", + "id": 315, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3128:4:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + "src": "3071:61:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 317, + "nodeType": "ExpressionStatement", + "src": "3071:61:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 322, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "3146:21:0", + "subExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 318, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "3146:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 320, + "indexExpression": { + "argumentTypes": null, + "id": 319, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "3153:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3146:13:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 321, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "nonce", + "nodeType": "MemberAccess", + "referencedDeclaration": 43, + "src": "3146:19:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 323, + "nodeType": "ExpressionStatement", + "src": "3146:21:0" + } + ] + } + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 329, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13088, + "src": "3215:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 330, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3215:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 332, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13104, + "src": "3235:4:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_Bridge_$1340", + "typeString": "contract Bridge" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_Bridge_$1340", + "typeString": "contract Bridge" + } + ], + "id": 331, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "3227:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 333, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3227:13:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 334, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 263, + "src": "3242:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "id": 326, + "name": "tokenContract", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 184, + "src": "3188:13:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IERC20_$10032", + "typeString": "contract IERC20" + } + }, + "id": 328, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "transferFrom", + "nodeType": "MemberAccess", + "referencedDeclaration": 10015, + "src": "3188:26:0", + "typeDescriptions": { + "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$_t_bool_$", + "typeString": "function (address,address,uint256) external returns (bool)" + } + }, + "id": 335, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3188:60:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 336, + "nodeType": "ExpressionStatement", + "src": "3188:60:0" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 338, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 263, + "src": "3279:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 339, + "name": "getNonce", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 654, + 667 + ], + "referencedDeclaration": 654, + "src": "3286:8:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 340, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3286:10:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 337, + "name": "ExchangeRequest", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8, + "src": "3263:15:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$returns$__$", + "typeString": "function (uint256,uint256)" + } + }, + "id": 341, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3263:34:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 342, + "nodeType": "EmitStatement", + "src": "3258:39:0" + } + ] + }, + "documentation": null, + "id": 344, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 266, + "modifierName": { + "argumentTypes": null, + "id": 265, + "name": "ready", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 196, + "src": "2823:5:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "2823:5:0" + } + ], + "name": "exchange", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 264, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 263, + "name": "value", + "nodeType": "VariableDeclaration", + "scope": 344, + "src": "2804:10:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 262, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "2804:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "2803:12:0" + }, + "returnParameters": { + "id": 267, + "nodeType": "ParameterList", + "parameters": [], + "src": "2829:0:0" + }, + "scope": 1340, + "src": "2786:518:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 373, + "nodeType": "Block", + "src": "3404:119:0", + "statements": [ + { + "condition": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 358, + "name": "Vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 64, + "src": "3426:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", + "typeString": "type(enum Bridge.Vote)" + } + }, + "id": 359, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "TRANSFER", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3426:13:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + { + "argumentTypes": null, + "id": 360, + "name": "hash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 346, + "src": "3441:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "argumentTypes": null, + "id": 361, + "name": "to", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 348, + "src": "3447:2:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 362, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 350, + "src": "3451:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 357, + "name": "tryVote", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 1084, + 1109, + 1134, + 1164 + ], + "referencedDeclaration": 1164, + "src": "3418:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$_t_bytes32_$_t_address_$_t_uint256_$returns$_t_bool_$", + "typeString": "function (enum Bridge.Vote,bytes32,address,uint256) returns (bool)" + } + }, + "id": 363, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3418:39:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 372, + "nodeType": "IfStatement", + "src": "3414:103:0", + "trueBody": { + "id": 371, + "nodeType": "Block", + "src": "3459:58:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 367, + "name": "to", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 348, + "src": "3496:2:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 368, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 350, + "src": "3500:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "id": 364, + "name": "tokenContract", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 184, + "src": "3473:13:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IERC20_$10032", + "typeString": "contract IERC20" + } + }, + "id": 366, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "transfer", + "nodeType": "MemberAccess", + "referencedDeclaration": 9986, + "src": "3473:22:0", + "typeDescriptions": { + "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$_t_bool_$", + "typeString": "function (address,uint256) external returns (bool)" + } + }, + "id": 369, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3473:33:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 370, + "nodeType": "ExpressionStatement", + "src": "3473:33:0" + } + ] + } + } + ] + }, + "documentation": null, + "id": 374, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 353, + "modifierName": { + "argumentTypes": null, + "id": 352, + "name": "readyOrVoting", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 213, + "src": "3373:13:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "3373:13:0" + }, + { + "arguments": null, + "id": 355, + "modifierName": { + "argumentTypes": null, + "id": 354, + "name": "currentValidator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 261, + "src": "3387:16:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "3387:16:0" + } + ], + "name": "transfer", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 351, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 346, + "name": "hash", + "nodeType": "VariableDeclaration", + "scope": 374, + "src": "3328:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 345, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "3328:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 348, + "name": "to", + "nodeType": "VariableDeclaration", + "scope": 374, + "src": "3342:10:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 347, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3342:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 350, + "name": "value", + "nodeType": "VariableDeclaration", + "scope": 374, + "src": "3354:10:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 349, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "3354:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "3327:38:0" + }, + "returnParameters": { + "id": 356, + "nodeType": "ParameterList", + "parameters": [], + "src": "3404:0:0" + }, + "scope": 1340, + "src": "3310:213:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 464, + "nodeType": "Block", + "src": "3582:638:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 389, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 385, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13088, + "src": "3615:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 386, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3615:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + ], + "id": 384, + "name": "getNextPartyId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 768, + "src": "3600:14:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_uint256_$", + "typeString": "function (address) view returns (uint256)" + } + }, + "id": 387, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3600:26:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 388, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3630:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "3600:31:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4e6f742061206e6578742076616c696461746f72", + "id": 390, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3633:22:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_44981c92ce908443b2fa5f878c54791e1a0c95d4cc04ea4f4d9224b3ec030922", + "typeString": "literal_string \"Not a next validator\"" + }, + "value": "Not a next validator" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_44981c92ce908443b2fa5f878c54791e1a0c95d4cc04ea4f4d9224b3ec030922", + "typeString": "literal_string \"Not a next validator\"" + } + ], + "id": 383, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 13091, + 13092 + ], + "referencedDeclaration": 13092, + "src": "3592:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 391, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3592:64:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 392, + "nodeType": "ExpressionStatement", + "src": "3592:64:0" + }, + { + "condition": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 394, + "name": "Vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 64, + "src": "3682:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", + "typeString": "type(enum Bridge.Vote)" + } + }, + "id": 395, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "CONFIRM_KEYGEN", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3682:19:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + { + "argumentTypes": null, + "id": 396, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 376, + "src": "3703:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 397, + "name": "y", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 378, + "src": "3706:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 393, + "name": "tryConfirm", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 1186, + 1214 + ], + "referencedDeclaration": 1214, + "src": "3671:10:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$_t_uint256_$_t_uint256_$returns$_t_bool_$", + "typeString": "function (enum Bridge.Vote,uint256,uint256) returns (bool)" + } + }, + "id": 398, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3671:37:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 463, + "nodeType": "IfStatement", + "src": "3667:547:0", + "trueBody": { + "id": 462, + "nodeType": "Block", + "src": "3710:504:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 404, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 399, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "3724:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 401, + "indexExpression": { + "argumentTypes": null, + "id": 400, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "3731:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3724:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 402, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "x", + "nodeType": "MemberAccess", + "referencedDeclaration": 45, + "src": "3724:19:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 403, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 376, + "src": "3746:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "3724:23:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 405, + "nodeType": "ExpressionStatement", + "src": "3724:23:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 411, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 406, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "3761:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 408, + "indexExpression": { + "argumentTypes": null, + "id": 407, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "3768:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3761:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 409, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "y", + "nodeType": "MemberAccess", + "referencedDeclaration": 47, + "src": "3761:19:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 410, + "name": "y", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 378, + "src": "3783:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "3761:23:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 412, + "nodeType": "ExpressionStatement", + "src": "3761:23:0" + }, + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 415, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 413, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "3802:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 414, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3815:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "3802:14:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "id": 460, + "nodeType": "Block", + "src": "4084:120:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 453, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 450, + "name": "status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 90, + "src": "4102:6:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 451, + "name": "Status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "4111:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Status_$53_$", + "typeString": "type(enum Bridge.Status)" + } + }, + "id": 452, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "FUNDS_TRANSFER", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "4111:21:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "src": "4102:30:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "id": 454, + "nodeType": "ExpressionStatement", + "src": "4102:30:0" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 456, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "4172:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 457, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "4179:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 455, + "name": "NewFundsTransfer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 24, + "src": "4155:16:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$returns$__$", + "typeString": "function (uint256,uint256)" + } + }, + "id": 458, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4155:34:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 459, + "nodeType": "EmitStatement", + "src": "4150:39:0" + } + ] + }, + "id": 461, + "nodeType": "IfStatement", + "src": "3798:406:0", + "trueBody": { + "id": 449, + "nodeType": "Block", + "src": "3818:248:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 419, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 416, + "name": "status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 90, + "src": "3836:6:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 417, + "name": "Status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "3845:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Status_$53_$", + "typeString": "type(enum Bridge.Status)" + } + }, + "id": 418, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "READY", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3845:12:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "src": "3836:21:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "id": 420, + "nodeType": "ExpressionStatement", + "src": "3836:21:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 427, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 421, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "3875:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 423, + "indexExpression": { + "argumentTypes": null, + "id": 422, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "3882:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3875:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 424, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "startBlock", + "nodeType": "MemberAccess", + "referencedDeclaration": 41, + "src": "3875:28:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 425, + "name": "block", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13078, + "src": "3906:5:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_block", + "typeString": "block" + } + }, + "id": 426, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "number", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3906:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "3875:43:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 428, + "nodeType": "ExpressionStatement", + "src": "3875:43:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 437, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 429, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "3936:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 431, + "indexExpression": { + "argumentTypes": null, + "id": 430, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "3943:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3936:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 432, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "nonce", + "nodeType": "MemberAccess", + "referencedDeclaration": 43, + "src": "3936:23:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 435, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "-", + "prefix": true, + "src": "3967:2:0", + "subExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 434, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3968:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "typeDescriptions": { + "typeIdentifier": "t_rational_minus_1_by_1", + "typeString": "int_const -1" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_minus_1_by_1", + "typeString": "int_const -1" + } + ], + "id": 433, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "3962:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": "uint" + }, + "id": 436, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3962:8:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "3936:34:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 438, + "nodeType": "ExpressionStatement", + "src": "3936:34:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 441, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 439, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "3988:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 440, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "3996:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "3988:17:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 442, + "nodeType": "ExpressionStatement", + "src": "3988:17:0" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 444, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "4039:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 445, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 376, + "src": "4046:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 446, + "name": "y", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 378, + "src": "4049:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 443, + "name": "EpochStart", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 32, + "src": "4028:10:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$_t_uint256_$returns$__$", + "typeString": "function (uint256,uint256,uint256)" + } + }, + "id": 447, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4028:23:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 448, + "nodeType": "EmitStatement", + "src": "4023:28:0" + } + ] + } + } + ] + } + } + ] + }, + "documentation": null, + "id": 465, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 381, + "modifierName": { + "argumentTypes": null, + "id": 380, + "name": "keygen", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 237, + "src": "3575:6:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "3575:6:0" + } + ], + "name": "confirmKeygen", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 379, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 376, + "name": "x", + "nodeType": "VariableDeclaration", + "scope": 465, + "src": "3552:6:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 375, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "3552:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 378, + "name": "y", + "nodeType": "VariableDeclaration", + "scope": 465, + "src": "3560:6:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 377, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "3560:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "3551:16:0" + }, + "returnParameters": { + "id": 382, + "nodeType": "ParameterList", + "parameters": [], + "src": "3582:0:0" + }, + "scope": 1340, + "src": "3529:691:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 520, + "nodeType": "Block", + "src": "4296:368:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 475, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 473, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "4314:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 474, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4322:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "4314:9:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "46697273742065706f636820646f6573206e6f74206e6565642066756e6473207472616e73666572", + "id": 476, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4325:42:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_8ddae2cc9da30ed8c59c39c6a950ef823ea484ac89ff6f37abb0317fb5f679a1", + "typeString": "literal_string \"First epoch does not need funds transfer\"" + }, + "value": "First epoch does not need funds transfer" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_8ddae2cc9da30ed8c59c39c6a950ef823ea484ac89ff6f37abb0317fb5f679a1", + "typeString": "literal_string \"First epoch does not need funds transfer\"" + } + ], + "id": 472, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 13091, + 13092 + ], + "referencedDeclaration": 13092, + "src": "4306:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 477, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4306:62:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 478, + "nodeType": "ExpressionStatement", + "src": "4306:62:0" + }, + { + "condition": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 480, + "name": "Vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 64, + "src": "4394:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", + "typeString": "type(enum Bridge.Vote)" + } + }, + "id": 481, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "CONFIRM_FUNDS_TRANSFER", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "4394:27:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + ], + "id": 479, + "name": "tryConfirm", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 1186, + 1214 + ], + "referencedDeclaration": 1186, + "src": "4383:10:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$returns$_t_bool_$", + "typeString": "function (enum Bridge.Vote) returns (bool)" + } + }, + "id": 482, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4383:39:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 519, + "nodeType": "IfStatement", + "src": "4379:279:0", + "trueBody": { + "id": 518, + "nodeType": "Block", + "src": "4424:234:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 486, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 483, + "name": "status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 90, + "src": "4438:6:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 484, + "name": "Status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "4447:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Status_$53_$", + "typeString": "type(enum Bridge.Status)" + } + }, + "id": 485, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "READY", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "4447:12:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "src": "4438:21:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "id": 487, + "nodeType": "ExpressionStatement", + "src": "4438:21:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 494, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 488, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "4473:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 490, + "indexExpression": { + "argumentTypes": null, + "id": 489, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "4480:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "4473:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 491, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "startBlock", + "nodeType": "MemberAccess", + "referencedDeclaration": 41, + "src": "4473:28:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 492, + "name": "block", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13078, + "src": "4504:5:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_block", + "typeString": "block" + } + }, + "id": 493, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "number", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "4504:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "4473:43:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 495, + "nodeType": "ExpressionStatement", + "src": "4473:43:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 504, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 496, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "4530:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 498, + "indexExpression": { + "argumentTypes": null, + "id": 497, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "4537:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "4530:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 499, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "nonce", + "nodeType": "MemberAccess", + "referencedDeclaration": 43, + "src": "4530:23:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 502, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "-", + "prefix": true, + "src": "4561:2:0", + "subExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 501, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4562:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "typeDescriptions": { + "typeIdentifier": "t_rational_minus_1_by_1", + "typeString": "int_const -1" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_minus_1_by_1", + "typeString": "int_const -1" + } + ], + "id": 500, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "4556:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": "uint" + }, + "id": 503, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4556:8:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "4530:34:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 505, + "nodeType": "ExpressionStatement", + "src": "4530:34:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 508, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 506, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "4578:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 507, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "4586:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "4578:17:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 509, + "nodeType": "ExpressionStatement", + "src": "4578:17:0" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 511, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "4625:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 512, + "name": "getX", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 678, + "src": "4632:4:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 513, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4632:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 514, + "name": "getY", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 689, + "src": "4640:4:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 515, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4640:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 510, + "name": "EpochStart", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 32, + "src": "4614:10:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$_t_uint256_$returns$__$", + "typeString": "function (uint256,uint256,uint256)" + } + }, + "id": 516, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4614:33:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 517, + "nodeType": "EmitStatement", + "src": "4609:38:0" + } + ] + } + } + ] + }, + "documentation": null, + "id": 521, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 468, + "modifierName": { + "argumentTypes": null, + "id": 467, + "name": "fundsTransfer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 249, + "src": "4265:13:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "4265:13:0" + }, + { + "arguments": null, + "id": 470, + "modifierName": { + "argumentTypes": null, + "id": 469, + "name": "currentValidator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 261, + "src": "4279:16:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "4279:16:0" + } + ], + "name": "confirmFundsTransfer", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 466, + "nodeType": "ParameterList", + "parameters": [], + "src": "4255:2:0" + }, + "returnParameters": { + "id": 471, + "nodeType": "ParameterList", + "parameters": [], + "src": "4296:0:0" + }, + "scope": 1340, + "src": "4226:438:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 530, + "nodeType": "Block", + "src": "4719:41:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 527, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "4747:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 526, + "name": "getParties", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 531, + 555 + ], + "referencedDeclaration": 555, + "src": "4736:10:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256) view returns (uint256)" + } + }, + "id": 528, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4736:17:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 525, + "id": 529, + "nodeType": "Return", + "src": "4729:24:0" + } + ] + }, + "documentation": null, + "id": 531, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getParties", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 522, + "nodeType": "ParameterList", + "parameters": [], + "src": "4689:2:0" + }, + "returnParameters": { + "id": 525, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 524, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 531, + "src": "4713:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 523, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "4713:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "4712:6:0" + }, + "scope": 1340, + "src": "4670:90:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 540, + "nodeType": "Block", + "src": "4819:45:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 537, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "4847:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 536, + "name": "getParties", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 531, + 555 + ], + "referencedDeclaration": 555, + "src": "4836:10:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256) view returns (uint256)" + } + }, + "id": 538, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4836:21:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 535, + "id": 539, + "nodeType": "Return", + "src": "4829:28:0" + } + ] + }, + "documentation": null, + "id": 541, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getNextParties", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 532, + "nodeType": "ParameterList", + "parameters": [], + "src": "4789:2:0" + }, + "returnParameters": { + "id": 535, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 534, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 541, + "src": "4813:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 533, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "4813:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "4812:6:0" + }, + "scope": 1340, + "src": "4766:98:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 554, + "nodeType": "Block", + "src": "4930:56:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 548, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "4947:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 550, + "indexExpression": { + "argumentTypes": null, + "id": 549, + "name": "_epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 543, + "src": "4954:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "4947:14:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 551, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "validators", + "nodeType": "MemberAccess", + "referencedDeclaration": 35, + "src": "4947:25:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 552, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "4947:32:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 547, + "id": 553, + "nodeType": "Return", + "src": "4940:39:0" + } + ] + }, + "documentation": null, + "id": 555, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getParties", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 544, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 543, + "name": "_epoch", + "nodeType": "VariableDeclaration", + "scope": 555, + "src": "4890:11:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 542, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "4890:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "4889:13:0" + }, + "returnParameters": { + "id": 547, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 546, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 555, + "src": "4924:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 545, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "4924:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "4923:6:0" + }, + "scope": 1340, + "src": "4870:116:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 564, + "nodeType": "Block", + "src": "5043:43:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 561, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "5073:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 560, + "name": "getThreshold", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 565, + 588 + ], + "referencedDeclaration": 588, + "src": "5060:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256) view returns (uint256)" + } + }, + "id": 562, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5060:19:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 559, + "id": 563, + "nodeType": "Return", + "src": "5053:26:0" + } + ] + }, + "documentation": null, + "id": 565, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getThreshold", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 556, + "nodeType": "ParameterList", + "parameters": [], + "src": "5013:2:0" + }, + "returnParameters": { + "id": 559, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 558, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 565, + "src": "5037:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 557, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5037:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5036:6:0" + }, + "scope": 1340, + "src": "4992:94:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 574, + "nodeType": "Block", + "src": "5147:47:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 571, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "5177:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 570, + "name": "getThreshold", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 565, + 588 + ], + "referencedDeclaration": 588, + "src": "5164:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256) view returns (uint256)" + } + }, + "id": 572, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5164:23:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 569, + "id": 573, + "nodeType": "Return", + "src": "5157:30:0" + } + ] + }, + "documentation": null, + "id": 575, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getNextThreshold", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 566, + "nodeType": "ParameterList", + "parameters": [], + "src": "5117:2:0" + }, + "returnParameters": { + "id": 569, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 568, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 575, + "src": "5141:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 567, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5141:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5140:6:0" + }, + "scope": 1340, + "src": "5092:102:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 587, + "nodeType": "Block", + "src": "5262:48:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 582, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "5279:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 584, + "indexExpression": { + "argumentTypes": null, + "id": 583, + "name": "_epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 577, + "src": "5286:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "5279:14:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 585, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "threshold", + "nodeType": "MemberAccess", + "referencedDeclaration": 37, + "src": "5279:24:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 581, + "id": 586, + "nodeType": "Return", + "src": "5272:31:0" + } + ] + }, + "documentation": null, + "id": 588, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getThreshold", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 578, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 577, + "name": "_epoch", + "nodeType": "VariableDeclaration", + "scope": 588, + "src": "5222:11:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 576, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5222:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5221:13:0" + }, + "returnParameters": { + "id": 581, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 580, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 588, + "src": "5256:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 579, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5256:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5255:6:0" + }, + "scope": 1340, + "src": "5200:110:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 597, + "nodeType": "Block", + "src": "5368:44:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 594, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "5399:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 593, + "name": "getStartBlock", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 598, + 611 + ], + "referencedDeclaration": 611, + "src": "5385:13:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256) view returns (uint256)" + } + }, + "id": 595, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5385:20:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 592, + "id": 596, + "nodeType": "Return", + "src": "5378:27:0" + } + ] + }, + "documentation": null, + "id": 598, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getStartBlock", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 589, + "nodeType": "ParameterList", + "parameters": [], + "src": "5338:2:0" + }, + "returnParameters": { + "id": 592, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 591, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 598, + "src": "5362:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 590, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5362:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5361:6:0" + }, + "scope": 1340, + "src": "5316:96:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 610, + "nodeType": "Block", + "src": "5481:49:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 605, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "5498:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 607, + "indexExpression": { + "argumentTypes": null, + "id": 606, + "name": "_epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 600, + "src": "5505:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "5498:14:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 608, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "startBlock", + "nodeType": "MemberAccess", + "referencedDeclaration": 41, + "src": "5498:25:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 604, + "id": 609, + "nodeType": "Return", + "src": "5491:32:0" + } + ] + }, + "documentation": null, + "id": 611, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getStartBlock", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 601, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 600, + "name": "_epoch", + "nodeType": "VariableDeclaration", + "scope": 611, + "src": "5441:11:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 599, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5441:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5440:13:0" + }, + "returnParameters": { + "id": 604, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 603, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 611, + "src": "5475:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 602, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5475:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5474:6:0" + }, + "scope": 1340, + "src": "5418:112:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 620, + "nodeType": "Block", + "src": "5587:43:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 617, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "5617:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 616, + "name": "getRangeSize", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 621, + 644 + ], + "referencedDeclaration": 644, + "src": "5604:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256) view returns (uint256)" + } + }, + "id": 618, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5604:19:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 615, + "id": 619, + "nodeType": "Return", + "src": "5597:26:0" + } + ] + }, + "documentation": null, + "id": 621, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getRangeSize", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 612, + "nodeType": "ParameterList", + "parameters": [], + "src": "5557:2:0" + }, + "returnParameters": { + "id": 615, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 614, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 621, + "src": "5581:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 613, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5581:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5580:6:0" + }, + "scope": 1340, + "src": "5536:94:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 630, + "nodeType": "Block", + "src": "5691:47:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 627, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "5721:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 626, + "name": "getRangeSize", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 621, + 644 + ], + "referencedDeclaration": 644, + "src": "5708:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256) view returns (uint256)" + } + }, + "id": 628, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5708:23:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 625, + "id": 629, + "nodeType": "Return", + "src": "5701:30:0" + } + ] + }, + "documentation": null, + "id": 631, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getNextRangeSize", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 622, + "nodeType": "ParameterList", + "parameters": [], + "src": "5661:2:0" + }, + "returnParameters": { + "id": 625, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 624, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 631, + "src": "5685:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 623, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5685:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5684:6:0" + }, + "scope": 1340, + "src": "5636:102:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 643, + "nodeType": "Block", + "src": "5806:48:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 638, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "5823:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 640, + "indexExpression": { + "argumentTypes": null, + "id": 639, + "name": "_epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 633, + "src": "5830:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "5823:14:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 641, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "rangeSize", + "nodeType": "MemberAccess", + "referencedDeclaration": 39, + "src": "5823:24:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 637, + "id": 642, + "nodeType": "Return", + "src": "5816:31:0" + } + ] + }, + "documentation": null, + "id": 644, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getRangeSize", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 634, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 633, + "name": "_epoch", + "nodeType": "VariableDeclaration", + "scope": 644, + "src": "5766:11:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 632, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5766:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5765:13:0" + }, + "returnParameters": { + "id": 637, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 636, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 644, + "src": "5800:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 635, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5800:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5799:6:0" + }, + "scope": 1340, + "src": "5744:110:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 653, + "nodeType": "Block", + "src": "5907:39:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 650, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "5933:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 649, + "name": "getNonce", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 654, + 667 + ], + "referencedDeclaration": 667, + "src": "5924:8:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256) view returns (uint256)" + } + }, + "id": 651, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5924:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 648, + "id": 652, + "nodeType": "Return", + "src": "5917:22:0" + } + ] + }, + "documentation": null, + "id": 654, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getNonce", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 645, + "nodeType": "ParameterList", + "parameters": [], + "src": "5877:2:0" + }, + "returnParameters": { + "id": 648, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 647, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 654, + "src": "5901:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 646, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5901:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5900:6:0" + }, + "scope": 1340, + "src": "5860:86:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 666, + "nodeType": "Block", + "src": "6010:44:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 661, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "6027:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 663, + "indexExpression": { + "argumentTypes": null, + "id": 662, + "name": "_epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 656, + "src": "6034:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "6027:14:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 664, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "nonce", + "nodeType": "MemberAccess", + "referencedDeclaration": 43, + "src": "6027:20:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 660, + "id": 665, + "nodeType": "Return", + "src": "6020:27:0" + } + ] + }, + "documentation": null, + "id": 667, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getNonce", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 657, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 656, + "name": "_epoch", + "nodeType": "VariableDeclaration", + "scope": 667, + "src": "5970:11:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 655, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5970:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5969:13:0" + }, + "returnParameters": { + "id": 660, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 659, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 667, + "src": "6004:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 658, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "6004:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "6003:6:0" + }, + "scope": 1340, + "src": "5952:102:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 677, + "nodeType": "Block", + "src": "6103:39:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 672, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "6120:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 674, + "indexExpression": { + "argumentTypes": null, + "id": 673, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "6127:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "6120:13:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 675, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "x", + "nodeType": "MemberAccess", + "referencedDeclaration": 45, + "src": "6120:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 671, + "id": 676, + "nodeType": "Return", + "src": "6113:22:0" + } + ] + }, + "documentation": null, + "id": 678, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getX", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 668, + "nodeType": "ParameterList", + "parameters": [], + "src": "6073:2:0" + }, + "returnParameters": { + "id": 671, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 670, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 678, + "src": "6097:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 669, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "6097:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "6096:6:0" + }, + "scope": 1340, + "src": "6060:82:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 688, + "nodeType": "Block", + "src": "6191:39:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 683, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "6208:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 685, + "indexExpression": { + "argumentTypes": null, + "id": 684, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "6215:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "6208:13:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 686, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "y", + "nodeType": "MemberAccess", + "referencedDeclaration": 47, + "src": "6208:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 682, + "id": 687, + "nodeType": "Return", + "src": "6201:22:0" + } + ] + }, + "documentation": null, + "id": 689, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getY", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 679, + "nodeType": "ParameterList", + "parameters": [], + "src": "6161:2:0" + }, + "returnParameters": { + "id": 682, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 681, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 689, + "src": "6185:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 680, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "6185:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "6184:6:0" + }, + "scope": 1340, + "src": "6148:82:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 727, + "nodeType": "Block", + "src": "6285:215:0", + "statements": [ + { + "assignments": [ + 697 + ], + "declarations": [ + { + "constant": false, + "id": 697, + "name": "validators", + "nodeType": "VariableDeclaration", + "scope": 727, + "src": "6295:27:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[]" + }, + "typeName": { + "baseType": { + "id": 695, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6295:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 696, + "length": null, + "nodeType": "ArrayTypeName", + "src": "6295:9:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 700, + "initialValue": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 698, + "name": "getValidators", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 780, + "src": "6325:13:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_array$_t_address_$dyn_memory_ptr_$", + "typeString": "function () view returns (address[] memory)" + } + }, + "id": 699, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6325:15:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "6295:45:0" + }, + { + "body": { + "id": 723, + "nodeType": "Block", + "src": "6390:86:0", + "statements": [ + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 717, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 712, + "name": "validators", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 697, + "src": "6408:10:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "id": 714, + "indexExpression": { + "argumentTypes": null, + "id": 713, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 702, + "src": "6419:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "6408:13:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 715, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13088, + "src": "6425:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 716, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "6425:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "src": "6408:27:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 722, + "nodeType": "IfStatement", + "src": "6404:61:0", + "trueBody": { + "expression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 720, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 718, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 702, + "src": "6460:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 719, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6464:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "6460:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 693, + "id": 721, + "nodeType": "Return", + "src": "6453:12:0" + } + } + ] + }, + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 708, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 705, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 702, + "src": "6367:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 706, + "name": "getParties", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 531, + 555 + ], + "referencedDeclaration": 531, + "src": "6371:10:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 707, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6371:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "6367:16:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 724, + "initializationExpression": { + "assignments": [ + 702 + ], + "declarations": [ + { + "constant": false, + "id": 702, + "name": "i", + "nodeType": "VariableDeclaration", + "scope": 724, + "src": "6355:6:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 701, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "6355:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 704, + "initialValue": { + "argumentTypes": null, + "hexValue": "30", + "id": 703, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6364:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "nodeType": "VariableDeclarationStatement", + "src": "6355:10:0" + }, + "loopExpression": { + "expression": { + "argumentTypes": null, + "id": 710, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "6385:3:0", + "subExpression": { + "argumentTypes": null, + "id": 709, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 702, + "src": "6385:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 711, + "nodeType": "ExpressionStatement", + "src": "6385:3:0" + }, + "nodeType": "ForStatement", + "src": "6350:126:0" + }, + { + "expression": { + "argumentTypes": null, + "hexValue": "30", + "id": 725, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6492:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "functionReturnParameters": 693, + "id": 726, + "nodeType": "Return", + "src": "6485:8:0" + } + ] + }, + "documentation": null, + "id": 728, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getPartyId", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 690, + "nodeType": "ParameterList", + "parameters": [], + "src": "6255:2:0" + }, + "returnParameters": { + "id": 693, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 692, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 728, + "src": "6279:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 691, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "6279:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "6278:6:0" + }, + "scope": 1340, + "src": "6236:264:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 767, + "nodeType": "Block", + "src": "6568:214:0", + "statements": [ + { + "assignments": [ + 738 + ], + "declarations": [ + { + "constant": false, + "id": 738, + "name": "validators", + "nodeType": "VariableDeclaration", + "scope": 767, + "src": "6578:27:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[]" + }, + "typeName": { + "baseType": { + "id": 736, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6578:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 737, + "length": null, + "nodeType": "ArrayTypeName", + "src": "6578:9:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 741, + "initialValue": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 739, + "name": "getNextValidators", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 792, + "src": "6608:17:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_array$_t_address_$dyn_memory_ptr_$", + "typeString": "function () view returns (address[] memory)" + } + }, + "id": 740, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6608:19:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "6578:49:0" + }, + { + "body": { + "id": 763, + "nodeType": "Block", + "src": "6681:77:0", + "statements": [ + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 757, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 753, + "name": "validators", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 738, + "src": "6699:10:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "id": 755, + "indexExpression": { + "argumentTypes": null, + "id": 754, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 743, + "src": "6710:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "6699:13:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 756, + "name": "a", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 730, + "src": "6716:1:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "6699:18:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 762, + "nodeType": "IfStatement", + "src": "6695:52:0", + "trueBody": { + "expression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 760, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 758, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 743, + "src": "6742:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 759, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6746:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "6742:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 734, + "id": 761, + "nodeType": "Return", + "src": "6735:12:0" + } + } + ] + }, + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 749, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 746, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 743, + "src": "6654:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 747, + "name": "getNextParties", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 541, + "src": "6658:14:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 748, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6658:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "6654:20:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 764, + "initializationExpression": { + "assignments": [ + 743 + ], + "declarations": [ + { + "constant": false, + "id": 743, + "name": "i", + "nodeType": "VariableDeclaration", + "scope": 764, + "src": "6642:6:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 742, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "6642:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 745, + "initialValue": { + "argumentTypes": null, + "hexValue": "30", + "id": 744, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6651:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "nodeType": "VariableDeclarationStatement", + "src": "6642:10:0" + }, + "loopExpression": { + "expression": { + "argumentTypes": null, + "id": 751, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "6676:3:0", + "subExpression": { + "argumentTypes": null, + "id": 750, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 743, + "src": "6676:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 752, + "nodeType": "ExpressionStatement", + "src": "6676:3:0" + }, + "nodeType": "ForStatement", + "src": "6637:121:0" + }, + { + "expression": { + "argumentTypes": null, + "hexValue": "30", + "id": 765, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6774:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "functionReturnParameters": 734, + "id": 766, + "nodeType": "Return", + "src": "6767:8:0" + } + ] + }, + "documentation": null, + "id": 768, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getNextPartyId", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 731, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 730, + "name": "a", + "nodeType": "VariableDeclaration", + "scope": 768, + "src": "6530:9:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 729, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6530:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "6529:11:0" + }, + "returnParameters": { + "id": 734, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 733, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 768, + "src": "6562:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 732, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "6562:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "6561:6:0" + }, + "scope": 1340, + "src": "6506:276:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 779, + "nodeType": "Block", + "src": "6852:48:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 774, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "6869:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 776, + "indexExpression": { + "argumentTypes": null, + "id": 775, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "6876:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "6869:13:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 777, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "validators", + "nodeType": "MemberAccess", + "referencedDeclaration": 35, + "src": "6869:24:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "functionReturnParameters": 773, + "id": 778, + "nodeType": "Return", + "src": "6862:31:0" + } + ] + }, + "documentation": null, + "id": 780, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getValidators", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 769, + "nodeType": "ParameterList", + "parameters": [], + "src": "6810:2:0" + }, + "returnParameters": { + "id": 773, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 772, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 780, + "src": "6834:16:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[]" + }, + "typeName": { + "baseType": { + "id": 770, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6834:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 771, + "length": null, + "nodeType": "ArrayTypeName", + "src": "6834:9:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "6833:18:0" + }, + "scope": 1340, + "src": "6788:112:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 791, + "nodeType": "Block", + "src": "6974:52:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 786, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "6991:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 788, + "indexExpression": { + "argumentTypes": null, + "id": 787, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "6998:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "6991:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 789, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "validators", + "nodeType": "MemberAccess", + "referencedDeclaration": 35, + "src": "6991:28:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "functionReturnParameters": 785, + "id": 790, + "nodeType": "Return", + "src": "6984:35:0" + } + ] + }, + "documentation": null, + "id": 792, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getNextValidators", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 781, + "nodeType": "ParameterList", + "parameters": [], + "src": "6932:2:0" + }, + "returnParameters": { + "id": 785, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 784, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 792, + "src": "6956:16:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[]" + }, + "typeName": { + "baseType": { + "id": 782, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6956:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 783, + "length": null, + "nodeType": "ArrayTypeName", + "src": "6956:9:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "6955:18:0" + }, + "scope": 1340, + "src": "6906:120:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 837, + "nodeType": "Block", + "src": "7093:296:0", + "statements": [ + { + "condition": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 800, + "name": "Vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 64, + "src": "7115:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", + "typeString": "type(enum Bridge.Vote)" + } + }, + "id": 801, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "START_VOTING", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "7115:17:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + ], + "id": 799, + "name": "tryVote", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 1084, + 1109, + 1134, + 1164 + ], + "referencedDeclaration": 1084, + "src": "7107:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$returns$_t_bool_$", + "typeString": "function (enum Bridge.Vote) returns (bool)" + } + }, + "id": 802, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7107:26:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 836, + "nodeType": "IfStatement", + "src": "7103:280:0", + "trueBody": { + "id": 835, + "nodeType": "Block", + "src": "7135:248:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 804, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "7149:11:0", + "subExpression": { + "argumentTypes": null, + "id": 803, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "7149:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 805, + "nodeType": "ExpressionStatement", + "src": "7149:11:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 809, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 806, + "name": "status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 90, + "src": "7174:6:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 807, + "name": "Status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "7183:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Status_$53_$", + "typeString": "type(enum Bridge.Status)" + } + }, + "id": 808, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "VOTING", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "7183:13:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "src": "7174:22:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "id": 810, + "nodeType": "ExpressionStatement", + "src": "7174:22:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 817, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 811, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "7210:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 813, + "indexExpression": { + "argumentTypes": null, + "id": 812, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "7217:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "7210:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 814, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "threshold", + "nodeType": "MemberAccess", + "referencedDeclaration": 37, + "src": "7210:27:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 815, + "name": "getThreshold", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 565, + 588 + ], + "referencedDeclaration": 565, + "src": "7240:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 816, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7240:14:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "7210:44:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 818, + "nodeType": "ExpressionStatement", + "src": "7210:44:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 825, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 819, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "7268:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 821, + "indexExpression": { + "argumentTypes": null, + "id": 820, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "7275:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "7268:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 822, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "validators", + "nodeType": "MemberAccess", + "referencedDeclaration": 35, + "src": "7268:28:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 823, + "name": "getValidators", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 780, + "src": "7299:13:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_array$_t_address_$dyn_memory_ptr_$", + "typeString": "function () view returns (address[] memory)" + } + }, + "id": 824, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7299:15:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "src": "7268:46:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 826, + "nodeType": "ExpressionStatement", + "src": "7268:46:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 833, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 827, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "7328:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 829, + "indexExpression": { + "argumentTypes": null, + "id": 828, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "7335:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "7328:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 830, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "rangeSize", + "nodeType": "MemberAccess", + "referencedDeclaration": 39, + "src": "7328:27:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 831, + "name": "getRangeSize", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 621, + 644 + ], + "referencedDeclaration": 621, + "src": "7358:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 832, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7358:14:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "7328:44:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 834, + "nodeType": "ExpressionStatement", + "src": "7328:44:0" + } + ] + } + } + ] + }, + "documentation": null, + "id": 838, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 795, + "modifierName": { + "argumentTypes": null, + "id": 794, + "name": "readyOrVoting", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 213, + "src": "7062:13:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "7062:13:0" + }, + { + "arguments": null, + "id": 797, + "modifierName": { + "argumentTypes": null, + "id": 796, + "name": "currentValidator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 261, + "src": "7076:16:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "7076:16:0" + } + ], + "name": "startVoting", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 793, + "nodeType": "ParameterList", + "parameters": [], + "src": "7052:2:0" + }, + "returnParameters": { + "id": 798, + "nodeType": "ParameterList", + "parameters": [], + "src": "7093:0:0" + }, + "scope": 1340, + "src": "7032:357:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 871, + "nodeType": "Block", + "src": "7471:202:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 852, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 849, + "name": "validator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 840, + "src": "7504:9:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 848, + "name": "getNextPartyId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 768, + "src": "7489:14:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_uint256_$", + "typeString": "function (address) view returns (uint256)" + } + }, + "id": 850, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7489:25:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 851, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7518:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "7489:30:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "416c726561647920612076616c696461746f72", + "id": 853, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7521:21:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_aeb0fe100da2796aa6136a3b1c66282f002b435141be331237dfa7127e6df6ff", + "typeString": "literal_string \"Already a validator\"" + }, + "value": "Already a validator" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_aeb0fe100da2796aa6136a3b1c66282f002b435141be331237dfa7127e6df6ff", + "typeString": "literal_string \"Already a validator\"" + } + ], + "id": 847, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 13091, + 13092 + ], + "referencedDeclaration": 13092, + "src": "7481:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 854, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7481:62:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 855, + "nodeType": "ExpressionStatement", + "src": "7481:62:0" + }, + { + "condition": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 857, + "name": "Vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 64, + "src": "7566:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", + "typeString": "type(enum Bridge.Vote)" + } + }, + "id": 858, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "ADD_VALIDATOR", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "7566:18:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + { + "argumentTypes": null, + "id": 859, + "name": "validator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 840, + "src": "7586:9:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 856, + "name": "tryVote", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 1084, + 1109, + 1134, + 1164 + ], + "referencedDeclaration": 1109, + "src": "7558:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$_t_address_$returns$_t_bool_$", + "typeString": "function (enum Bridge.Vote,address) returns (bool)" + } + }, + "id": 860, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7558:38:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 870, + "nodeType": "IfStatement", + "src": "7554:113:0", + "trueBody": { + "id": 869, + "nodeType": "Block", + "src": "7598:69:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 866, + "name": "validator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 840, + "src": "7646:9:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 861, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "7612:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 863, + "indexExpression": { + "argumentTypes": null, + "id": 862, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "7619:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "7612:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 864, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "validators", + "nodeType": "MemberAccess", + "referencedDeclaration": 35, + "src": "7612:28:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 865, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "push", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "7612:33:0", + "typeDescriptions": { + "typeIdentifier": "t_function_arraypush_nonpayable$_t_address_$returns$_t_uint256_$", + "typeString": "function (address) returns (uint256)" + } + }, + "id": 867, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7612:44:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 868, + "nodeType": "ExpressionStatement", + "src": "7612:44:0" + } + ] + } + } + ] + }, + "documentation": null, + "id": 872, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 843, + "modifierName": { + "argumentTypes": null, + "id": 842, + "name": "voting", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 225, + "src": "7447:6:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "7447:6:0" + }, + { + "arguments": null, + "id": 845, + "modifierName": { + "argumentTypes": null, + "id": 844, + "name": "currentValidator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 261, + "src": "7454:16:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "7454:16:0" + } + ], + "name": "voteAddValidator", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 841, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 840, + "name": "validator", + "nodeType": "VariableDeclaration", + "scope": 872, + "src": "7421:17:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 839, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7421:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "7420:19:0" + }, + "returnParameters": { + "id": 846, + "nodeType": "ParameterList", + "parameters": [], + "src": "7471:0:0" + }, + "scope": 1340, + "src": "7395:278:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 901, + "nodeType": "Block", + "src": "7758:192:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 886, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 883, + "name": "validator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 874, + "src": "7791:9:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 882, + "name": "getNextPartyId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 768, + "src": "7776:14:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_uint256_$", + "typeString": "function (address) view returns (uint256)" + } + }, + "id": 884, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7776:25:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 885, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7805:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "7776:30:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "416c7265616479206e6f7420612076616c696461746f72", + "id": 887, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7808:25:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_2332ed568e8af3d64f1f2b0b098c504cab97ba4128fb9f08cfa3f851ced05961", + "typeString": "literal_string \"Already not a validator\"" + }, + "value": "Already not a validator" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_2332ed568e8af3d64f1f2b0b098c504cab97ba4128fb9f08cfa3f851ced05961", + "typeString": "literal_string \"Already not a validator\"" + } + ], + "id": 881, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 13091, + 13092 + ], + "referencedDeclaration": 13092, + "src": "7768:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 888, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7768:66:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 889, + "nodeType": "ExpressionStatement", + "src": "7768:66:0" + }, + { + "condition": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 891, + "name": "Vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 64, + "src": "7857:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", + "typeString": "type(enum Bridge.Vote)" + } + }, + "id": 892, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "REMOVE_VALIDATOR", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "7857:21:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + { + "argumentTypes": null, + "id": 893, + "name": "validator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 874, + "src": "7880:9:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 890, + "name": "tryVote", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 1084, + 1109, + 1134, + 1164 + ], + "referencedDeclaration": 1109, + "src": "7849:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$_t_address_$returns$_t_bool_$", + "typeString": "function (enum Bridge.Vote,address) returns (bool)" + } + }, + "id": 894, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7849:41:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 900, + "nodeType": "IfStatement", + "src": "7845:99:0", + "trueBody": { + "id": 899, + "nodeType": "Block", + "src": "7892:52:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 896, + "name": "validator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 874, + "src": "7923:9:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 895, + "name": "_removeValidator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 967, + "src": "7906:16:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$", + "typeString": "function (address)" + } + }, + "id": 897, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7906:27:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 898, + "nodeType": "ExpressionStatement", + "src": "7906:27:0" + } + ] + } + } + ] + }, + "documentation": null, + "id": 902, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 877, + "modifierName": { + "argumentTypes": null, + "id": 876, + "name": "voting", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 225, + "src": "7734:6:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "7734:6:0" + }, + { + "arguments": null, + "id": 879, + "modifierName": { + "argumentTypes": null, + "id": 878, + "name": "currentValidator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 261, + "src": "7741:16:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "7741:16:0" + } + ], + "name": "voteRemoveValidator", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 875, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 874, + "name": "validator", + "nodeType": "VariableDeclaration", + "scope": 902, + "src": "7708:17:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 873, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7708:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "7707:19:0" + }, + "returnParameters": { + "id": 880, + "nodeType": "ParameterList", + "parameters": [], + "src": "7758:0:0" + }, + "scope": 1340, + "src": "7679:271:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 966, + "nodeType": "Block", + "src": "8009:383:0", + "statements": [ + { + "body": { + "id": 946, + "nodeType": "Block", + "src": "8067:205:0", + "statements": [ + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 927, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 920, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "8085:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 922, + "indexExpression": { + "argumentTypes": null, + "id": 921, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "8092:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "8085:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 923, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "validators", + "nodeType": "MemberAccess", + "referencedDeclaration": 35, + "src": "8085:28:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 925, + "indexExpression": { + "argumentTypes": null, + "id": 924, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 908, + "src": "8114:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "8085:31:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 926, + "name": "validator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 904, + "src": "8120:9:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "8085:44:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 945, + "nodeType": "IfStatement", + "src": "8081:181:0", + "trueBody": { + "id": 944, + "nodeType": "Block", + "src": "8131:131:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 941, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 928, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "8149:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 930, + "indexExpression": { + "argumentTypes": null, + "id": 929, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "8156:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "8149:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 931, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "validators", + "nodeType": "MemberAccess", + "referencedDeclaration": 35, + "src": "8149:28:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 933, + "indexExpression": { + "argumentTypes": null, + "id": 932, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 908, + "src": "8178:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "8149:31:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 934, + "name": "getNextValidators", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 792, + "src": "8183:17:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_array$_t_address_$dyn_memory_ptr_$", + "typeString": "function () view returns (address[] memory)" + } + }, + "id": 935, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8183:19:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "id": 940, + "indexExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 939, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 936, + "name": "getNextParties", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 541, + "src": "8203:14:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 937, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8203:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 938, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8222:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "8203:20:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "8183:41:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "8149:75:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 942, + "nodeType": "ExpressionStatement", + "src": "8149:75:0" + }, + { + "id": 943, + "nodeType": "Break", + "src": "8242:5:0" + } + ] + } + } + ] + }, + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 916, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 911, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 908, + "src": "8036:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 915, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 912, + "name": "getNextParties", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 541, + "src": "8040:14:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 913, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8040:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 914, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8059:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "8040:20:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "8036:24:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 947, + "initializationExpression": { + "assignments": [ + 908 + ], + "declarations": [ + { + "constant": false, + "id": 908, + "name": "i", + "nodeType": "VariableDeclaration", + "scope": 947, + "src": "8024:6:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 907, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "8024:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 910, + "initialValue": { + "argumentTypes": null, + "hexValue": "30", + "id": 909, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8033:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "nodeType": "VariableDeclarationStatement", + "src": "8024:10:0" + }, + "loopExpression": { + "expression": { + "argumentTypes": null, + "id": 918, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "8062:3:0", + "subExpression": { + "argumentTypes": null, + "id": 917, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 908, + "src": "8062:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 919, + "nodeType": "ExpressionStatement", + "src": "8062:3:0" + }, + "nodeType": "ForStatement", + "src": "8019:253:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 957, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "delete", + "prefix": true, + "src": "8281:57:0", + "subExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 948, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "8288:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 950, + "indexExpression": { + "argumentTypes": null, + "id": 949, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "8295:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "8288:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 951, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "validators", + "nodeType": "MemberAccess", + "referencedDeclaration": 35, + "src": "8288:28:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 956, + "indexExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 955, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 952, + "name": "getNextParties", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 541, + "src": "8317:14:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 953, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8317:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 954, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8336:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "8317:20:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "8288:50:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 958, + "nodeType": "ExpressionStatement", + "src": "8281:57:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 964, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "--", + "prefix": false, + "src": "8348:37:0", + "subExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 959, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "8348:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 961, + "indexExpression": { + "argumentTypes": null, + "id": 960, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "8355:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "8348:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 962, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "validators", + "nodeType": "MemberAccess", + "referencedDeclaration": 35, + "src": "8348:28:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 963, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "8348:35:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 965, + "nodeType": "ExpressionStatement", + "src": "8348:37:0" + } + ] + }, + "documentation": null, + "id": 967, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_removeValidator", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 905, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 904, + "name": "validator", + "nodeType": "VariableDeclaration", + "scope": 967, + "src": "7982:17:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 903, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7982:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "7981:19:0" + }, + "returnParameters": { + "id": 906, + "nodeType": "ParameterList", + "parameters": [], + "src": "8009:0:0" + }, + "scope": 1340, + "src": "7956:436:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "private" + }, + { + "body": { + "id": 990, + "nodeType": "Block", + "src": "8474:127:0", + "statements": [ + { + "condition": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 977, + "name": "Vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 64, + "src": "8496:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", + "typeString": "type(enum Bridge.Vote)" + } + }, + "id": 978, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "CHANGE_THRESHOLD", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "8496:21:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + { + "argumentTypes": null, + "id": 979, + "name": "threshold", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 969, + "src": "8519:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 976, + "name": "tryVote", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 1084, + 1109, + 1134, + 1164 + ], + "referencedDeclaration": 1134, + "src": "8488:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$_t_uint256_$returns$_t_bool_$", + "typeString": "function (enum Bridge.Vote,uint256) returns (bool)" + } + }, + "id": 980, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8488:41:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 989, + "nodeType": "IfStatement", + "src": "8484:111:0", + "trueBody": { + "id": 988, + "nodeType": "Block", + "src": "8531:64:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 986, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 981, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "8545:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 983, + "indexExpression": { + "argumentTypes": null, + "id": 982, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "8552:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "8545:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 984, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "threshold", + "nodeType": "MemberAccess", + "referencedDeclaration": 37, + "src": "8545:27:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 985, + "name": "threshold", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 969, + "src": "8575:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "8545:39:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 987, + "nodeType": "ExpressionStatement", + "src": "8545:39:0" + } + ] + } + } + ] + }, + "documentation": null, + "id": 991, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 972, + "modifierName": { + "argumentTypes": null, + "id": 971, + "name": "voting", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 225, + "src": "8450:6:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "8450:6:0" + }, + { + "arguments": null, + "id": 974, + "modifierName": { + "argumentTypes": null, + "id": 973, + "name": "currentValidator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 261, + "src": "8457:16:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "8457:16:0" + } + ], + "name": "voteChangeThreshold", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 970, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 969, + "name": "threshold", + "nodeType": "VariableDeclaration", + "scope": 991, + "src": "8427:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 968, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "8427:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "8426:16:0" + }, + "returnParameters": { + "id": 975, + "nodeType": "ParameterList", + "parameters": [], + "src": "8474:0:0" + }, + "scope": 1340, + "src": "8398:203:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 1014, + "nodeType": "Block", + "src": "8683:128:0", + "statements": [ + { + "condition": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1001, + "name": "Vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 64, + "src": "8705:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", + "typeString": "type(enum Bridge.Vote)" + } + }, + "id": 1002, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "CHANGE_RANGE_SIZE", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "8705:22:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + { + "argumentTypes": null, + "id": 1003, + "name": "rangeSize", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 993, + "src": "8729:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 1000, + "name": "tryVote", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 1084, + 1109, + 1134, + 1164 + ], + "referencedDeclaration": 1134, + "src": "8697:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$_t_uint256_$returns$_t_bool_$", + "typeString": "function (enum Bridge.Vote,uint256) returns (bool)" + } + }, + "id": 1004, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8697:42:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 1013, + "nodeType": "IfStatement", + "src": "8693:112:0", + "trueBody": { + "id": 1012, + "nodeType": "Block", + "src": "8741:64:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 1010, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1005, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "8755:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 1007, + "indexExpression": { + "argumentTypes": null, + "id": 1006, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "8762:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "8755:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 1008, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "rangeSize", + "nodeType": "MemberAccess", + "referencedDeclaration": 39, + "src": "8755:27:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 1009, + "name": "rangeSize", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 993, + "src": "8785:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "8755:39:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 1011, + "nodeType": "ExpressionStatement", + "src": "8755:39:0" + } + ] + } + } + ] + }, + "documentation": null, + "id": 1015, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 996, + "modifierName": { + "argumentTypes": null, + "id": 995, + "name": "voting", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 225, + "src": "8659:6:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "8659:6:0" + }, + { + "arguments": null, + "id": 998, + "modifierName": { + "argumentTypes": null, + "id": 997, + "name": "currentValidator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 261, + "src": "8666:16:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "8666:16:0" + } + ], + "name": "voteChangeRangeSize", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 994, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 993, + "name": "rangeSize", + "nodeType": "VariableDeclaration", + "scope": 1015, + "src": "8636:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 992, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "8636:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "8635:16:0" + }, + "returnParameters": { + "id": 999, + "nodeType": "ParameterList", + "parameters": [], + "src": "8683:0:0" + }, + "scope": 1340, + "src": "8607:204:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 1038, + "nodeType": "Block", + "src": "8875:141:0", + "statements": [ + { + "condition": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1023, + "name": "Vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 64, + "src": "8897:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", + "typeString": "type(enum Bridge.Vote)" + } + }, + "id": 1024, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "START_KEYGEN", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "8897:17:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + ], + "id": 1022, + "name": "tryVote", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 1084, + 1109, + 1134, + 1164 + ], + "referencedDeclaration": 1084, + "src": "8889:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$returns$_t_bool_$", + "typeString": "function (enum Bridge.Vote) returns (bool)" + } + }, + "id": 1025, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8889:26:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 1037, + "nodeType": "IfStatement", + "src": "8885:125:0", + "trueBody": { + "id": 1036, + "nodeType": "Block", + "src": "8917:93:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 1029, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 1026, + "name": "status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 90, + "src": "8931:6:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1027, + "name": "Status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "8940:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Status_$53_$", + "typeString": "type(enum Bridge.Status)" + } + }, + "id": 1028, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "KEYGEN", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "8940:13:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "src": "8931:22:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "id": 1030, + "nodeType": "ExpressionStatement", + "src": "8931:22:0" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1032, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "8982:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 1033, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "8989:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 1031, + "name": "NewEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14, + "src": "8973:8:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$returns$__$", + "typeString": "function (uint256,uint256)" + } + }, + "id": 1034, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8973:26:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1035, + "nodeType": "EmitStatement", + "src": "8968:31:0" + } + ] + } + } + ] + }, + "documentation": null, + "id": 1039, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 1018, + "modifierName": { + "argumentTypes": null, + "id": 1017, + "name": "voting", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 225, + "src": "8851:6:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "8851:6:0" + }, + { + "arguments": null, + "id": 1020, + "modifierName": { + "argumentTypes": null, + "id": 1019, + "name": "currentValidator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 261, + "src": "8858:16:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "8858:16:0" + } + ], + "name": "voteStartKeygen", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1016, + "nodeType": "ParameterList", + "parameters": [], + "src": "8841:2:0" + }, + "returnParameters": { + "id": 1021, + "nodeType": "ParameterList", + "parameters": [], + "src": "8875:0:0" + }, + "scope": 1340, + "src": "8817:199:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 1061, + "nodeType": "Block", + "src": "9081:144:0", + "statements": [ + { + "condition": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1047, + "name": "Vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 64, + "src": "9103:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", + "typeString": "type(enum Bridge.Vote)" + } + }, + "id": 1048, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "CANCEL_KEYGEN", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "9103:18:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + ], + "id": 1046, + "name": "tryVote", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 1084, + 1109, + 1134, + 1164 + ], + "referencedDeclaration": 1084, + "src": "9095:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$returns$_t_bool_$", + "typeString": "function (enum Bridge.Vote) returns (bool)" + } + }, + "id": 1049, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9095:27:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 1060, + "nodeType": "IfStatement", + "src": "9091:128:0", + "trueBody": { + "id": 1059, + "nodeType": "Block", + "src": "9124:95:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 1053, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 1050, + "name": "status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 90, + "src": "9138:6:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1051, + "name": "Status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "9147:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Status_$53_$", + "typeString": "type(enum Bridge.Status)" + } + }, + "id": 1052, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "VOTING", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "9147:13:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "src": "9138:22:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "id": 1054, + "nodeType": "ExpressionStatement", + "src": "9138:22:0" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1056, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "9198:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 1055, + "name": "NewEpochCancelled", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 18, + "src": "9180:17:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 1057, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9180:28:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1058, + "nodeType": "EmitStatement", + "src": "9175:33:0" + } + ] + } + } + ] + }, + "documentation": null, + "id": 1062, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 1042, + "modifierName": { + "argumentTypes": null, + "id": 1041, + "name": "keygen", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 237, + "src": "9057:6:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "9057:6:0" + }, + { + "arguments": null, + "id": 1044, + "modifierName": { + "argumentTypes": null, + "id": 1043, + "name": "currentValidator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 261, + "src": "9064:16:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "9064:16:0" + } + ], + "name": "voteCancelKeygen", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1040, + "nodeType": "ParameterList", + "parameters": [], + "src": "9047:2:0" + }, + "returnParameters": { + "id": 1045, + "nodeType": "ParameterList", + "parameters": [], + "src": "9081:0:0" + }, + "scope": 1340, + "src": "9022:203:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 1083, + "nodeType": "Block", + "src": "9286:110:0", + "statements": [ + { + "assignments": [ + 1070 + ], + "declarations": [ + { + "constant": false, + "id": 1070, + "name": "vote", + "nodeType": "VariableDeclaration", + "scope": 1083, + "src": "9296:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1069, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "9296:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1078, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1074, + "name": "voteType", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1064, + "src": "9338:8:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + { + "argumentTypes": null, + "id": 1075, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "9348:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "id": 1072, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13075, + "src": "9321:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 1073, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "9321:16:0", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 1076, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9321:37:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 1071, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13082, + "src": "9311:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 1077, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9311:48:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "9296:63:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1080, + "name": "vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1070, + "src": "9384:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 1079, + "name": "putVote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1268, + "src": "9376:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$_t_bool_$", + "typeString": "function (bytes32) returns (bool)" + } + }, + "id": 1081, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9376:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 1068, + "id": 1082, + "nodeType": "Return", + "src": "9369:20:0" + } + ] + }, + "documentation": null, + "id": 1084, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "tryVote", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1065, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1064, + "name": "voteType", + "nodeType": "VariableDeclaration", + "scope": 1084, + "src": "9248:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + "typeName": { + "contractScope": null, + "id": 1063, + "name": "Vote", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 64, + "src": "9248:4:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "9247:15:0" + }, + "returnParameters": { + "id": 1068, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1067, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 1084, + "src": "9280:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 1066, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "9280:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "9279:6:0" + }, + "scope": 1340, + "src": "9231:165:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "private" + }, + { + "body": { + "id": 1108, + "nodeType": "Block", + "src": "9471:116:0", + "statements": [ + { + "assignments": [ + 1094 + ], + "declarations": [ + { + "constant": false, + "id": 1094, + "name": "vote", + "nodeType": "VariableDeclaration", + "scope": 1108, + "src": "9481:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1093, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "9481:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1103, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1098, + "name": "voteType", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1086, + "src": "9523:8:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + { + "argumentTypes": null, + "id": 1099, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "9533:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 1100, + "name": "addr", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1088, + "src": "9544:4:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "expression": { + "argumentTypes": null, + "id": 1096, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13075, + "src": "9506:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 1097, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "9506:16:0", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 1101, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9506:43:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 1095, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13082, + "src": "9496:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 1102, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9496:54:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "9481:69:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1105, + "name": "vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1094, + "src": "9575:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 1104, + "name": "putVote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1268, + "src": "9567:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$_t_bool_$", + "typeString": "function (bytes32) returns (bool)" + } + }, + "id": 1106, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9567:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 1092, + "id": 1107, + "nodeType": "Return", + "src": "9560:20:0" + } + ] + }, + "documentation": null, + "id": 1109, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "tryVote", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1089, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1086, + "name": "voteType", + "nodeType": "VariableDeclaration", + "scope": 1109, + "src": "9419:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + "typeName": { + "contractScope": null, + "id": 1085, + "name": "Vote", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 64, + "src": "9419:4:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1088, + "name": "addr", + "nodeType": "VariableDeclaration", + "scope": 1109, + "src": "9434:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1087, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "9434:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "9418:29:0" + }, + "returnParameters": { + "id": 1092, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1091, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 1109, + "src": "9465:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 1090, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "9465:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "9464:6:0" + }, + "scope": 1340, + "src": "9402:185:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "private" + }, + { + "body": { + "id": 1133, + "nodeType": "Block", + "src": "9658:115:0", + "statements": [ + { + "assignments": [ + 1119 + ], + "declarations": [ + { + "constant": false, + "id": 1119, + "name": "vote", + "nodeType": "VariableDeclaration", + "scope": 1133, + "src": "9668:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1118, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "9668:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1128, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1123, + "name": "voteType", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1111, + "src": "9710:8:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + { + "argumentTypes": null, + "id": 1124, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "9720:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 1125, + "name": "num", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1113, + "src": "9731:3:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "id": 1121, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13075, + "src": "9693:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 1122, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "9693:16:0", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 1126, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9693:42:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 1120, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13082, + "src": "9683:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 1127, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9683:53:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "9668:68:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1130, + "name": "vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1119, + "src": "9761:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 1129, + "name": "putVote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1268, + "src": "9753:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$_t_bool_$", + "typeString": "function (bytes32) returns (bool)" + } + }, + "id": 1131, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9753:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 1117, + "id": 1132, + "nodeType": "Return", + "src": "9746:20:0" + } + ] + }, + "documentation": null, + "id": 1134, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "tryVote", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1114, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1111, + "name": "voteType", + "nodeType": "VariableDeclaration", + "scope": 1134, + "src": "9610:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + "typeName": { + "contractScope": null, + "id": 1110, + "name": "Vote", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 64, + "src": "9610:4:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1113, + "name": "num", + "nodeType": "VariableDeclaration", + "scope": 1134, + "src": "9625:8:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1112, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "9625:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "9609:25:0" + }, + "returnParameters": { + "id": 1117, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1116, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 1134, + "src": "9652:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 1115, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "9652:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "9651:6:0" + }, + "scope": 1340, + "src": "9593:180:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "private" + }, + { + "body": { + "id": 1163, + "nodeType": "Block", + "src": "9872:116:0", + "statements": [ + { + "assignments": [ + 1148 + ], + "declarations": [ + { + "constant": false, + "id": 1148, + "name": "vote", + "nodeType": "VariableDeclaration", + "scope": 1163, + "src": "9882:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1147, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "9882:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1158, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1152, + "name": "voteType", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1136, + "src": "9924:8:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + { + "argumentTypes": null, + "id": 1153, + "name": "hash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1138, + "src": "9934:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "argumentTypes": null, + "id": 1154, + "name": "to", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1140, + "src": "9940:2:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 1155, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1142, + "src": "9944:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "id": 1150, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13075, + "src": "9907:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 1151, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "9907:16:0", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 1156, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9907:43:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 1149, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13082, + "src": "9897:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 1157, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9897:54:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "9882:69:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1160, + "name": "vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1148, + "src": "9976:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 1159, + "name": "putVote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1268, + "src": "9968:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$_t_bool_$", + "typeString": "function (bytes32) returns (bool)" + } + }, + "id": 1161, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9968:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 1146, + "id": 1162, + "nodeType": "Return", + "src": "9961:20:0" + } + ] + }, + "documentation": null, + "id": 1164, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "tryVote", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1143, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1136, + "name": "voteType", + "nodeType": "VariableDeclaration", + "scope": 1164, + "src": "9796:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + "typeName": { + "contractScope": null, + "id": 1135, + "name": "Vote", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 64, + "src": "9796:4:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1138, + "name": "hash", + "nodeType": "VariableDeclaration", + "scope": 1164, + "src": "9811:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1137, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "9811:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1140, + "name": "to", + "nodeType": "VariableDeclaration", + "scope": 1164, + "src": "9825:10:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1139, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "9825:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1142, + "name": "value", + "nodeType": "VariableDeclaration", + "scope": 1164, + "src": "9837:10:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1141, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "9837:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "9795:53:0" + }, + "returnParameters": { + "id": 1146, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1145, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 1164, + "src": "9866:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 1144, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "9866:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "9865:6:0" + }, + "scope": 1340, + "src": "9779:209:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "private" + }, + { + "body": { + "id": 1185, + "nodeType": "Block", + "src": "10052:113:0", + "statements": [ + { + "assignments": [ + 1172 + ], + "declarations": [ + { + "constant": false, + "id": 1172, + "name": "vote", + "nodeType": "VariableDeclaration", + "scope": 1185, + "src": "10062:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1171, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "10062:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1180, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1176, + "name": "voteType", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1166, + "src": "10104:8:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + { + "argumentTypes": null, + "id": 1177, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "10114:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "id": 1174, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13075, + "src": "10087:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 1175, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "10087:16:0", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 1178, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10087:37:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 1173, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13082, + "src": "10077:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 1179, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10077:48:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "10062:63:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1182, + "name": "vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1172, + "src": "10153:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 1181, + "name": "putConfirm", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1322, + "src": "10142:10:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$_t_bool_$", + "typeString": "function (bytes32) returns (bool)" + } + }, + "id": 1183, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10142:16:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 1170, + "id": 1184, + "nodeType": "Return", + "src": "10135:23:0" + } + ] + }, + "documentation": null, + "id": 1186, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "tryConfirm", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1167, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1166, + "name": "voteType", + "nodeType": "VariableDeclaration", + "scope": 1186, + "src": "10014:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + "typeName": { + "contractScope": null, + "id": 1165, + "name": "Vote", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 64, + "src": "10014:4:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "10013:15:0" + }, + "returnParameters": { + "id": 1170, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1169, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 1186, + "src": "10046:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 1168, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "10046:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "10045:6:0" + }, + "scope": 1340, + "src": "9994:171:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "private" + }, + { + "body": { + "id": 1213, + "nodeType": "Block", + "src": "10245:119:0", + "statements": [ + { + "assignments": [ + 1198 + ], + "declarations": [ + { + "constant": false, + "id": 1198, + "name": "vote", + "nodeType": "VariableDeclaration", + "scope": 1213, + "src": "10255:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1197, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "10255:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1208, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1202, + "name": "voteType", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1188, + "src": "10297:8:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + { + "argumentTypes": null, + "id": 1203, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "10307:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 1204, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1190, + "src": "10318:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 1205, + "name": "y", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1192, + "src": "10321:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "id": 1200, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13075, + "src": "10280:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 1201, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "10280:16:0", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 1206, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10280:43:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 1199, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13082, + "src": "10270:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 1207, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10270:54:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "10255:69:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1210, + "name": "vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1198, + "src": "10352:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 1209, + "name": "putConfirm", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1322, + "src": "10341:10:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$_t_bool_$", + "typeString": "function (bytes32) returns (bool)" + } + }, + "id": 1211, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10341:16:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 1196, + "id": 1212, + "nodeType": "Return", + "src": "10334:23:0" + } + ] + }, + "documentation": null, + "id": 1214, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "tryConfirm", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1193, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1188, + "name": "voteType", + "nodeType": "VariableDeclaration", + "scope": 1214, + "src": "10191:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + "typeName": { + "contractScope": null, + "id": 1187, + "name": "Vote", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 64, + "src": "10191:4:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1190, + "name": "x", + "nodeType": "VariableDeclaration", + "scope": 1214, + "src": "10206:6:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1189, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "10206:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1192, + "name": "y", + "nodeType": "VariableDeclaration", + "scope": 1214, + "src": "10214:6:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1191, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "10214:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "10190:31:0" + }, + "returnParameters": { + "id": 1196, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1195, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 1214, + "src": "10239:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 1194, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "10239:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "10238:6:0" + }, + "scope": 1340, + "src": "10171:193:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "private" + }, + { + "body": { + "id": 1267, + "nodeType": "Block", + "src": "10424:355:0", + "statements": [ + { + "assignments": [ + 1222 + ], + "declarations": [ + { + "constant": false, + "id": 1222, + "name": "personalVote", + "nodeType": "VariableDeclaration", + "scope": 1267, + "src": "10434:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1221, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "10434:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1226, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1224, + "name": "vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1216, + "src": "10473:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 1223, + "name": "personalizeVote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1339, + "src": "10457:15:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_bytes32_$", + "typeString": "function (bytes32) view returns (bytes32)" + } + }, + "id": 1225, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10457:21:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "10434:44:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1231, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "10496:20:0", + "subExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1228, + "name": "votes", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 84, + "src": "10497:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", + "typeString": "mapping(bytes32 => bool)" + } + }, + "id": 1230, + "indexExpression": { + "argumentTypes": null, + "id": 1229, + "name": "personalVote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1222, + "src": "10503:12:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "10497:19:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "566f74656420616c7265616479", + "id": 1232, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10518:15:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_230c30109b60c15b21799291aaf5c571045da3dc3f224d8bbd2f2e688c149a47", + "typeString": "literal_string \"Voted already\"" + }, + "value": "Voted already" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_230c30109b60c15b21799291aaf5c571045da3dc3f224d8bbd2f2e688c149a47", + "typeString": "literal_string \"Voted already\"" + } + ], + "id": 1227, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 13091, + 13092 + ], + "referencedDeclaration": 13092, + "src": "10488:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1233, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10488:46:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1234, + "nodeType": "ExpressionStatement", + "src": "10488:46:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 1239, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1235, + "name": "votes", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 84, + "src": "10545:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", + "typeString": "mapping(bytes32 => bool)" + } + }, + "id": 1237, + "indexExpression": { + "argumentTypes": null, + "id": 1236, + "name": "personalVote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1222, + "src": "10551:12:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "10545:19:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "74727565", + "id": 1238, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10567:4:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + "src": "10545:26:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 1240, + "nodeType": "ExpressionStatement", + "src": "10545:26:0" + }, + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 1246, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1241, + "name": "votesCount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 80, + "src": "10585:10:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + } + }, + "id": 1243, + "indexExpression": { + "argumentTypes": null, + "id": 1242, + "name": "vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1216, + "src": "10596:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "10585:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 1244, + "name": "getThreshold", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 565, + 588 + ], + "referencedDeclaration": 565, + "src": "10605:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 1245, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10605:14:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "10585:34:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "id": 1265, + "nodeType": "Block", + "src": "10704:69:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 1261, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "10718:18:0", + "subExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1258, + "name": "votesCount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 80, + "src": "10718:10:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + } + }, + "id": 1260, + "indexExpression": { + "argumentTypes": null, + "id": 1259, + "name": "vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1216, + "src": "10729:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "10718:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 1262, + "nodeType": "ExpressionStatement", + "src": "10718:18:0" + }, + { + "expression": { + "argumentTypes": null, + "hexValue": "66616c7365", + "id": 1263, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10757:5:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + }, + "functionReturnParameters": 1220, + "id": 1264, + "nodeType": "Return", + "src": "10750:12:0" + } + ] + }, + "id": 1266, + "nodeType": "IfStatement", + "src": "10581:192:0", + "trueBody": { + "id": 1257, + "nodeType": "Block", + "src": "10621:77:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 1253, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1247, + "name": "votesCount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 80, + "src": "10635:10:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + } + }, + "id": 1249, + "indexExpression": { + "argumentTypes": null, + "id": 1248, + "name": "vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1216, + "src": "10646:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "10635:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_rational_57896044618658097711785492504343953926634992332820282019728792003956564819968_by_1", + "typeString": "int_const 5789...(69 digits omitted)...9968" + }, + "id": 1252, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "hexValue": "32", + "id": 1250, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10654:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" + }, + "nodeType": "BinaryOperation", + "operator": "**", + "rightExpression": { + "argumentTypes": null, + "hexValue": "323535", + "id": 1251, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10659:3:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_255_by_1", + "typeString": "int_const 255" + }, + "value": "255" + }, + "src": "10654:8:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_57896044618658097711785492504343953926634992332820282019728792003956564819968_by_1", + "typeString": "int_const 5789...(69 digits omitted)...9968" + } + }, + "src": "10635:27:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 1254, + "nodeType": "ExpressionStatement", + "src": "10635:27:0" + }, + { + "expression": { + "argumentTypes": null, + "hexValue": "74727565", + "id": 1255, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10683:4:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + "functionReturnParameters": 1220, + "id": 1256, + "nodeType": "Return", + "src": "10676:11:0" + } + ] + } + } + ] + }, + "documentation": null, + "id": 1268, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "putVote", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1217, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1216, + "name": "vote", + "nodeType": "VariableDeclaration", + "scope": 1268, + "src": "10387:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1215, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "10387:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "10386:14:0" + }, + "returnParameters": { + "id": 1220, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1219, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 1268, + "src": "10418:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 1218, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "10418:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "10417:6:0" + }, + "scope": 1340, + "src": "10370:409:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "private" + }, + { + "body": { + "id": 1321, + "nodeType": "Block", + "src": "10842:363:0", + "statements": [ + { + "assignments": [ + 1276 + ], + "declarations": [ + { + "constant": false, + "id": 1276, + "name": "personalVote", + "nodeType": "VariableDeclaration", + "scope": 1321, + "src": "10852:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1275, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "10852:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1280, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1278, + "name": "vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1270, + "src": "10891:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 1277, + "name": "personalizeVote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1339, + "src": "10875:15:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_bytes32_$", + "typeString": "function (bytes32) view returns (bytes32)" + } + }, + "id": 1279, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10875:21:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "10852:44:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1285, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "10914:20:0", + "subExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1282, + "name": "votes", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 84, + "src": "10915:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", + "typeString": "mapping(bytes32 => bool)" + } + }, + "id": 1284, + "indexExpression": { + "argumentTypes": null, + "id": 1283, + "name": "personalVote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1276, + "src": "10921:12:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "10915:19:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "436f6e6669726d656420616c7265616479", + "id": 1286, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10936:19:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_762a97ce67d271844ad9c09d89a5271fde7fe7537af208da055a904cd67ac7bc", + "typeString": "literal_string \"Confirmed already\"" + }, + "value": "Confirmed already" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_762a97ce67d271844ad9c09d89a5271fde7fe7537af208da055a904cd67ac7bc", + "typeString": "literal_string \"Confirmed already\"" + } + ], + "id": 1281, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 13091, + 13092 + ], + "referencedDeclaration": 13092, + "src": "10906:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1287, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10906:50:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1288, + "nodeType": "ExpressionStatement", + "src": "10906:50:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 1293, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1289, + "name": "votes", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 84, + "src": "10967:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", + "typeString": "mapping(bytes32 => bool)" + } + }, + "id": 1291, + "indexExpression": { + "argumentTypes": null, + "id": 1290, + "name": "personalVote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1276, + "src": "10973:12:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "10967:19:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "74727565", + "id": 1292, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10989:4:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + "src": "10967:26:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 1294, + "nodeType": "ExpressionStatement", + "src": "10967:26:0" + }, + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 1300, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1295, + "name": "votesCount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 80, + "src": "11007:10:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + } + }, + "id": 1297, + "indexExpression": { + "argumentTypes": null, + "id": 1296, + "name": "vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1270, + "src": "11018:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "11007:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 1298, + "name": "getNextThreshold", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 575, + "src": "11027:16:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 1299, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11027:18:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "11007:38:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "id": 1319, + "nodeType": "Block", + "src": "11130:69:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 1315, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "11144:18:0", + "subExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1312, + "name": "votesCount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 80, + "src": "11144:10:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + } + }, + "id": 1314, + "indexExpression": { + "argumentTypes": null, + "id": 1313, + "name": "vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1270, + "src": "11155:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "11144:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 1316, + "nodeType": "ExpressionStatement", + "src": "11144:18:0" + }, + { + "expression": { + "argumentTypes": null, + "hexValue": "66616c7365", + "id": 1317, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "11183:5:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + }, + "functionReturnParameters": 1274, + "id": 1318, + "nodeType": "Return", + "src": "11176:12:0" + } + ] + }, + "id": 1320, + "nodeType": "IfStatement", + "src": "11003:196:0", + "trueBody": { + "id": 1311, + "nodeType": "Block", + "src": "11047:77:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 1307, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1301, + "name": "votesCount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 80, + "src": "11061:10:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + } + }, + "id": 1303, + "indexExpression": { + "argumentTypes": null, + "id": 1302, + "name": "vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1270, + "src": "11072:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "11061:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_rational_57896044618658097711785492504343953926634992332820282019728792003956564819968_by_1", + "typeString": "int_const 5789...(69 digits omitted)...9968" + }, + "id": 1306, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "hexValue": "32", + "id": 1304, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "11080:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" + }, + "nodeType": "BinaryOperation", + "operator": "**", + "rightExpression": { + "argumentTypes": null, + "hexValue": "323535", + "id": 1305, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "11085:3:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_255_by_1", + "typeString": "int_const 255" + }, + "value": "255" + }, + "src": "11080:8:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_57896044618658097711785492504343953926634992332820282019728792003956564819968_by_1", + "typeString": "int_const 5789...(69 digits omitted)...9968" + } + }, + "src": "11061:27:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 1308, + "nodeType": "ExpressionStatement", + "src": "11061:27:0" + }, + { + "expression": { + "argumentTypes": null, + "hexValue": "74727565", + "id": 1309, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "11109:4:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + "functionReturnParameters": 1274, + "id": 1310, + "nodeType": "Return", + "src": "11102:11:0" + } + ] + } + } + ] + }, + "documentation": null, + "id": 1322, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "putConfirm", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1271, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1270, + "name": "vote", + "nodeType": "VariableDeclaration", + "scope": 1322, + "src": "10805:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1269, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "10805:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "10804:14:0" + }, + "returnParameters": { + "id": 1274, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1273, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 1322, + "src": "10836:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 1272, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "10836:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "10835:6:0" + }, + "scope": 1340, + "src": "10785:420:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "private" + }, + { + "body": { + "id": 1338, + "nodeType": "Block", + "src": "11281:69:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1332, + "name": "vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1324, + "src": "11325:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1333, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13088, + "src": "11331:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1334, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "11331:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + ], + "expression": { + "argumentTypes": null, + "id": 1330, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13075, + "src": "11308:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 1331, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "11308:16:0", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 1335, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11308:34:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 1329, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13082, + "src": "11298:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 1336, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11298:45:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "functionReturnParameters": 1328, + "id": 1337, + "nodeType": "Return", + "src": "11291:52:0" + } + ] + }, + "documentation": null, + "id": 1339, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "personalizeVote", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1325, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1324, + "name": "vote", + "nodeType": "VariableDeclaration", + "scope": 1339, + "src": "11236:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1323, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "11236:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "11235:14:0" + }, + "returnParameters": { + "id": 1328, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1327, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 1339, + "src": "11272:7:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1326, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "11272:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "11271:9:0" + }, + "scope": 1340, + "src": "11211:139:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "private" + } + ], + "scope": 1341, + "src": "93:11259:0" + } + ], + "src": "0:11353:0" + }, + "compiler": { + "name": "solc", + "version": "0.5.9+commit.e560f70d.Emscripten.clang" + }, + "networks": { + "44": { + "events": { + "0x3ef85928df9ae51bdb3eb4c00ec73b92b82307f319ac1b029de14796a0972609": { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "oldEpoch", + "type": "uint256" + }, + { + "indexed": true, + "name": "newEpoch", + "type": "uint256" + } + ], + "name": "NewEpoch", + "type": "event", + "signature": "0x3ef85928df9ae51bdb3eb4c00ec73b92b82307f319ac1b029de14796a0972609" + }, + "0xddbb65cfe1ae4aec03cef0f9667c6d7ba3740927d0c60f4dd4d7104cc31d180a": { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "epoch", + "type": "uint256" + } + ], + "name": "NewEpochCancelled", + "type": "event", + "signature": "0xddbb65cfe1ae4aec03cef0f9667c6d7ba3740927d0c60f4dd4d7104cc31d180a" + }, + "0xf4735b85cc98f9a712832825ecab4cfb1649d658f9a73c57a00ea7dde735c79b": { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "oldEpoch", + "type": "uint256" + }, + { + "indexed": true, + "name": "newEpoch", + "type": "uint256" + } + ], + "name": "NewFundsTransfer", + "type": "event", + "signature": "0xf4735b85cc98f9a712832825ecab4cfb1649d658f9a73c57a00ea7dde735c79b" + }, + "0xc33272939f066c227e913a4b3434d860794f185c551685c29451a3a38b9b259c": { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "epoch", + "type": "uint256" + }, + { + "indexed": false, + "name": "x", + "type": "uint256" + }, + { + "indexed": false, + "name": "y", + "type": "uint256" + } + ], + "name": "EpochStart", + "type": "event", + "signature": "0xc33272939f066c227e913a4b3434d860794f185c551685c29451a3a38b9b259c" + }, + "0x62e1f484b3909b2c013673bad76a9f14b010600ba983f11ad26e83082883570e": { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "value", + "type": "uint256" + } + ], + "name": "ExchangeRequest", + "type": "event", + "signature": "0x62e1f484b3909b2c013673bad76a9f14b010600ba983f11ad26e83082883570e" + }, + "0x9273b6f22cee1ef3d7cdc2a9c031936003526bae368886259511f7dd40044b02": { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "value", + "type": "uint256" + }, + { + "indexed": false, + "name": "nonce", + "type": "uint256" + } + ], + "name": "ExchangeRequest", + "type": "event", + "signature": "0x9273b6f22cee1ef3d7cdc2a9c031936003526bae368886259511f7dd40044b02" + } + }, + "links": {}, + "address": "0x44c158FE850821ae69DaF37AADF5c539e9d0025B", + "transactionHash": "0x912e1b3c5341609e1d0c0cd5d81ff6b7d9b2e8f497bd393ea91af1a4038cba78" + } + }, + "schemaVersion": "3.0.11", + "updatedAt": "2019-10-28T13:22:54.868Z", + "devdoc": { + "methods": {} + }, + "userdoc": { + "methods": {} + } +} \ No newline at end of file diff --git a/src/oracle/ethWatcher/Dockerfile b/src/oracle/ethWatcher/Dockerfile index 25351a1..fa11564 100644 --- a/src/oracle/ethWatcher/Dockerfile +++ b/src/oracle/ethWatcher/Dockerfile @@ -10,5 +10,6 @@ COPY ./ethWatcher/package.json /watcher/ RUN npm install COPY ./ethWatcher/ethWatcher.js ./shared/db.js ./shared/logger.js ./shared/amqp.js ./shared/crypto.js /watcher/ +COPY ./proxy/Bridge.json /watcher/contracts_data/ ENTRYPOINT ["node", "ethWatcher.js"] diff --git a/src/oracle/proxy/Bridge.json b/src/oracle/proxy/Bridge.json new file mode 100644 index 0000000..9eba79e --- /dev/null +++ b/src/oracle/proxy/Bridge.json @@ -0,0 +1,35243 @@ +{ + "contractName": "Bridge", + "abi": [ + { + "constant": true, + "inputs": [], + "name": "status", + "outputs": [ + { + "name": "", + "type": "uint8" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "", + "type": "bytes32" + } + ], + "name": "usedRange", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "", + "type": "bytes32" + } + ], + "name": "votes", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "", + "type": "bytes32" + } + ], + "name": "dbTransfer", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "tokenContract", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "epoch", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "", + "type": "bytes32" + } + ], + "name": "votesCount", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "nextEpoch", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "", + "type": "bytes32" + } + ], + "name": "dbTransferCount", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "name": "threshold", + "type": "uint256" + }, + { + "name": "validators", + "type": "address[]" + }, + { + "name": "_tokenContract", + "type": "address" + }, + { + "name": "limits", + "type": "uint256[2]" + }, + { + "name": "rangeSize", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "value", + "type": "uint256" + }, + { + "indexed": false, + "name": "nonce", + "type": "uint256" + } + ], + "name": "ExchangeRequest", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "oldEpoch", + "type": "uint256" + }, + { + "indexed": true, + "name": "newEpoch", + "type": "uint256" + } + ], + "name": "NewEpoch", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "epoch", + "type": "uint256" + } + ], + "name": "NewEpochCancelled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "oldEpoch", + "type": "uint256" + }, + { + "indexed": true, + "name": "newEpoch", + "type": "uint256" + } + ], + "name": "NewFundsTransfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "epoch", + "type": "uint256" + }, + { + "indexed": false, + "name": "x", + "type": "uint256" + }, + { + "indexed": false, + "name": "y", + "type": "uint256" + } + ], + "name": "EpochStart", + "type": "event" + }, + { + "constant": false, + "inputs": [ + { + "name": "value", + "type": "uint256" + } + ], + "name": "exchange", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "hash", + "type": "bytes32" + }, + { + "name": "to", + "type": "address" + }, + { + "name": "value", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "x", + "type": "uint256" + }, + { + "name": "y", + "type": "uint256" + } + ], + "name": "confirmKeygen", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "confirmFundsTransfer", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getNextParties", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getParties", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_epoch", + "type": "uint256" + } + ], + "name": "getParties", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getNextThreshold", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getThreshold", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_epoch", + "type": "uint256" + } + ], + "name": "getThreshold", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getStartBlock", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_epoch", + "type": "uint256" + } + ], + "name": "getStartBlock", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getNextRangeSize", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_epoch", + "type": "uint256" + } + ], + "name": "getRangeSize", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getRangeSize", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_epoch", + "type": "uint256" + } + ], + "name": "getNonce", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getNonce", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getX", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getY", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getPartyId", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "a", + "type": "address" + } + ], + "name": "getNextPartyId", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getValidators", + "outputs": [ + { + "name": "", + "type": "address[]" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getNextValidators", + "outputs": [ + { + "name": "", + "type": "address[]" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "startVoting", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "validator", + "type": "address" + } + ], + "name": "voteAddValidator", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "validator", + "type": "address" + } + ], + "name": "voteRemoveValidator", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "threshold", + "type": "uint256" + } + ], + "name": "voteChangeThreshold", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "rangeSize", + "type": "uint256" + } + ], + "name": "voteChangeRangeSize", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "voteStartKeygen", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "voteCancelKeygen", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + } + ], + "metadata": "{\"compiler\":{\"version\":\"0.5.9+commit.e560f70d\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":true,\"inputs\":[{\"name\":\"_epoch\",\"type\":\"uint256\"}],\"name\":\"getStartBlock\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getNextParties\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getY\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"a\",\"type\":\"address\"}],\"name\":\"getNextPartyId\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"startVoting\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"status\",\"outputs\":[{\"name\":\"\",\"type\":\"uint8\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"rangeSize\",\"type\":\"uint256\"}],\"name\":\"voteChangeRangeSize\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"usedRange\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getRangeSize\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"votes\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getPartyId\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"voteCancelKeygen\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_epoch\",\"type\":\"uint256\"}],\"name\":\"getNonce\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"hash\",\"type\":\"bytes32\"},{\"name\":\"to\",\"type\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getNextValidators\",\"outputs\":[{\"name\":\"\",\"type\":\"address[]\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_epoch\",\"type\":\"uint256\"}],\"name\":\"getParties\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_epoch\",\"type\":\"uint256\"}],\"name\":\"getThreshold\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"dbTransfer\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getX\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"exchange\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"tokenContract\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"validator\",\"type\":\"address\"}],\"name\":\"voteAddValidator\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getNextThreshold\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"epoch\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"voteStartKeygen\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"validator\",\"type\":\"address\"}],\"name\":\"voteRemoveValidator\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getStartBlock\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"x\",\"type\":\"uint256\"},{\"name\":\"y\",\"type\":\"uint256\"}],\"name\":\"confirmKeygen\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getParties\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"votesCount\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"nextEpoch\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getValidators\",\"outputs\":[{\"name\":\"\",\"type\":\"address[]\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getNextRangeSize\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_epoch\",\"type\":\"uint256\"}],\"name\":\"getRangeSize\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"threshold\",\"type\":\"uint256\"}],\"name\":\"voteChangeThreshold\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getNonce\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"dbTransferCount\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"confirmFundsTransfer\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getThreshold\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"threshold\",\"type\":\"uint256\"},{\"name\":\"validators\",\"type\":\"address[]\"},{\"name\":\"_tokenContract\",\"type\":\"address\"},{\"name\":\"limits\",\"type\":\"uint256[2]\"},{\"name\":\"rangeSize\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"value\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"ExchangeRequest\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"oldEpoch\",\"type\":\"uint256\"},{\"indexed\":true,\"name\":\"newEpoch\",\"type\":\"uint256\"}],\"name\":\"NewEpoch\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"epoch\",\"type\":\"uint256\"}],\"name\":\"NewEpochCancelled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"oldEpoch\",\"type\":\"uint256\"},{\"indexed\":true,\"name\":\"newEpoch\",\"type\":\"uint256\"}],\"name\":\"NewFundsTransfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"epoch\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"x\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"y\",\"type\":\"uint256\"}],\"name\":\"EpochStart\",\"type\":\"event\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/build/contracts/Bridge.sol\":\"Bridge\"},\"evmVersion\":\"petersburg\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":3},\"remappings\":[]},\"sources\":{\"/build/contracts/Bridge.sol\":{\"keccak256\":\"0xedcf62b24f2b47b0e83af55ca6471e82e301f8287aa78e7c41bbca2d3ddc4155\",\"urls\":[\"bzzr://84b325be5714e21d85966ce976f9996d2f7d2305b467c191d37f6e91bb1901fb\",\"dweb:/ipfs/QmY1RVRv3H9E9T2VwmSdyKxAfQFMd7t9yYjcVFVpox9Lf8\"]},\"/build/contracts/openzeppelin-solidity/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0x90e8c2521653bbb1768b05889c5760031e688d9cd361f167489b89215e201b95\",\"urls\":[\"bzzr://aa8b45b57edafc3d67bc5d916327ea16807fae33f753ca163ae0c4061b789766\",\"dweb:/ipfs/QmP5NaEwZthQeM2ESz4WTT3osrP7jhbvu7ocbttBi2JAw6\"]}},\"version\":1}", + "bytecode": "0x60806040523480156200001157600080fd5b5060405162001f4838038062001f48833981810160405260c08110156200003757600080fd5b8151602083018051919392830192916401000000008111156200005957600080fd5b820160208101848111156200006d57600080fd5b81518560208202830111640100000000821117156200008b57600080fd5b505060208201516080830151825192955090935060409092019190620000b057600080fd5b83518510620000be57600080fd5b600b80546001600160a01b0385166001600160a01b0319909116179055600060078190556006805460ff19166002179055600160088190556040805160e08101825287815260208082018a905291810185905260608101849052600019608082015260a0810184905260c081018490529183529182528051805191927fada5013122d395ba3c54772283fb069b10426056ef8ca54750cb9bb552a59e7d926200016b9284920190620001f9565b506020820151600182015560408201516002820155606082015160038201556080820151600482015560a0820151600582015560c09091015160069091015581600060200201516009558160016020020151600a556040516001906000907f3ef85928df9ae51bdb3eb4c00ec73b92b82307f319ac1b029de14796a0972609908290a350505050506200028d565b82805482825590600052602060002090810192821562000251579160200282015b828111156200025157825182546001600160a01b0319166001600160a01b039091161782556020909201916001909101906200021a565b506200025f92915062000263565b5090565b6200028a91905b808211156200025f5780546001600160a01b03191681556001016200026a565b90565b611cab806200029d6000396000f3fe608060405234801561001057600080fd5b50600436106101cd5760003560e01c806301b2320e146101d2578063073ce82d146102015780630b7f166514610209578063197d6ca4146102115780631ec6b60a14610237578063200d2ed2146102415780632493b9fc1461026d5780632a2acafa1461028a5780632a4b93af146102bb5780632b38cd96146102c35780632fb0fc6f146102e057806339f0ebb1146102e85780633d46b819146102f05780633feb1bd81461030d57806340cddab31461033f578063447fe289146103975780634615d5e9146103b457806349f92f63146103d15780635197c7aa146103ee57806353556559146103f657806355a373d61461041357806357456f22146104375780638199d3fd1461045d578063900cf0cf14610465578063915eb0e71461046d5780639bf6a74a14610475578063a5f18c011461049b578063a7699d02146104a3578063a8311aa8146104c6578063aae46bab146104ce578063aea0e78b146104eb578063b7ab4db5146104f3578063c2668caf146104fb578063c3e3a45c14610503578063cc8ee06514610520578063d087d2881461053d578063d09fc00414610545578063df78523014610562578063e75235b81461056a575b600080fd5b6101ef600480360360208110156101e857600080fd5b5035610572565b60408051918252519081900360200190f35b6101ef61058a565b6101ef61059d565b6101ef6004803603602081101561022757600080fd5b50356001600160a01b03166105b5565b61023f610620565b005b610249610778565b6040518082600381111561025957fe5b60ff16815260200191505060405180910390f35b61023f6004803603602081101561028357600080fd5b5035610781565b6102a7600480360360208110156102a057600080fd5b5035610846565b604080519115158252519081900360200190f35b6101ef61085b565b6102a7600480360360208110156102d957600080fd5b5035610868565b6101ef61087d565b61023f6108e7565b6101ef6004803603602081101561030657600080fd5b50356109d3565b61023f6004803603606081101561032357600080fd5b508035906001600160a01b0360208201351690604001356109e8565b610347610b48565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561038357818101518382015260200161036b565b505050509050019250505060405180910390f35b6101ef600480360360208110156103ad57600080fd5b5035610bb3565b6101ef600480360360208110156103ca57600080fd5b5035610bc5565b6102a7600480360360208110156103e757600080fd5b5035610bda565b6101ef610bef565b61023f6004803603602081101561040c57600080fd5b5035610c07565b61041b610e1c565b604080516001600160a01b039092168252519081900360200190f35b61023f6004803603602081101561044d57600080fd5b50356001600160a01b0316610e2b565b6101ef610f63565b6101ef610f70565b61023f610f76565b61023f6004803603602081101561048b57600080fd5b50356001600160a01b031661105d565b6101ef611164565b61023f600480360360408110156104b957600080fd5b5080359060200135611171565b6101ef611304565b6101ef600480360360208110156104e457600080fd5b5035611311565b6101ef611323565b610347611329565b6101ef611392565b6101ef6004803603602081101561051957600080fd5b503561139b565b61023f6004803603602081101561053657600080fd5b50356113b0565b6101ef611471565b6101ef6004803603602081101561055b57600080fd5b503561147e565b61023f611490565b6101ef6115fc565b6000818152602081905260409020600301545b919050565b6000610597600854610bb3565b90505b90565b60075460009081526020819052604090206006015490565b600060606105c1610b48565b905060005b6105ce61058a565b81101561061657836001600160a01b03168282815181106105eb57fe5b60200260200101516001600160a01b0316141561060e5760010191506105859050565b6001016105c6565b5060009392505050565b600060065460ff16600381111561063357fe5b148061064f5750600160065460ff16600381111561064d57fe5b145b61069f576040805162461bcd60e51b815260206004820152601c60248201527b4e6f7420696e207265616479206f7220766f74696e6720737461746560201b604482015290519081900360640190fd5b6106a761087d565b6106e6576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b6106f06002611609565b15610776576008805460019081019091556006805460ff191690911790556107166115fc565b600854600090815260208190526040902060010155610733611329565b60085460009081526020818152604090912082516107579391929190910190611b27565b5061076061085b565b6008546000908152602081905260409020600201555b565b60065460ff1681565b600160065460ff16600381111561079457fe5b146107d4576040805162461bcd60e51b81526020600482015260136024820152600080516020611c0f833981519152604482015290519081900360640190fd5b6107dc61087d565b61081b576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b610826600682611660565b156108435760085460009081526020819052604090206002018190555b50565b60056020526000908152604090205460ff1681565b600061059760075461139b565b60046020526000908152604090205460ff1681565b60006060610889611329565b905060005b610896611304565b8110156108de57336001600160a01b03168282815181106108b357fe5b60200260200101516001600160a01b031614156108d657600101915061059a9050565b60010161088e565b50600091505090565b600260065460ff1660038111156108fa57fe5b14610942576040805162461bcd60e51b81526020600482015260136024820152724e6f7420696e206b657967656e20737461746560681b604482015290519081900360640190fd5b61094a61087d565b610989576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b6109936008611609565b15610776576006805460ff191660011790556008546040517fddbb65cfe1ae4aec03cef0f9667c6d7ba3740927d0c60f4dd4d7104cc31d180a90600090a2565b60009081526020819052604090206004015490565b600060065460ff1660038111156109fb57fe5b1480610a175750600160065460ff166003811115610a1557fe5b145b610a67576040805162461bcd60e51b815260206004820152601c60248201527b4e6f7420696e207265616479206f7220766f74696e6720737461746560201b604482015290519081900360640190fd5b610a6f61087d565b610aae576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b610abb60098484846116c0565b15610b4357600b546040805163a9059cbb60e01b81526001600160a01b038581166004830152602482018590529151919092169163a9059cbb9160448083019260209291908290030181600087803b158015610b1657600080fd5b505af1158015610b2a573d6000803e3d6000fd5b505050506040513d6020811015610b4057600080fd5b50505b505050565b60085460009081526020818152604091829020805483518184028101840190945280845260609392830182828015610ba957602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610b8b575b5050505050905090565b60009081526020819052604090205490565b60009081526020819052604090206001015490565b60026020526000908152604090205460ff1681565b60075460009081526020819052604090206005015490565b600060065460ff166003811115610c1a57fe5b14610c61576040805162461bcd60e51b81526020600482015260126024820152714e6f7420696e20726561647920737461746560701b604482015290519081900360640190fd5b6009548110158015610c7857506402540be4008110155b8015610c865750600a548111155b610c8f57600080fd5b6000610c9961085b565b610ca1611164565b430381610caa57fe5b60075460408051939092046020808501829052848401929092528251808503840181526060909401835283519382019390932060009081526005909152205490915060ff16610d4f57600780546040805160208082018690528183019390935281518082038301815260609091018252805190830120600090815260058352818120805460ff1916600190811790915593548152918290529020600401805490910190555b600b54604080516323b872dd60e01b81523360048201523060248201526044810185905290516001600160a01b03909216916323b872dd916064808201926020929091908290030181600087803b158015610da957600080fd5b505af1158015610dbd573d6000803e3d6000fd5b505050506040513d6020811015610dd357600080fd5b507f9273b6f22cee1ef3d7cdc2a9c031936003526bae368886259511f7dd40044b02905082610e00611471565b6040805192835260208301919091528051918290030190a15050565b600b546001600160a01b031681565b600160065460ff166003811115610e3e57fe5b14610e7e576040805162461bcd60e51b81526020600482015260136024820152600080516020611c0f833981519152604482015290519081900360640190fd5b610e8661087d565b610ec5576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b610ece816105b5565b15610f16576040805162461bcd60e51b815260206004820152601360248201527220b63932b0b23c9030903b30b634b230ba37b960691b604482015290519081900360640190fd5b610f2160038261173d565b15610843576008546000908152602081815260408220805460018101825590835291200180546001600160a01b0383166001600160a01b031990911617905550565b6000610597600854610bc5565b60075481565b600160065460ff166003811115610f8957fe5b14610fc9576040805162461bcd60e51b81526020600482015260136024820152600080516020611c0f833981519152604482015290519081900360640190fd5b610fd161087d565b611010576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b61101a6007611609565b15610776576006805460ff191660021790556008546007546040517f3ef85928df9ae51bdb3eb4c00ec73b92b82307f319ac1b029de14796a097260990600090a3565b600160065460ff16600381111561107057fe5b146110b0576040805162461bcd60e51b81526020600482015260136024820152600080516020611c0f833981519152604482015290519081900360640190fd5b6110b861087d565b6110f7576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b611100816105b5565b61114b576040805162461bcd60e51b815260206004820152601760248201527620b63932b0b23c903737ba1030903b30b634b230ba37b960491b604482015290519081900360640190fd5b61115660048261173d565b1561084357610843816117aa565b6000610597600754610572565b600260065460ff16600381111561118457fe5b146111cc576040805162461bcd60e51b81526020600482015260136024820152724e6f7420696e206b657967656e20737461746560681b604482015290519081900360640190fd5b6111d5336105b5565b61121d576040805162461bcd60e51b81526020600482015260146024820152732737ba1030903732bc3a103b30b634b230ba37b960611b604482015290519081900360640190fd5b611229600083836118e4565b15611300576008805460009081526020819052604080822060050185905582548252902060060182905554600114156112c3576006805460ff191690556008805460009081526020818152604080832043600390910155835483529182902060001960049091015591546007819055815185815292830184905281519092600080516020611bef83398151915292908290030190a2611300565b6006805460ff191660031790556008546007546040517ff4735b85cc98f9a712832825ecab4cfb1649d658f9a73c57a00ea7dde735c79b90600090a35b5050565b6000610597600754610bb3565b60036020526000908152604090205481565b60085481565b60075460009081526020818152604091829020805483518184028101840190945280845260609392830182828015610ba9576020028201919060005260206000209081546001600160a01b03168152600190910190602001808311610b8b575050505050905090565b60006105976008545b60009081526020819052604090206002015490565b600160065460ff1660038111156113c357fe5b14611403576040805162461bcd60e51b81526020600482015260136024820152600080516020611c0f833981519152604482015290519081900360640190fd5b61140b61087d565b61144a576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b611455600582611660565b1561084357600854600090815260208190526040902060010155565b60006105976007546109d3565b60016020526000908152604090205481565b600360065460ff1660038111156114a357fe5b146114f3576040805162461bcd60e51b815260206004820152601b60248201527a4e6f7420696e2066756e6473207472616e7366657220737461746560281b604482015290519081900360640190fd5b6114fb61087d565b61153a576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b60006007541161157b5760405162461bcd60e51b8152600401808060200182810382526028815260200180611c2f6028913960400191505060405180910390fd5b611585600161194d565b15610776576006805460ff191690556008805460009081526020819052604080822043600390910155825482529020600019600490910155546007819055600080516020611bef8339815191526115da610bef565b6115e261059d565b6040805192835260208301919091528051918290030190a2565b6000610597600754610bc5565b600080826008546040516020018083600981111561162357fe5b60ff1660f81b8152600101828152602001925050506040516020818303038152906040528051906020012090506116598161199d565b9392505050565b60008083600854846040516020018084600981111561167b57fe5b60ff1660f81b815260010183815260200182815260200193505050506040516020818303038152906040528051906020012090506116b88161199d565b949350505050565b60008085858585604051602001808560098111156116da57fe5b60ff1660f81b8152600101848152602001836001600160a01b03166001600160a01b031660601b81526014018281526020019450505050506040516020818303038152906040528051906020012090506117338161199d565b9695505050505050565b60008083600854846040516020018084600981111561175857fe5b60ff1660f81b8152600101838152602001826001600160a01b03166001600160a01b031660601b815260140193505050506040516020818303038152906040528051906020012090506116b88161199d565b60005b60016117b761058a565b0381101561188557600854600090815260208190526040902080546001600160a01b0384169190839081106117e857fe5b6000918252602090912001546001600160a01b0316141561187d5761180b610b48565b600161181561058a565b038151811061182057fe5b60200260200101516000806008548152602001908152602001600020600001828154811061184a57fe5b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550611885565b6001016117ad565b50600854600090815260208190526040902060016118a161058a565b03815481106118ac57fe5b6000918252602080832090910180546001600160a01b0319169055600854825281905260409020805490611300906000198301611b8c565b6000808460085485856040516020018085600981111561190057fe5b60ff1660f81b815260010184815260200183815260200182815260200194505050505060405160208183030381529060405280519060200120905061194481611a70565b95945050505050565b600080826008546040516020018083600981111561196757fe5b60ff1660f81b81526001018281526020019250505060405160208183030381529060405280519060200120905061165981611a70565b6000806119a983611af8565b60008181526004602052604090205490915060ff1615611a00576040805162461bcd60e51b815260206004820152600d60248201526c566f74656420616c726561647960981b604482015290519081900360640190fd5b6000818152600460205260409020805460ff19166001179055611a216115fc565b6000848152600360205260409020541415611a545750506000818152600360205260409020600160ff1b90556001610585565b5050600081815260036020526040812080546001019055610585565b600080611a7c83611af8565b60008181526004602052604090205490915060ff1615611ad7576040805162461bcd60e51b8152602060048201526011602482015270436f6e6669726d656420616c726561647960781b604482015290519081900360640190fd5b6000818152600460205260409020805460ff19166001179055611a21610f63565b604080516020808201939093523360601b81830152815180820360340181526054909101909152805191012090565b828054828255906000526020600020908101928215611b7c579160200282015b82811115611b7c57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190611b47565b50611b88929150611bb0565b5090565b815481835581811115610b4357600083815260209020610b43918101908301611bd4565b61059a91905b80821115611b885780546001600160a01b0319168155600101611bb6565b61059a91905b80821115611b885760008155600101611bda56fec33272939f066c227e913a4b3434d860794f185c551685c29451a3a38b9b259c4e6f7420696e20766f74696e672073746174650000000000000000000000000046697273742065706f636820646f6573206e6f74206e6565642066756e6473207472616e736665724e6f7420612063757272656e742076616c696461746f72000000000000000000a265627a7a72305820dfb70a1c283919f9128aabe00d30be35942e7ded3ecf2eb30af4168b8b02e15a64736f6c63430005090032", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101cd5760003560e01c806301b2320e146101d2578063073ce82d146102015780630b7f166514610209578063197d6ca4146102115780631ec6b60a14610237578063200d2ed2146102415780632493b9fc1461026d5780632a2acafa1461028a5780632a4b93af146102bb5780632b38cd96146102c35780632fb0fc6f146102e057806339f0ebb1146102e85780633d46b819146102f05780633feb1bd81461030d57806340cddab31461033f578063447fe289146103975780634615d5e9146103b457806349f92f63146103d15780635197c7aa146103ee57806353556559146103f657806355a373d61461041357806357456f22146104375780638199d3fd1461045d578063900cf0cf14610465578063915eb0e71461046d5780639bf6a74a14610475578063a5f18c011461049b578063a7699d02146104a3578063a8311aa8146104c6578063aae46bab146104ce578063aea0e78b146104eb578063b7ab4db5146104f3578063c2668caf146104fb578063c3e3a45c14610503578063cc8ee06514610520578063d087d2881461053d578063d09fc00414610545578063df78523014610562578063e75235b81461056a575b600080fd5b6101ef600480360360208110156101e857600080fd5b5035610572565b60408051918252519081900360200190f35b6101ef61058a565b6101ef61059d565b6101ef6004803603602081101561022757600080fd5b50356001600160a01b03166105b5565b61023f610620565b005b610249610778565b6040518082600381111561025957fe5b60ff16815260200191505060405180910390f35b61023f6004803603602081101561028357600080fd5b5035610781565b6102a7600480360360208110156102a057600080fd5b5035610846565b604080519115158252519081900360200190f35b6101ef61085b565b6102a7600480360360208110156102d957600080fd5b5035610868565b6101ef61087d565b61023f6108e7565b6101ef6004803603602081101561030657600080fd5b50356109d3565b61023f6004803603606081101561032357600080fd5b508035906001600160a01b0360208201351690604001356109e8565b610347610b48565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561038357818101518382015260200161036b565b505050509050019250505060405180910390f35b6101ef600480360360208110156103ad57600080fd5b5035610bb3565b6101ef600480360360208110156103ca57600080fd5b5035610bc5565b6102a7600480360360208110156103e757600080fd5b5035610bda565b6101ef610bef565b61023f6004803603602081101561040c57600080fd5b5035610c07565b61041b610e1c565b604080516001600160a01b039092168252519081900360200190f35b61023f6004803603602081101561044d57600080fd5b50356001600160a01b0316610e2b565b6101ef610f63565b6101ef610f70565b61023f610f76565b61023f6004803603602081101561048b57600080fd5b50356001600160a01b031661105d565b6101ef611164565b61023f600480360360408110156104b957600080fd5b5080359060200135611171565b6101ef611304565b6101ef600480360360208110156104e457600080fd5b5035611311565b6101ef611323565b610347611329565b6101ef611392565b6101ef6004803603602081101561051957600080fd5b503561139b565b61023f6004803603602081101561053657600080fd5b50356113b0565b6101ef611471565b6101ef6004803603602081101561055b57600080fd5b503561147e565b61023f611490565b6101ef6115fc565b6000818152602081905260409020600301545b919050565b6000610597600854610bb3565b90505b90565b60075460009081526020819052604090206006015490565b600060606105c1610b48565b905060005b6105ce61058a565b81101561061657836001600160a01b03168282815181106105eb57fe5b60200260200101516001600160a01b0316141561060e5760010191506105859050565b6001016105c6565b5060009392505050565b600060065460ff16600381111561063357fe5b148061064f5750600160065460ff16600381111561064d57fe5b145b61069f576040805162461bcd60e51b815260206004820152601c60248201527b4e6f7420696e207265616479206f7220766f74696e6720737461746560201b604482015290519081900360640190fd5b6106a761087d565b6106e6576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b6106f06002611609565b15610776576008805460019081019091556006805460ff191690911790556107166115fc565b600854600090815260208190526040902060010155610733611329565b60085460009081526020818152604090912082516107579391929190910190611b27565b5061076061085b565b6008546000908152602081905260409020600201555b565b60065460ff1681565b600160065460ff16600381111561079457fe5b146107d4576040805162461bcd60e51b81526020600482015260136024820152600080516020611c0f833981519152604482015290519081900360640190fd5b6107dc61087d565b61081b576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b610826600682611660565b156108435760085460009081526020819052604090206002018190555b50565b60056020526000908152604090205460ff1681565b600061059760075461139b565b60046020526000908152604090205460ff1681565b60006060610889611329565b905060005b610896611304565b8110156108de57336001600160a01b03168282815181106108b357fe5b60200260200101516001600160a01b031614156108d657600101915061059a9050565b60010161088e565b50600091505090565b600260065460ff1660038111156108fa57fe5b14610942576040805162461bcd60e51b81526020600482015260136024820152724e6f7420696e206b657967656e20737461746560681b604482015290519081900360640190fd5b61094a61087d565b610989576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b6109936008611609565b15610776576006805460ff191660011790556008546040517fddbb65cfe1ae4aec03cef0f9667c6d7ba3740927d0c60f4dd4d7104cc31d180a90600090a2565b60009081526020819052604090206004015490565b600060065460ff1660038111156109fb57fe5b1480610a175750600160065460ff166003811115610a1557fe5b145b610a67576040805162461bcd60e51b815260206004820152601c60248201527b4e6f7420696e207265616479206f7220766f74696e6720737461746560201b604482015290519081900360640190fd5b610a6f61087d565b610aae576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b610abb60098484846116c0565b15610b4357600b546040805163a9059cbb60e01b81526001600160a01b038581166004830152602482018590529151919092169163a9059cbb9160448083019260209291908290030181600087803b158015610b1657600080fd5b505af1158015610b2a573d6000803e3d6000fd5b505050506040513d6020811015610b4057600080fd5b50505b505050565b60085460009081526020818152604091829020805483518184028101840190945280845260609392830182828015610ba957602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610b8b575b5050505050905090565b60009081526020819052604090205490565b60009081526020819052604090206001015490565b60026020526000908152604090205460ff1681565b60075460009081526020819052604090206005015490565b600060065460ff166003811115610c1a57fe5b14610c61576040805162461bcd60e51b81526020600482015260126024820152714e6f7420696e20726561647920737461746560701b604482015290519081900360640190fd5b6009548110158015610c7857506402540be4008110155b8015610c865750600a548111155b610c8f57600080fd5b6000610c9961085b565b610ca1611164565b430381610caa57fe5b60075460408051939092046020808501829052848401929092528251808503840181526060909401835283519382019390932060009081526005909152205490915060ff16610d4f57600780546040805160208082018690528183019390935281518082038301815260609091018252805190830120600090815260058352818120805460ff1916600190811790915593548152918290529020600401805490910190555b600b54604080516323b872dd60e01b81523360048201523060248201526044810185905290516001600160a01b03909216916323b872dd916064808201926020929091908290030181600087803b158015610da957600080fd5b505af1158015610dbd573d6000803e3d6000fd5b505050506040513d6020811015610dd357600080fd5b507f9273b6f22cee1ef3d7cdc2a9c031936003526bae368886259511f7dd40044b02905082610e00611471565b6040805192835260208301919091528051918290030190a15050565b600b546001600160a01b031681565b600160065460ff166003811115610e3e57fe5b14610e7e576040805162461bcd60e51b81526020600482015260136024820152600080516020611c0f833981519152604482015290519081900360640190fd5b610e8661087d565b610ec5576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b610ece816105b5565b15610f16576040805162461bcd60e51b815260206004820152601360248201527220b63932b0b23c9030903b30b634b230ba37b960691b604482015290519081900360640190fd5b610f2160038261173d565b15610843576008546000908152602081815260408220805460018101825590835291200180546001600160a01b0383166001600160a01b031990911617905550565b6000610597600854610bc5565b60075481565b600160065460ff166003811115610f8957fe5b14610fc9576040805162461bcd60e51b81526020600482015260136024820152600080516020611c0f833981519152604482015290519081900360640190fd5b610fd161087d565b611010576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b61101a6007611609565b15610776576006805460ff191660021790556008546007546040517f3ef85928df9ae51bdb3eb4c00ec73b92b82307f319ac1b029de14796a097260990600090a3565b600160065460ff16600381111561107057fe5b146110b0576040805162461bcd60e51b81526020600482015260136024820152600080516020611c0f833981519152604482015290519081900360640190fd5b6110b861087d565b6110f7576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b611100816105b5565b61114b576040805162461bcd60e51b815260206004820152601760248201527620b63932b0b23c903737ba1030903b30b634b230ba37b960491b604482015290519081900360640190fd5b61115660048261173d565b1561084357610843816117aa565b6000610597600754610572565b600260065460ff16600381111561118457fe5b146111cc576040805162461bcd60e51b81526020600482015260136024820152724e6f7420696e206b657967656e20737461746560681b604482015290519081900360640190fd5b6111d5336105b5565b61121d576040805162461bcd60e51b81526020600482015260146024820152732737ba1030903732bc3a103b30b634b230ba37b960611b604482015290519081900360640190fd5b611229600083836118e4565b15611300576008805460009081526020819052604080822060050185905582548252902060060182905554600114156112c3576006805460ff191690556008805460009081526020818152604080832043600390910155835483529182902060001960049091015591546007819055815185815292830184905281519092600080516020611bef83398151915292908290030190a2611300565b6006805460ff191660031790556008546007546040517ff4735b85cc98f9a712832825ecab4cfb1649d658f9a73c57a00ea7dde735c79b90600090a35b5050565b6000610597600754610bb3565b60036020526000908152604090205481565b60085481565b60075460009081526020818152604091829020805483518184028101840190945280845260609392830182828015610ba9576020028201919060005260206000209081546001600160a01b03168152600190910190602001808311610b8b575050505050905090565b60006105976008545b60009081526020819052604090206002015490565b600160065460ff1660038111156113c357fe5b14611403576040805162461bcd60e51b81526020600482015260136024820152600080516020611c0f833981519152604482015290519081900360640190fd5b61140b61087d565b61144a576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b611455600582611660565b1561084357600854600090815260208190526040902060010155565b60006105976007546109d3565b60016020526000908152604090205481565b600360065460ff1660038111156114a357fe5b146114f3576040805162461bcd60e51b815260206004820152601b60248201527a4e6f7420696e2066756e6473207472616e7366657220737461746560281b604482015290519081900360640190fd5b6114fb61087d565b61153a576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b60006007541161157b5760405162461bcd60e51b8152600401808060200182810382526028815260200180611c2f6028913960400191505060405180910390fd5b611585600161194d565b15610776576006805460ff191690556008805460009081526020819052604080822043600390910155825482529020600019600490910155546007819055600080516020611bef8339815191526115da610bef565b6115e261059d565b6040805192835260208301919091528051918290030190a2565b6000610597600754610bc5565b600080826008546040516020018083600981111561162357fe5b60ff1660f81b8152600101828152602001925050506040516020818303038152906040528051906020012090506116598161199d565b9392505050565b60008083600854846040516020018084600981111561167b57fe5b60ff1660f81b815260010183815260200182815260200193505050506040516020818303038152906040528051906020012090506116b88161199d565b949350505050565b60008085858585604051602001808560098111156116da57fe5b60ff1660f81b8152600101848152602001836001600160a01b03166001600160a01b031660601b81526014018281526020019450505050506040516020818303038152906040528051906020012090506117338161199d565b9695505050505050565b60008083600854846040516020018084600981111561175857fe5b60ff1660f81b8152600101838152602001826001600160a01b03166001600160a01b031660601b815260140193505050506040516020818303038152906040528051906020012090506116b88161199d565b60005b60016117b761058a565b0381101561188557600854600090815260208190526040902080546001600160a01b0384169190839081106117e857fe5b6000918252602090912001546001600160a01b0316141561187d5761180b610b48565b600161181561058a565b038151811061182057fe5b60200260200101516000806008548152602001908152602001600020600001828154811061184a57fe5b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550611885565b6001016117ad565b50600854600090815260208190526040902060016118a161058a565b03815481106118ac57fe5b6000918252602080832090910180546001600160a01b0319169055600854825281905260409020805490611300906000198301611b8c565b6000808460085485856040516020018085600981111561190057fe5b60ff1660f81b815260010184815260200183815260200182815260200194505050505060405160208183030381529060405280519060200120905061194481611a70565b95945050505050565b600080826008546040516020018083600981111561196757fe5b60ff1660f81b81526001018281526020019250505060405160208183030381529060405280519060200120905061165981611a70565b6000806119a983611af8565b60008181526004602052604090205490915060ff1615611a00576040805162461bcd60e51b815260206004820152600d60248201526c566f74656420616c726561647960981b604482015290519081900360640190fd5b6000818152600460205260409020805460ff19166001179055611a216115fc565b6000848152600360205260409020541415611a545750506000818152600360205260409020600160ff1b90556001610585565b5050600081815260036020526040812080546001019055610585565b600080611a7c83611af8565b60008181526004602052604090205490915060ff1615611ad7576040805162461bcd60e51b8152602060048201526011602482015270436f6e6669726d656420616c726561647960781b604482015290519081900360640190fd5b6000818152600460205260409020805460ff19166001179055611a21610f63565b604080516020808201939093523360601b81830152815180820360340181526054909101909152805191012090565b828054828255906000526020600020908101928215611b7c579160200282015b82811115611b7c57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190611b47565b50611b88929150611bb0565b5090565b815481835581811115610b4357600083815260209020610b43918101908301611bd4565b61059a91905b80821115611b885780546001600160a01b0319168155600101611bb6565b61059a91905b80821115611b885760008155600101611bda56fec33272939f066c227e913a4b3434d860794f185c551685c29451a3a38b9b259c4e6f7420696e20766f74696e672073746174650000000000000000000000000046697273742065706f636820646f6573206e6f74206e6565642066756e6473207472616e736665724e6f7420612063757272656e742076616c696461746f72000000000000000000a265627a7a72305820dfb70a1c283919f9128aabe00d30be35942e7ded3ecf2eb30af4168b8b02e15a64736f6c63430005090032", + "sourceMap": "93:11259:0:-;;;1516:530;8:9:-1;5:2;;;30:1;27;20:12;5:2;1516:530:0;;;;;;;;;;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;1516:530:0;;;;;;;;;;;;;;19:11:-1;11:20;;8:2;;;44:1;41;34:12;8:2;62:21;;123:4;114:14;;138:31;;;135:2;;;182:1;179;172:12;135:2;219:3;213:10;331:9;325:2;311:12;307:21;289:16;285:44;282:59;261:11;247:12;244:29;233:116;230:2;;;362:1;359;352:12;230:2;-1:-1;;1516:530:0;;;;;;;;1661:17;;1516:530;;-1:-1:-1;1516:530:0;;-1:-1:-1;1516:530:0;;;;;;1653:30;;;;;;1713:10;:17;1701:9;:29;1693:38;;;;;;1742:13;:38;;-1:-1:-1;;;;;1742:38:0;;-1:-1:-1;;;;;;1742:38:0;;;;;;-1:-1:-1;1791:5:0;:9;;;1810:6;:22;;-1:-1:-1;;1810:22:0;1819:13;1810:22;;;-1:-1:-1;1842:9:0;:13;;;1886:58;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;1886:58:0;;;;;;;;;;;;;;;;1866:17;;;;;;:78;;;;1886:58;;1866:17;;:78;;:17;;:78;;;:::i;:::-;-1:-1:-1;1866:78:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1968:6;-1:-1:-1;1968:9:0;;;;1955:10;:22;2000:6;2007:1;2000:9;;;;1987:10;:22;2025:14;;2037:1;;2034;;2025:14;;2034:1;;2025:14;1516:530;;;;;93:11259;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;93:11259:0;-1:-1:-1;;;;;93:11259:0;;;;;;;;;;;-1:-1:-1;93:11259:0;;;;;;;-1:-1:-1;93:11259:0;;;-1:-1:-1;93:11259:0;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;-1:-1:-1;;;;;;93:11259:0;;;;;;;;;:::o;:::-;;;;;;;", + "deployedSourceMap": "93:11259:0:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;93:11259:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5418:112;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;5418:112:0;;:::i;:::-;;;;;;;;;;;;;;;;4766:98;;;:::i;6148:82::-;;;:::i;6506:276::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;6506:276:0;-1:-1:-1;;;;;6506:276:0;;:::i;7032:357::-;;;:::i;:::-;;1395:20;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8607:204;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;8607:204:0;;:::i;1347:41::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1347:41:0;;:::i;:::-;;;;;;;;;;;;;;;;;;5536:94;;;:::i;1304:37::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1304:37:0;;:::i;6236:264::-;;;:::i;9022:203::-;;;:::i;5952:102::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;5952:102:0;;:::i;3310:213::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;3310:213:0;;;-1:-1:-1;;;;;3310:213:0;;;;;;;;;;:::i;6906:120::-;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:100:-1;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;6906:120:0;;;;;;;;;;;;;;;;;4870:116;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;4870:116:0;;:::i;5200:110::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;5200:110:0;;:::i;1208:42::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1208:42:0;;:::i;6060:82::-;;;:::i;2786:518::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;2786:518:0;;:::i;2052:27::-;;;:::i;:::-;;;;-1:-1:-1;;;;;2052:27:0;;;;;;;;;;;;;;7395:278;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;7395:278:0;-1:-1:-1;;;;;7395:278:0;;:::i;5092:102::-;;;:::i;1422:17::-;;;:::i;8817:199::-;;;:::i;7679:271::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;7679:271:0;-1:-1:-1;;;;;7679:271:0;;:::i;5316:96::-;;;:::i;3529:691::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;3529:691:0;;;;;;;:::i;4670:90::-;;;:::i;1256:42::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1256:42:0;;:::i;1445:21::-;;;:::i;6788:112::-;;;:::i;5636:102::-;;;:::i;5744:110::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;5744:110:0;;:::i;8398:203::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;8398:203:0;;:::i;5860:86::-;;;:::i;1155:47::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1155:47:0;;:::i;4226:438::-;;;:::i;4992:94::-;;;:::i;5418:112::-;5475:4;5498:14;;;;;;;;;;:25;;;5418:112;;;;:::o;4766:98::-;4813:4;4836:21;4847:9;;4836:10;:21::i;:::-;4829:28;;4766:98;;:::o;6148:82::-;6215:5;;6185:4;6208:13;;;;;;;;;;:15;;;6148:82;:::o;6506:276::-;6562:4;6578:27;6608:19;:17;:19::i;:::-;6578:49;-1:-1:-1;6642:6:0;6637:121;6658:16;:14;:16::i;:::-;6654:1;:20;6637:121;;;6716:1;-1:-1:-1;;;;;6699:18:0;:10;6710:1;6699:13;;;;;;;;;;;;;;-1:-1:-1;;;;;6699:18:0;;6695:52;;;6746:1;6742:5;;-1:-1:-1;6735:12:0;;-1:-1:-1;6735:12:0;6695:52;6676:3;;6637:121;;;-1:-1:-1;6774:1:0;;6506:276;-1:-1:-1;;;6506:276:0:o;7032:357::-;2239:12;2229:6;;;;:22;;;;;;;;;:49;;;-1:-1:-1;2265:13:0;2255:6;;;;:23;;;;;;;;;2229:49;2221:90;;;;;-1:-1:-1;;;2221:90:0;;;;;;;;;;;;-1:-1:-1;;;2221:90:0;;;;;;;;;;;;;;;2717:12;:10;:12::i;:::-;2709:53;;;;;-1:-1:-1;;;2709:53:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2709:53:0;;;;;;;;;;;;;;;7107:26;7115:17;7107:7;:26::i;:::-;7103:280;;;7149:9;:11;;;;;;;;;7174:6;:22;;-1:-1:-1;;7174:22:0;;;;;;7240:14;:12;:14::i;:::-;7217:9;;7210:6;:17;;;;;;;;;;:27;;:44;7299:15;:13;:15::i;:::-;7275:9;;7268:6;:17;;;;;;;;;;;:46;;;;:17;;:46;;;;;;:::i;:::-;;7358:14;:12;:14::i;:::-;7335:9;;7328:6;:17;;;;;;;;;;:27;;:44;7103:280;7032:357::o;1395:20::-;;;;;;:::o;8607:204::-;2379:13;2369:6;;;;:23;;;;;;;;;2361:55;;;;;-1:-1:-1;;;2361:55:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2361:55:0;;;;;;;;;;;;;;;2717:12;:10;:12::i;:::-;2709:53;;;;;-1:-1:-1;;;2709:53:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2709:53:0;;;;;;;;;;;;;;;8697:42;8705:22;8729:9;8697:7;:42::i;:::-;8693:112;;;8762:9;;8755:6;:17;;;;;;;;;;:27;;:39;;;8693:112;8607:204;:::o;1347:41::-;;;;;;;;;;;;;;;:::o;5536:94::-;5581:4;5604:19;5617:5;;5604:12;:19::i;1304:37::-;;;;;;;;;;;;;;;:::o;6236:264::-;6279:4;6295:27;6325:15;:13;:15::i;:::-;6295:45;-1:-1:-1;6355:6:0;6350:126;6371:12;:10;:12::i;:::-;6367:1;:16;6350:126;;;6425:10;-1:-1:-1;;;;;6408:27:0;:10;6419:1;6408:13;;;;;;;;;;;;;;-1:-1:-1;;;;;6408:27:0;;6404:61;;;6464:1;6460:5;;-1:-1:-1;6453:12:0;;-1:-1:-1;6453:12:0;6404:61;6385:3;;6350:126;;;;6492:1;6485:8;;;6236:264;:::o;9022:203::-;2484:13;2474:6;;;;:23;;;;;;;;;2466:55;;;;;-1:-1:-1;;;2466:55:0;;;;;;;;;;;;-1:-1:-1;;;2466:55:0;;;;;;;;;;;;;;;2717:12;:10;:12::i;:::-;2709:53;;;;;-1:-1:-1;;;2709:53:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2709:53:0;;;;;;;;;;;;;;;9095:27;9103:18;9095:7;:27::i;:::-;9091:128;;;9138:6;:22;;-1:-1:-1;;9138:22:0;9147:13;9138:22;;;9198:9;;9180:28;;;;-1:-1:-1;;9180:28:0;9022:203::o;5952:102::-;6004:4;6027:14;;;;;;;;;;:20;;;;5952:102::o;3310:213::-;2239:12;2229:6;;;;:22;;;;;;;;;:49;;;-1:-1:-1;2265:13:0;2255:6;;;;:23;;;;;;;;;2229:49;2221:90;;;;;-1:-1:-1;;;2221:90:0;;;;;;;;;;;;-1:-1:-1;;;2221:90:0;;;;;;;;;;;;;;;2717:12;:10;:12::i;:::-;2709:53;;;;;-1:-1:-1;;;2709:53:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2709:53:0;;;;;;;;;;;;;;;3418:39;3426:13;3441:4;3447:2;3451:5;3418:7;:39::i;:::-;3414:103;;;3473:13;;:33;;;-1:-1:-1;;;3473:33:0;;-1:-1:-1;;;;;3473:33:0;;;;;;;;;;;;;;;:13;;;;;:22;;:33;;;;;;;;;;;;;;:13;;:33;;;5:2:-1;;;;30:1;27;20:12;5:2;3473:33:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3473:33:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;3414:103:0;3310:213;;;:::o;6906:120::-;6998:9;;6991:6;:17;;;;;;;;;;;;6984:35;;;;;;;;;;;;;;;;;6956:16;;6984:35;;;6991:17;6984:35;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;6984:35:0;;;;;;;;;;;;;;;;;;;;;;;6906:120;:::o;4870:116::-;4924:4;4947:14;;;;;;;;;;:32;;4870:116::o;5200:110::-;5256:4;5279:14;;;;;;;;;;:24;;;;5200:110::o;1208:42::-;;;;;;;;;;;;;;;:::o;6060:82::-;6127:5;;6097:4;6120:13;;;;;;;;;;:15;;;6060:82;:::o;2786:518::-;2129:12;2119:6;;;;:22;;;;;;;;;2111:53;;;;;-1:-1:-1;;;2111:53:0;;;;;;;;;;;;-1:-1:-1;;;2111:53:0;;;;;;;;;;;;;;;2856:10;;2847:5;:19;;:40;;;;;2879:8;2870:5;:17;;2847:40;:63;;;;;2900:10;;2891:5;:19;;2847:63;2839:72;;;;;;2922:12;2972:14;:12;:14::i;:::-;2953:15;:13;:15::i;:::-;2938:12;:30;2937:49;;;;;3047:5;;3021:32;;;2937:49;;;;3021:32;;;;;;;;;;;;;;;;26:21:-1;;;22:32;;6:49;;3021:32:0;;;;;;3011:43;;;;;;;;;3001:54;;;;:9;:54;;;;;2937:49;;-1:-1:-1;3001:54:0;;2996:182;;3117:5;;;3091:32;;;;;;;;;;;;;;;;;;;26:21:-1;;;22:32;;6:49;;3091:32:0;;;;;;3081:43;;;;;;3071:54;;;;:9;:54;;;;;:61;;-1:-1:-1;;3071:61:0;3128:4;3071:61;;;;;;3153:5;;3146:13;;;;;;;;:19;;:21;;;;;;;2996:182;3188:13;;:60;;;-1:-1:-1;;;3188:60:0;;3215:10;3188:60;;;;3235:4;3188:60;;;;;;;;;;;;-1:-1:-1;;;;;3188:13:0;;;;:26;;:60;;;;;;;;;;;;;;;:13;;:60;;;5:2:-1;;;;30:1;27;20:12;5:2;3188:60:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3188:60:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;3263:34:0;;-1:-1:-1;3279:5:0;3286:10;:8;:10::i;:::-;3263:34;;;;;;;;;;;;;;;;;;;;;;2174:1;2786:518;:::o;2052:27::-;;;-1:-1:-1;;;;;2052:27:0;;:::o;7395:278::-;2379:13;2369:6;;;;:23;;;;;;;;;2361:55;;;;;-1:-1:-1;;;2361:55:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2361:55:0;;;;;;;;;;;;;;;2717:12;:10;:12::i;:::-;2709:53;;;;;-1:-1:-1;;;2709:53:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2709:53:0;;;;;;;;;;;;;;;7489:25;7504:9;7489:14;:25::i;:::-;:30;7481:62;;;;;-1:-1:-1;;;7481:62:0;;;;;;;;;;;;-1:-1:-1;;;7481:62:0;;;;;;;;;;;;;;;7558:38;7566:18;7586:9;7558:7;:38::i;:::-;7554:113;;;7619:9;;7612:6;:17;;;;;;;;;;27:10:-1;;39:1;23:18;;45:23;;7612:44:0;;;;;;;;-1:-1:-1;;;;;7612:44:0;;-1:-1:-1;;;;;;7612:44:0;;;;;;7395:278;:::o;5092:102::-;5141:4;5164:23;5177:9;;5164:12;:23::i;1422:17::-;;;;:::o;8817:199::-;2379:13;2369:6;;;;:23;;;;;;;;;2361:55;;;;;-1:-1:-1;;;2361:55:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2361:55:0;;;;;;;;;;;;;;;2717:12;:10;:12::i;:::-;2709:53;;;;;-1:-1:-1;;;2709:53:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2709:53:0;;;;;;;;;;;;;;;8889:26;8897:17;8889:7;:26::i;:::-;8885:125;;;8931:6;:22;;-1:-1:-1;;8931:22:0;8940:13;8931:22;;;8989:9;;8982:5;;8973:26;;;;-1:-1:-1;;8973:26:0;8817:199::o;7679:271::-;2379:13;2369:6;;;;:23;;;;;;;;;2361:55;;;;;-1:-1:-1;;;2361:55:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2361:55:0;;;;;;;;;;;;;;;2717:12;:10;:12::i;:::-;2709:53;;;;;-1:-1:-1;;;2709:53:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2709:53:0;;;;;;;;;;;;;;;7776:25;7791:9;7776:14;:25::i;:::-;7768:66;;;;;-1:-1:-1;;;7768:66:0;;;;;;;;;;;;-1:-1:-1;;;7768:66:0;;;;;;;;;;;;;;;7849:41;7857:21;7880:9;7849:7;:41::i;:::-;7845:99;;;7906:27;7923:9;7906:16;:27::i;5316:96::-;5362:4;5385:20;5399:5;;5385:13;:20::i;3529:691::-;2484:13;2474:6;;;;:23;;;;;;;;;2466:55;;;;;-1:-1:-1;;;2466:55:0;;;;;;;;;;;;-1:-1:-1;;;2466:55:0;;;;;;;;;;;;;;;3600:26;3615:10;3600:14;:26::i;:::-;3592:64;;;;;-1:-1:-1;;;3592:64:0;;;;;;;;;;;;-1:-1:-1;;;3592:64:0;;;;;;;;;;;;;;;3671:37;3682:19;3703:1;3706;3671:10;:37::i;:::-;3667:547;;;3731:9;;;3724:6;:17;;;;;;;;;;;:19;;:23;;;3768:9;;3761:17;;;;:19;;:23;;;3802:9;3815:1;3802:14;3798:406;;;3836:6;:21;;-1:-1:-1;;3836:21:0;;;3882:9;;;3845:12;3875:17;;;;;;;;;;;3906:12;3875:28;;;;:43;3943:9;;3936:17;;;;;;-1:-1:-1;;3936:23:0;;;;:34;3996:9;;3988:5;:17;;;4028:23;;;;;;;;;;;;;3996:9;;-1:-1:-1;;;;;;;;;;;4028:23:0;;;;;;;;3798:406;;;4102:6;:30;;-1:-1:-1;;4102:30:0;4111:21;4102:30;;;4179:9;;4172:5;;4155:34;;;;-1:-1:-1;;4155:34:0;3798:406;3529:691;;:::o;4670:90::-;4713:4;4736:17;4747:5;;4736:10;:17::i;1256:42::-;;;;;;;;;;;;;:::o;1445:21::-;;;;:::o;6788:112::-;6876:5;;6869:6;:13;;;;;;;;;;;;6862:31;;;;;;;;;;;;;;;;;6834:16;;6862:31;;;6869:13;6862:31;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;6862:31:0;;;;;;;;;;;;;;;;;;;;;;6788:112;:::o;5636:102::-;5685:4;5708:23;5721:9;;5744:110;5800:4;5823:14;;;;;;;;;;:24;;;;5744:110::o;8398:203::-;2379:13;2369:6;;;;:23;;;;;;;;;2361:55;;;;;-1:-1:-1;;;2361:55:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2361:55:0;;;;;;;;;;;;;;;2717:12;:10;:12::i;:::-;2709:53;;;;;-1:-1:-1;;;2709:53:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2709:53:0;;;;;;;;;;;;;;;8488:41;8496:21;8519:9;8488:7;:41::i;:::-;8484:111;;;8552:9;;8545:6;:17;;;;;;;;;;:27;;:39;8398:203::o;5860:86::-;5901:4;5924:15;5933:5;;5924:8;:15::i;1155:47::-;;;;;;;;;;;;;:::o;4226:438::-;2596:21;2586:6;;;;:31;;;;;;;;;2578:71;;;;;-1:-1:-1;;;2578:71:0;;;;;;;;;;;;-1:-1:-1;;;2578:71:0;;;;;;;;;;;;;;;2717:12;:10;:12::i;:::-;2709:53;;;;;-1:-1:-1;;;2709:53:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2709:53:0;;;;;;;;;;;;;;;4322:1;4314:5;;:9;4306:62;;;;-1:-1:-1;;;4306:62:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4383:39;4394:27;4383:10;:39::i;:::-;4379:279;;;4438:6;:21;;-1:-1:-1;;4438:21:0;;;4480:9;;;4447:12;4473:17;;;;;;;;;;;4504:12;4473:28;;;;:43;4537:9;;4530:17;;;;-1:-1:-1;;4530:23:0;;;;:34;4586:9;4578:5;:17;;;-1:-1:-1;;;;;;;;;;;4632:6:0;:4;:6::i;:::-;4640;:4;:6::i;:::-;4614:33;;;;;;;;;;;;;;;;;;;;;;4226:438::o;4992:94::-;5037:4;5060:19;5073:5;;5060:12;:19::i;9231:165::-;9280:4;9296:12;9338:8;9348:9;;9321:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;9321:37:0;;;9311:48;;;;;;9296:63;;9376:13;9384:4;9376:7;:13::i;:::-;9369:20;9231:165;-1:-1:-1;;;9231:165:0:o;9593:180::-;9652:4;9668:12;9710:8;9720:9;;9731:3;9693:42;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;9693:42:0;;;9683:53;;;;;;9668:68;;9753:13;9761:4;9753:7;:13::i;:::-;9746:20;9593:180;-1:-1:-1;;;;9593:180:0:o;9779:209::-;9866:4;9882:12;9924:8;9934:4;9940:2;9944:5;9907:43;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;9907:43:0;-1:-1:-1;;;;;9907:43:0;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;9907:43:0;;;9897:54;;;;;;9882:69;;9968:13;9976:4;9968:7;:13::i;:::-;9961:20;9779:209;-1:-1:-1;;;;;;9779:209:0:o;9402:185::-;9465:4;9481:12;9523:8;9533:9;;9544:4;9506:43;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;9506:43:0;-1:-1:-1;;;;;9506:43:0;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;9506:43:0;;;9496:54;;;;;;9481:69;;9567:13;9575:4;9567:7;:13::i;7956:436::-;8024:6;8019:253;8059:1;8040:16;:14;:16::i;:::-;:20;8036:1;:24;8019:253;;;8092:9;;8085:6;:17;;;;;;;;;;:31;;-1:-1:-1;;;;;8085:44:0;;;:17;8114:1;;8085:31;;;;;;;;;;;;;;;;-1:-1:-1;;;;;8085:31:0;:44;8081:181;;;8183:19;:17;:19::i;:::-;8222:1;8203:16;:14;:16::i;:::-;:20;8183:41;;;;;;;;;;;;;;8149:6;:17;8156:9;;8149:17;;;;;;;;;;;:28;;8178:1;8149:31;;;;;;;;;;;;;;;;:75;;;;;-1:-1:-1;;;;;8149:75:0;;;;;-1:-1:-1;;;;;8149:75:0;;;;;;8242:5;;8081:181;8062:3;;8019:253;;;-1:-1:-1;8295:9:0;;8288:6;:17;;;;;;;;;;8336:1;8317:16;:14;:16::i;:::-;:20;8288:50;;;;;;;;;;;;;;;;;;;8281:57;;-1:-1:-1;;;;;;8281:57:0;;;8355:9;;8348:17;;;;;;;;:37;;;;;-1:-1:-1;;8348:37:0;;;:::i;10171:193::-;10239:4;10255:12;10297:8;10307:9;;10318:1;10321;10280:43;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;10280:43:0;;;10270:54;;;;;;10255:69;;10341:16;10352:4;10341:10;:16::i;:::-;10334:23;10171:193;-1:-1:-1;;;;;10171:193:0:o;9994:171::-;10046:4;10062:12;10104:8;10114:9;;10087:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;10087:37:0;;;10077:48;;;;;;10062:63;;10142:16;10153:4;10142:10;:16::i;10370:409::-;10418:4;10434:20;10457:21;10473:4;10457:15;:21::i;:::-;10497:19;;;;:5;:19;;;;;;10434:44;;-1:-1:-1;10497:19:0;;10496:20;10488:46;;;;;-1:-1:-1;;;10488:46:0;;;;;;;;;;;;-1:-1:-1;;;10488:46:0;;;;;;;;;;;;;;;10545:19;;;;:5;:19;;;;;:26;;-1:-1:-1;;10545:26:0;10567:4;10545:26;;;10605:14;:12;:14::i;:::-;10585:16;;;;:10;:16;;;;;;:34;10581:192;;;-1:-1:-1;;10635:16:0;;;;:10;:16;;;;;-1:-1:-1;;;10635:27:0;;10683:4;10676:11;;10581:192;-1:-1:-1;;10718:16:0;;;;:10;:16;;;;;:18;;;;;;10750:12;;10785:420;10836:4;10852:20;10875:21;10891:4;10875:15;:21::i;:::-;10915:19;;;;:5;:19;;;;;;10852:44;;-1:-1:-1;10915:19:0;;10914:20;10906:50;;;;;-1:-1:-1;;;10906:50:0;;;;;;;;;;;;-1:-1:-1;;;10906:50:0;;;;;;;;;;;;;;;10967:19;;;;:5;:19;;;;;:26;;-1:-1:-1;;10967:26:0;10989:4;10967:26;;;11027:18;:16;:18::i;11211:139::-;11308:34;;;;;;;;;;;11331:10;11308:34;;;;;;;;26:21:-1;;;22:32;;6:49;;11308:34:0;;;;;;;11298:45;;;;;;11211:139::o;93:11259::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;93:11259:0;-1:-1:-1;;;;;93:11259:0;;;;;;;;;;;-1:-1:-1;93:11259:0;;;;;;;-1:-1:-1;93:11259:0;;;-1:-1:-1;93:11259:0;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;-1:-1:-1;;;;;;93:11259:0;;;;;;;;;;;;;;;;;;;;;;;;", + "source": "pragma solidity ^0.5.0;\n\nimport './openzeppelin-solidity/contracts/token/ERC20/IERC20.sol';\n\ncontract Bridge {\n event ExchangeRequest(uint value, uint nonce);\n event NewEpoch(uint indexed oldEpoch, uint indexed newEpoch);\n event NewEpochCancelled(uint indexed epoch);\n event NewFundsTransfer(uint indexed oldEpoch, uint indexed newEpoch);\n event EpochStart(uint indexed epoch, uint x, uint y);\n\n struct State {\n address[] validators;\n uint threshold;\n uint rangeSize;\n uint startBlock;\n uint nonce;\n uint x;\n uint y;\n }\n\n enum Status {\n READY, // bridge is in ready to perform operations\n VOTING, // voting for changing in next epoch, but still ready\n KEYGEN, //keygen, can be cancelled\n FUNDS_TRANSFER // funds transfer, cannot be cancelled\n }\n\n enum Vote {\n CONFIRM_KEYGEN,\n CONFIRM_FUNDS_TRANSFER,\n START_VOTING,\n ADD_VALIDATOR,\n REMOVE_VALIDATOR,\n CHANGE_THRESHOLD,\n CHANGE_RANGE_SIZE,\n START_KEYGEN,\n CANCEL_KEYGEN,\n TRANSFER\n }\n\n mapping(uint => State) states;\n\n mapping(bytes32 => uint) public dbTransferCount;\n mapping(bytes32 => bool) public dbTransfer;\n mapping(bytes32 => uint) public votesCount;\n mapping(bytes32 => bool) public votes;\n mapping(bytes32 => bool) public usedRange;\n\n Status public status;\n\n uint public epoch;\n uint public nextEpoch;\n\n uint minTxLimit;\n uint maxTxLimit;\n\n constructor(uint threshold, address[] memory validators, address _tokenContract, uint[2] memory limits, uint rangeSize) public {\n require(validators.length > 0);\n require(threshold < validators.length);\n\n tokenContract = IERC20(_tokenContract);\n\n epoch = 0;\n status = Status.KEYGEN;\n nextEpoch = 1;\n\n states[nextEpoch] = State(validators, threshold, rangeSize, 0, uint(-1), 0, 0);\n\n minTxLimit = limits[0];\n maxTxLimit = limits[1];\n\n emit NewEpoch(0, 1);\n }\n\n IERC20 public tokenContract;\n\n modifier ready {\n require(status == Status.READY, \"Not in ready state\");\n _;\n }\n\n modifier readyOrVoting {\n require(status == Status.READY || status == Status.VOTING, \"Not in ready or voting state\");\n _;\n }\n\n modifier voting {\n require(status == Status.VOTING, \"Not in voting state\");\n _;\n }\n\n modifier keygen {\n require(status == Status.KEYGEN, \"Not in keygen state\");\n _;\n }\n\n modifier fundsTransfer {\n require(status == Status.FUNDS_TRANSFER, \"Not in funds transfer state\");\n _;\n }\n\n modifier currentValidator {\n require(getPartyId() != 0, \"Not a current validator\");\n _;\n }\n\n function exchange(uint value) public ready {\n require(value >= minTxLimit && value >= 10 ** 10 && value <= maxTxLimit);\n\n uint txRange = (block.number - getStartBlock()) / getRangeSize();\n if (!usedRange[keccak256(abi.encodePacked(txRange, epoch))]) {\n usedRange[keccak256(abi.encodePacked(txRange, epoch))] = true;\n states[epoch].nonce++;\n }\n\n tokenContract.transferFrom(msg.sender, address(this), value);\n emit ExchangeRequest(value, getNonce());\n }\n\n function transfer(bytes32 hash, address to, uint value) public readyOrVoting currentValidator {\n if (tryVote(Vote.TRANSFER, hash, to, value)) {\n tokenContract.transfer(to, value);\n }\n }\n\n function confirmKeygen(uint x, uint y) public keygen {\n require(getNextPartyId(msg.sender) != 0, \"Not a next validator\");\n\n if (tryConfirm(Vote.CONFIRM_KEYGEN, x, y)) {\n states[nextEpoch].x = x;\n states[nextEpoch].y = y;\n if (nextEpoch == 1) {\n status = Status.READY;\n states[nextEpoch].startBlock = block.number;\n states[nextEpoch].nonce = uint(-1);\n epoch = nextEpoch;\n emit EpochStart(epoch, x, y);\n }\n else {\n status = Status.FUNDS_TRANSFER;\n emit NewFundsTransfer(epoch, nextEpoch);\n }\n }\n }\n\n function confirmFundsTransfer() public fundsTransfer currentValidator {\n require(epoch > 0, \"First epoch does not need funds transfer\");\n\n if (tryConfirm(Vote.CONFIRM_FUNDS_TRANSFER)) {\n status = Status.READY;\n states[nextEpoch].startBlock = block.number;\n states[nextEpoch].nonce = uint(-1);\n epoch = nextEpoch;\n emit EpochStart(epoch, getX(), getY());\n }\n }\n\n function getParties() view public returns (uint) {\n return getParties(epoch);\n }\n\n function getNextParties() view public returns (uint) {\n return getParties(nextEpoch);\n }\n\n function getParties(uint _epoch) view public returns (uint) {\n return states[_epoch].validators.length;\n }\n\n function getThreshold() view public returns (uint) {\n return getThreshold(epoch);\n }\n\n function getNextThreshold() view public returns (uint) {\n return getThreshold(nextEpoch);\n }\n\n function getThreshold(uint _epoch) view public returns (uint) {\n return states[_epoch].threshold;\n }\n\n function getStartBlock() view public returns (uint) {\n return getStartBlock(epoch);\n }\n\n function getStartBlock(uint _epoch) view public returns (uint) {\n return states[_epoch].startBlock;\n }\n\n function getRangeSize() view public returns (uint) {\n return getRangeSize(epoch);\n }\n\n function getNextRangeSize() view public returns (uint) {\n return getRangeSize(nextEpoch);\n }\n\n function getRangeSize(uint _epoch) view public returns (uint) {\n return states[_epoch].rangeSize;\n }\n\n function getNonce() view public returns (uint) {\n return getNonce(epoch);\n }\n\n function getNonce(uint _epoch) view public returns (uint) {\n return states[_epoch].nonce;\n }\n\n function getX() view public returns (uint) {\n return states[epoch].x;\n }\n\n function getY() view public returns (uint) {\n return states[epoch].y;\n }\n\n function getPartyId() view public returns (uint) {\n address[] memory validators = getValidators();\n for (uint i = 0; i < getParties(); i++) {\n if (validators[i] == msg.sender)\n return i + 1;\n }\n return 0;\n }\n\n function getNextPartyId(address a) view public returns (uint) {\n address[] memory validators = getNextValidators();\n for (uint i = 0; i < getNextParties(); i++) {\n if (validators[i] == a)\n return i + 1;\n }\n return 0;\n }\n\n function getValidators() view public returns (address[] memory) {\n return states[epoch].validators;\n }\n\n function getNextValidators() view public returns (address[] memory) {\n return states[nextEpoch].validators;\n }\n\n function startVoting() public readyOrVoting currentValidator {\n if (tryVote(Vote.START_VOTING)) {\n nextEpoch++;\n status = Status.VOTING;\n states[nextEpoch].threshold = getThreshold();\n states[nextEpoch].validators = getValidators();\n states[nextEpoch].rangeSize = getRangeSize();\n }\n }\n\n function voteAddValidator(address validator) public voting currentValidator {\n require(getNextPartyId(validator) == 0, \"Already a validator\");\n\n if (tryVote(Vote.ADD_VALIDATOR, validator)) {\n states[nextEpoch].validators.push(validator);\n }\n }\n\n function voteRemoveValidator(address validator) public voting currentValidator {\n require(getNextPartyId(validator) != 0, \"Already not a validator\");\n\n if (tryVote(Vote.REMOVE_VALIDATOR, validator)) {\n _removeValidator(validator);\n }\n }\n\n function _removeValidator(address validator) private {\n for (uint i = 0; i < getNextParties() - 1; i++) {\n if (states[nextEpoch].validators[i] == validator) {\n states[nextEpoch].validators[i] = getNextValidators()[getNextParties() - 1];\n break;\n }\n }\n delete states[nextEpoch].validators[getNextParties() - 1];\n states[nextEpoch].validators.length--;\n }\n\n function voteChangeThreshold(uint threshold) public voting currentValidator {\n if (tryVote(Vote.CHANGE_THRESHOLD, threshold)) {\n states[nextEpoch].threshold = threshold;\n }\n }\n\n function voteChangeRangeSize(uint rangeSize) public voting currentValidator {\n if (tryVote(Vote.CHANGE_RANGE_SIZE, rangeSize)) {\n states[nextEpoch].rangeSize = rangeSize;\n }\n }\n\n function voteStartKeygen() public voting currentValidator {\n if (tryVote(Vote.START_KEYGEN)) {\n status = Status.KEYGEN;\n\n emit NewEpoch(epoch, nextEpoch);\n }\n }\n\n function voteCancelKeygen() public keygen currentValidator {\n if (tryVote(Vote.CANCEL_KEYGEN)) {\n status = Status.VOTING;\n\n emit NewEpochCancelled(nextEpoch);\n }\n }\n\n function tryVote(Vote voteType) private returns (bool) {\n bytes32 vote = keccak256(abi.encodePacked(voteType, nextEpoch));\n return putVote(vote);\n }\n\n function tryVote(Vote voteType, address addr) private returns (bool) {\n bytes32 vote = keccak256(abi.encodePacked(voteType, nextEpoch, addr));\n return putVote(vote);\n }\n\n function tryVote(Vote voteType, uint num) private returns (bool) {\n bytes32 vote = keccak256(abi.encodePacked(voteType, nextEpoch, num));\n return putVote(vote);\n }\n\n function tryVote(Vote voteType, bytes32 hash, address to, uint value) private returns (bool) {\n bytes32 vote = keccak256(abi.encodePacked(voteType, hash, to, value));\n return putVote(vote);\n }\n\n function tryConfirm(Vote voteType) private returns (bool) {\n bytes32 vote = keccak256(abi.encodePacked(voteType, nextEpoch));\n return putConfirm(vote);\n }\n\n function tryConfirm(Vote voteType, uint x, uint y) private returns (bool) {\n bytes32 vote = keccak256(abi.encodePacked(voteType, nextEpoch, x, y));\n return putConfirm(vote);\n }\n\n function putVote(bytes32 vote) private returns (bool) {\n bytes32 personalVote = personalizeVote(vote);\n require(!votes[personalVote], \"Voted already\");\n\n votes[personalVote] = true;\n if (votesCount[vote] == getThreshold()) {\n votesCount[vote] = 2 ** 255;\n return true;\n } else {\n votesCount[vote]++;\n return false;\n }\n }\n\n function putConfirm(bytes32 vote) private returns (bool) {\n bytes32 personalVote = personalizeVote(vote);\n require(!votes[personalVote], \"Confirmed already\");\n\n votes[personalVote] = true;\n if (votesCount[vote] == getNextThreshold()) {\n votesCount[vote] = 2 ** 255;\n return true;\n } else {\n votesCount[vote]++;\n return false;\n }\n }\n\n function personalizeVote(bytes32 vote) private view returns (bytes32) {\n return keccak256(abi.encodePacked(vote, msg.sender));\n }\n}\n", + "sourcePath": "/build/contracts/Bridge.sol", + "ast": { + "absolutePath": "/build/contracts/Bridge.sol", + "exportedSymbols": { + "Bridge": [ + 1340 + ] + }, + "id": 1341, + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 1, + "literals": [ + "solidity", + "^", + "0.5", + ".0" + ], + "nodeType": "PragmaDirective", + "src": "0:23:0" + }, + { + "absolutePath": "/build/contracts/openzeppelin-solidity/contracts/token/ERC20/IERC20.sol", + "file": "./openzeppelin-solidity/contracts/token/ERC20/IERC20.sol", + "id": 2, + "nodeType": "ImportDirective", + "scope": 1341, + "sourceUnit": 10033, + "src": "25:66:0", + "symbolAliases": [], + "unitAlias": "" + }, + { + "baseContracts": [], + "contractDependencies": [], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "id": 1340, + "linearizedBaseContracts": [ + 1340 + ], + "name": "Bridge", + "nodeType": "ContractDefinition", + "nodes": [ + { + "anonymous": false, + "documentation": null, + "id": 8, + "name": "ExchangeRequest", + "nodeType": "EventDefinition", + "parameters": { + "id": 7, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4, + "indexed": false, + "name": "value", + "nodeType": "VariableDeclaration", + "scope": 8, + "src": "137:10:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "137:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 6, + "indexed": false, + "name": "nonce", + "nodeType": "VariableDeclaration", + "scope": 8, + "src": "149:10:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 5, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "149:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "136:24:0" + }, + "src": "115:46:0" + }, + { + "anonymous": false, + "documentation": null, + "id": 14, + "name": "NewEpoch", + "nodeType": "EventDefinition", + "parameters": { + "id": 13, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10, + "indexed": true, + "name": "oldEpoch", + "nodeType": "VariableDeclaration", + "scope": 14, + "src": "181:21:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 9, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "181:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 12, + "indexed": true, + "name": "newEpoch", + "nodeType": "VariableDeclaration", + "scope": 14, + "src": "204:21:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 11, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "204:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "180:46:0" + }, + "src": "166:61:0" + }, + { + "anonymous": false, + "documentation": null, + "id": 18, + "name": "NewEpochCancelled", + "nodeType": "EventDefinition", + "parameters": { + "id": 17, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 16, + "indexed": true, + "name": "epoch", + "nodeType": "VariableDeclaration", + "scope": 18, + "src": "256:18:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 15, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "256:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "255:20:0" + }, + "src": "232:44:0" + }, + { + "anonymous": false, + "documentation": null, + "id": 24, + "name": "NewFundsTransfer", + "nodeType": "EventDefinition", + "parameters": { + "id": 23, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 20, + "indexed": true, + "name": "oldEpoch", + "nodeType": "VariableDeclaration", + "scope": 24, + "src": "304:21:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 19, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "304:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 22, + "indexed": true, + "name": "newEpoch", + "nodeType": "VariableDeclaration", + "scope": 24, + "src": "327:21:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 21, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "327:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "303:46:0" + }, + "src": "281:69:0" + }, + { + "anonymous": false, + "documentation": null, + "id": 32, + "name": "EpochStart", + "nodeType": "EventDefinition", + "parameters": { + "id": 31, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 26, + "indexed": true, + "name": "epoch", + "nodeType": "VariableDeclaration", + "scope": 32, + "src": "372:18:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 25, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "372:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 28, + "indexed": false, + "name": "x", + "nodeType": "VariableDeclaration", + "scope": 32, + "src": "392:6:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 27, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "392:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 30, + "indexed": false, + "name": "y", + "nodeType": "VariableDeclaration", + "scope": 32, + "src": "400:6:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 29, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "400:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "371:36:0" + }, + "src": "355:53:0" + }, + { + "canonicalName": "Bridge.State", + "id": 48, + "members": [ + { + "constant": false, + "id": 35, + "name": "validators", + "nodeType": "VariableDeclaration", + "scope": 48, + "src": "437:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + }, + "typeName": { + "baseType": { + "id": 33, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "437:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 34, + "length": null, + "nodeType": "ArrayTypeName", + "src": "437:9:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 37, + "name": "threshold", + "nodeType": "VariableDeclaration", + "scope": 48, + "src": "467:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 36, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "467:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 39, + "name": "rangeSize", + "nodeType": "VariableDeclaration", + "scope": 48, + "src": "491:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 38, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "491:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 41, + "name": "startBlock", + "nodeType": "VariableDeclaration", + "scope": 48, + "src": "515:15:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 40, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "515:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 43, + "name": "nonce", + "nodeType": "VariableDeclaration", + "scope": 48, + "src": "540:10:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 42, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "540:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 45, + "name": "x", + "nodeType": "VariableDeclaration", + "scope": 48, + "src": "560:6:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 44, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "560:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 47, + "name": "y", + "nodeType": "VariableDeclaration", + "scope": 48, + "src": "576:6:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 46, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "576:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "name": "State", + "nodeType": "StructDefinition", + "scope": 1340, + "src": "414:175:0", + "visibility": "public" + }, + { + "canonicalName": "Bridge.Status", + "id": 53, + "members": [ + { + "id": 49, + "name": "READY", + "nodeType": "EnumValue", + "src": "617:5:0" + }, + { + "id": 50, + "name": "VOTING", + "nodeType": "EnumValue", + "src": "676:6:0" + }, + { + "id": 51, + "name": "KEYGEN", + "nodeType": "EnumValue", + "src": "746:6:0" + }, + { + "id": 52, + "name": "FUNDS_TRANSFER", + "nodeType": "EnumValue", + "src": "789:14:0" + } + ], + "name": "Status", + "nodeType": "EnumDefinition", + "src": "595:253:0" + }, + { + "canonicalName": "Bridge.Vote", + "id": 64, + "members": [ + { + "id": 54, + "name": "CONFIRM_KEYGEN", + "nodeType": "EnumValue", + "src": "874:14:0" + }, + { + "id": 55, + "name": "CONFIRM_FUNDS_TRANSFER", + "nodeType": "EnumValue", + "src": "898:22:0" + }, + { + "id": 56, + "name": "START_VOTING", + "nodeType": "EnumValue", + "src": "930:12:0" + }, + { + "id": 57, + "name": "ADD_VALIDATOR", + "nodeType": "EnumValue", + "src": "952:13:0" + }, + { + "id": 58, + "name": "REMOVE_VALIDATOR", + "nodeType": "EnumValue", + "src": "975:16:0" + }, + { + "id": 59, + "name": "CHANGE_THRESHOLD", + "nodeType": "EnumValue", + "src": "1001:16:0" + }, + { + "id": 60, + "name": "CHANGE_RANGE_SIZE", + "nodeType": "EnumValue", + "src": "1027:17:0" + }, + { + "id": 61, + "name": "START_KEYGEN", + "nodeType": "EnumValue", + "src": "1054:12:0" + }, + { + "id": 62, + "name": "CANCEL_KEYGEN", + "nodeType": "EnumValue", + "src": "1076:13:0" + }, + { + "id": 63, + "name": "TRANSFER", + "nodeType": "EnumValue", + "src": "1099:8:0" + } + ], + "name": "Vote", + "nodeType": "EnumDefinition", + "src": "854:259:0" + }, + { + "constant": false, + "id": 68, + "name": "states", + "nodeType": "VariableDeclaration", + "scope": 1340, + "src": "1119:29:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State)" + }, + "typeName": { + "id": 67, + "keyType": { + "id": 65, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1127:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Mapping", + "src": "1119:22:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State)" + }, + "valueType": { + "contractScope": null, + "id": 66, + "name": "State", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 48, + "src": "1135:5:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage_ptr", + "typeString": "struct Bridge.State" + } + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 72, + "name": "dbTransferCount", + "nodeType": "VariableDeclaration", + "scope": 1340, + "src": "1155:47:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + }, + "typeName": { + "id": 71, + "keyType": { + "id": 69, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1163:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "Mapping", + "src": "1155:24:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + }, + "valueType": { + "id": 70, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1174:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + }, + "value": null, + "visibility": "public" + }, + { + "constant": false, + "id": 76, + "name": "dbTransfer", + "nodeType": "VariableDeclaration", + "scope": 1340, + "src": "1208:42:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", + "typeString": "mapping(bytes32 => bool)" + }, + "typeName": { + "id": 75, + "keyType": { + "id": 73, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1216:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "Mapping", + "src": "1208:24:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", + "typeString": "mapping(bytes32 => bool)" + }, + "valueType": { + "id": 74, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "1227:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + }, + "value": null, + "visibility": "public" + }, + { + "constant": false, + "id": 80, + "name": "votesCount", + "nodeType": "VariableDeclaration", + "scope": 1340, + "src": "1256:42:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + }, + "typeName": { + "id": 79, + "keyType": { + "id": 77, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1264:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "Mapping", + "src": "1256:24:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + }, + "valueType": { + "id": 78, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1275:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + }, + "value": null, + "visibility": "public" + }, + { + "constant": false, + "id": 84, + "name": "votes", + "nodeType": "VariableDeclaration", + "scope": 1340, + "src": "1304:37:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", + "typeString": "mapping(bytes32 => bool)" + }, + "typeName": { + "id": 83, + "keyType": { + "id": 81, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1312:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "Mapping", + "src": "1304:24:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", + "typeString": "mapping(bytes32 => bool)" + }, + "valueType": { + "id": 82, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "1323:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + }, + "value": null, + "visibility": "public" + }, + { + "constant": false, + "id": 88, + "name": "usedRange", + "nodeType": "VariableDeclaration", + "scope": 1340, + "src": "1347:41:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", + "typeString": "mapping(bytes32 => bool)" + }, + "typeName": { + "id": 87, + "keyType": { + "id": 85, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1355:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "Mapping", + "src": "1347:24:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", + "typeString": "mapping(bytes32 => bool)" + }, + "valueType": { + "id": 86, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "1366:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + }, + "value": null, + "visibility": "public" + }, + { + "constant": false, + "id": 90, + "name": "status", + "nodeType": "VariableDeclaration", + "scope": 1340, + "src": "1395:20:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + }, + "typeName": { + "contractScope": null, + "id": 89, + "name": "Status", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 53, + "src": "1395:6:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "value": null, + "visibility": "public" + }, + { + "constant": false, + "id": 92, + "name": "epoch", + "nodeType": "VariableDeclaration", + "scope": 1340, + "src": "1422:17:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 91, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1422:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "public" + }, + { + "constant": false, + "id": 94, + "name": "nextEpoch", + "nodeType": "VariableDeclaration", + "scope": 1340, + "src": "1445:21:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 93, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1445:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "public" + }, + { + "constant": false, + "id": 96, + "name": "minTxLimit", + "nodeType": "VariableDeclaration", + "scope": 1340, + "src": "1473:15:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 95, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1473:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 98, + "name": "maxTxLimit", + "nodeType": "VariableDeclaration", + "scope": 1340, + "src": "1494:15:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 97, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1494:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "body": { + "id": 181, + "nodeType": "Block", + "src": "1643:403:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 118, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 115, + "name": "validators", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 103, + "src": "1661:10:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "id": 116, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "1661:17:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 117, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1681:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "1661:21:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 114, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 13091, + 13092 + ], + "referencedDeclaration": 13091, + "src": "1653:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 119, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1653:30:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 120, + "nodeType": "ExpressionStatement", + "src": "1653:30:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 125, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 122, + "name": "threshold", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 100, + "src": "1701:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 123, + "name": "validators", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 103, + "src": "1713:10:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "id": 124, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "1713:17:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1701:29:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 121, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 13091, + 13092 + ], + "referencedDeclaration": 13091, + "src": "1693:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 126, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1693:38:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 127, + "nodeType": "ExpressionStatement", + "src": "1693:38:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 132, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 128, + "name": "tokenContract", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 184, + "src": "1742:13:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IERC20_$10032", + "typeString": "contract IERC20" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 130, + "name": "_tokenContract", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 105, + "src": "1765:14:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 129, + "name": "IERC20", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10032, + "src": "1758:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IERC20_$10032_$", + "typeString": "type(contract IERC20)" + } + }, + "id": 131, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1758:22:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IERC20_$10032", + "typeString": "contract IERC20" + } + }, + "src": "1742:38:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IERC20_$10032", + "typeString": "contract IERC20" + } + }, + "id": 133, + "nodeType": "ExpressionStatement", + "src": "1742:38:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 136, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 134, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "1791:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "30", + "id": 135, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1799:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "1791:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 137, + "nodeType": "ExpressionStatement", + "src": "1791:9:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 141, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 138, + "name": "status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 90, + "src": "1810:6:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 139, + "name": "Status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "1819:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Status_$53_$", + "typeString": "type(enum Bridge.Status)" + } + }, + "id": 140, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "KEYGEN", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "1819:13:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "src": "1810:22:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "id": 142, + "nodeType": "ExpressionStatement", + "src": "1810:22:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 145, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 143, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "1842:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "31", + "id": 144, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1854:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "1842:13:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 146, + "nodeType": "ExpressionStatement", + "src": "1842:13:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 162, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 147, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "1866:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 149, + "indexExpression": { + "argumentTypes": null, + "id": 148, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "1873:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "1866:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 151, + "name": "validators", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 103, + "src": "1892:10:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + { + "argumentTypes": null, + "id": 152, + "name": "threshold", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 100, + "src": "1904:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 153, + "name": "rangeSize", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 111, + "src": "1915:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "hexValue": "30", + "id": 154, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1926:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 157, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "-", + "prefix": true, + "src": "1934:2:0", + "subExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 156, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1935:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "typeDescriptions": { + "typeIdentifier": "t_rational_minus_1_by_1", + "typeString": "int_const -1" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_minus_1_by_1", + "typeString": "int_const -1" + } + ], + "id": 155, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "1929:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": "uint" + }, + "id": 158, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1929:8:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "hexValue": "30", + "id": 159, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1939:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + { + "argumentTypes": null, + "hexValue": "30", + "id": 160, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1942:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 150, + "name": "State", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 48, + "src": "1886:5:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_struct$_State_$48_storage_ptr_$", + "typeString": "type(struct Bridge.State storage pointer)" + } + }, + "id": 161, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "structConstructorCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1886:58:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_memory", + "typeString": "struct Bridge.State memory" + } + }, + "src": "1866:78:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 163, + "nodeType": "ExpressionStatement", + "src": "1866:78:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 168, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 164, + "name": "minTxLimit", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 96, + "src": "1955:10:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 165, + "name": "limits", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 109, + "src": "1968:6:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$2_memory_ptr", + "typeString": "uint256[2] memory" + } + }, + "id": 167, + "indexExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 166, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1975:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "1968:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1955:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 169, + "nodeType": "ExpressionStatement", + "src": "1955:22:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 174, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 170, + "name": "maxTxLimit", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 98, + "src": "1987:10:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 171, + "name": "limits", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 109, + "src": "2000:6:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$2_memory_ptr", + "typeString": "uint256[2] memory" + } + }, + "id": 173, + "indexExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 172, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2007:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "2000:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1987:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 175, + "nodeType": "ExpressionStatement", + "src": "1987:22:0" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "hexValue": "30", + "id": 177, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2034:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + { + "argumentTypes": null, + "hexValue": "31", + "id": 178, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2037:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + } + ], + "id": 176, + "name": "NewEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14, + "src": "2025:8:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$returns$__$", + "typeString": "function (uint256,uint256)" + } + }, + "id": 179, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2025:14:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 180, + "nodeType": "EmitStatement", + "src": "2020:19:0" + } + ] + }, + "documentation": null, + "id": 182, + "implemented": true, + "kind": "constructor", + "modifiers": [], + "name": "", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 112, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 100, + "name": "threshold", + "nodeType": "VariableDeclaration", + "scope": 182, + "src": "1528:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 99, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1528:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 103, + "name": "validators", + "nodeType": "VariableDeclaration", + "scope": 182, + "src": "1544:27:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[]" + }, + "typeName": { + "baseType": { + "id": 101, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1544:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 102, + "length": null, + "nodeType": "ArrayTypeName", + "src": "1544:9:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 105, + "name": "_tokenContract", + "nodeType": "VariableDeclaration", + "scope": 182, + "src": "1573:22:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 104, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1573:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 109, + "name": "limits", + "nodeType": "VariableDeclaration", + "scope": 182, + "src": "1597:21:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$2_memory_ptr", + "typeString": "uint256[2]" + }, + "typeName": { + "baseType": { + "id": 106, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1597:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 108, + "length": { + "argumentTypes": null, + "hexValue": "32", + "id": 107, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1602:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" + }, + "nodeType": "ArrayTypeName", + "src": "1597:7:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$2_storage_ptr", + "typeString": "uint256[2]" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 111, + "name": "rangeSize", + "nodeType": "VariableDeclaration", + "scope": 182, + "src": "1620:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 110, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1620:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1527:108:0" + }, + "returnParameters": { + "id": 113, + "nodeType": "ParameterList", + "parameters": [], + "src": "1643:0:0" + }, + "scope": 1340, + "src": "1516:530:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "constant": false, + "id": 184, + "name": "tokenContract", + "nodeType": "VariableDeclaration", + "scope": 1340, + "src": "2052:27:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IERC20_$10032", + "typeString": "contract IERC20" + }, + "typeName": { + "contractScope": null, + "id": 183, + "name": "IERC20", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 10032, + "src": "2052:6:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IERC20_$10032", + "typeString": "contract IERC20" + } + }, + "value": null, + "visibility": "public" + }, + { + "body": { + "id": 195, + "nodeType": "Block", + "src": "2101:81:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + }, + "id": 190, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 187, + "name": "status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 90, + "src": "2119:6:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 188, + "name": "Status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "2129:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Status_$53_$", + "typeString": "type(enum Bridge.Status)" + } + }, + "id": 189, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "READY", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2129:12:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "src": "2119:22:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4e6f7420696e207265616479207374617465", + "id": 191, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2143:20:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_965c39c15b78dbcd8a954511641ca86e15fc1ae6d6c30a67536872ccde75b679", + "typeString": "literal_string \"Not in ready state\"" + }, + "value": "Not in ready state" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_965c39c15b78dbcd8a954511641ca86e15fc1ae6d6c30a67536872ccde75b679", + "typeString": "literal_string \"Not in ready state\"" + } + ], + "id": 186, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 13091, + 13092 + ], + "referencedDeclaration": 13092, + "src": "2111:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 192, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2111:53:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 193, + "nodeType": "ExpressionStatement", + "src": "2111:53:0" + }, + { + "id": 194, + "nodeType": "PlaceholderStatement", + "src": "2174:1:0" + } + ] + }, + "documentation": null, + "id": 196, + "name": "ready", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 185, + "nodeType": "ParameterList", + "parameters": [], + "src": "2101:0:0" + }, + "src": "2086:96:0", + "visibility": "internal" + }, + { + "body": { + "id": 212, + "nodeType": "Block", + "src": "2211:118:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 207, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + }, + "id": 202, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 199, + "name": "status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 90, + "src": "2229:6:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 200, + "name": "Status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "2239:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Status_$53_$", + "typeString": "type(enum Bridge.Status)" + } + }, + "id": 201, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "READY", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2239:12:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "src": "2229:22:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "||", + "rightExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + }, + "id": 206, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 203, + "name": "status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 90, + "src": "2255:6:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 204, + "name": "Status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "2265:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Status_$53_$", + "typeString": "type(enum Bridge.Status)" + } + }, + "id": 205, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "VOTING", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2265:13:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "src": "2255:23:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "2229:49:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4e6f7420696e207265616479206f7220766f74696e67207374617465", + "id": 208, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2280:30:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_7e3f7359baa731593d4e3921720b92600c22ed1d950d208e0c826ad2eddebe96", + "typeString": "literal_string \"Not in ready or voting state\"" + }, + "value": "Not in ready or voting state" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_7e3f7359baa731593d4e3921720b92600c22ed1d950d208e0c826ad2eddebe96", + "typeString": "literal_string \"Not in ready or voting state\"" + } + ], + "id": 198, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 13091, + 13092 + ], + "referencedDeclaration": 13092, + "src": "2221:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 209, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2221:90:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 210, + "nodeType": "ExpressionStatement", + "src": "2221:90:0" + }, + { + "id": 211, + "nodeType": "PlaceholderStatement", + "src": "2321:1:0" + } + ] + }, + "documentation": null, + "id": 213, + "name": "readyOrVoting", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 197, + "nodeType": "ParameterList", + "parameters": [], + "src": "2211:0:0" + }, + "src": "2188:141:0", + "visibility": "internal" + }, + { + "body": { + "id": 224, + "nodeType": "Block", + "src": "2351:83:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + }, + "id": 219, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 216, + "name": "status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 90, + "src": "2369:6:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 217, + "name": "Status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "2379:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Status_$53_$", + "typeString": "type(enum Bridge.Status)" + } + }, + "id": 218, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "VOTING", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2379:13:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "src": "2369:23:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4e6f7420696e20766f74696e67207374617465", + "id": 220, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2394:21:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_0cbee9834b110b21e0730bf5c3d2972fb9867ff221df239e7ae60883592f05d1", + "typeString": "literal_string \"Not in voting state\"" + }, + "value": "Not in voting state" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_0cbee9834b110b21e0730bf5c3d2972fb9867ff221df239e7ae60883592f05d1", + "typeString": "literal_string \"Not in voting state\"" + } + ], + "id": 215, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 13091, + 13092 + ], + "referencedDeclaration": 13092, + "src": "2361:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 221, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2361:55:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 222, + "nodeType": "ExpressionStatement", + "src": "2361:55:0" + }, + { + "id": 223, + "nodeType": "PlaceholderStatement", + "src": "2426:1:0" + } + ] + }, + "documentation": null, + "id": 225, + "name": "voting", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 214, + "nodeType": "ParameterList", + "parameters": [], + "src": "2351:0:0" + }, + "src": "2335:99:0", + "visibility": "internal" + }, + { + "body": { + "id": 236, + "nodeType": "Block", + "src": "2456:83:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + }, + "id": 231, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 228, + "name": "status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 90, + "src": "2474:6:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 229, + "name": "Status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "2484:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Status_$53_$", + "typeString": "type(enum Bridge.Status)" + } + }, + "id": 230, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "KEYGEN", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2484:13:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "src": "2474:23:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4e6f7420696e206b657967656e207374617465", + "id": 232, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2499:21:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_ed0fee6382e0651a224348a21558d03a4a439c3bd5edc24945894a3417c14010", + "typeString": "literal_string \"Not in keygen state\"" + }, + "value": "Not in keygen state" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_ed0fee6382e0651a224348a21558d03a4a439c3bd5edc24945894a3417c14010", + "typeString": "literal_string \"Not in keygen state\"" + } + ], + "id": 227, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 13091, + 13092 + ], + "referencedDeclaration": 13092, + "src": "2466:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 233, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2466:55:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 234, + "nodeType": "ExpressionStatement", + "src": "2466:55:0" + }, + { + "id": 235, + "nodeType": "PlaceholderStatement", + "src": "2531:1:0" + } + ] + }, + "documentation": null, + "id": 237, + "name": "keygen", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 226, + "nodeType": "ParameterList", + "parameters": [], + "src": "2456:0:0" + }, + "src": "2440:99:0", + "visibility": "internal" + }, + { + "body": { + "id": 248, + "nodeType": "Block", + "src": "2568:99:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + }, + "id": 243, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 240, + "name": "status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 90, + "src": "2586:6:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 241, + "name": "Status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "2596:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Status_$53_$", + "typeString": "type(enum Bridge.Status)" + } + }, + "id": 242, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "FUNDS_TRANSFER", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2596:21:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "src": "2586:31:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4e6f7420696e2066756e6473207472616e73666572207374617465", + "id": 244, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2619:29:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_6347c9fecd6f58520ad10dfd1347ce3dc42cc0eed7a4182ca64dd11c69fc3008", + "typeString": "literal_string \"Not in funds transfer state\"" + }, + "value": "Not in funds transfer state" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_6347c9fecd6f58520ad10dfd1347ce3dc42cc0eed7a4182ca64dd11c69fc3008", + "typeString": "literal_string \"Not in funds transfer state\"" + } + ], + "id": 239, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 13091, + 13092 + ], + "referencedDeclaration": 13092, + "src": "2578:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 245, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2578:71:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 246, + "nodeType": "ExpressionStatement", + "src": "2578:71:0" + }, + { + "id": 247, + "nodeType": "PlaceholderStatement", + "src": "2659:1:0" + } + ] + }, + "documentation": null, + "id": 249, + "name": "fundsTransfer", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 238, + "nodeType": "ParameterList", + "parameters": [], + "src": "2568:0:0" + }, + "src": "2545:122:0", + "visibility": "internal" + }, + { + "body": { + "id": 260, + "nodeType": "Block", + "src": "2699:81:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 255, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 252, + "name": "getPartyId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 728, + "src": "2717:10:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 253, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2717:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 254, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2733:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "2717:17:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4e6f7420612063757272656e742076616c696461746f72", + "id": 256, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2736:25:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_8dc18d5bb1361900b9758b388df331056e31071cae84b276c0f03794c4dc634a", + "typeString": "literal_string \"Not a current validator\"" + }, + "value": "Not a current validator" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_8dc18d5bb1361900b9758b388df331056e31071cae84b276c0f03794c4dc634a", + "typeString": "literal_string \"Not a current validator\"" + } + ], + "id": 251, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 13091, + 13092 + ], + "referencedDeclaration": 13092, + "src": "2709:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 257, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2709:53:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 258, + "nodeType": "ExpressionStatement", + "src": "2709:53:0" + }, + { + "id": 259, + "nodeType": "PlaceholderStatement", + "src": "2772:1:0" + } + ] + }, + "documentation": null, + "id": 261, + "name": "currentValidator", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 250, + "nodeType": "ParameterList", + "parameters": [], + "src": "2699:0:0" + }, + "src": "2673:107:0", + "visibility": "internal" + }, + { + "body": { + "id": 343, + "nodeType": "Block", + "src": "2829:475:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 281, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 277, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 271, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 269, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 263, + "src": "2847:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "id": 270, + "name": "minTxLimit", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 96, + "src": "2856:10:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "2847:19:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 276, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 272, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 263, + "src": "2870:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_rational_10000000000_by_1", + "typeString": "int_const 10000000000" + }, + "id": 275, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "hexValue": "3130", + "id": 273, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2879:2:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_10_by_1", + "typeString": "int_const 10" + }, + "value": "10" + }, + "nodeType": "BinaryOperation", + "operator": "**", + "rightExpression": { + "argumentTypes": null, + "hexValue": "3130", + "id": 274, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2885:2:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_10_by_1", + "typeString": "int_const 10" + }, + "value": "10" + }, + "src": "2879:8:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_10000000000_by_1", + "typeString": "int_const 10000000000" + } + }, + "src": "2870:17:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "2847:40:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 280, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 278, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 263, + "src": "2891:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "id": 279, + "name": "maxTxLimit", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 98, + "src": "2900:10:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "2891:19:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "2847:63:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 268, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 13091, + 13092 + ], + "referencedDeclaration": 13091, + "src": "2839:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 282, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2839:72:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 283, + "nodeType": "ExpressionStatement", + "src": "2839:72:0" + }, + { + "assignments": [ + 285 + ], + "declarations": [ + { + "constant": false, + "id": 285, + "name": "txRange", + "nodeType": "VariableDeclaration", + "scope": 343, + "src": "2922:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 284, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "2922:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 295, + "initialValue": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 294, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "components": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 290, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 286, + "name": "block", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13078, + "src": "2938:5:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_block", + "typeString": "block" + } + }, + "id": 287, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "number", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2938:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 288, + "name": "getStartBlock", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 598, + 611 + ], + "referencedDeclaration": 598, + "src": "2953:13:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 289, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2953:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "2938:30:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 291, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "2937:32:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "/", + "rightExpression": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 292, + "name": "getRangeSize", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 621, + 644 + ], + "referencedDeclaration": 621, + "src": "2972:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 293, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2972:14:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "2937:49:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "2922:64:0" + }, + { + "condition": { + "argumentTypes": null, + "id": 305, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "3000:55:0", + "subExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 296, + "name": "usedRange", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 88, + "src": "3001:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", + "typeString": "mapping(bytes32 => bool)" + } + }, + "id": 304, + "indexExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 300, + "name": "txRange", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 285, + "src": "3038:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 301, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "3047:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "id": 298, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13075, + "src": "3021:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 299, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3021:16:0", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 302, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3021:32:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 297, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13082, + "src": "3011:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 303, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3011:43:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3001:54:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 325, + "nodeType": "IfStatement", + "src": "2996:182:0", + "trueBody": { + "id": 324, + "nodeType": "Block", + "src": "3057:121:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 316, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 306, + "name": "usedRange", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 88, + "src": "3071:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", + "typeString": "mapping(bytes32 => bool)" + } + }, + "id": 314, + "indexExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 310, + "name": "txRange", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 285, + "src": "3108:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 311, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "3117:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "id": 308, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13075, + "src": "3091:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 309, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3091:16:0", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 312, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3091:32:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 307, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13082, + "src": "3081:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 313, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3081:43:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "3071:54:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "74727565", + "id": 315, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3128:4:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + "src": "3071:61:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 317, + "nodeType": "ExpressionStatement", + "src": "3071:61:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 322, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "3146:21:0", + "subExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 318, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "3146:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 320, + "indexExpression": { + "argumentTypes": null, + "id": 319, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "3153:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3146:13:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 321, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "nonce", + "nodeType": "MemberAccess", + "referencedDeclaration": 43, + "src": "3146:19:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 323, + "nodeType": "ExpressionStatement", + "src": "3146:21:0" + } + ] + } + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 329, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13088, + "src": "3215:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 330, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3215:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 332, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13104, + "src": "3235:4:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_Bridge_$1340", + "typeString": "contract Bridge" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_Bridge_$1340", + "typeString": "contract Bridge" + } + ], + "id": 331, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "3227:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 333, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3227:13:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 334, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 263, + "src": "3242:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "id": 326, + "name": "tokenContract", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 184, + "src": "3188:13:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IERC20_$10032", + "typeString": "contract IERC20" + } + }, + "id": 328, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "transferFrom", + "nodeType": "MemberAccess", + "referencedDeclaration": 10015, + "src": "3188:26:0", + "typeDescriptions": { + "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$_t_bool_$", + "typeString": "function (address,address,uint256) external returns (bool)" + } + }, + "id": 335, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3188:60:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 336, + "nodeType": "ExpressionStatement", + "src": "3188:60:0" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 338, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 263, + "src": "3279:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 339, + "name": "getNonce", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 654, + 667 + ], + "referencedDeclaration": 654, + "src": "3286:8:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 340, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3286:10:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 337, + "name": "ExchangeRequest", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8, + "src": "3263:15:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$returns$__$", + "typeString": "function (uint256,uint256)" + } + }, + "id": 341, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3263:34:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 342, + "nodeType": "EmitStatement", + "src": "3258:39:0" + } + ] + }, + "documentation": null, + "id": 344, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 266, + "modifierName": { + "argumentTypes": null, + "id": 265, + "name": "ready", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 196, + "src": "2823:5:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "2823:5:0" + } + ], + "name": "exchange", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 264, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 263, + "name": "value", + "nodeType": "VariableDeclaration", + "scope": 344, + "src": "2804:10:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 262, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "2804:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "2803:12:0" + }, + "returnParameters": { + "id": 267, + "nodeType": "ParameterList", + "parameters": [], + "src": "2829:0:0" + }, + "scope": 1340, + "src": "2786:518:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 373, + "nodeType": "Block", + "src": "3404:119:0", + "statements": [ + { + "condition": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 358, + "name": "Vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 64, + "src": "3426:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", + "typeString": "type(enum Bridge.Vote)" + } + }, + "id": 359, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "TRANSFER", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3426:13:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + { + "argumentTypes": null, + "id": 360, + "name": "hash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 346, + "src": "3441:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "argumentTypes": null, + "id": 361, + "name": "to", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 348, + "src": "3447:2:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 362, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 350, + "src": "3451:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 357, + "name": "tryVote", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 1084, + 1109, + 1134, + 1164 + ], + "referencedDeclaration": 1164, + "src": "3418:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$_t_bytes32_$_t_address_$_t_uint256_$returns$_t_bool_$", + "typeString": "function (enum Bridge.Vote,bytes32,address,uint256) returns (bool)" + } + }, + "id": 363, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3418:39:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 372, + "nodeType": "IfStatement", + "src": "3414:103:0", + "trueBody": { + "id": 371, + "nodeType": "Block", + "src": "3459:58:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 367, + "name": "to", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 348, + "src": "3496:2:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 368, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 350, + "src": "3500:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "id": 364, + "name": "tokenContract", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 184, + "src": "3473:13:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IERC20_$10032", + "typeString": "contract IERC20" + } + }, + "id": 366, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "transfer", + "nodeType": "MemberAccess", + "referencedDeclaration": 9986, + "src": "3473:22:0", + "typeDescriptions": { + "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$_t_bool_$", + "typeString": "function (address,uint256) external returns (bool)" + } + }, + "id": 369, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3473:33:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 370, + "nodeType": "ExpressionStatement", + "src": "3473:33:0" + } + ] + } + } + ] + }, + "documentation": null, + "id": 374, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 353, + "modifierName": { + "argumentTypes": null, + "id": 352, + "name": "readyOrVoting", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 213, + "src": "3373:13:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "3373:13:0" + }, + { + "arguments": null, + "id": 355, + "modifierName": { + "argumentTypes": null, + "id": 354, + "name": "currentValidator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 261, + "src": "3387:16:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "3387:16:0" + } + ], + "name": "transfer", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 351, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 346, + "name": "hash", + "nodeType": "VariableDeclaration", + "scope": 374, + "src": "3328:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 345, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "3328:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 348, + "name": "to", + "nodeType": "VariableDeclaration", + "scope": 374, + "src": "3342:10:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 347, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3342:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 350, + "name": "value", + "nodeType": "VariableDeclaration", + "scope": 374, + "src": "3354:10:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 349, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "3354:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "3327:38:0" + }, + "returnParameters": { + "id": 356, + "nodeType": "ParameterList", + "parameters": [], + "src": "3404:0:0" + }, + "scope": 1340, + "src": "3310:213:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 464, + "nodeType": "Block", + "src": "3582:638:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 389, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 385, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13088, + "src": "3615:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 386, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3615:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + ], + "id": 384, + "name": "getNextPartyId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 768, + "src": "3600:14:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_uint256_$", + "typeString": "function (address) view returns (uint256)" + } + }, + "id": 387, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3600:26:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 388, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3630:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "3600:31:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4e6f742061206e6578742076616c696461746f72", + "id": 390, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3633:22:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_44981c92ce908443b2fa5f878c54791e1a0c95d4cc04ea4f4d9224b3ec030922", + "typeString": "literal_string \"Not a next validator\"" + }, + "value": "Not a next validator" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_44981c92ce908443b2fa5f878c54791e1a0c95d4cc04ea4f4d9224b3ec030922", + "typeString": "literal_string \"Not a next validator\"" + } + ], + "id": 383, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 13091, + 13092 + ], + "referencedDeclaration": 13092, + "src": "3592:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 391, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3592:64:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 392, + "nodeType": "ExpressionStatement", + "src": "3592:64:0" + }, + { + "condition": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 394, + "name": "Vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 64, + "src": "3682:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", + "typeString": "type(enum Bridge.Vote)" + } + }, + "id": 395, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "CONFIRM_KEYGEN", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3682:19:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + { + "argumentTypes": null, + "id": 396, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 376, + "src": "3703:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 397, + "name": "y", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 378, + "src": "3706:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 393, + "name": "tryConfirm", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 1186, + 1214 + ], + "referencedDeclaration": 1214, + "src": "3671:10:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$_t_uint256_$_t_uint256_$returns$_t_bool_$", + "typeString": "function (enum Bridge.Vote,uint256,uint256) returns (bool)" + } + }, + "id": 398, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3671:37:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 463, + "nodeType": "IfStatement", + "src": "3667:547:0", + "trueBody": { + "id": 462, + "nodeType": "Block", + "src": "3710:504:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 404, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 399, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "3724:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 401, + "indexExpression": { + "argumentTypes": null, + "id": 400, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "3731:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3724:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 402, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "x", + "nodeType": "MemberAccess", + "referencedDeclaration": 45, + "src": "3724:19:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 403, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 376, + "src": "3746:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "3724:23:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 405, + "nodeType": "ExpressionStatement", + "src": "3724:23:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 411, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 406, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "3761:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 408, + "indexExpression": { + "argumentTypes": null, + "id": 407, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "3768:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3761:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 409, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "y", + "nodeType": "MemberAccess", + "referencedDeclaration": 47, + "src": "3761:19:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 410, + "name": "y", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 378, + "src": "3783:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "3761:23:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 412, + "nodeType": "ExpressionStatement", + "src": "3761:23:0" + }, + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 415, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 413, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "3802:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 414, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3815:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "3802:14:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "id": 460, + "nodeType": "Block", + "src": "4084:120:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 453, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 450, + "name": "status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 90, + "src": "4102:6:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 451, + "name": "Status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "4111:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Status_$53_$", + "typeString": "type(enum Bridge.Status)" + } + }, + "id": 452, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "FUNDS_TRANSFER", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "4111:21:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "src": "4102:30:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "id": 454, + "nodeType": "ExpressionStatement", + "src": "4102:30:0" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 456, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "4172:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 457, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "4179:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 455, + "name": "NewFundsTransfer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 24, + "src": "4155:16:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$returns$__$", + "typeString": "function (uint256,uint256)" + } + }, + "id": 458, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4155:34:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 459, + "nodeType": "EmitStatement", + "src": "4150:39:0" + } + ] + }, + "id": 461, + "nodeType": "IfStatement", + "src": "3798:406:0", + "trueBody": { + "id": 449, + "nodeType": "Block", + "src": "3818:248:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 419, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 416, + "name": "status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 90, + "src": "3836:6:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 417, + "name": "Status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "3845:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Status_$53_$", + "typeString": "type(enum Bridge.Status)" + } + }, + "id": 418, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "READY", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3845:12:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "src": "3836:21:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "id": 420, + "nodeType": "ExpressionStatement", + "src": "3836:21:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 427, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 421, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "3875:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 423, + "indexExpression": { + "argumentTypes": null, + "id": 422, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "3882:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3875:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 424, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "startBlock", + "nodeType": "MemberAccess", + "referencedDeclaration": 41, + "src": "3875:28:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 425, + "name": "block", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13078, + "src": "3906:5:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_block", + "typeString": "block" + } + }, + "id": 426, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "number", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3906:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "3875:43:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 428, + "nodeType": "ExpressionStatement", + "src": "3875:43:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 437, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 429, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "3936:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 431, + "indexExpression": { + "argumentTypes": null, + "id": 430, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "3943:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3936:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 432, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "nonce", + "nodeType": "MemberAccess", + "referencedDeclaration": 43, + "src": "3936:23:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 435, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "-", + "prefix": true, + "src": "3967:2:0", + "subExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 434, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3968:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "typeDescriptions": { + "typeIdentifier": "t_rational_minus_1_by_1", + "typeString": "int_const -1" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_minus_1_by_1", + "typeString": "int_const -1" + } + ], + "id": 433, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "3962:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": "uint" + }, + "id": 436, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3962:8:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "3936:34:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 438, + "nodeType": "ExpressionStatement", + "src": "3936:34:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 441, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 439, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "3988:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 440, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "3996:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "3988:17:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 442, + "nodeType": "ExpressionStatement", + "src": "3988:17:0" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 444, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "4039:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 445, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 376, + "src": "4046:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 446, + "name": "y", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 378, + "src": "4049:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 443, + "name": "EpochStart", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 32, + "src": "4028:10:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$_t_uint256_$returns$__$", + "typeString": "function (uint256,uint256,uint256)" + } + }, + "id": 447, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4028:23:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 448, + "nodeType": "EmitStatement", + "src": "4023:28:0" + } + ] + } + } + ] + } + } + ] + }, + "documentation": null, + "id": 465, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 381, + "modifierName": { + "argumentTypes": null, + "id": 380, + "name": "keygen", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 237, + "src": "3575:6:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "3575:6:0" + } + ], + "name": "confirmKeygen", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 379, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 376, + "name": "x", + "nodeType": "VariableDeclaration", + "scope": 465, + "src": "3552:6:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 375, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "3552:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 378, + "name": "y", + "nodeType": "VariableDeclaration", + "scope": 465, + "src": "3560:6:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 377, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "3560:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "3551:16:0" + }, + "returnParameters": { + "id": 382, + "nodeType": "ParameterList", + "parameters": [], + "src": "3582:0:0" + }, + "scope": 1340, + "src": "3529:691:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 520, + "nodeType": "Block", + "src": "4296:368:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 475, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 473, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "4314:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 474, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4322:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "4314:9:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "46697273742065706f636820646f6573206e6f74206e6565642066756e6473207472616e73666572", + "id": 476, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4325:42:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_8ddae2cc9da30ed8c59c39c6a950ef823ea484ac89ff6f37abb0317fb5f679a1", + "typeString": "literal_string \"First epoch does not need funds transfer\"" + }, + "value": "First epoch does not need funds transfer" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_8ddae2cc9da30ed8c59c39c6a950ef823ea484ac89ff6f37abb0317fb5f679a1", + "typeString": "literal_string \"First epoch does not need funds transfer\"" + } + ], + "id": 472, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 13091, + 13092 + ], + "referencedDeclaration": 13092, + "src": "4306:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 477, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4306:62:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 478, + "nodeType": "ExpressionStatement", + "src": "4306:62:0" + }, + { + "condition": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 480, + "name": "Vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 64, + "src": "4394:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", + "typeString": "type(enum Bridge.Vote)" + } + }, + "id": 481, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "CONFIRM_FUNDS_TRANSFER", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "4394:27:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + ], + "id": 479, + "name": "tryConfirm", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 1186, + 1214 + ], + "referencedDeclaration": 1186, + "src": "4383:10:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$returns$_t_bool_$", + "typeString": "function (enum Bridge.Vote) returns (bool)" + } + }, + "id": 482, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4383:39:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 519, + "nodeType": "IfStatement", + "src": "4379:279:0", + "trueBody": { + "id": 518, + "nodeType": "Block", + "src": "4424:234:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 486, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 483, + "name": "status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 90, + "src": "4438:6:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 484, + "name": "Status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "4447:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Status_$53_$", + "typeString": "type(enum Bridge.Status)" + } + }, + "id": 485, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "READY", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "4447:12:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "src": "4438:21:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "id": 487, + "nodeType": "ExpressionStatement", + "src": "4438:21:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 494, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 488, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "4473:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 490, + "indexExpression": { + "argumentTypes": null, + "id": 489, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "4480:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "4473:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 491, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "startBlock", + "nodeType": "MemberAccess", + "referencedDeclaration": 41, + "src": "4473:28:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 492, + "name": "block", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13078, + "src": "4504:5:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_block", + "typeString": "block" + } + }, + "id": 493, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "number", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "4504:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "4473:43:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 495, + "nodeType": "ExpressionStatement", + "src": "4473:43:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 504, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 496, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "4530:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 498, + "indexExpression": { + "argumentTypes": null, + "id": 497, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "4537:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "4530:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 499, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "nonce", + "nodeType": "MemberAccess", + "referencedDeclaration": 43, + "src": "4530:23:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 502, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "-", + "prefix": true, + "src": "4561:2:0", + "subExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 501, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4562:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "typeDescriptions": { + "typeIdentifier": "t_rational_minus_1_by_1", + "typeString": "int_const -1" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_minus_1_by_1", + "typeString": "int_const -1" + } + ], + "id": 500, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "4556:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": "uint" + }, + "id": 503, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4556:8:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "4530:34:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 505, + "nodeType": "ExpressionStatement", + "src": "4530:34:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 508, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 506, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "4578:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 507, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "4586:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "4578:17:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 509, + "nodeType": "ExpressionStatement", + "src": "4578:17:0" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 511, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "4625:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 512, + "name": "getX", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 678, + "src": "4632:4:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 513, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4632:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 514, + "name": "getY", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 689, + "src": "4640:4:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 515, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4640:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 510, + "name": "EpochStart", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 32, + "src": "4614:10:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$_t_uint256_$returns$__$", + "typeString": "function (uint256,uint256,uint256)" + } + }, + "id": 516, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4614:33:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 517, + "nodeType": "EmitStatement", + "src": "4609:38:0" + } + ] + } + } + ] + }, + "documentation": null, + "id": 521, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 468, + "modifierName": { + "argumentTypes": null, + "id": 467, + "name": "fundsTransfer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 249, + "src": "4265:13:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "4265:13:0" + }, + { + "arguments": null, + "id": 470, + "modifierName": { + "argumentTypes": null, + "id": 469, + "name": "currentValidator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 261, + "src": "4279:16:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "4279:16:0" + } + ], + "name": "confirmFundsTransfer", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 466, + "nodeType": "ParameterList", + "parameters": [], + "src": "4255:2:0" + }, + "returnParameters": { + "id": 471, + "nodeType": "ParameterList", + "parameters": [], + "src": "4296:0:0" + }, + "scope": 1340, + "src": "4226:438:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 530, + "nodeType": "Block", + "src": "4719:41:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 527, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "4747:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 526, + "name": "getParties", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 531, + 555 + ], + "referencedDeclaration": 555, + "src": "4736:10:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256) view returns (uint256)" + } + }, + "id": 528, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4736:17:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 525, + "id": 529, + "nodeType": "Return", + "src": "4729:24:0" + } + ] + }, + "documentation": null, + "id": 531, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getParties", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 522, + "nodeType": "ParameterList", + "parameters": [], + "src": "4689:2:0" + }, + "returnParameters": { + "id": 525, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 524, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 531, + "src": "4713:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 523, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "4713:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "4712:6:0" + }, + "scope": 1340, + "src": "4670:90:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 540, + "nodeType": "Block", + "src": "4819:45:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 537, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "4847:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 536, + "name": "getParties", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 531, + 555 + ], + "referencedDeclaration": 555, + "src": "4836:10:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256) view returns (uint256)" + } + }, + "id": 538, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4836:21:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 535, + "id": 539, + "nodeType": "Return", + "src": "4829:28:0" + } + ] + }, + "documentation": null, + "id": 541, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getNextParties", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 532, + "nodeType": "ParameterList", + "parameters": [], + "src": "4789:2:0" + }, + "returnParameters": { + "id": 535, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 534, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 541, + "src": "4813:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 533, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "4813:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "4812:6:0" + }, + "scope": 1340, + "src": "4766:98:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 554, + "nodeType": "Block", + "src": "4930:56:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 548, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "4947:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 550, + "indexExpression": { + "argumentTypes": null, + "id": 549, + "name": "_epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 543, + "src": "4954:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "4947:14:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 551, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "validators", + "nodeType": "MemberAccess", + "referencedDeclaration": 35, + "src": "4947:25:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 552, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "4947:32:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 547, + "id": 553, + "nodeType": "Return", + "src": "4940:39:0" + } + ] + }, + "documentation": null, + "id": 555, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getParties", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 544, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 543, + "name": "_epoch", + "nodeType": "VariableDeclaration", + "scope": 555, + "src": "4890:11:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 542, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "4890:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "4889:13:0" + }, + "returnParameters": { + "id": 547, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 546, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 555, + "src": "4924:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 545, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "4924:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "4923:6:0" + }, + "scope": 1340, + "src": "4870:116:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 564, + "nodeType": "Block", + "src": "5043:43:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 561, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "5073:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 560, + "name": "getThreshold", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 565, + 588 + ], + "referencedDeclaration": 588, + "src": "5060:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256) view returns (uint256)" + } + }, + "id": 562, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5060:19:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 559, + "id": 563, + "nodeType": "Return", + "src": "5053:26:0" + } + ] + }, + "documentation": null, + "id": 565, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getThreshold", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 556, + "nodeType": "ParameterList", + "parameters": [], + "src": "5013:2:0" + }, + "returnParameters": { + "id": 559, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 558, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 565, + "src": "5037:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 557, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5037:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5036:6:0" + }, + "scope": 1340, + "src": "4992:94:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 574, + "nodeType": "Block", + "src": "5147:47:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 571, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "5177:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 570, + "name": "getThreshold", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 565, + 588 + ], + "referencedDeclaration": 588, + "src": "5164:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256) view returns (uint256)" + } + }, + "id": 572, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5164:23:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 569, + "id": 573, + "nodeType": "Return", + "src": "5157:30:0" + } + ] + }, + "documentation": null, + "id": 575, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getNextThreshold", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 566, + "nodeType": "ParameterList", + "parameters": [], + "src": "5117:2:0" + }, + "returnParameters": { + "id": 569, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 568, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 575, + "src": "5141:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 567, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5141:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5140:6:0" + }, + "scope": 1340, + "src": "5092:102:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 587, + "nodeType": "Block", + "src": "5262:48:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 582, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "5279:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 584, + "indexExpression": { + "argumentTypes": null, + "id": 583, + "name": "_epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 577, + "src": "5286:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "5279:14:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 585, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "threshold", + "nodeType": "MemberAccess", + "referencedDeclaration": 37, + "src": "5279:24:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 581, + "id": 586, + "nodeType": "Return", + "src": "5272:31:0" + } + ] + }, + "documentation": null, + "id": 588, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getThreshold", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 578, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 577, + "name": "_epoch", + "nodeType": "VariableDeclaration", + "scope": 588, + "src": "5222:11:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 576, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5222:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5221:13:0" + }, + "returnParameters": { + "id": 581, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 580, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 588, + "src": "5256:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 579, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5256:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5255:6:0" + }, + "scope": 1340, + "src": "5200:110:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 597, + "nodeType": "Block", + "src": "5368:44:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 594, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "5399:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 593, + "name": "getStartBlock", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 598, + 611 + ], + "referencedDeclaration": 611, + "src": "5385:13:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256) view returns (uint256)" + } + }, + "id": 595, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5385:20:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 592, + "id": 596, + "nodeType": "Return", + "src": "5378:27:0" + } + ] + }, + "documentation": null, + "id": 598, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getStartBlock", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 589, + "nodeType": "ParameterList", + "parameters": [], + "src": "5338:2:0" + }, + "returnParameters": { + "id": 592, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 591, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 598, + "src": "5362:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 590, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5362:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5361:6:0" + }, + "scope": 1340, + "src": "5316:96:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 610, + "nodeType": "Block", + "src": "5481:49:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 605, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "5498:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 607, + "indexExpression": { + "argumentTypes": null, + "id": 606, + "name": "_epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 600, + "src": "5505:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "5498:14:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 608, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "startBlock", + "nodeType": "MemberAccess", + "referencedDeclaration": 41, + "src": "5498:25:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 604, + "id": 609, + "nodeType": "Return", + "src": "5491:32:0" + } + ] + }, + "documentation": null, + "id": 611, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getStartBlock", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 601, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 600, + "name": "_epoch", + "nodeType": "VariableDeclaration", + "scope": 611, + "src": "5441:11:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 599, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5441:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5440:13:0" + }, + "returnParameters": { + "id": 604, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 603, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 611, + "src": "5475:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 602, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5475:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5474:6:0" + }, + "scope": 1340, + "src": "5418:112:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 620, + "nodeType": "Block", + "src": "5587:43:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 617, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "5617:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 616, + "name": "getRangeSize", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 621, + 644 + ], + "referencedDeclaration": 644, + "src": "5604:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256) view returns (uint256)" + } + }, + "id": 618, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5604:19:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 615, + "id": 619, + "nodeType": "Return", + "src": "5597:26:0" + } + ] + }, + "documentation": null, + "id": 621, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getRangeSize", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 612, + "nodeType": "ParameterList", + "parameters": [], + "src": "5557:2:0" + }, + "returnParameters": { + "id": 615, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 614, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 621, + "src": "5581:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 613, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5581:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5580:6:0" + }, + "scope": 1340, + "src": "5536:94:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 630, + "nodeType": "Block", + "src": "5691:47:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 627, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "5721:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 626, + "name": "getRangeSize", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 621, + 644 + ], + "referencedDeclaration": 644, + "src": "5708:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256) view returns (uint256)" + } + }, + "id": 628, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5708:23:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 625, + "id": 629, + "nodeType": "Return", + "src": "5701:30:0" + } + ] + }, + "documentation": null, + "id": 631, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getNextRangeSize", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 622, + "nodeType": "ParameterList", + "parameters": [], + "src": "5661:2:0" + }, + "returnParameters": { + "id": 625, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 624, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 631, + "src": "5685:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 623, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5685:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5684:6:0" + }, + "scope": 1340, + "src": "5636:102:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 643, + "nodeType": "Block", + "src": "5806:48:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 638, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "5823:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 640, + "indexExpression": { + "argumentTypes": null, + "id": 639, + "name": "_epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 633, + "src": "5830:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "5823:14:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 641, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "rangeSize", + "nodeType": "MemberAccess", + "referencedDeclaration": 39, + "src": "5823:24:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 637, + "id": 642, + "nodeType": "Return", + "src": "5816:31:0" + } + ] + }, + "documentation": null, + "id": 644, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getRangeSize", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 634, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 633, + "name": "_epoch", + "nodeType": "VariableDeclaration", + "scope": 644, + "src": "5766:11:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 632, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5766:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5765:13:0" + }, + "returnParameters": { + "id": 637, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 636, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 644, + "src": "5800:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 635, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5800:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5799:6:0" + }, + "scope": 1340, + "src": "5744:110:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 653, + "nodeType": "Block", + "src": "5907:39:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 650, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "5933:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 649, + "name": "getNonce", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 654, + 667 + ], + "referencedDeclaration": 667, + "src": "5924:8:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256) view returns (uint256)" + } + }, + "id": 651, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5924:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 648, + "id": 652, + "nodeType": "Return", + "src": "5917:22:0" + } + ] + }, + "documentation": null, + "id": 654, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getNonce", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 645, + "nodeType": "ParameterList", + "parameters": [], + "src": "5877:2:0" + }, + "returnParameters": { + "id": 648, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 647, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 654, + "src": "5901:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 646, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5901:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5900:6:0" + }, + "scope": 1340, + "src": "5860:86:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 666, + "nodeType": "Block", + "src": "6010:44:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 661, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "6027:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 663, + "indexExpression": { + "argumentTypes": null, + "id": 662, + "name": "_epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 656, + "src": "6034:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "6027:14:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 664, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "nonce", + "nodeType": "MemberAccess", + "referencedDeclaration": 43, + "src": "6027:20:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 660, + "id": 665, + "nodeType": "Return", + "src": "6020:27:0" + } + ] + }, + "documentation": null, + "id": 667, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getNonce", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 657, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 656, + "name": "_epoch", + "nodeType": "VariableDeclaration", + "scope": 667, + "src": "5970:11:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 655, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5970:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5969:13:0" + }, + "returnParameters": { + "id": 660, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 659, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 667, + "src": "6004:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 658, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "6004:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "6003:6:0" + }, + "scope": 1340, + "src": "5952:102:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 677, + "nodeType": "Block", + "src": "6103:39:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 672, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "6120:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 674, + "indexExpression": { + "argumentTypes": null, + "id": 673, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "6127:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "6120:13:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 675, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "x", + "nodeType": "MemberAccess", + "referencedDeclaration": 45, + "src": "6120:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 671, + "id": 676, + "nodeType": "Return", + "src": "6113:22:0" + } + ] + }, + "documentation": null, + "id": 678, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getX", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 668, + "nodeType": "ParameterList", + "parameters": [], + "src": "6073:2:0" + }, + "returnParameters": { + "id": 671, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 670, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 678, + "src": "6097:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 669, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "6097:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "6096:6:0" + }, + "scope": 1340, + "src": "6060:82:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 688, + "nodeType": "Block", + "src": "6191:39:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 683, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "6208:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 685, + "indexExpression": { + "argumentTypes": null, + "id": 684, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "6215:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "6208:13:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 686, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "y", + "nodeType": "MemberAccess", + "referencedDeclaration": 47, + "src": "6208:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 682, + "id": 687, + "nodeType": "Return", + "src": "6201:22:0" + } + ] + }, + "documentation": null, + "id": 689, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getY", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 679, + "nodeType": "ParameterList", + "parameters": [], + "src": "6161:2:0" + }, + "returnParameters": { + "id": 682, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 681, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 689, + "src": "6185:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 680, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "6185:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "6184:6:0" + }, + "scope": 1340, + "src": "6148:82:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 727, + "nodeType": "Block", + "src": "6285:215:0", + "statements": [ + { + "assignments": [ + 697 + ], + "declarations": [ + { + "constant": false, + "id": 697, + "name": "validators", + "nodeType": "VariableDeclaration", + "scope": 727, + "src": "6295:27:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[]" + }, + "typeName": { + "baseType": { + "id": 695, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6295:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 696, + "length": null, + "nodeType": "ArrayTypeName", + "src": "6295:9:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 700, + "initialValue": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 698, + "name": "getValidators", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 780, + "src": "6325:13:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_array$_t_address_$dyn_memory_ptr_$", + "typeString": "function () view returns (address[] memory)" + } + }, + "id": 699, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6325:15:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "6295:45:0" + }, + { + "body": { + "id": 723, + "nodeType": "Block", + "src": "6390:86:0", + "statements": [ + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 717, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 712, + "name": "validators", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 697, + "src": "6408:10:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "id": 714, + "indexExpression": { + "argumentTypes": null, + "id": 713, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 702, + "src": "6419:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "6408:13:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 715, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13088, + "src": "6425:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 716, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "6425:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "src": "6408:27:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 722, + "nodeType": "IfStatement", + "src": "6404:61:0", + "trueBody": { + "expression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 720, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 718, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 702, + "src": "6460:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 719, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6464:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "6460:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 693, + "id": 721, + "nodeType": "Return", + "src": "6453:12:0" + } + } + ] + }, + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 708, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 705, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 702, + "src": "6367:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 706, + "name": "getParties", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 531, + 555 + ], + "referencedDeclaration": 531, + "src": "6371:10:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 707, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6371:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "6367:16:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 724, + "initializationExpression": { + "assignments": [ + 702 + ], + "declarations": [ + { + "constant": false, + "id": 702, + "name": "i", + "nodeType": "VariableDeclaration", + "scope": 724, + "src": "6355:6:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 701, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "6355:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 704, + "initialValue": { + "argumentTypes": null, + "hexValue": "30", + "id": 703, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6364:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "nodeType": "VariableDeclarationStatement", + "src": "6355:10:0" + }, + "loopExpression": { + "expression": { + "argumentTypes": null, + "id": 710, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "6385:3:0", + "subExpression": { + "argumentTypes": null, + "id": 709, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 702, + "src": "6385:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 711, + "nodeType": "ExpressionStatement", + "src": "6385:3:0" + }, + "nodeType": "ForStatement", + "src": "6350:126:0" + }, + { + "expression": { + "argumentTypes": null, + "hexValue": "30", + "id": 725, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6492:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "functionReturnParameters": 693, + "id": 726, + "nodeType": "Return", + "src": "6485:8:0" + } + ] + }, + "documentation": null, + "id": 728, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getPartyId", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 690, + "nodeType": "ParameterList", + "parameters": [], + "src": "6255:2:0" + }, + "returnParameters": { + "id": 693, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 692, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 728, + "src": "6279:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 691, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "6279:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "6278:6:0" + }, + "scope": 1340, + "src": "6236:264:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 767, + "nodeType": "Block", + "src": "6568:214:0", + "statements": [ + { + "assignments": [ + 738 + ], + "declarations": [ + { + "constant": false, + "id": 738, + "name": "validators", + "nodeType": "VariableDeclaration", + "scope": 767, + "src": "6578:27:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[]" + }, + "typeName": { + "baseType": { + "id": 736, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6578:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 737, + "length": null, + "nodeType": "ArrayTypeName", + "src": "6578:9:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 741, + "initialValue": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 739, + "name": "getNextValidators", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 792, + "src": "6608:17:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_array$_t_address_$dyn_memory_ptr_$", + "typeString": "function () view returns (address[] memory)" + } + }, + "id": 740, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6608:19:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "6578:49:0" + }, + { + "body": { + "id": 763, + "nodeType": "Block", + "src": "6681:77:0", + "statements": [ + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 757, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 753, + "name": "validators", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 738, + "src": "6699:10:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "id": 755, + "indexExpression": { + "argumentTypes": null, + "id": 754, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 743, + "src": "6710:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "6699:13:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 756, + "name": "a", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 730, + "src": "6716:1:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "6699:18:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 762, + "nodeType": "IfStatement", + "src": "6695:52:0", + "trueBody": { + "expression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 760, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 758, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 743, + "src": "6742:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 759, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6746:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "6742:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 734, + "id": 761, + "nodeType": "Return", + "src": "6735:12:0" + } + } + ] + }, + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 749, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 746, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 743, + "src": "6654:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 747, + "name": "getNextParties", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 541, + "src": "6658:14:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 748, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6658:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "6654:20:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 764, + "initializationExpression": { + "assignments": [ + 743 + ], + "declarations": [ + { + "constant": false, + "id": 743, + "name": "i", + "nodeType": "VariableDeclaration", + "scope": 764, + "src": "6642:6:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 742, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "6642:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 745, + "initialValue": { + "argumentTypes": null, + "hexValue": "30", + "id": 744, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6651:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "nodeType": "VariableDeclarationStatement", + "src": "6642:10:0" + }, + "loopExpression": { + "expression": { + "argumentTypes": null, + "id": 751, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "6676:3:0", + "subExpression": { + "argumentTypes": null, + "id": 750, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 743, + "src": "6676:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 752, + "nodeType": "ExpressionStatement", + "src": "6676:3:0" + }, + "nodeType": "ForStatement", + "src": "6637:121:0" + }, + { + "expression": { + "argumentTypes": null, + "hexValue": "30", + "id": 765, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6774:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "functionReturnParameters": 734, + "id": 766, + "nodeType": "Return", + "src": "6767:8:0" + } + ] + }, + "documentation": null, + "id": 768, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getNextPartyId", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 731, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 730, + "name": "a", + "nodeType": "VariableDeclaration", + "scope": 768, + "src": "6530:9:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 729, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6530:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "6529:11:0" + }, + "returnParameters": { + "id": 734, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 733, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 768, + "src": "6562:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 732, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "6562:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "6561:6:0" + }, + "scope": 1340, + "src": "6506:276:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 779, + "nodeType": "Block", + "src": "6852:48:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 774, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "6869:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 776, + "indexExpression": { + "argumentTypes": null, + "id": 775, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "6876:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "6869:13:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 777, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "validators", + "nodeType": "MemberAccess", + "referencedDeclaration": 35, + "src": "6869:24:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "functionReturnParameters": 773, + "id": 778, + "nodeType": "Return", + "src": "6862:31:0" + } + ] + }, + "documentation": null, + "id": 780, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getValidators", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 769, + "nodeType": "ParameterList", + "parameters": [], + "src": "6810:2:0" + }, + "returnParameters": { + "id": 773, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 772, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 780, + "src": "6834:16:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[]" + }, + "typeName": { + "baseType": { + "id": 770, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6834:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 771, + "length": null, + "nodeType": "ArrayTypeName", + "src": "6834:9:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "6833:18:0" + }, + "scope": 1340, + "src": "6788:112:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 791, + "nodeType": "Block", + "src": "6974:52:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 786, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "6991:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 788, + "indexExpression": { + "argumentTypes": null, + "id": 787, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "6998:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "6991:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 789, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "validators", + "nodeType": "MemberAccess", + "referencedDeclaration": 35, + "src": "6991:28:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "functionReturnParameters": 785, + "id": 790, + "nodeType": "Return", + "src": "6984:35:0" + } + ] + }, + "documentation": null, + "id": 792, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getNextValidators", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 781, + "nodeType": "ParameterList", + "parameters": [], + "src": "6932:2:0" + }, + "returnParameters": { + "id": 785, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 784, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 792, + "src": "6956:16:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[]" + }, + "typeName": { + "baseType": { + "id": 782, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6956:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 783, + "length": null, + "nodeType": "ArrayTypeName", + "src": "6956:9:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "6955:18:0" + }, + "scope": 1340, + "src": "6906:120:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 837, + "nodeType": "Block", + "src": "7093:296:0", + "statements": [ + { + "condition": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 800, + "name": "Vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 64, + "src": "7115:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", + "typeString": "type(enum Bridge.Vote)" + } + }, + "id": 801, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "START_VOTING", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "7115:17:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + ], + "id": 799, + "name": "tryVote", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 1084, + 1109, + 1134, + 1164 + ], + "referencedDeclaration": 1084, + "src": "7107:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$returns$_t_bool_$", + "typeString": "function (enum Bridge.Vote) returns (bool)" + } + }, + "id": 802, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7107:26:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 836, + "nodeType": "IfStatement", + "src": "7103:280:0", + "trueBody": { + "id": 835, + "nodeType": "Block", + "src": "7135:248:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 804, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "7149:11:0", + "subExpression": { + "argumentTypes": null, + "id": 803, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "7149:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 805, + "nodeType": "ExpressionStatement", + "src": "7149:11:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 809, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 806, + "name": "status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 90, + "src": "7174:6:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 807, + "name": "Status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "7183:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Status_$53_$", + "typeString": "type(enum Bridge.Status)" + } + }, + "id": 808, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "VOTING", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "7183:13:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "src": "7174:22:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "id": 810, + "nodeType": "ExpressionStatement", + "src": "7174:22:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 817, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 811, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "7210:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 813, + "indexExpression": { + "argumentTypes": null, + "id": 812, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "7217:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "7210:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 814, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "threshold", + "nodeType": "MemberAccess", + "referencedDeclaration": 37, + "src": "7210:27:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 815, + "name": "getThreshold", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 565, + 588 + ], + "referencedDeclaration": 565, + "src": "7240:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 816, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7240:14:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "7210:44:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 818, + "nodeType": "ExpressionStatement", + "src": "7210:44:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 825, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 819, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "7268:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 821, + "indexExpression": { + "argumentTypes": null, + "id": 820, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "7275:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "7268:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 822, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "validators", + "nodeType": "MemberAccess", + "referencedDeclaration": 35, + "src": "7268:28:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 823, + "name": "getValidators", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 780, + "src": "7299:13:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_array$_t_address_$dyn_memory_ptr_$", + "typeString": "function () view returns (address[] memory)" + } + }, + "id": 824, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7299:15:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "src": "7268:46:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 826, + "nodeType": "ExpressionStatement", + "src": "7268:46:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 833, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 827, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "7328:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 829, + "indexExpression": { + "argumentTypes": null, + "id": 828, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "7335:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "7328:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 830, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "rangeSize", + "nodeType": "MemberAccess", + "referencedDeclaration": 39, + "src": "7328:27:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 831, + "name": "getRangeSize", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 621, + 644 + ], + "referencedDeclaration": 621, + "src": "7358:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 832, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7358:14:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "7328:44:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 834, + "nodeType": "ExpressionStatement", + "src": "7328:44:0" + } + ] + } + } + ] + }, + "documentation": null, + "id": 838, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 795, + "modifierName": { + "argumentTypes": null, + "id": 794, + "name": "readyOrVoting", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 213, + "src": "7062:13:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "7062:13:0" + }, + { + "arguments": null, + "id": 797, + "modifierName": { + "argumentTypes": null, + "id": 796, + "name": "currentValidator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 261, + "src": "7076:16:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "7076:16:0" + } + ], + "name": "startVoting", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 793, + "nodeType": "ParameterList", + "parameters": [], + "src": "7052:2:0" + }, + "returnParameters": { + "id": 798, + "nodeType": "ParameterList", + "parameters": [], + "src": "7093:0:0" + }, + "scope": 1340, + "src": "7032:357:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 871, + "nodeType": "Block", + "src": "7471:202:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 852, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 849, + "name": "validator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 840, + "src": "7504:9:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 848, + "name": "getNextPartyId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 768, + "src": "7489:14:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_uint256_$", + "typeString": "function (address) view returns (uint256)" + } + }, + "id": 850, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7489:25:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 851, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7518:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "7489:30:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "416c726561647920612076616c696461746f72", + "id": 853, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7521:21:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_aeb0fe100da2796aa6136a3b1c66282f002b435141be331237dfa7127e6df6ff", + "typeString": "literal_string \"Already a validator\"" + }, + "value": "Already a validator" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_aeb0fe100da2796aa6136a3b1c66282f002b435141be331237dfa7127e6df6ff", + "typeString": "literal_string \"Already a validator\"" + } + ], + "id": 847, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 13091, + 13092 + ], + "referencedDeclaration": 13092, + "src": "7481:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 854, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7481:62:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 855, + "nodeType": "ExpressionStatement", + "src": "7481:62:0" + }, + { + "condition": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 857, + "name": "Vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 64, + "src": "7566:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", + "typeString": "type(enum Bridge.Vote)" + } + }, + "id": 858, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "ADD_VALIDATOR", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "7566:18:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + { + "argumentTypes": null, + "id": 859, + "name": "validator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 840, + "src": "7586:9:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 856, + "name": "tryVote", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 1084, + 1109, + 1134, + 1164 + ], + "referencedDeclaration": 1109, + "src": "7558:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$_t_address_$returns$_t_bool_$", + "typeString": "function (enum Bridge.Vote,address) returns (bool)" + } + }, + "id": 860, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7558:38:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 870, + "nodeType": "IfStatement", + "src": "7554:113:0", + "trueBody": { + "id": 869, + "nodeType": "Block", + "src": "7598:69:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 866, + "name": "validator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 840, + "src": "7646:9:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 861, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "7612:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 863, + "indexExpression": { + "argumentTypes": null, + "id": 862, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "7619:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "7612:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 864, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "validators", + "nodeType": "MemberAccess", + "referencedDeclaration": 35, + "src": "7612:28:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 865, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "push", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "7612:33:0", + "typeDescriptions": { + "typeIdentifier": "t_function_arraypush_nonpayable$_t_address_$returns$_t_uint256_$", + "typeString": "function (address) returns (uint256)" + } + }, + "id": 867, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7612:44:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 868, + "nodeType": "ExpressionStatement", + "src": "7612:44:0" + } + ] + } + } + ] + }, + "documentation": null, + "id": 872, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 843, + "modifierName": { + "argumentTypes": null, + "id": 842, + "name": "voting", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 225, + "src": "7447:6:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "7447:6:0" + }, + { + "arguments": null, + "id": 845, + "modifierName": { + "argumentTypes": null, + "id": 844, + "name": "currentValidator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 261, + "src": "7454:16:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "7454:16:0" + } + ], + "name": "voteAddValidator", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 841, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 840, + "name": "validator", + "nodeType": "VariableDeclaration", + "scope": 872, + "src": "7421:17:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 839, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7421:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "7420:19:0" + }, + "returnParameters": { + "id": 846, + "nodeType": "ParameterList", + "parameters": [], + "src": "7471:0:0" + }, + "scope": 1340, + "src": "7395:278:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 901, + "nodeType": "Block", + "src": "7758:192:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 886, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 883, + "name": "validator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 874, + "src": "7791:9:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 882, + "name": "getNextPartyId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 768, + "src": "7776:14:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_uint256_$", + "typeString": "function (address) view returns (uint256)" + } + }, + "id": 884, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7776:25:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 885, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7805:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "7776:30:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "416c7265616479206e6f7420612076616c696461746f72", + "id": 887, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7808:25:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_2332ed568e8af3d64f1f2b0b098c504cab97ba4128fb9f08cfa3f851ced05961", + "typeString": "literal_string \"Already not a validator\"" + }, + "value": "Already not a validator" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_2332ed568e8af3d64f1f2b0b098c504cab97ba4128fb9f08cfa3f851ced05961", + "typeString": "literal_string \"Already not a validator\"" + } + ], + "id": 881, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 13091, + 13092 + ], + "referencedDeclaration": 13092, + "src": "7768:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 888, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7768:66:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 889, + "nodeType": "ExpressionStatement", + "src": "7768:66:0" + }, + { + "condition": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 891, + "name": "Vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 64, + "src": "7857:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", + "typeString": "type(enum Bridge.Vote)" + } + }, + "id": 892, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "REMOVE_VALIDATOR", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "7857:21:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + { + "argumentTypes": null, + "id": 893, + "name": "validator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 874, + "src": "7880:9:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 890, + "name": "tryVote", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 1084, + 1109, + 1134, + 1164 + ], + "referencedDeclaration": 1109, + "src": "7849:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$_t_address_$returns$_t_bool_$", + "typeString": "function (enum Bridge.Vote,address) returns (bool)" + } + }, + "id": 894, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7849:41:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 900, + "nodeType": "IfStatement", + "src": "7845:99:0", + "trueBody": { + "id": 899, + "nodeType": "Block", + "src": "7892:52:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 896, + "name": "validator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 874, + "src": "7923:9:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 895, + "name": "_removeValidator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 967, + "src": "7906:16:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$", + "typeString": "function (address)" + } + }, + "id": 897, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7906:27:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 898, + "nodeType": "ExpressionStatement", + "src": "7906:27:0" + } + ] + } + } + ] + }, + "documentation": null, + "id": 902, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 877, + "modifierName": { + "argumentTypes": null, + "id": 876, + "name": "voting", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 225, + "src": "7734:6:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "7734:6:0" + }, + { + "arguments": null, + "id": 879, + "modifierName": { + "argumentTypes": null, + "id": 878, + "name": "currentValidator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 261, + "src": "7741:16:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "7741:16:0" + } + ], + "name": "voteRemoveValidator", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 875, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 874, + "name": "validator", + "nodeType": "VariableDeclaration", + "scope": 902, + "src": "7708:17:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 873, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7708:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "7707:19:0" + }, + "returnParameters": { + "id": 880, + "nodeType": "ParameterList", + "parameters": [], + "src": "7758:0:0" + }, + "scope": 1340, + "src": "7679:271:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 966, + "nodeType": "Block", + "src": "8009:383:0", + "statements": [ + { + "body": { + "id": 946, + "nodeType": "Block", + "src": "8067:205:0", + "statements": [ + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 927, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 920, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "8085:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 922, + "indexExpression": { + "argumentTypes": null, + "id": 921, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "8092:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "8085:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 923, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "validators", + "nodeType": "MemberAccess", + "referencedDeclaration": 35, + "src": "8085:28:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 925, + "indexExpression": { + "argumentTypes": null, + "id": 924, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 908, + "src": "8114:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "8085:31:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 926, + "name": "validator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 904, + "src": "8120:9:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "8085:44:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 945, + "nodeType": "IfStatement", + "src": "8081:181:0", + "trueBody": { + "id": 944, + "nodeType": "Block", + "src": "8131:131:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 941, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 928, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "8149:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 930, + "indexExpression": { + "argumentTypes": null, + "id": 929, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "8156:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "8149:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 931, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "validators", + "nodeType": "MemberAccess", + "referencedDeclaration": 35, + "src": "8149:28:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 933, + "indexExpression": { + "argumentTypes": null, + "id": 932, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 908, + "src": "8178:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "8149:31:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 934, + "name": "getNextValidators", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 792, + "src": "8183:17:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_array$_t_address_$dyn_memory_ptr_$", + "typeString": "function () view returns (address[] memory)" + } + }, + "id": 935, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8183:19:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "id": 940, + "indexExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 939, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 936, + "name": "getNextParties", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 541, + "src": "8203:14:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 937, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8203:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 938, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8222:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "8203:20:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "8183:41:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "8149:75:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 942, + "nodeType": "ExpressionStatement", + "src": "8149:75:0" + }, + { + "id": 943, + "nodeType": "Break", + "src": "8242:5:0" + } + ] + } + } + ] + }, + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 916, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 911, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 908, + "src": "8036:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 915, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 912, + "name": "getNextParties", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 541, + "src": "8040:14:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 913, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8040:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 914, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8059:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "8040:20:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "8036:24:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 947, + "initializationExpression": { + "assignments": [ + 908 + ], + "declarations": [ + { + "constant": false, + "id": 908, + "name": "i", + "nodeType": "VariableDeclaration", + "scope": 947, + "src": "8024:6:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 907, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "8024:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 910, + "initialValue": { + "argumentTypes": null, + "hexValue": "30", + "id": 909, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8033:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "nodeType": "VariableDeclarationStatement", + "src": "8024:10:0" + }, + "loopExpression": { + "expression": { + "argumentTypes": null, + "id": 918, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "8062:3:0", + "subExpression": { + "argumentTypes": null, + "id": 917, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 908, + "src": "8062:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 919, + "nodeType": "ExpressionStatement", + "src": "8062:3:0" + }, + "nodeType": "ForStatement", + "src": "8019:253:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 957, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "delete", + "prefix": true, + "src": "8281:57:0", + "subExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 948, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "8288:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 950, + "indexExpression": { + "argumentTypes": null, + "id": 949, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "8295:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "8288:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 951, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "validators", + "nodeType": "MemberAccess", + "referencedDeclaration": 35, + "src": "8288:28:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 956, + "indexExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 955, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 952, + "name": "getNextParties", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 541, + "src": "8317:14:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 953, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8317:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 954, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8336:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "8317:20:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "8288:50:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 958, + "nodeType": "ExpressionStatement", + "src": "8281:57:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 964, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "--", + "prefix": false, + "src": "8348:37:0", + "subExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 959, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "8348:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 961, + "indexExpression": { + "argumentTypes": null, + "id": 960, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "8355:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "8348:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 962, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "validators", + "nodeType": "MemberAccess", + "referencedDeclaration": 35, + "src": "8348:28:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 963, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "8348:35:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 965, + "nodeType": "ExpressionStatement", + "src": "8348:37:0" + } + ] + }, + "documentation": null, + "id": 967, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_removeValidator", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 905, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 904, + "name": "validator", + "nodeType": "VariableDeclaration", + "scope": 967, + "src": "7982:17:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 903, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7982:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "7981:19:0" + }, + "returnParameters": { + "id": 906, + "nodeType": "ParameterList", + "parameters": [], + "src": "8009:0:0" + }, + "scope": 1340, + "src": "7956:436:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "private" + }, + { + "body": { + "id": 990, + "nodeType": "Block", + "src": "8474:127:0", + "statements": [ + { + "condition": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 977, + "name": "Vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 64, + "src": "8496:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", + "typeString": "type(enum Bridge.Vote)" + } + }, + "id": 978, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "CHANGE_THRESHOLD", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "8496:21:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + { + "argumentTypes": null, + "id": 979, + "name": "threshold", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 969, + "src": "8519:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 976, + "name": "tryVote", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 1084, + 1109, + 1134, + 1164 + ], + "referencedDeclaration": 1134, + "src": "8488:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$_t_uint256_$returns$_t_bool_$", + "typeString": "function (enum Bridge.Vote,uint256) returns (bool)" + } + }, + "id": 980, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8488:41:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 989, + "nodeType": "IfStatement", + "src": "8484:111:0", + "trueBody": { + "id": 988, + "nodeType": "Block", + "src": "8531:64:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 986, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 981, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "8545:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 983, + "indexExpression": { + "argumentTypes": null, + "id": 982, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "8552:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "8545:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 984, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "threshold", + "nodeType": "MemberAccess", + "referencedDeclaration": 37, + "src": "8545:27:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 985, + "name": "threshold", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 969, + "src": "8575:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "8545:39:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 987, + "nodeType": "ExpressionStatement", + "src": "8545:39:0" + } + ] + } + } + ] + }, + "documentation": null, + "id": 991, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 972, + "modifierName": { + "argumentTypes": null, + "id": 971, + "name": "voting", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 225, + "src": "8450:6:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "8450:6:0" + }, + { + "arguments": null, + "id": 974, + "modifierName": { + "argumentTypes": null, + "id": 973, + "name": "currentValidator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 261, + "src": "8457:16:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "8457:16:0" + } + ], + "name": "voteChangeThreshold", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 970, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 969, + "name": "threshold", + "nodeType": "VariableDeclaration", + "scope": 991, + "src": "8427:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 968, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "8427:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "8426:16:0" + }, + "returnParameters": { + "id": 975, + "nodeType": "ParameterList", + "parameters": [], + "src": "8474:0:0" + }, + "scope": 1340, + "src": "8398:203:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 1014, + "nodeType": "Block", + "src": "8683:128:0", + "statements": [ + { + "condition": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1001, + "name": "Vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 64, + "src": "8705:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", + "typeString": "type(enum Bridge.Vote)" + } + }, + "id": 1002, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "CHANGE_RANGE_SIZE", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "8705:22:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + { + "argumentTypes": null, + "id": 1003, + "name": "rangeSize", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 993, + "src": "8729:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 1000, + "name": "tryVote", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 1084, + 1109, + 1134, + 1164 + ], + "referencedDeclaration": 1134, + "src": "8697:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$_t_uint256_$returns$_t_bool_$", + "typeString": "function (enum Bridge.Vote,uint256) returns (bool)" + } + }, + "id": 1004, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8697:42:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 1013, + "nodeType": "IfStatement", + "src": "8693:112:0", + "trueBody": { + "id": 1012, + "nodeType": "Block", + "src": "8741:64:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 1010, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1005, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "8755:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 1007, + "indexExpression": { + "argumentTypes": null, + "id": 1006, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "8762:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "8755:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 1008, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "rangeSize", + "nodeType": "MemberAccess", + "referencedDeclaration": 39, + "src": "8755:27:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 1009, + "name": "rangeSize", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 993, + "src": "8785:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "8755:39:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 1011, + "nodeType": "ExpressionStatement", + "src": "8755:39:0" + } + ] + } + } + ] + }, + "documentation": null, + "id": 1015, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 996, + "modifierName": { + "argumentTypes": null, + "id": 995, + "name": "voting", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 225, + "src": "8659:6:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "8659:6:0" + }, + { + "arguments": null, + "id": 998, + "modifierName": { + "argumentTypes": null, + "id": 997, + "name": "currentValidator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 261, + "src": "8666:16:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "8666:16:0" + } + ], + "name": "voteChangeRangeSize", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 994, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 993, + "name": "rangeSize", + "nodeType": "VariableDeclaration", + "scope": 1015, + "src": "8636:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 992, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "8636:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "8635:16:0" + }, + "returnParameters": { + "id": 999, + "nodeType": "ParameterList", + "parameters": [], + "src": "8683:0:0" + }, + "scope": 1340, + "src": "8607:204:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 1038, + "nodeType": "Block", + "src": "8875:141:0", + "statements": [ + { + "condition": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1023, + "name": "Vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 64, + "src": "8897:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", + "typeString": "type(enum Bridge.Vote)" + } + }, + "id": 1024, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "START_KEYGEN", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "8897:17:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + ], + "id": 1022, + "name": "tryVote", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 1084, + 1109, + 1134, + 1164 + ], + "referencedDeclaration": 1084, + "src": "8889:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$returns$_t_bool_$", + "typeString": "function (enum Bridge.Vote) returns (bool)" + } + }, + "id": 1025, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8889:26:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 1037, + "nodeType": "IfStatement", + "src": "8885:125:0", + "trueBody": { + "id": 1036, + "nodeType": "Block", + "src": "8917:93:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 1029, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 1026, + "name": "status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 90, + "src": "8931:6:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1027, + "name": "Status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "8940:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Status_$53_$", + "typeString": "type(enum Bridge.Status)" + } + }, + "id": 1028, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "KEYGEN", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "8940:13:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "src": "8931:22:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "id": 1030, + "nodeType": "ExpressionStatement", + "src": "8931:22:0" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1032, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "8982:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 1033, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "8989:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 1031, + "name": "NewEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14, + "src": "8973:8:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$returns$__$", + "typeString": "function (uint256,uint256)" + } + }, + "id": 1034, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8973:26:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1035, + "nodeType": "EmitStatement", + "src": "8968:31:0" + } + ] + } + } + ] + }, + "documentation": null, + "id": 1039, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 1018, + "modifierName": { + "argumentTypes": null, + "id": 1017, + "name": "voting", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 225, + "src": "8851:6:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "8851:6:0" + }, + { + "arguments": null, + "id": 1020, + "modifierName": { + "argumentTypes": null, + "id": 1019, + "name": "currentValidator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 261, + "src": "8858:16:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "8858:16:0" + } + ], + "name": "voteStartKeygen", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1016, + "nodeType": "ParameterList", + "parameters": [], + "src": "8841:2:0" + }, + "returnParameters": { + "id": 1021, + "nodeType": "ParameterList", + "parameters": [], + "src": "8875:0:0" + }, + "scope": 1340, + "src": "8817:199:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 1061, + "nodeType": "Block", + "src": "9081:144:0", + "statements": [ + { + "condition": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1047, + "name": "Vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 64, + "src": "9103:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", + "typeString": "type(enum Bridge.Vote)" + } + }, + "id": 1048, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "CANCEL_KEYGEN", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "9103:18:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + ], + "id": 1046, + "name": "tryVote", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 1084, + 1109, + 1134, + 1164 + ], + "referencedDeclaration": 1084, + "src": "9095:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$returns$_t_bool_$", + "typeString": "function (enum Bridge.Vote) returns (bool)" + } + }, + "id": 1049, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9095:27:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 1060, + "nodeType": "IfStatement", + "src": "9091:128:0", + "trueBody": { + "id": 1059, + "nodeType": "Block", + "src": "9124:95:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 1053, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 1050, + "name": "status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 90, + "src": "9138:6:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1051, + "name": "Status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "9147:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Status_$53_$", + "typeString": "type(enum Bridge.Status)" + } + }, + "id": 1052, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "VOTING", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "9147:13:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "src": "9138:22:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "id": 1054, + "nodeType": "ExpressionStatement", + "src": "9138:22:0" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1056, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "9198:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 1055, + "name": "NewEpochCancelled", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 18, + "src": "9180:17:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 1057, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9180:28:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1058, + "nodeType": "EmitStatement", + "src": "9175:33:0" + } + ] + } + } + ] + }, + "documentation": null, + "id": 1062, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 1042, + "modifierName": { + "argumentTypes": null, + "id": 1041, + "name": "keygen", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 237, + "src": "9057:6:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "9057:6:0" + }, + { + "arguments": null, + "id": 1044, + "modifierName": { + "argumentTypes": null, + "id": 1043, + "name": "currentValidator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 261, + "src": "9064:16:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "9064:16:0" + } + ], + "name": "voteCancelKeygen", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1040, + "nodeType": "ParameterList", + "parameters": [], + "src": "9047:2:0" + }, + "returnParameters": { + "id": 1045, + "nodeType": "ParameterList", + "parameters": [], + "src": "9081:0:0" + }, + "scope": 1340, + "src": "9022:203:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 1083, + "nodeType": "Block", + "src": "9286:110:0", + "statements": [ + { + "assignments": [ + 1070 + ], + "declarations": [ + { + "constant": false, + "id": 1070, + "name": "vote", + "nodeType": "VariableDeclaration", + "scope": 1083, + "src": "9296:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1069, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "9296:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1078, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1074, + "name": "voteType", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1064, + "src": "9338:8:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + { + "argumentTypes": null, + "id": 1075, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "9348:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "id": 1072, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13075, + "src": "9321:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 1073, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "9321:16:0", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 1076, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9321:37:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 1071, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13082, + "src": "9311:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 1077, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9311:48:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "9296:63:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1080, + "name": "vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1070, + "src": "9384:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 1079, + "name": "putVote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1268, + "src": "9376:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$_t_bool_$", + "typeString": "function (bytes32) returns (bool)" + } + }, + "id": 1081, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9376:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 1068, + "id": 1082, + "nodeType": "Return", + "src": "9369:20:0" + } + ] + }, + "documentation": null, + "id": 1084, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "tryVote", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1065, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1064, + "name": "voteType", + "nodeType": "VariableDeclaration", + "scope": 1084, + "src": "9248:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + "typeName": { + "contractScope": null, + "id": 1063, + "name": "Vote", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 64, + "src": "9248:4:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "9247:15:0" + }, + "returnParameters": { + "id": 1068, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1067, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 1084, + "src": "9280:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 1066, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "9280:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "9279:6:0" + }, + "scope": 1340, + "src": "9231:165:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "private" + }, + { + "body": { + "id": 1108, + "nodeType": "Block", + "src": "9471:116:0", + "statements": [ + { + "assignments": [ + 1094 + ], + "declarations": [ + { + "constant": false, + "id": 1094, + "name": "vote", + "nodeType": "VariableDeclaration", + "scope": 1108, + "src": "9481:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1093, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "9481:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1103, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1098, + "name": "voteType", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1086, + "src": "9523:8:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + { + "argumentTypes": null, + "id": 1099, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "9533:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 1100, + "name": "addr", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1088, + "src": "9544:4:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "expression": { + "argumentTypes": null, + "id": 1096, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13075, + "src": "9506:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 1097, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "9506:16:0", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 1101, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9506:43:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 1095, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13082, + "src": "9496:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 1102, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9496:54:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "9481:69:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1105, + "name": "vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1094, + "src": "9575:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 1104, + "name": "putVote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1268, + "src": "9567:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$_t_bool_$", + "typeString": "function (bytes32) returns (bool)" + } + }, + "id": 1106, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9567:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 1092, + "id": 1107, + "nodeType": "Return", + "src": "9560:20:0" + } + ] + }, + "documentation": null, + "id": 1109, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "tryVote", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1089, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1086, + "name": "voteType", + "nodeType": "VariableDeclaration", + "scope": 1109, + "src": "9419:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + "typeName": { + "contractScope": null, + "id": 1085, + "name": "Vote", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 64, + "src": "9419:4:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1088, + "name": "addr", + "nodeType": "VariableDeclaration", + "scope": 1109, + "src": "9434:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1087, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "9434:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "9418:29:0" + }, + "returnParameters": { + "id": 1092, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1091, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 1109, + "src": "9465:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 1090, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "9465:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "9464:6:0" + }, + "scope": 1340, + "src": "9402:185:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "private" + }, + { + "body": { + "id": 1133, + "nodeType": "Block", + "src": "9658:115:0", + "statements": [ + { + "assignments": [ + 1119 + ], + "declarations": [ + { + "constant": false, + "id": 1119, + "name": "vote", + "nodeType": "VariableDeclaration", + "scope": 1133, + "src": "9668:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1118, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "9668:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1128, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1123, + "name": "voteType", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1111, + "src": "9710:8:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + { + "argumentTypes": null, + "id": 1124, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "9720:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 1125, + "name": "num", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1113, + "src": "9731:3:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "id": 1121, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13075, + "src": "9693:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 1122, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "9693:16:0", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 1126, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9693:42:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 1120, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13082, + "src": "9683:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 1127, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9683:53:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "9668:68:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1130, + "name": "vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1119, + "src": "9761:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 1129, + "name": "putVote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1268, + "src": "9753:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$_t_bool_$", + "typeString": "function (bytes32) returns (bool)" + } + }, + "id": 1131, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9753:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 1117, + "id": 1132, + "nodeType": "Return", + "src": "9746:20:0" + } + ] + }, + "documentation": null, + "id": 1134, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "tryVote", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1114, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1111, + "name": "voteType", + "nodeType": "VariableDeclaration", + "scope": 1134, + "src": "9610:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + "typeName": { + "contractScope": null, + "id": 1110, + "name": "Vote", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 64, + "src": "9610:4:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1113, + "name": "num", + "nodeType": "VariableDeclaration", + "scope": 1134, + "src": "9625:8:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1112, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "9625:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "9609:25:0" + }, + "returnParameters": { + "id": 1117, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1116, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 1134, + "src": "9652:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 1115, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "9652:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "9651:6:0" + }, + "scope": 1340, + "src": "9593:180:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "private" + }, + { + "body": { + "id": 1163, + "nodeType": "Block", + "src": "9872:116:0", + "statements": [ + { + "assignments": [ + 1148 + ], + "declarations": [ + { + "constant": false, + "id": 1148, + "name": "vote", + "nodeType": "VariableDeclaration", + "scope": 1163, + "src": "9882:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1147, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "9882:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1158, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1152, + "name": "voteType", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1136, + "src": "9924:8:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + { + "argumentTypes": null, + "id": 1153, + "name": "hash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1138, + "src": "9934:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "argumentTypes": null, + "id": 1154, + "name": "to", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1140, + "src": "9940:2:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 1155, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1142, + "src": "9944:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "id": 1150, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13075, + "src": "9907:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 1151, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "9907:16:0", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 1156, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9907:43:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 1149, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13082, + "src": "9897:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 1157, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9897:54:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "9882:69:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1160, + "name": "vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1148, + "src": "9976:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 1159, + "name": "putVote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1268, + "src": "9968:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$_t_bool_$", + "typeString": "function (bytes32) returns (bool)" + } + }, + "id": 1161, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9968:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 1146, + "id": 1162, + "nodeType": "Return", + "src": "9961:20:0" + } + ] + }, + "documentation": null, + "id": 1164, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "tryVote", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1143, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1136, + "name": "voteType", + "nodeType": "VariableDeclaration", + "scope": 1164, + "src": "9796:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + "typeName": { + "contractScope": null, + "id": 1135, + "name": "Vote", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 64, + "src": "9796:4:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1138, + "name": "hash", + "nodeType": "VariableDeclaration", + "scope": 1164, + "src": "9811:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1137, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "9811:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1140, + "name": "to", + "nodeType": "VariableDeclaration", + "scope": 1164, + "src": "9825:10:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1139, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "9825:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1142, + "name": "value", + "nodeType": "VariableDeclaration", + "scope": 1164, + "src": "9837:10:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1141, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "9837:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "9795:53:0" + }, + "returnParameters": { + "id": 1146, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1145, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 1164, + "src": "9866:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 1144, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "9866:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "9865:6:0" + }, + "scope": 1340, + "src": "9779:209:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "private" + }, + { + "body": { + "id": 1185, + "nodeType": "Block", + "src": "10052:113:0", + "statements": [ + { + "assignments": [ + 1172 + ], + "declarations": [ + { + "constant": false, + "id": 1172, + "name": "vote", + "nodeType": "VariableDeclaration", + "scope": 1185, + "src": "10062:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1171, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "10062:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1180, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1176, + "name": "voteType", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1166, + "src": "10104:8:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + { + "argumentTypes": null, + "id": 1177, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "10114:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "id": 1174, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13075, + "src": "10087:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 1175, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "10087:16:0", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 1178, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10087:37:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 1173, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13082, + "src": "10077:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 1179, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10077:48:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "10062:63:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1182, + "name": "vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1172, + "src": "10153:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 1181, + "name": "putConfirm", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1322, + "src": "10142:10:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$_t_bool_$", + "typeString": "function (bytes32) returns (bool)" + } + }, + "id": 1183, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10142:16:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 1170, + "id": 1184, + "nodeType": "Return", + "src": "10135:23:0" + } + ] + }, + "documentation": null, + "id": 1186, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "tryConfirm", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1167, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1166, + "name": "voteType", + "nodeType": "VariableDeclaration", + "scope": 1186, + "src": "10014:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + "typeName": { + "contractScope": null, + "id": 1165, + "name": "Vote", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 64, + "src": "10014:4:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "10013:15:0" + }, + "returnParameters": { + "id": 1170, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1169, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 1186, + "src": "10046:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 1168, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "10046:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "10045:6:0" + }, + "scope": 1340, + "src": "9994:171:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "private" + }, + { + "body": { + "id": 1213, + "nodeType": "Block", + "src": "10245:119:0", + "statements": [ + { + "assignments": [ + 1198 + ], + "declarations": [ + { + "constant": false, + "id": 1198, + "name": "vote", + "nodeType": "VariableDeclaration", + "scope": 1213, + "src": "10255:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1197, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "10255:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1208, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1202, + "name": "voteType", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1188, + "src": "10297:8:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + { + "argumentTypes": null, + "id": 1203, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "10307:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 1204, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1190, + "src": "10318:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 1205, + "name": "y", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1192, + "src": "10321:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "id": 1200, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13075, + "src": "10280:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 1201, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "10280:16:0", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 1206, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10280:43:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 1199, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13082, + "src": "10270:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 1207, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10270:54:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "10255:69:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1210, + "name": "vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1198, + "src": "10352:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 1209, + "name": "putConfirm", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1322, + "src": "10341:10:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$_t_bool_$", + "typeString": "function (bytes32) returns (bool)" + } + }, + "id": 1211, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10341:16:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 1196, + "id": 1212, + "nodeType": "Return", + "src": "10334:23:0" + } + ] + }, + "documentation": null, + "id": 1214, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "tryConfirm", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1193, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1188, + "name": "voteType", + "nodeType": "VariableDeclaration", + "scope": 1214, + "src": "10191:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + "typeName": { + "contractScope": null, + "id": 1187, + "name": "Vote", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 64, + "src": "10191:4:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1190, + "name": "x", + "nodeType": "VariableDeclaration", + "scope": 1214, + "src": "10206:6:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1189, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "10206:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1192, + "name": "y", + "nodeType": "VariableDeclaration", + "scope": 1214, + "src": "10214:6:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1191, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "10214:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "10190:31:0" + }, + "returnParameters": { + "id": 1196, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1195, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 1214, + "src": "10239:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 1194, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "10239:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "10238:6:0" + }, + "scope": 1340, + "src": "10171:193:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "private" + }, + { + "body": { + "id": 1267, + "nodeType": "Block", + "src": "10424:355:0", + "statements": [ + { + "assignments": [ + 1222 + ], + "declarations": [ + { + "constant": false, + "id": 1222, + "name": "personalVote", + "nodeType": "VariableDeclaration", + "scope": 1267, + "src": "10434:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1221, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "10434:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1226, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1224, + "name": "vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1216, + "src": "10473:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 1223, + "name": "personalizeVote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1339, + "src": "10457:15:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_bytes32_$", + "typeString": "function (bytes32) view returns (bytes32)" + } + }, + "id": 1225, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10457:21:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "10434:44:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1231, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "10496:20:0", + "subExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1228, + "name": "votes", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 84, + "src": "10497:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", + "typeString": "mapping(bytes32 => bool)" + } + }, + "id": 1230, + "indexExpression": { + "argumentTypes": null, + "id": 1229, + "name": "personalVote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1222, + "src": "10503:12:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "10497:19:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "566f74656420616c7265616479", + "id": 1232, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10518:15:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_230c30109b60c15b21799291aaf5c571045da3dc3f224d8bbd2f2e688c149a47", + "typeString": "literal_string \"Voted already\"" + }, + "value": "Voted already" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_230c30109b60c15b21799291aaf5c571045da3dc3f224d8bbd2f2e688c149a47", + "typeString": "literal_string \"Voted already\"" + } + ], + "id": 1227, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 13091, + 13092 + ], + "referencedDeclaration": 13092, + "src": "10488:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1233, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10488:46:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1234, + "nodeType": "ExpressionStatement", + "src": "10488:46:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 1239, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1235, + "name": "votes", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 84, + "src": "10545:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", + "typeString": "mapping(bytes32 => bool)" + } + }, + "id": 1237, + "indexExpression": { + "argumentTypes": null, + "id": 1236, + "name": "personalVote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1222, + "src": "10551:12:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "10545:19:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "74727565", + "id": 1238, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10567:4:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + "src": "10545:26:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 1240, + "nodeType": "ExpressionStatement", + "src": "10545:26:0" + }, + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 1246, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1241, + "name": "votesCount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 80, + "src": "10585:10:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + } + }, + "id": 1243, + "indexExpression": { + "argumentTypes": null, + "id": 1242, + "name": "vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1216, + "src": "10596:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "10585:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 1244, + "name": "getThreshold", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 565, + 588 + ], + "referencedDeclaration": 565, + "src": "10605:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 1245, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10605:14:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "10585:34:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "id": 1265, + "nodeType": "Block", + "src": "10704:69:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 1261, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "10718:18:0", + "subExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1258, + "name": "votesCount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 80, + "src": "10718:10:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + } + }, + "id": 1260, + "indexExpression": { + "argumentTypes": null, + "id": 1259, + "name": "vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1216, + "src": "10729:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "10718:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 1262, + "nodeType": "ExpressionStatement", + "src": "10718:18:0" + }, + { + "expression": { + "argumentTypes": null, + "hexValue": "66616c7365", + "id": 1263, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10757:5:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + }, + "functionReturnParameters": 1220, + "id": 1264, + "nodeType": "Return", + "src": "10750:12:0" + } + ] + }, + "id": 1266, + "nodeType": "IfStatement", + "src": "10581:192:0", + "trueBody": { + "id": 1257, + "nodeType": "Block", + "src": "10621:77:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 1253, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1247, + "name": "votesCount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 80, + "src": "10635:10:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + } + }, + "id": 1249, + "indexExpression": { + "argumentTypes": null, + "id": 1248, + "name": "vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1216, + "src": "10646:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "10635:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_rational_57896044618658097711785492504343953926634992332820282019728792003956564819968_by_1", + "typeString": "int_const 5789...(69 digits omitted)...9968" + }, + "id": 1252, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "hexValue": "32", + "id": 1250, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10654:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" + }, + "nodeType": "BinaryOperation", + "operator": "**", + "rightExpression": { + "argumentTypes": null, + "hexValue": "323535", + "id": 1251, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10659:3:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_255_by_1", + "typeString": "int_const 255" + }, + "value": "255" + }, + "src": "10654:8:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_57896044618658097711785492504343953926634992332820282019728792003956564819968_by_1", + "typeString": "int_const 5789...(69 digits omitted)...9968" + } + }, + "src": "10635:27:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 1254, + "nodeType": "ExpressionStatement", + "src": "10635:27:0" + }, + { + "expression": { + "argumentTypes": null, + "hexValue": "74727565", + "id": 1255, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10683:4:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + "functionReturnParameters": 1220, + "id": 1256, + "nodeType": "Return", + "src": "10676:11:0" + } + ] + } + } + ] + }, + "documentation": null, + "id": 1268, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "putVote", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1217, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1216, + "name": "vote", + "nodeType": "VariableDeclaration", + "scope": 1268, + "src": "10387:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1215, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "10387:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "10386:14:0" + }, + "returnParameters": { + "id": 1220, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1219, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 1268, + "src": "10418:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 1218, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "10418:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "10417:6:0" + }, + "scope": 1340, + "src": "10370:409:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "private" + }, + { + "body": { + "id": 1321, + "nodeType": "Block", + "src": "10842:363:0", + "statements": [ + { + "assignments": [ + 1276 + ], + "declarations": [ + { + "constant": false, + "id": 1276, + "name": "personalVote", + "nodeType": "VariableDeclaration", + "scope": 1321, + "src": "10852:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1275, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "10852:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1280, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1278, + "name": "vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1270, + "src": "10891:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 1277, + "name": "personalizeVote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1339, + "src": "10875:15:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_bytes32_$", + "typeString": "function (bytes32) view returns (bytes32)" + } + }, + "id": 1279, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10875:21:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "10852:44:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1285, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "10914:20:0", + "subExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1282, + "name": "votes", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 84, + "src": "10915:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", + "typeString": "mapping(bytes32 => bool)" + } + }, + "id": 1284, + "indexExpression": { + "argumentTypes": null, + "id": 1283, + "name": "personalVote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1276, + "src": "10921:12:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "10915:19:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "436f6e6669726d656420616c7265616479", + "id": 1286, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10936:19:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_762a97ce67d271844ad9c09d89a5271fde7fe7537af208da055a904cd67ac7bc", + "typeString": "literal_string \"Confirmed already\"" + }, + "value": "Confirmed already" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_762a97ce67d271844ad9c09d89a5271fde7fe7537af208da055a904cd67ac7bc", + "typeString": "literal_string \"Confirmed already\"" + } + ], + "id": 1281, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 13091, + 13092 + ], + "referencedDeclaration": 13092, + "src": "10906:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1287, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10906:50:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1288, + "nodeType": "ExpressionStatement", + "src": "10906:50:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 1293, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1289, + "name": "votes", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 84, + "src": "10967:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", + "typeString": "mapping(bytes32 => bool)" + } + }, + "id": 1291, + "indexExpression": { + "argumentTypes": null, + "id": 1290, + "name": "personalVote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1276, + "src": "10973:12:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "10967:19:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "74727565", + "id": 1292, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10989:4:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + "src": "10967:26:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 1294, + "nodeType": "ExpressionStatement", + "src": "10967:26:0" + }, + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 1300, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1295, + "name": "votesCount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 80, + "src": "11007:10:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + } + }, + "id": 1297, + "indexExpression": { + "argumentTypes": null, + "id": 1296, + "name": "vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1270, + "src": "11018:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "11007:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 1298, + "name": "getNextThreshold", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 575, + "src": "11027:16:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 1299, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11027:18:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "11007:38:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "id": 1319, + "nodeType": "Block", + "src": "11130:69:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 1315, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "11144:18:0", + "subExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1312, + "name": "votesCount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 80, + "src": "11144:10:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + } + }, + "id": 1314, + "indexExpression": { + "argumentTypes": null, + "id": 1313, + "name": "vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1270, + "src": "11155:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "11144:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 1316, + "nodeType": "ExpressionStatement", + "src": "11144:18:0" + }, + { + "expression": { + "argumentTypes": null, + "hexValue": "66616c7365", + "id": 1317, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "11183:5:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + }, + "functionReturnParameters": 1274, + "id": 1318, + "nodeType": "Return", + "src": "11176:12:0" + } + ] + }, + "id": 1320, + "nodeType": "IfStatement", + "src": "11003:196:0", + "trueBody": { + "id": 1311, + "nodeType": "Block", + "src": "11047:77:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 1307, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1301, + "name": "votesCount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 80, + "src": "11061:10:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + } + }, + "id": 1303, + "indexExpression": { + "argumentTypes": null, + "id": 1302, + "name": "vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1270, + "src": "11072:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "11061:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_rational_57896044618658097711785492504343953926634992332820282019728792003956564819968_by_1", + "typeString": "int_const 5789...(69 digits omitted)...9968" + }, + "id": 1306, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "hexValue": "32", + "id": 1304, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "11080:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" + }, + "nodeType": "BinaryOperation", + "operator": "**", + "rightExpression": { + "argumentTypes": null, + "hexValue": "323535", + "id": 1305, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "11085:3:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_255_by_1", + "typeString": "int_const 255" + }, + "value": "255" + }, + "src": "11080:8:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_57896044618658097711785492504343953926634992332820282019728792003956564819968_by_1", + "typeString": "int_const 5789...(69 digits omitted)...9968" + } + }, + "src": "11061:27:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 1308, + "nodeType": "ExpressionStatement", + "src": "11061:27:0" + }, + { + "expression": { + "argumentTypes": null, + "hexValue": "74727565", + "id": 1309, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "11109:4:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + "functionReturnParameters": 1274, + "id": 1310, + "nodeType": "Return", + "src": "11102:11:0" + } + ] + } + } + ] + }, + "documentation": null, + "id": 1322, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "putConfirm", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1271, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1270, + "name": "vote", + "nodeType": "VariableDeclaration", + "scope": 1322, + "src": "10805:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1269, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "10805:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "10804:14:0" + }, + "returnParameters": { + "id": 1274, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1273, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 1322, + "src": "10836:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 1272, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "10836:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "10835:6:0" + }, + "scope": 1340, + "src": "10785:420:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "private" + }, + { + "body": { + "id": 1338, + "nodeType": "Block", + "src": "11281:69:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1332, + "name": "vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1324, + "src": "11325:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1333, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13088, + "src": "11331:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1334, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "11331:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + ], + "expression": { + "argumentTypes": null, + "id": 1330, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13075, + "src": "11308:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 1331, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "11308:16:0", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 1335, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11308:34:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 1329, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13082, + "src": "11298:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 1336, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11298:45:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "functionReturnParameters": 1328, + "id": 1337, + "nodeType": "Return", + "src": "11291:52:0" + } + ] + }, + "documentation": null, + "id": 1339, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "personalizeVote", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1325, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1324, + "name": "vote", + "nodeType": "VariableDeclaration", + "scope": 1339, + "src": "11236:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1323, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "11236:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "11235:14:0" + }, + "returnParameters": { + "id": 1328, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1327, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 1339, + "src": "11272:7:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1326, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "11272:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "11271:9:0" + }, + "scope": 1340, + "src": "11211:139:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "private" + } + ], + "scope": 1341, + "src": "93:11259:0" + } + ], + "src": "0:11353:0" + }, + "legacyAST": { + "absolutePath": "/build/contracts/Bridge.sol", + "exportedSymbols": { + "Bridge": [ + 1340 + ] + }, + "id": 1341, + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 1, + "literals": [ + "solidity", + "^", + "0.5", + ".0" + ], + "nodeType": "PragmaDirective", + "src": "0:23:0" + }, + { + "absolutePath": "/build/contracts/openzeppelin-solidity/contracts/token/ERC20/IERC20.sol", + "file": "./openzeppelin-solidity/contracts/token/ERC20/IERC20.sol", + "id": 2, + "nodeType": "ImportDirective", + "scope": 1341, + "sourceUnit": 10033, + "src": "25:66:0", + "symbolAliases": [], + "unitAlias": "" + }, + { + "baseContracts": [], + "contractDependencies": [], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "id": 1340, + "linearizedBaseContracts": [ + 1340 + ], + "name": "Bridge", + "nodeType": "ContractDefinition", + "nodes": [ + { + "anonymous": false, + "documentation": null, + "id": 8, + "name": "ExchangeRequest", + "nodeType": "EventDefinition", + "parameters": { + "id": 7, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4, + "indexed": false, + "name": "value", + "nodeType": "VariableDeclaration", + "scope": 8, + "src": "137:10:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "137:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 6, + "indexed": false, + "name": "nonce", + "nodeType": "VariableDeclaration", + "scope": 8, + "src": "149:10:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 5, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "149:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "136:24:0" + }, + "src": "115:46:0" + }, + { + "anonymous": false, + "documentation": null, + "id": 14, + "name": "NewEpoch", + "nodeType": "EventDefinition", + "parameters": { + "id": 13, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10, + "indexed": true, + "name": "oldEpoch", + "nodeType": "VariableDeclaration", + "scope": 14, + "src": "181:21:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 9, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "181:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 12, + "indexed": true, + "name": "newEpoch", + "nodeType": "VariableDeclaration", + "scope": 14, + "src": "204:21:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 11, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "204:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "180:46:0" + }, + "src": "166:61:0" + }, + { + "anonymous": false, + "documentation": null, + "id": 18, + "name": "NewEpochCancelled", + "nodeType": "EventDefinition", + "parameters": { + "id": 17, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 16, + "indexed": true, + "name": "epoch", + "nodeType": "VariableDeclaration", + "scope": 18, + "src": "256:18:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 15, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "256:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "255:20:0" + }, + "src": "232:44:0" + }, + { + "anonymous": false, + "documentation": null, + "id": 24, + "name": "NewFundsTransfer", + "nodeType": "EventDefinition", + "parameters": { + "id": 23, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 20, + "indexed": true, + "name": "oldEpoch", + "nodeType": "VariableDeclaration", + "scope": 24, + "src": "304:21:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 19, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "304:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 22, + "indexed": true, + "name": "newEpoch", + "nodeType": "VariableDeclaration", + "scope": 24, + "src": "327:21:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 21, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "327:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "303:46:0" + }, + "src": "281:69:0" + }, + { + "anonymous": false, + "documentation": null, + "id": 32, + "name": "EpochStart", + "nodeType": "EventDefinition", + "parameters": { + "id": 31, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 26, + "indexed": true, + "name": "epoch", + "nodeType": "VariableDeclaration", + "scope": 32, + "src": "372:18:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 25, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "372:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 28, + "indexed": false, + "name": "x", + "nodeType": "VariableDeclaration", + "scope": 32, + "src": "392:6:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 27, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "392:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 30, + "indexed": false, + "name": "y", + "nodeType": "VariableDeclaration", + "scope": 32, + "src": "400:6:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 29, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "400:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "371:36:0" + }, + "src": "355:53:0" + }, + { + "canonicalName": "Bridge.State", + "id": 48, + "members": [ + { + "constant": false, + "id": 35, + "name": "validators", + "nodeType": "VariableDeclaration", + "scope": 48, + "src": "437:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + }, + "typeName": { + "baseType": { + "id": 33, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "437:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 34, + "length": null, + "nodeType": "ArrayTypeName", + "src": "437:9:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 37, + "name": "threshold", + "nodeType": "VariableDeclaration", + "scope": 48, + "src": "467:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 36, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "467:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 39, + "name": "rangeSize", + "nodeType": "VariableDeclaration", + "scope": 48, + "src": "491:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 38, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "491:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 41, + "name": "startBlock", + "nodeType": "VariableDeclaration", + "scope": 48, + "src": "515:15:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 40, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "515:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 43, + "name": "nonce", + "nodeType": "VariableDeclaration", + "scope": 48, + "src": "540:10:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 42, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "540:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 45, + "name": "x", + "nodeType": "VariableDeclaration", + "scope": 48, + "src": "560:6:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 44, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "560:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 47, + "name": "y", + "nodeType": "VariableDeclaration", + "scope": 48, + "src": "576:6:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 46, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "576:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "name": "State", + "nodeType": "StructDefinition", + "scope": 1340, + "src": "414:175:0", + "visibility": "public" + }, + { + "canonicalName": "Bridge.Status", + "id": 53, + "members": [ + { + "id": 49, + "name": "READY", + "nodeType": "EnumValue", + "src": "617:5:0" + }, + { + "id": 50, + "name": "VOTING", + "nodeType": "EnumValue", + "src": "676:6:0" + }, + { + "id": 51, + "name": "KEYGEN", + "nodeType": "EnumValue", + "src": "746:6:0" + }, + { + "id": 52, + "name": "FUNDS_TRANSFER", + "nodeType": "EnumValue", + "src": "789:14:0" + } + ], + "name": "Status", + "nodeType": "EnumDefinition", + "src": "595:253:0" + }, + { + "canonicalName": "Bridge.Vote", + "id": 64, + "members": [ + { + "id": 54, + "name": "CONFIRM_KEYGEN", + "nodeType": "EnumValue", + "src": "874:14:0" + }, + { + "id": 55, + "name": "CONFIRM_FUNDS_TRANSFER", + "nodeType": "EnumValue", + "src": "898:22:0" + }, + { + "id": 56, + "name": "START_VOTING", + "nodeType": "EnumValue", + "src": "930:12:0" + }, + { + "id": 57, + "name": "ADD_VALIDATOR", + "nodeType": "EnumValue", + "src": "952:13:0" + }, + { + "id": 58, + "name": "REMOVE_VALIDATOR", + "nodeType": "EnumValue", + "src": "975:16:0" + }, + { + "id": 59, + "name": "CHANGE_THRESHOLD", + "nodeType": "EnumValue", + "src": "1001:16:0" + }, + { + "id": 60, + "name": "CHANGE_RANGE_SIZE", + "nodeType": "EnumValue", + "src": "1027:17:0" + }, + { + "id": 61, + "name": "START_KEYGEN", + "nodeType": "EnumValue", + "src": "1054:12:0" + }, + { + "id": 62, + "name": "CANCEL_KEYGEN", + "nodeType": "EnumValue", + "src": "1076:13:0" + }, + { + "id": 63, + "name": "TRANSFER", + "nodeType": "EnumValue", + "src": "1099:8:0" + } + ], + "name": "Vote", + "nodeType": "EnumDefinition", + "src": "854:259:0" + }, + { + "constant": false, + "id": 68, + "name": "states", + "nodeType": "VariableDeclaration", + "scope": 1340, + "src": "1119:29:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State)" + }, + "typeName": { + "id": 67, + "keyType": { + "id": 65, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1127:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Mapping", + "src": "1119:22:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State)" + }, + "valueType": { + "contractScope": null, + "id": 66, + "name": "State", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 48, + "src": "1135:5:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage_ptr", + "typeString": "struct Bridge.State" + } + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 72, + "name": "dbTransferCount", + "nodeType": "VariableDeclaration", + "scope": 1340, + "src": "1155:47:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + }, + "typeName": { + "id": 71, + "keyType": { + "id": 69, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1163:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "Mapping", + "src": "1155:24:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + }, + "valueType": { + "id": 70, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1174:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + }, + "value": null, + "visibility": "public" + }, + { + "constant": false, + "id": 76, + "name": "dbTransfer", + "nodeType": "VariableDeclaration", + "scope": 1340, + "src": "1208:42:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", + "typeString": "mapping(bytes32 => bool)" + }, + "typeName": { + "id": 75, + "keyType": { + "id": 73, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1216:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "Mapping", + "src": "1208:24:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", + "typeString": "mapping(bytes32 => bool)" + }, + "valueType": { + "id": 74, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "1227:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + }, + "value": null, + "visibility": "public" + }, + { + "constant": false, + "id": 80, + "name": "votesCount", + "nodeType": "VariableDeclaration", + "scope": 1340, + "src": "1256:42:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + }, + "typeName": { + "id": 79, + "keyType": { + "id": 77, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1264:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "Mapping", + "src": "1256:24:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + }, + "valueType": { + "id": 78, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1275:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + }, + "value": null, + "visibility": "public" + }, + { + "constant": false, + "id": 84, + "name": "votes", + "nodeType": "VariableDeclaration", + "scope": 1340, + "src": "1304:37:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", + "typeString": "mapping(bytes32 => bool)" + }, + "typeName": { + "id": 83, + "keyType": { + "id": 81, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1312:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "Mapping", + "src": "1304:24:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", + "typeString": "mapping(bytes32 => bool)" + }, + "valueType": { + "id": 82, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "1323:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + }, + "value": null, + "visibility": "public" + }, + { + "constant": false, + "id": 88, + "name": "usedRange", + "nodeType": "VariableDeclaration", + "scope": 1340, + "src": "1347:41:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", + "typeString": "mapping(bytes32 => bool)" + }, + "typeName": { + "id": 87, + "keyType": { + "id": 85, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1355:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "Mapping", + "src": "1347:24:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", + "typeString": "mapping(bytes32 => bool)" + }, + "valueType": { + "id": 86, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "1366:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + }, + "value": null, + "visibility": "public" + }, + { + "constant": false, + "id": 90, + "name": "status", + "nodeType": "VariableDeclaration", + "scope": 1340, + "src": "1395:20:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + }, + "typeName": { + "contractScope": null, + "id": 89, + "name": "Status", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 53, + "src": "1395:6:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "value": null, + "visibility": "public" + }, + { + "constant": false, + "id": 92, + "name": "epoch", + "nodeType": "VariableDeclaration", + "scope": 1340, + "src": "1422:17:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 91, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1422:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "public" + }, + { + "constant": false, + "id": 94, + "name": "nextEpoch", + "nodeType": "VariableDeclaration", + "scope": 1340, + "src": "1445:21:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 93, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1445:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "public" + }, + { + "constant": false, + "id": 96, + "name": "minTxLimit", + "nodeType": "VariableDeclaration", + "scope": 1340, + "src": "1473:15:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 95, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1473:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 98, + "name": "maxTxLimit", + "nodeType": "VariableDeclaration", + "scope": 1340, + "src": "1494:15:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 97, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1494:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "body": { + "id": 181, + "nodeType": "Block", + "src": "1643:403:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 118, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 115, + "name": "validators", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 103, + "src": "1661:10:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "id": 116, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "1661:17:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 117, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1681:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "1661:21:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 114, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 13091, + 13092 + ], + "referencedDeclaration": 13091, + "src": "1653:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 119, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1653:30:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 120, + "nodeType": "ExpressionStatement", + "src": "1653:30:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 125, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 122, + "name": "threshold", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 100, + "src": "1701:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 123, + "name": "validators", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 103, + "src": "1713:10:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "id": 124, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "1713:17:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1701:29:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 121, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 13091, + 13092 + ], + "referencedDeclaration": 13091, + "src": "1693:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 126, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1693:38:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 127, + "nodeType": "ExpressionStatement", + "src": "1693:38:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 132, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 128, + "name": "tokenContract", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 184, + "src": "1742:13:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IERC20_$10032", + "typeString": "contract IERC20" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 130, + "name": "_tokenContract", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 105, + "src": "1765:14:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 129, + "name": "IERC20", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10032, + "src": "1758:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IERC20_$10032_$", + "typeString": "type(contract IERC20)" + } + }, + "id": 131, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1758:22:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IERC20_$10032", + "typeString": "contract IERC20" + } + }, + "src": "1742:38:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IERC20_$10032", + "typeString": "contract IERC20" + } + }, + "id": 133, + "nodeType": "ExpressionStatement", + "src": "1742:38:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 136, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 134, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "1791:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "30", + "id": 135, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1799:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "1791:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 137, + "nodeType": "ExpressionStatement", + "src": "1791:9:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 141, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 138, + "name": "status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 90, + "src": "1810:6:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 139, + "name": "Status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "1819:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Status_$53_$", + "typeString": "type(enum Bridge.Status)" + } + }, + "id": 140, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "KEYGEN", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "1819:13:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "src": "1810:22:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "id": 142, + "nodeType": "ExpressionStatement", + "src": "1810:22:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 145, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 143, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "1842:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "31", + "id": 144, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1854:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "1842:13:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 146, + "nodeType": "ExpressionStatement", + "src": "1842:13:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 162, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 147, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "1866:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 149, + "indexExpression": { + "argumentTypes": null, + "id": 148, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "1873:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "1866:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 151, + "name": "validators", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 103, + "src": "1892:10:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + { + "argumentTypes": null, + "id": 152, + "name": "threshold", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 100, + "src": "1904:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 153, + "name": "rangeSize", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 111, + "src": "1915:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "hexValue": "30", + "id": 154, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1926:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 157, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "-", + "prefix": true, + "src": "1934:2:0", + "subExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 156, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1935:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "typeDescriptions": { + "typeIdentifier": "t_rational_minus_1_by_1", + "typeString": "int_const -1" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_minus_1_by_1", + "typeString": "int_const -1" + } + ], + "id": 155, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "1929:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": "uint" + }, + "id": 158, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1929:8:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "hexValue": "30", + "id": 159, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1939:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + { + "argumentTypes": null, + "hexValue": "30", + "id": 160, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1942:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 150, + "name": "State", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 48, + "src": "1886:5:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_struct$_State_$48_storage_ptr_$", + "typeString": "type(struct Bridge.State storage pointer)" + } + }, + "id": 161, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "structConstructorCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1886:58:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_memory", + "typeString": "struct Bridge.State memory" + } + }, + "src": "1866:78:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 163, + "nodeType": "ExpressionStatement", + "src": "1866:78:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 168, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 164, + "name": "minTxLimit", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 96, + "src": "1955:10:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 165, + "name": "limits", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 109, + "src": "1968:6:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$2_memory_ptr", + "typeString": "uint256[2] memory" + } + }, + "id": 167, + "indexExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 166, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1975:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "1968:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1955:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 169, + "nodeType": "ExpressionStatement", + "src": "1955:22:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 174, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 170, + "name": "maxTxLimit", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 98, + "src": "1987:10:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 171, + "name": "limits", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 109, + "src": "2000:6:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$2_memory_ptr", + "typeString": "uint256[2] memory" + } + }, + "id": 173, + "indexExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 172, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2007:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "2000:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1987:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 175, + "nodeType": "ExpressionStatement", + "src": "1987:22:0" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "hexValue": "30", + "id": 177, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2034:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + { + "argumentTypes": null, + "hexValue": "31", + "id": 178, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2037:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + } + ], + "id": 176, + "name": "NewEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14, + "src": "2025:8:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$returns$__$", + "typeString": "function (uint256,uint256)" + } + }, + "id": 179, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2025:14:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 180, + "nodeType": "EmitStatement", + "src": "2020:19:0" + } + ] + }, + "documentation": null, + "id": 182, + "implemented": true, + "kind": "constructor", + "modifiers": [], + "name": "", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 112, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 100, + "name": "threshold", + "nodeType": "VariableDeclaration", + "scope": 182, + "src": "1528:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 99, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1528:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 103, + "name": "validators", + "nodeType": "VariableDeclaration", + "scope": 182, + "src": "1544:27:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[]" + }, + "typeName": { + "baseType": { + "id": 101, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1544:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 102, + "length": null, + "nodeType": "ArrayTypeName", + "src": "1544:9:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 105, + "name": "_tokenContract", + "nodeType": "VariableDeclaration", + "scope": 182, + "src": "1573:22:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 104, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1573:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 109, + "name": "limits", + "nodeType": "VariableDeclaration", + "scope": 182, + "src": "1597:21:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$2_memory_ptr", + "typeString": "uint256[2]" + }, + "typeName": { + "baseType": { + "id": 106, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1597:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 108, + "length": { + "argumentTypes": null, + "hexValue": "32", + "id": 107, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1602:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" + }, + "nodeType": "ArrayTypeName", + "src": "1597:7:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$2_storage_ptr", + "typeString": "uint256[2]" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 111, + "name": "rangeSize", + "nodeType": "VariableDeclaration", + "scope": 182, + "src": "1620:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 110, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1620:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1527:108:0" + }, + "returnParameters": { + "id": 113, + "nodeType": "ParameterList", + "parameters": [], + "src": "1643:0:0" + }, + "scope": 1340, + "src": "1516:530:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "constant": false, + "id": 184, + "name": "tokenContract", + "nodeType": "VariableDeclaration", + "scope": 1340, + "src": "2052:27:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IERC20_$10032", + "typeString": "contract IERC20" + }, + "typeName": { + "contractScope": null, + "id": 183, + "name": "IERC20", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 10032, + "src": "2052:6:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IERC20_$10032", + "typeString": "contract IERC20" + } + }, + "value": null, + "visibility": "public" + }, + { + "body": { + "id": 195, + "nodeType": "Block", + "src": "2101:81:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + }, + "id": 190, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 187, + "name": "status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 90, + "src": "2119:6:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 188, + "name": "Status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "2129:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Status_$53_$", + "typeString": "type(enum Bridge.Status)" + } + }, + "id": 189, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "READY", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2129:12:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "src": "2119:22:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4e6f7420696e207265616479207374617465", + "id": 191, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2143:20:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_965c39c15b78dbcd8a954511641ca86e15fc1ae6d6c30a67536872ccde75b679", + "typeString": "literal_string \"Not in ready state\"" + }, + "value": "Not in ready state" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_965c39c15b78dbcd8a954511641ca86e15fc1ae6d6c30a67536872ccde75b679", + "typeString": "literal_string \"Not in ready state\"" + } + ], + "id": 186, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 13091, + 13092 + ], + "referencedDeclaration": 13092, + "src": "2111:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 192, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2111:53:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 193, + "nodeType": "ExpressionStatement", + "src": "2111:53:0" + }, + { + "id": 194, + "nodeType": "PlaceholderStatement", + "src": "2174:1:0" + } + ] + }, + "documentation": null, + "id": 196, + "name": "ready", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 185, + "nodeType": "ParameterList", + "parameters": [], + "src": "2101:0:0" + }, + "src": "2086:96:0", + "visibility": "internal" + }, + { + "body": { + "id": 212, + "nodeType": "Block", + "src": "2211:118:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 207, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + }, + "id": 202, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 199, + "name": "status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 90, + "src": "2229:6:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 200, + "name": "Status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "2239:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Status_$53_$", + "typeString": "type(enum Bridge.Status)" + } + }, + "id": 201, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "READY", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2239:12:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "src": "2229:22:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "||", + "rightExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + }, + "id": 206, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 203, + "name": "status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 90, + "src": "2255:6:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 204, + "name": "Status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "2265:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Status_$53_$", + "typeString": "type(enum Bridge.Status)" + } + }, + "id": 205, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "VOTING", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2265:13:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "src": "2255:23:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "2229:49:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4e6f7420696e207265616479206f7220766f74696e67207374617465", + "id": 208, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2280:30:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_7e3f7359baa731593d4e3921720b92600c22ed1d950d208e0c826ad2eddebe96", + "typeString": "literal_string \"Not in ready or voting state\"" + }, + "value": "Not in ready or voting state" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_7e3f7359baa731593d4e3921720b92600c22ed1d950d208e0c826ad2eddebe96", + "typeString": "literal_string \"Not in ready or voting state\"" + } + ], + "id": 198, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 13091, + 13092 + ], + "referencedDeclaration": 13092, + "src": "2221:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 209, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2221:90:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 210, + "nodeType": "ExpressionStatement", + "src": "2221:90:0" + }, + { + "id": 211, + "nodeType": "PlaceholderStatement", + "src": "2321:1:0" + } + ] + }, + "documentation": null, + "id": 213, + "name": "readyOrVoting", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 197, + "nodeType": "ParameterList", + "parameters": [], + "src": "2211:0:0" + }, + "src": "2188:141:0", + "visibility": "internal" + }, + { + "body": { + "id": 224, + "nodeType": "Block", + "src": "2351:83:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + }, + "id": 219, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 216, + "name": "status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 90, + "src": "2369:6:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 217, + "name": "Status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "2379:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Status_$53_$", + "typeString": "type(enum Bridge.Status)" + } + }, + "id": 218, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "VOTING", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2379:13:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "src": "2369:23:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4e6f7420696e20766f74696e67207374617465", + "id": 220, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2394:21:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_0cbee9834b110b21e0730bf5c3d2972fb9867ff221df239e7ae60883592f05d1", + "typeString": "literal_string \"Not in voting state\"" + }, + "value": "Not in voting state" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_0cbee9834b110b21e0730bf5c3d2972fb9867ff221df239e7ae60883592f05d1", + "typeString": "literal_string \"Not in voting state\"" + } + ], + "id": 215, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 13091, + 13092 + ], + "referencedDeclaration": 13092, + "src": "2361:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 221, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2361:55:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 222, + "nodeType": "ExpressionStatement", + "src": "2361:55:0" + }, + { + "id": 223, + "nodeType": "PlaceholderStatement", + "src": "2426:1:0" + } + ] + }, + "documentation": null, + "id": 225, + "name": "voting", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 214, + "nodeType": "ParameterList", + "parameters": [], + "src": "2351:0:0" + }, + "src": "2335:99:0", + "visibility": "internal" + }, + { + "body": { + "id": 236, + "nodeType": "Block", + "src": "2456:83:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + }, + "id": 231, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 228, + "name": "status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 90, + "src": "2474:6:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 229, + "name": "Status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "2484:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Status_$53_$", + "typeString": "type(enum Bridge.Status)" + } + }, + "id": 230, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "KEYGEN", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2484:13:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "src": "2474:23:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4e6f7420696e206b657967656e207374617465", + "id": 232, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2499:21:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_ed0fee6382e0651a224348a21558d03a4a439c3bd5edc24945894a3417c14010", + "typeString": "literal_string \"Not in keygen state\"" + }, + "value": "Not in keygen state" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_ed0fee6382e0651a224348a21558d03a4a439c3bd5edc24945894a3417c14010", + "typeString": "literal_string \"Not in keygen state\"" + } + ], + "id": 227, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 13091, + 13092 + ], + "referencedDeclaration": 13092, + "src": "2466:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 233, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2466:55:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 234, + "nodeType": "ExpressionStatement", + "src": "2466:55:0" + }, + { + "id": 235, + "nodeType": "PlaceholderStatement", + "src": "2531:1:0" + } + ] + }, + "documentation": null, + "id": 237, + "name": "keygen", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 226, + "nodeType": "ParameterList", + "parameters": [], + "src": "2456:0:0" + }, + "src": "2440:99:0", + "visibility": "internal" + }, + { + "body": { + "id": 248, + "nodeType": "Block", + "src": "2568:99:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + }, + "id": 243, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 240, + "name": "status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 90, + "src": "2586:6:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 241, + "name": "Status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "2596:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Status_$53_$", + "typeString": "type(enum Bridge.Status)" + } + }, + "id": 242, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "FUNDS_TRANSFER", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2596:21:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "src": "2586:31:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4e6f7420696e2066756e6473207472616e73666572207374617465", + "id": 244, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2619:29:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_6347c9fecd6f58520ad10dfd1347ce3dc42cc0eed7a4182ca64dd11c69fc3008", + "typeString": "literal_string \"Not in funds transfer state\"" + }, + "value": "Not in funds transfer state" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_6347c9fecd6f58520ad10dfd1347ce3dc42cc0eed7a4182ca64dd11c69fc3008", + "typeString": "literal_string \"Not in funds transfer state\"" + } + ], + "id": 239, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 13091, + 13092 + ], + "referencedDeclaration": 13092, + "src": "2578:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 245, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2578:71:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 246, + "nodeType": "ExpressionStatement", + "src": "2578:71:0" + }, + { + "id": 247, + "nodeType": "PlaceholderStatement", + "src": "2659:1:0" + } + ] + }, + "documentation": null, + "id": 249, + "name": "fundsTransfer", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 238, + "nodeType": "ParameterList", + "parameters": [], + "src": "2568:0:0" + }, + "src": "2545:122:0", + "visibility": "internal" + }, + { + "body": { + "id": 260, + "nodeType": "Block", + "src": "2699:81:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 255, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 252, + "name": "getPartyId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 728, + "src": "2717:10:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 253, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2717:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 254, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2733:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "2717:17:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4e6f7420612063757272656e742076616c696461746f72", + "id": 256, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2736:25:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_8dc18d5bb1361900b9758b388df331056e31071cae84b276c0f03794c4dc634a", + "typeString": "literal_string \"Not a current validator\"" + }, + "value": "Not a current validator" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_8dc18d5bb1361900b9758b388df331056e31071cae84b276c0f03794c4dc634a", + "typeString": "literal_string \"Not a current validator\"" + } + ], + "id": 251, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 13091, + 13092 + ], + "referencedDeclaration": 13092, + "src": "2709:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 257, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2709:53:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 258, + "nodeType": "ExpressionStatement", + "src": "2709:53:0" + }, + { + "id": 259, + "nodeType": "PlaceholderStatement", + "src": "2772:1:0" + } + ] + }, + "documentation": null, + "id": 261, + "name": "currentValidator", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 250, + "nodeType": "ParameterList", + "parameters": [], + "src": "2699:0:0" + }, + "src": "2673:107:0", + "visibility": "internal" + }, + { + "body": { + "id": 343, + "nodeType": "Block", + "src": "2829:475:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 281, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 277, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 271, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 269, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 263, + "src": "2847:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "id": 270, + "name": "minTxLimit", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 96, + "src": "2856:10:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "2847:19:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 276, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 272, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 263, + "src": "2870:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_rational_10000000000_by_1", + "typeString": "int_const 10000000000" + }, + "id": 275, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "hexValue": "3130", + "id": 273, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2879:2:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_10_by_1", + "typeString": "int_const 10" + }, + "value": "10" + }, + "nodeType": "BinaryOperation", + "operator": "**", + "rightExpression": { + "argumentTypes": null, + "hexValue": "3130", + "id": 274, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2885:2:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_10_by_1", + "typeString": "int_const 10" + }, + "value": "10" + }, + "src": "2879:8:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_10000000000_by_1", + "typeString": "int_const 10000000000" + } + }, + "src": "2870:17:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "2847:40:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 280, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 278, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 263, + "src": "2891:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "id": 279, + "name": "maxTxLimit", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 98, + "src": "2900:10:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "2891:19:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "2847:63:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 268, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 13091, + 13092 + ], + "referencedDeclaration": 13091, + "src": "2839:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 282, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2839:72:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 283, + "nodeType": "ExpressionStatement", + "src": "2839:72:0" + }, + { + "assignments": [ + 285 + ], + "declarations": [ + { + "constant": false, + "id": 285, + "name": "txRange", + "nodeType": "VariableDeclaration", + "scope": 343, + "src": "2922:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 284, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "2922:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 295, + "initialValue": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 294, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "components": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 290, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 286, + "name": "block", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13078, + "src": "2938:5:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_block", + "typeString": "block" + } + }, + "id": 287, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "number", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2938:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 288, + "name": "getStartBlock", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 598, + 611 + ], + "referencedDeclaration": 598, + "src": "2953:13:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 289, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2953:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "2938:30:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 291, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "2937:32:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "/", + "rightExpression": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 292, + "name": "getRangeSize", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 621, + 644 + ], + "referencedDeclaration": 621, + "src": "2972:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 293, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2972:14:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "2937:49:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "2922:64:0" + }, + { + "condition": { + "argumentTypes": null, + "id": 305, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "3000:55:0", + "subExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 296, + "name": "usedRange", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 88, + "src": "3001:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", + "typeString": "mapping(bytes32 => bool)" + } + }, + "id": 304, + "indexExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 300, + "name": "txRange", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 285, + "src": "3038:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 301, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "3047:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "id": 298, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13075, + "src": "3021:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 299, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3021:16:0", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 302, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3021:32:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 297, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13082, + "src": "3011:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 303, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3011:43:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3001:54:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 325, + "nodeType": "IfStatement", + "src": "2996:182:0", + "trueBody": { + "id": 324, + "nodeType": "Block", + "src": "3057:121:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 316, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 306, + "name": "usedRange", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 88, + "src": "3071:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", + "typeString": "mapping(bytes32 => bool)" + } + }, + "id": 314, + "indexExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 310, + "name": "txRange", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 285, + "src": "3108:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 311, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "3117:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "id": 308, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13075, + "src": "3091:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 309, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3091:16:0", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 312, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3091:32:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 307, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13082, + "src": "3081:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 313, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3081:43:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "3071:54:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "74727565", + "id": 315, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3128:4:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + "src": "3071:61:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 317, + "nodeType": "ExpressionStatement", + "src": "3071:61:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 322, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "3146:21:0", + "subExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 318, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "3146:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 320, + "indexExpression": { + "argumentTypes": null, + "id": 319, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "3153:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3146:13:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 321, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "nonce", + "nodeType": "MemberAccess", + "referencedDeclaration": 43, + "src": "3146:19:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 323, + "nodeType": "ExpressionStatement", + "src": "3146:21:0" + } + ] + } + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 329, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13088, + "src": "3215:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 330, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3215:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 332, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13104, + "src": "3235:4:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_Bridge_$1340", + "typeString": "contract Bridge" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_Bridge_$1340", + "typeString": "contract Bridge" + } + ], + "id": 331, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "3227:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 333, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3227:13:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 334, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 263, + "src": "3242:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "id": 326, + "name": "tokenContract", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 184, + "src": "3188:13:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IERC20_$10032", + "typeString": "contract IERC20" + } + }, + "id": 328, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "transferFrom", + "nodeType": "MemberAccess", + "referencedDeclaration": 10015, + "src": "3188:26:0", + "typeDescriptions": { + "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$_t_bool_$", + "typeString": "function (address,address,uint256) external returns (bool)" + } + }, + "id": 335, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3188:60:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 336, + "nodeType": "ExpressionStatement", + "src": "3188:60:0" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 338, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 263, + "src": "3279:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 339, + "name": "getNonce", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 654, + 667 + ], + "referencedDeclaration": 654, + "src": "3286:8:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 340, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3286:10:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 337, + "name": "ExchangeRequest", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8, + "src": "3263:15:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$returns$__$", + "typeString": "function (uint256,uint256)" + } + }, + "id": 341, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3263:34:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 342, + "nodeType": "EmitStatement", + "src": "3258:39:0" + } + ] + }, + "documentation": null, + "id": 344, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 266, + "modifierName": { + "argumentTypes": null, + "id": 265, + "name": "ready", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 196, + "src": "2823:5:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "2823:5:0" + } + ], + "name": "exchange", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 264, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 263, + "name": "value", + "nodeType": "VariableDeclaration", + "scope": 344, + "src": "2804:10:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 262, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "2804:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "2803:12:0" + }, + "returnParameters": { + "id": 267, + "nodeType": "ParameterList", + "parameters": [], + "src": "2829:0:0" + }, + "scope": 1340, + "src": "2786:518:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 373, + "nodeType": "Block", + "src": "3404:119:0", + "statements": [ + { + "condition": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 358, + "name": "Vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 64, + "src": "3426:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", + "typeString": "type(enum Bridge.Vote)" + } + }, + "id": 359, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "TRANSFER", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3426:13:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + { + "argumentTypes": null, + "id": 360, + "name": "hash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 346, + "src": "3441:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "argumentTypes": null, + "id": 361, + "name": "to", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 348, + "src": "3447:2:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 362, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 350, + "src": "3451:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 357, + "name": "tryVote", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 1084, + 1109, + 1134, + 1164 + ], + "referencedDeclaration": 1164, + "src": "3418:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$_t_bytes32_$_t_address_$_t_uint256_$returns$_t_bool_$", + "typeString": "function (enum Bridge.Vote,bytes32,address,uint256) returns (bool)" + } + }, + "id": 363, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3418:39:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 372, + "nodeType": "IfStatement", + "src": "3414:103:0", + "trueBody": { + "id": 371, + "nodeType": "Block", + "src": "3459:58:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 367, + "name": "to", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 348, + "src": "3496:2:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 368, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 350, + "src": "3500:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "id": 364, + "name": "tokenContract", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 184, + "src": "3473:13:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IERC20_$10032", + "typeString": "contract IERC20" + } + }, + "id": 366, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "transfer", + "nodeType": "MemberAccess", + "referencedDeclaration": 9986, + "src": "3473:22:0", + "typeDescriptions": { + "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$_t_bool_$", + "typeString": "function (address,uint256) external returns (bool)" + } + }, + "id": 369, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3473:33:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 370, + "nodeType": "ExpressionStatement", + "src": "3473:33:0" + } + ] + } + } + ] + }, + "documentation": null, + "id": 374, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 353, + "modifierName": { + "argumentTypes": null, + "id": 352, + "name": "readyOrVoting", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 213, + "src": "3373:13:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "3373:13:0" + }, + { + "arguments": null, + "id": 355, + "modifierName": { + "argumentTypes": null, + "id": 354, + "name": "currentValidator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 261, + "src": "3387:16:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "3387:16:0" + } + ], + "name": "transfer", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 351, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 346, + "name": "hash", + "nodeType": "VariableDeclaration", + "scope": 374, + "src": "3328:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 345, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "3328:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 348, + "name": "to", + "nodeType": "VariableDeclaration", + "scope": 374, + "src": "3342:10:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 347, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3342:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 350, + "name": "value", + "nodeType": "VariableDeclaration", + "scope": 374, + "src": "3354:10:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 349, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "3354:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "3327:38:0" + }, + "returnParameters": { + "id": 356, + "nodeType": "ParameterList", + "parameters": [], + "src": "3404:0:0" + }, + "scope": 1340, + "src": "3310:213:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 464, + "nodeType": "Block", + "src": "3582:638:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 389, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 385, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13088, + "src": "3615:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 386, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3615:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + ], + "id": 384, + "name": "getNextPartyId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 768, + "src": "3600:14:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_uint256_$", + "typeString": "function (address) view returns (uint256)" + } + }, + "id": 387, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3600:26:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 388, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3630:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "3600:31:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4e6f742061206e6578742076616c696461746f72", + "id": 390, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3633:22:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_44981c92ce908443b2fa5f878c54791e1a0c95d4cc04ea4f4d9224b3ec030922", + "typeString": "literal_string \"Not a next validator\"" + }, + "value": "Not a next validator" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_44981c92ce908443b2fa5f878c54791e1a0c95d4cc04ea4f4d9224b3ec030922", + "typeString": "literal_string \"Not a next validator\"" + } + ], + "id": 383, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 13091, + 13092 + ], + "referencedDeclaration": 13092, + "src": "3592:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 391, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3592:64:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 392, + "nodeType": "ExpressionStatement", + "src": "3592:64:0" + }, + { + "condition": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 394, + "name": "Vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 64, + "src": "3682:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", + "typeString": "type(enum Bridge.Vote)" + } + }, + "id": 395, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "CONFIRM_KEYGEN", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3682:19:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + { + "argumentTypes": null, + "id": 396, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 376, + "src": "3703:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 397, + "name": "y", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 378, + "src": "3706:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 393, + "name": "tryConfirm", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 1186, + 1214 + ], + "referencedDeclaration": 1214, + "src": "3671:10:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$_t_uint256_$_t_uint256_$returns$_t_bool_$", + "typeString": "function (enum Bridge.Vote,uint256,uint256) returns (bool)" + } + }, + "id": 398, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3671:37:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 463, + "nodeType": "IfStatement", + "src": "3667:547:0", + "trueBody": { + "id": 462, + "nodeType": "Block", + "src": "3710:504:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 404, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 399, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "3724:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 401, + "indexExpression": { + "argumentTypes": null, + "id": 400, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "3731:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3724:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 402, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "x", + "nodeType": "MemberAccess", + "referencedDeclaration": 45, + "src": "3724:19:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 403, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 376, + "src": "3746:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "3724:23:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 405, + "nodeType": "ExpressionStatement", + "src": "3724:23:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 411, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 406, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "3761:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 408, + "indexExpression": { + "argumentTypes": null, + "id": 407, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "3768:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3761:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 409, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "y", + "nodeType": "MemberAccess", + "referencedDeclaration": 47, + "src": "3761:19:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 410, + "name": "y", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 378, + "src": "3783:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "3761:23:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 412, + "nodeType": "ExpressionStatement", + "src": "3761:23:0" + }, + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 415, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 413, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "3802:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 414, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3815:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "3802:14:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "id": 460, + "nodeType": "Block", + "src": "4084:120:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 453, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 450, + "name": "status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 90, + "src": "4102:6:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 451, + "name": "Status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "4111:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Status_$53_$", + "typeString": "type(enum Bridge.Status)" + } + }, + "id": 452, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "FUNDS_TRANSFER", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "4111:21:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "src": "4102:30:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "id": 454, + "nodeType": "ExpressionStatement", + "src": "4102:30:0" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 456, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "4172:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 457, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "4179:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 455, + "name": "NewFundsTransfer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 24, + "src": "4155:16:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$returns$__$", + "typeString": "function (uint256,uint256)" + } + }, + "id": 458, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4155:34:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 459, + "nodeType": "EmitStatement", + "src": "4150:39:0" + } + ] + }, + "id": 461, + "nodeType": "IfStatement", + "src": "3798:406:0", + "trueBody": { + "id": 449, + "nodeType": "Block", + "src": "3818:248:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 419, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 416, + "name": "status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 90, + "src": "3836:6:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 417, + "name": "Status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "3845:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Status_$53_$", + "typeString": "type(enum Bridge.Status)" + } + }, + "id": 418, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "READY", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3845:12:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "src": "3836:21:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "id": 420, + "nodeType": "ExpressionStatement", + "src": "3836:21:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 427, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 421, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "3875:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 423, + "indexExpression": { + "argumentTypes": null, + "id": 422, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "3882:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3875:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 424, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "startBlock", + "nodeType": "MemberAccess", + "referencedDeclaration": 41, + "src": "3875:28:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 425, + "name": "block", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13078, + "src": "3906:5:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_block", + "typeString": "block" + } + }, + "id": 426, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "number", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3906:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "3875:43:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 428, + "nodeType": "ExpressionStatement", + "src": "3875:43:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 437, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 429, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "3936:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 431, + "indexExpression": { + "argumentTypes": null, + "id": 430, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "3943:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3936:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 432, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "nonce", + "nodeType": "MemberAccess", + "referencedDeclaration": 43, + "src": "3936:23:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 435, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "-", + "prefix": true, + "src": "3967:2:0", + "subExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 434, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3968:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "typeDescriptions": { + "typeIdentifier": "t_rational_minus_1_by_1", + "typeString": "int_const -1" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_minus_1_by_1", + "typeString": "int_const -1" + } + ], + "id": 433, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "3962:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": "uint" + }, + "id": 436, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3962:8:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "3936:34:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 438, + "nodeType": "ExpressionStatement", + "src": "3936:34:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 441, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 439, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "3988:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 440, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "3996:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "3988:17:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 442, + "nodeType": "ExpressionStatement", + "src": "3988:17:0" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 444, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "4039:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 445, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 376, + "src": "4046:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 446, + "name": "y", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 378, + "src": "4049:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 443, + "name": "EpochStart", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 32, + "src": "4028:10:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$_t_uint256_$returns$__$", + "typeString": "function (uint256,uint256,uint256)" + } + }, + "id": 447, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4028:23:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 448, + "nodeType": "EmitStatement", + "src": "4023:28:0" + } + ] + } + } + ] + } + } + ] + }, + "documentation": null, + "id": 465, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 381, + "modifierName": { + "argumentTypes": null, + "id": 380, + "name": "keygen", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 237, + "src": "3575:6:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "3575:6:0" + } + ], + "name": "confirmKeygen", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 379, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 376, + "name": "x", + "nodeType": "VariableDeclaration", + "scope": 465, + "src": "3552:6:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 375, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "3552:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 378, + "name": "y", + "nodeType": "VariableDeclaration", + "scope": 465, + "src": "3560:6:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 377, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "3560:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "3551:16:0" + }, + "returnParameters": { + "id": 382, + "nodeType": "ParameterList", + "parameters": [], + "src": "3582:0:0" + }, + "scope": 1340, + "src": "3529:691:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 520, + "nodeType": "Block", + "src": "4296:368:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 475, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 473, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "4314:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 474, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4322:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "4314:9:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "46697273742065706f636820646f6573206e6f74206e6565642066756e6473207472616e73666572", + "id": 476, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4325:42:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_8ddae2cc9da30ed8c59c39c6a950ef823ea484ac89ff6f37abb0317fb5f679a1", + "typeString": "literal_string \"First epoch does not need funds transfer\"" + }, + "value": "First epoch does not need funds transfer" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_8ddae2cc9da30ed8c59c39c6a950ef823ea484ac89ff6f37abb0317fb5f679a1", + "typeString": "literal_string \"First epoch does not need funds transfer\"" + } + ], + "id": 472, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 13091, + 13092 + ], + "referencedDeclaration": 13092, + "src": "4306:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 477, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4306:62:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 478, + "nodeType": "ExpressionStatement", + "src": "4306:62:0" + }, + { + "condition": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 480, + "name": "Vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 64, + "src": "4394:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", + "typeString": "type(enum Bridge.Vote)" + } + }, + "id": 481, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "CONFIRM_FUNDS_TRANSFER", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "4394:27:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + ], + "id": 479, + "name": "tryConfirm", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 1186, + 1214 + ], + "referencedDeclaration": 1186, + "src": "4383:10:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$returns$_t_bool_$", + "typeString": "function (enum Bridge.Vote) returns (bool)" + } + }, + "id": 482, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4383:39:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 519, + "nodeType": "IfStatement", + "src": "4379:279:0", + "trueBody": { + "id": 518, + "nodeType": "Block", + "src": "4424:234:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 486, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 483, + "name": "status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 90, + "src": "4438:6:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 484, + "name": "Status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "4447:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Status_$53_$", + "typeString": "type(enum Bridge.Status)" + } + }, + "id": 485, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "READY", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "4447:12:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "src": "4438:21:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "id": 487, + "nodeType": "ExpressionStatement", + "src": "4438:21:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 494, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 488, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "4473:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 490, + "indexExpression": { + "argumentTypes": null, + "id": 489, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "4480:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "4473:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 491, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "startBlock", + "nodeType": "MemberAccess", + "referencedDeclaration": 41, + "src": "4473:28:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 492, + "name": "block", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13078, + "src": "4504:5:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_block", + "typeString": "block" + } + }, + "id": 493, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "number", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "4504:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "4473:43:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 495, + "nodeType": "ExpressionStatement", + "src": "4473:43:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 504, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 496, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "4530:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 498, + "indexExpression": { + "argumentTypes": null, + "id": 497, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "4537:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "4530:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 499, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "nonce", + "nodeType": "MemberAccess", + "referencedDeclaration": 43, + "src": "4530:23:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 502, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "-", + "prefix": true, + "src": "4561:2:0", + "subExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 501, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4562:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "typeDescriptions": { + "typeIdentifier": "t_rational_minus_1_by_1", + "typeString": "int_const -1" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_minus_1_by_1", + "typeString": "int_const -1" + } + ], + "id": 500, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "4556:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": "uint" + }, + "id": 503, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4556:8:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "4530:34:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 505, + "nodeType": "ExpressionStatement", + "src": "4530:34:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 508, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 506, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "4578:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 507, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "4586:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "4578:17:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 509, + "nodeType": "ExpressionStatement", + "src": "4578:17:0" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 511, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "4625:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 512, + "name": "getX", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 678, + "src": "4632:4:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 513, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4632:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 514, + "name": "getY", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 689, + "src": "4640:4:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 515, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4640:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 510, + "name": "EpochStart", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 32, + "src": "4614:10:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$_t_uint256_$returns$__$", + "typeString": "function (uint256,uint256,uint256)" + } + }, + "id": 516, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4614:33:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 517, + "nodeType": "EmitStatement", + "src": "4609:38:0" + } + ] + } + } + ] + }, + "documentation": null, + "id": 521, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 468, + "modifierName": { + "argumentTypes": null, + "id": 467, + "name": "fundsTransfer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 249, + "src": "4265:13:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "4265:13:0" + }, + { + "arguments": null, + "id": 470, + "modifierName": { + "argumentTypes": null, + "id": 469, + "name": "currentValidator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 261, + "src": "4279:16:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "4279:16:0" + } + ], + "name": "confirmFundsTransfer", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 466, + "nodeType": "ParameterList", + "parameters": [], + "src": "4255:2:0" + }, + "returnParameters": { + "id": 471, + "nodeType": "ParameterList", + "parameters": [], + "src": "4296:0:0" + }, + "scope": 1340, + "src": "4226:438:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 530, + "nodeType": "Block", + "src": "4719:41:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 527, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "4747:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 526, + "name": "getParties", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 531, + 555 + ], + "referencedDeclaration": 555, + "src": "4736:10:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256) view returns (uint256)" + } + }, + "id": 528, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4736:17:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 525, + "id": 529, + "nodeType": "Return", + "src": "4729:24:0" + } + ] + }, + "documentation": null, + "id": 531, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getParties", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 522, + "nodeType": "ParameterList", + "parameters": [], + "src": "4689:2:0" + }, + "returnParameters": { + "id": 525, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 524, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 531, + "src": "4713:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 523, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "4713:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "4712:6:0" + }, + "scope": 1340, + "src": "4670:90:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 540, + "nodeType": "Block", + "src": "4819:45:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 537, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "4847:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 536, + "name": "getParties", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 531, + 555 + ], + "referencedDeclaration": 555, + "src": "4836:10:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256) view returns (uint256)" + } + }, + "id": 538, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4836:21:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 535, + "id": 539, + "nodeType": "Return", + "src": "4829:28:0" + } + ] + }, + "documentation": null, + "id": 541, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getNextParties", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 532, + "nodeType": "ParameterList", + "parameters": [], + "src": "4789:2:0" + }, + "returnParameters": { + "id": 535, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 534, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 541, + "src": "4813:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 533, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "4813:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "4812:6:0" + }, + "scope": 1340, + "src": "4766:98:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 554, + "nodeType": "Block", + "src": "4930:56:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 548, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "4947:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 550, + "indexExpression": { + "argumentTypes": null, + "id": 549, + "name": "_epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 543, + "src": "4954:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "4947:14:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 551, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "validators", + "nodeType": "MemberAccess", + "referencedDeclaration": 35, + "src": "4947:25:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 552, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "4947:32:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 547, + "id": 553, + "nodeType": "Return", + "src": "4940:39:0" + } + ] + }, + "documentation": null, + "id": 555, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getParties", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 544, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 543, + "name": "_epoch", + "nodeType": "VariableDeclaration", + "scope": 555, + "src": "4890:11:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 542, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "4890:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "4889:13:0" + }, + "returnParameters": { + "id": 547, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 546, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 555, + "src": "4924:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 545, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "4924:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "4923:6:0" + }, + "scope": 1340, + "src": "4870:116:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 564, + "nodeType": "Block", + "src": "5043:43:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 561, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "5073:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 560, + "name": "getThreshold", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 565, + 588 + ], + "referencedDeclaration": 588, + "src": "5060:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256) view returns (uint256)" + } + }, + "id": 562, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5060:19:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 559, + "id": 563, + "nodeType": "Return", + "src": "5053:26:0" + } + ] + }, + "documentation": null, + "id": 565, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getThreshold", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 556, + "nodeType": "ParameterList", + "parameters": [], + "src": "5013:2:0" + }, + "returnParameters": { + "id": 559, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 558, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 565, + "src": "5037:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 557, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5037:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5036:6:0" + }, + "scope": 1340, + "src": "4992:94:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 574, + "nodeType": "Block", + "src": "5147:47:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 571, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "5177:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 570, + "name": "getThreshold", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 565, + 588 + ], + "referencedDeclaration": 588, + "src": "5164:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256) view returns (uint256)" + } + }, + "id": 572, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5164:23:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 569, + "id": 573, + "nodeType": "Return", + "src": "5157:30:0" + } + ] + }, + "documentation": null, + "id": 575, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getNextThreshold", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 566, + "nodeType": "ParameterList", + "parameters": [], + "src": "5117:2:0" + }, + "returnParameters": { + "id": 569, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 568, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 575, + "src": "5141:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 567, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5141:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5140:6:0" + }, + "scope": 1340, + "src": "5092:102:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 587, + "nodeType": "Block", + "src": "5262:48:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 582, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "5279:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 584, + "indexExpression": { + "argumentTypes": null, + "id": 583, + "name": "_epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 577, + "src": "5286:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "5279:14:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 585, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "threshold", + "nodeType": "MemberAccess", + "referencedDeclaration": 37, + "src": "5279:24:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 581, + "id": 586, + "nodeType": "Return", + "src": "5272:31:0" + } + ] + }, + "documentation": null, + "id": 588, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getThreshold", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 578, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 577, + "name": "_epoch", + "nodeType": "VariableDeclaration", + "scope": 588, + "src": "5222:11:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 576, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5222:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5221:13:0" + }, + "returnParameters": { + "id": 581, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 580, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 588, + "src": "5256:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 579, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5256:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5255:6:0" + }, + "scope": 1340, + "src": "5200:110:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 597, + "nodeType": "Block", + "src": "5368:44:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 594, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "5399:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 593, + "name": "getStartBlock", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 598, + 611 + ], + "referencedDeclaration": 611, + "src": "5385:13:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256) view returns (uint256)" + } + }, + "id": 595, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5385:20:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 592, + "id": 596, + "nodeType": "Return", + "src": "5378:27:0" + } + ] + }, + "documentation": null, + "id": 598, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getStartBlock", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 589, + "nodeType": "ParameterList", + "parameters": [], + "src": "5338:2:0" + }, + "returnParameters": { + "id": 592, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 591, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 598, + "src": "5362:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 590, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5362:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5361:6:0" + }, + "scope": 1340, + "src": "5316:96:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 610, + "nodeType": "Block", + "src": "5481:49:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 605, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "5498:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 607, + "indexExpression": { + "argumentTypes": null, + "id": 606, + "name": "_epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 600, + "src": "5505:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "5498:14:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 608, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "startBlock", + "nodeType": "MemberAccess", + "referencedDeclaration": 41, + "src": "5498:25:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 604, + "id": 609, + "nodeType": "Return", + "src": "5491:32:0" + } + ] + }, + "documentation": null, + "id": 611, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getStartBlock", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 601, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 600, + "name": "_epoch", + "nodeType": "VariableDeclaration", + "scope": 611, + "src": "5441:11:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 599, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5441:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5440:13:0" + }, + "returnParameters": { + "id": 604, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 603, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 611, + "src": "5475:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 602, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5475:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5474:6:0" + }, + "scope": 1340, + "src": "5418:112:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 620, + "nodeType": "Block", + "src": "5587:43:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 617, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "5617:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 616, + "name": "getRangeSize", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 621, + 644 + ], + "referencedDeclaration": 644, + "src": "5604:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256) view returns (uint256)" + } + }, + "id": 618, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5604:19:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 615, + "id": 619, + "nodeType": "Return", + "src": "5597:26:0" + } + ] + }, + "documentation": null, + "id": 621, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getRangeSize", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 612, + "nodeType": "ParameterList", + "parameters": [], + "src": "5557:2:0" + }, + "returnParameters": { + "id": 615, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 614, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 621, + "src": "5581:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 613, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5581:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5580:6:0" + }, + "scope": 1340, + "src": "5536:94:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 630, + "nodeType": "Block", + "src": "5691:47:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 627, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "5721:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 626, + "name": "getRangeSize", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 621, + 644 + ], + "referencedDeclaration": 644, + "src": "5708:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256) view returns (uint256)" + } + }, + "id": 628, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5708:23:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 625, + "id": 629, + "nodeType": "Return", + "src": "5701:30:0" + } + ] + }, + "documentation": null, + "id": 631, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getNextRangeSize", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 622, + "nodeType": "ParameterList", + "parameters": [], + "src": "5661:2:0" + }, + "returnParameters": { + "id": 625, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 624, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 631, + "src": "5685:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 623, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5685:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5684:6:0" + }, + "scope": 1340, + "src": "5636:102:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 643, + "nodeType": "Block", + "src": "5806:48:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 638, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "5823:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 640, + "indexExpression": { + "argumentTypes": null, + "id": 639, + "name": "_epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 633, + "src": "5830:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "5823:14:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 641, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "rangeSize", + "nodeType": "MemberAccess", + "referencedDeclaration": 39, + "src": "5823:24:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 637, + "id": 642, + "nodeType": "Return", + "src": "5816:31:0" + } + ] + }, + "documentation": null, + "id": 644, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getRangeSize", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 634, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 633, + "name": "_epoch", + "nodeType": "VariableDeclaration", + "scope": 644, + "src": "5766:11:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 632, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5766:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5765:13:0" + }, + "returnParameters": { + "id": 637, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 636, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 644, + "src": "5800:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 635, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5800:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5799:6:0" + }, + "scope": 1340, + "src": "5744:110:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 653, + "nodeType": "Block", + "src": "5907:39:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 650, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "5933:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 649, + "name": "getNonce", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 654, + 667 + ], + "referencedDeclaration": 667, + "src": "5924:8:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256) view returns (uint256)" + } + }, + "id": 651, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5924:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 648, + "id": 652, + "nodeType": "Return", + "src": "5917:22:0" + } + ] + }, + "documentation": null, + "id": 654, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getNonce", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 645, + "nodeType": "ParameterList", + "parameters": [], + "src": "5877:2:0" + }, + "returnParameters": { + "id": 648, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 647, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 654, + "src": "5901:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 646, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5901:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5900:6:0" + }, + "scope": 1340, + "src": "5860:86:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 666, + "nodeType": "Block", + "src": "6010:44:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 661, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "6027:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 663, + "indexExpression": { + "argumentTypes": null, + "id": 662, + "name": "_epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 656, + "src": "6034:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "6027:14:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 664, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "nonce", + "nodeType": "MemberAccess", + "referencedDeclaration": 43, + "src": "6027:20:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 660, + "id": 665, + "nodeType": "Return", + "src": "6020:27:0" + } + ] + }, + "documentation": null, + "id": 667, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getNonce", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 657, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 656, + "name": "_epoch", + "nodeType": "VariableDeclaration", + "scope": 667, + "src": "5970:11:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 655, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5970:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5969:13:0" + }, + "returnParameters": { + "id": 660, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 659, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 667, + "src": "6004:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 658, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "6004:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "6003:6:0" + }, + "scope": 1340, + "src": "5952:102:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 677, + "nodeType": "Block", + "src": "6103:39:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 672, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "6120:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 674, + "indexExpression": { + "argumentTypes": null, + "id": 673, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "6127:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "6120:13:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 675, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "x", + "nodeType": "MemberAccess", + "referencedDeclaration": 45, + "src": "6120:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 671, + "id": 676, + "nodeType": "Return", + "src": "6113:22:0" + } + ] + }, + "documentation": null, + "id": 678, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getX", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 668, + "nodeType": "ParameterList", + "parameters": [], + "src": "6073:2:0" + }, + "returnParameters": { + "id": 671, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 670, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 678, + "src": "6097:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 669, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "6097:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "6096:6:0" + }, + "scope": 1340, + "src": "6060:82:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 688, + "nodeType": "Block", + "src": "6191:39:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 683, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "6208:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 685, + "indexExpression": { + "argumentTypes": null, + "id": 684, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "6215:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "6208:13:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 686, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "y", + "nodeType": "MemberAccess", + "referencedDeclaration": 47, + "src": "6208:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 682, + "id": 687, + "nodeType": "Return", + "src": "6201:22:0" + } + ] + }, + "documentation": null, + "id": 689, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getY", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 679, + "nodeType": "ParameterList", + "parameters": [], + "src": "6161:2:0" + }, + "returnParameters": { + "id": 682, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 681, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 689, + "src": "6185:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 680, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "6185:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "6184:6:0" + }, + "scope": 1340, + "src": "6148:82:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 727, + "nodeType": "Block", + "src": "6285:215:0", + "statements": [ + { + "assignments": [ + 697 + ], + "declarations": [ + { + "constant": false, + "id": 697, + "name": "validators", + "nodeType": "VariableDeclaration", + "scope": 727, + "src": "6295:27:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[]" + }, + "typeName": { + "baseType": { + "id": 695, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6295:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 696, + "length": null, + "nodeType": "ArrayTypeName", + "src": "6295:9:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 700, + "initialValue": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 698, + "name": "getValidators", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 780, + "src": "6325:13:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_array$_t_address_$dyn_memory_ptr_$", + "typeString": "function () view returns (address[] memory)" + } + }, + "id": 699, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6325:15:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "6295:45:0" + }, + { + "body": { + "id": 723, + "nodeType": "Block", + "src": "6390:86:0", + "statements": [ + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 717, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 712, + "name": "validators", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 697, + "src": "6408:10:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "id": 714, + "indexExpression": { + "argumentTypes": null, + "id": 713, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 702, + "src": "6419:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "6408:13:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 715, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13088, + "src": "6425:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 716, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "6425:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "src": "6408:27:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 722, + "nodeType": "IfStatement", + "src": "6404:61:0", + "trueBody": { + "expression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 720, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 718, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 702, + "src": "6460:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 719, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6464:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "6460:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 693, + "id": 721, + "nodeType": "Return", + "src": "6453:12:0" + } + } + ] + }, + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 708, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 705, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 702, + "src": "6367:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 706, + "name": "getParties", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 531, + 555 + ], + "referencedDeclaration": 531, + "src": "6371:10:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 707, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6371:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "6367:16:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 724, + "initializationExpression": { + "assignments": [ + 702 + ], + "declarations": [ + { + "constant": false, + "id": 702, + "name": "i", + "nodeType": "VariableDeclaration", + "scope": 724, + "src": "6355:6:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 701, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "6355:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 704, + "initialValue": { + "argumentTypes": null, + "hexValue": "30", + "id": 703, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6364:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "nodeType": "VariableDeclarationStatement", + "src": "6355:10:0" + }, + "loopExpression": { + "expression": { + "argumentTypes": null, + "id": 710, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "6385:3:0", + "subExpression": { + "argumentTypes": null, + "id": 709, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 702, + "src": "6385:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 711, + "nodeType": "ExpressionStatement", + "src": "6385:3:0" + }, + "nodeType": "ForStatement", + "src": "6350:126:0" + }, + { + "expression": { + "argumentTypes": null, + "hexValue": "30", + "id": 725, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6492:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "functionReturnParameters": 693, + "id": 726, + "nodeType": "Return", + "src": "6485:8:0" + } + ] + }, + "documentation": null, + "id": 728, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getPartyId", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 690, + "nodeType": "ParameterList", + "parameters": [], + "src": "6255:2:0" + }, + "returnParameters": { + "id": 693, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 692, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 728, + "src": "6279:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 691, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "6279:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "6278:6:0" + }, + "scope": 1340, + "src": "6236:264:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 767, + "nodeType": "Block", + "src": "6568:214:0", + "statements": [ + { + "assignments": [ + 738 + ], + "declarations": [ + { + "constant": false, + "id": 738, + "name": "validators", + "nodeType": "VariableDeclaration", + "scope": 767, + "src": "6578:27:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[]" + }, + "typeName": { + "baseType": { + "id": 736, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6578:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 737, + "length": null, + "nodeType": "ArrayTypeName", + "src": "6578:9:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 741, + "initialValue": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 739, + "name": "getNextValidators", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 792, + "src": "6608:17:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_array$_t_address_$dyn_memory_ptr_$", + "typeString": "function () view returns (address[] memory)" + } + }, + "id": 740, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6608:19:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "6578:49:0" + }, + { + "body": { + "id": 763, + "nodeType": "Block", + "src": "6681:77:0", + "statements": [ + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 757, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 753, + "name": "validators", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 738, + "src": "6699:10:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "id": 755, + "indexExpression": { + "argumentTypes": null, + "id": 754, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 743, + "src": "6710:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "6699:13:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 756, + "name": "a", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 730, + "src": "6716:1:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "6699:18:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 762, + "nodeType": "IfStatement", + "src": "6695:52:0", + "trueBody": { + "expression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 760, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 758, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 743, + "src": "6742:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 759, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6746:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "6742:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 734, + "id": 761, + "nodeType": "Return", + "src": "6735:12:0" + } + } + ] + }, + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 749, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 746, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 743, + "src": "6654:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 747, + "name": "getNextParties", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 541, + "src": "6658:14:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 748, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6658:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "6654:20:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 764, + "initializationExpression": { + "assignments": [ + 743 + ], + "declarations": [ + { + "constant": false, + "id": 743, + "name": "i", + "nodeType": "VariableDeclaration", + "scope": 764, + "src": "6642:6:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 742, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "6642:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 745, + "initialValue": { + "argumentTypes": null, + "hexValue": "30", + "id": 744, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6651:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "nodeType": "VariableDeclarationStatement", + "src": "6642:10:0" + }, + "loopExpression": { + "expression": { + "argumentTypes": null, + "id": 751, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "6676:3:0", + "subExpression": { + "argumentTypes": null, + "id": 750, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 743, + "src": "6676:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 752, + "nodeType": "ExpressionStatement", + "src": "6676:3:0" + }, + "nodeType": "ForStatement", + "src": "6637:121:0" + }, + { + "expression": { + "argumentTypes": null, + "hexValue": "30", + "id": 765, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6774:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "functionReturnParameters": 734, + "id": 766, + "nodeType": "Return", + "src": "6767:8:0" + } + ] + }, + "documentation": null, + "id": 768, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getNextPartyId", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 731, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 730, + "name": "a", + "nodeType": "VariableDeclaration", + "scope": 768, + "src": "6530:9:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 729, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6530:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "6529:11:0" + }, + "returnParameters": { + "id": 734, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 733, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 768, + "src": "6562:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 732, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "6562:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "6561:6:0" + }, + "scope": 1340, + "src": "6506:276:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 779, + "nodeType": "Block", + "src": "6852:48:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 774, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "6869:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 776, + "indexExpression": { + "argumentTypes": null, + "id": 775, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "6876:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "6869:13:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 777, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "validators", + "nodeType": "MemberAccess", + "referencedDeclaration": 35, + "src": "6869:24:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "functionReturnParameters": 773, + "id": 778, + "nodeType": "Return", + "src": "6862:31:0" + } + ] + }, + "documentation": null, + "id": 780, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getValidators", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 769, + "nodeType": "ParameterList", + "parameters": [], + "src": "6810:2:0" + }, + "returnParameters": { + "id": 773, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 772, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 780, + "src": "6834:16:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[]" + }, + "typeName": { + "baseType": { + "id": 770, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6834:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 771, + "length": null, + "nodeType": "ArrayTypeName", + "src": "6834:9:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "6833:18:0" + }, + "scope": 1340, + "src": "6788:112:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 791, + "nodeType": "Block", + "src": "6974:52:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 786, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "6991:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 788, + "indexExpression": { + "argumentTypes": null, + "id": 787, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "6998:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "6991:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 789, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "validators", + "nodeType": "MemberAccess", + "referencedDeclaration": 35, + "src": "6991:28:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "functionReturnParameters": 785, + "id": 790, + "nodeType": "Return", + "src": "6984:35:0" + } + ] + }, + "documentation": null, + "id": 792, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getNextValidators", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 781, + "nodeType": "ParameterList", + "parameters": [], + "src": "6932:2:0" + }, + "returnParameters": { + "id": 785, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 784, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 792, + "src": "6956:16:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[]" + }, + "typeName": { + "baseType": { + "id": 782, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6956:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 783, + "length": null, + "nodeType": "ArrayTypeName", + "src": "6956:9:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "6955:18:0" + }, + "scope": 1340, + "src": "6906:120:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 837, + "nodeType": "Block", + "src": "7093:296:0", + "statements": [ + { + "condition": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 800, + "name": "Vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 64, + "src": "7115:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", + "typeString": "type(enum Bridge.Vote)" + } + }, + "id": 801, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "START_VOTING", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "7115:17:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + ], + "id": 799, + "name": "tryVote", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 1084, + 1109, + 1134, + 1164 + ], + "referencedDeclaration": 1084, + "src": "7107:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$returns$_t_bool_$", + "typeString": "function (enum Bridge.Vote) returns (bool)" + } + }, + "id": 802, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7107:26:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 836, + "nodeType": "IfStatement", + "src": "7103:280:0", + "trueBody": { + "id": 835, + "nodeType": "Block", + "src": "7135:248:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 804, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "7149:11:0", + "subExpression": { + "argumentTypes": null, + "id": 803, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "7149:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 805, + "nodeType": "ExpressionStatement", + "src": "7149:11:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 809, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 806, + "name": "status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 90, + "src": "7174:6:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 807, + "name": "Status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "7183:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Status_$53_$", + "typeString": "type(enum Bridge.Status)" + } + }, + "id": 808, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "VOTING", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "7183:13:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "src": "7174:22:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "id": 810, + "nodeType": "ExpressionStatement", + "src": "7174:22:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 817, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 811, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "7210:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 813, + "indexExpression": { + "argumentTypes": null, + "id": 812, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "7217:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "7210:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 814, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "threshold", + "nodeType": "MemberAccess", + "referencedDeclaration": 37, + "src": "7210:27:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 815, + "name": "getThreshold", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 565, + 588 + ], + "referencedDeclaration": 565, + "src": "7240:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 816, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7240:14:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "7210:44:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 818, + "nodeType": "ExpressionStatement", + "src": "7210:44:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 825, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 819, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "7268:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 821, + "indexExpression": { + "argumentTypes": null, + "id": 820, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "7275:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "7268:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 822, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "validators", + "nodeType": "MemberAccess", + "referencedDeclaration": 35, + "src": "7268:28:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 823, + "name": "getValidators", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 780, + "src": "7299:13:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_array$_t_address_$dyn_memory_ptr_$", + "typeString": "function () view returns (address[] memory)" + } + }, + "id": 824, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7299:15:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "src": "7268:46:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 826, + "nodeType": "ExpressionStatement", + "src": "7268:46:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 833, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 827, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "7328:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 829, + "indexExpression": { + "argumentTypes": null, + "id": 828, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "7335:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "7328:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 830, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "rangeSize", + "nodeType": "MemberAccess", + "referencedDeclaration": 39, + "src": "7328:27:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 831, + "name": "getRangeSize", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 621, + 644 + ], + "referencedDeclaration": 621, + "src": "7358:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 832, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7358:14:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "7328:44:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 834, + "nodeType": "ExpressionStatement", + "src": "7328:44:0" + } + ] + } + } + ] + }, + "documentation": null, + "id": 838, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 795, + "modifierName": { + "argumentTypes": null, + "id": 794, + "name": "readyOrVoting", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 213, + "src": "7062:13:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "7062:13:0" + }, + { + "arguments": null, + "id": 797, + "modifierName": { + "argumentTypes": null, + "id": 796, + "name": "currentValidator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 261, + "src": "7076:16:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "7076:16:0" + } + ], + "name": "startVoting", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 793, + "nodeType": "ParameterList", + "parameters": [], + "src": "7052:2:0" + }, + "returnParameters": { + "id": 798, + "nodeType": "ParameterList", + "parameters": [], + "src": "7093:0:0" + }, + "scope": 1340, + "src": "7032:357:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 871, + "nodeType": "Block", + "src": "7471:202:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 852, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 849, + "name": "validator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 840, + "src": "7504:9:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 848, + "name": "getNextPartyId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 768, + "src": "7489:14:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_uint256_$", + "typeString": "function (address) view returns (uint256)" + } + }, + "id": 850, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7489:25:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 851, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7518:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "7489:30:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "416c726561647920612076616c696461746f72", + "id": 853, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7521:21:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_aeb0fe100da2796aa6136a3b1c66282f002b435141be331237dfa7127e6df6ff", + "typeString": "literal_string \"Already a validator\"" + }, + "value": "Already a validator" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_aeb0fe100da2796aa6136a3b1c66282f002b435141be331237dfa7127e6df6ff", + "typeString": "literal_string \"Already a validator\"" + } + ], + "id": 847, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 13091, + 13092 + ], + "referencedDeclaration": 13092, + "src": "7481:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 854, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7481:62:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 855, + "nodeType": "ExpressionStatement", + "src": "7481:62:0" + }, + { + "condition": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 857, + "name": "Vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 64, + "src": "7566:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", + "typeString": "type(enum Bridge.Vote)" + } + }, + "id": 858, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "ADD_VALIDATOR", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "7566:18:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + { + "argumentTypes": null, + "id": 859, + "name": "validator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 840, + "src": "7586:9:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 856, + "name": "tryVote", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 1084, + 1109, + 1134, + 1164 + ], + "referencedDeclaration": 1109, + "src": "7558:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$_t_address_$returns$_t_bool_$", + "typeString": "function (enum Bridge.Vote,address) returns (bool)" + } + }, + "id": 860, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7558:38:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 870, + "nodeType": "IfStatement", + "src": "7554:113:0", + "trueBody": { + "id": 869, + "nodeType": "Block", + "src": "7598:69:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 866, + "name": "validator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 840, + "src": "7646:9:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 861, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "7612:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 863, + "indexExpression": { + "argumentTypes": null, + "id": 862, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "7619:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "7612:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 864, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "validators", + "nodeType": "MemberAccess", + "referencedDeclaration": 35, + "src": "7612:28:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 865, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "push", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "7612:33:0", + "typeDescriptions": { + "typeIdentifier": "t_function_arraypush_nonpayable$_t_address_$returns$_t_uint256_$", + "typeString": "function (address) returns (uint256)" + } + }, + "id": 867, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7612:44:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 868, + "nodeType": "ExpressionStatement", + "src": "7612:44:0" + } + ] + } + } + ] + }, + "documentation": null, + "id": 872, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 843, + "modifierName": { + "argumentTypes": null, + "id": 842, + "name": "voting", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 225, + "src": "7447:6:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "7447:6:0" + }, + { + "arguments": null, + "id": 845, + "modifierName": { + "argumentTypes": null, + "id": 844, + "name": "currentValidator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 261, + "src": "7454:16:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "7454:16:0" + } + ], + "name": "voteAddValidator", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 841, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 840, + "name": "validator", + "nodeType": "VariableDeclaration", + "scope": 872, + "src": "7421:17:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 839, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7421:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "7420:19:0" + }, + "returnParameters": { + "id": 846, + "nodeType": "ParameterList", + "parameters": [], + "src": "7471:0:0" + }, + "scope": 1340, + "src": "7395:278:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 901, + "nodeType": "Block", + "src": "7758:192:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 886, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 883, + "name": "validator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 874, + "src": "7791:9:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 882, + "name": "getNextPartyId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 768, + "src": "7776:14:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_uint256_$", + "typeString": "function (address) view returns (uint256)" + } + }, + "id": 884, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7776:25:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 885, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7805:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "7776:30:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "416c7265616479206e6f7420612076616c696461746f72", + "id": 887, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7808:25:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_2332ed568e8af3d64f1f2b0b098c504cab97ba4128fb9f08cfa3f851ced05961", + "typeString": "literal_string \"Already not a validator\"" + }, + "value": "Already not a validator" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_2332ed568e8af3d64f1f2b0b098c504cab97ba4128fb9f08cfa3f851ced05961", + "typeString": "literal_string \"Already not a validator\"" + } + ], + "id": 881, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 13091, + 13092 + ], + "referencedDeclaration": 13092, + "src": "7768:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 888, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7768:66:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 889, + "nodeType": "ExpressionStatement", + "src": "7768:66:0" + }, + { + "condition": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 891, + "name": "Vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 64, + "src": "7857:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", + "typeString": "type(enum Bridge.Vote)" + } + }, + "id": 892, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "REMOVE_VALIDATOR", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "7857:21:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + { + "argumentTypes": null, + "id": 893, + "name": "validator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 874, + "src": "7880:9:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 890, + "name": "tryVote", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 1084, + 1109, + 1134, + 1164 + ], + "referencedDeclaration": 1109, + "src": "7849:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$_t_address_$returns$_t_bool_$", + "typeString": "function (enum Bridge.Vote,address) returns (bool)" + } + }, + "id": 894, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7849:41:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 900, + "nodeType": "IfStatement", + "src": "7845:99:0", + "trueBody": { + "id": 899, + "nodeType": "Block", + "src": "7892:52:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 896, + "name": "validator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 874, + "src": "7923:9:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 895, + "name": "_removeValidator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 967, + "src": "7906:16:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$", + "typeString": "function (address)" + } + }, + "id": 897, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7906:27:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 898, + "nodeType": "ExpressionStatement", + "src": "7906:27:0" + } + ] + } + } + ] + }, + "documentation": null, + "id": 902, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 877, + "modifierName": { + "argumentTypes": null, + "id": 876, + "name": "voting", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 225, + "src": "7734:6:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "7734:6:0" + }, + { + "arguments": null, + "id": 879, + "modifierName": { + "argumentTypes": null, + "id": 878, + "name": "currentValidator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 261, + "src": "7741:16:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "7741:16:0" + } + ], + "name": "voteRemoveValidator", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 875, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 874, + "name": "validator", + "nodeType": "VariableDeclaration", + "scope": 902, + "src": "7708:17:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 873, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7708:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "7707:19:0" + }, + "returnParameters": { + "id": 880, + "nodeType": "ParameterList", + "parameters": [], + "src": "7758:0:0" + }, + "scope": 1340, + "src": "7679:271:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 966, + "nodeType": "Block", + "src": "8009:383:0", + "statements": [ + { + "body": { + "id": 946, + "nodeType": "Block", + "src": "8067:205:0", + "statements": [ + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 927, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 920, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "8085:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 922, + "indexExpression": { + "argumentTypes": null, + "id": 921, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "8092:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "8085:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 923, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "validators", + "nodeType": "MemberAccess", + "referencedDeclaration": 35, + "src": "8085:28:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 925, + "indexExpression": { + "argumentTypes": null, + "id": 924, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 908, + "src": "8114:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "8085:31:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 926, + "name": "validator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 904, + "src": "8120:9:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "8085:44:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 945, + "nodeType": "IfStatement", + "src": "8081:181:0", + "trueBody": { + "id": 944, + "nodeType": "Block", + "src": "8131:131:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 941, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 928, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "8149:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 930, + "indexExpression": { + "argumentTypes": null, + "id": 929, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "8156:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "8149:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 931, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "validators", + "nodeType": "MemberAccess", + "referencedDeclaration": 35, + "src": "8149:28:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 933, + "indexExpression": { + "argumentTypes": null, + "id": 932, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 908, + "src": "8178:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "8149:31:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 934, + "name": "getNextValidators", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 792, + "src": "8183:17:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_array$_t_address_$dyn_memory_ptr_$", + "typeString": "function () view returns (address[] memory)" + } + }, + "id": 935, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8183:19:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "id": 940, + "indexExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 939, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 936, + "name": "getNextParties", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 541, + "src": "8203:14:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 937, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8203:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 938, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8222:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "8203:20:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "8183:41:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "8149:75:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 942, + "nodeType": "ExpressionStatement", + "src": "8149:75:0" + }, + { + "id": 943, + "nodeType": "Break", + "src": "8242:5:0" + } + ] + } + } + ] + }, + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 916, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 911, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 908, + "src": "8036:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 915, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 912, + "name": "getNextParties", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 541, + "src": "8040:14:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 913, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8040:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 914, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8059:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "8040:20:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "8036:24:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 947, + "initializationExpression": { + "assignments": [ + 908 + ], + "declarations": [ + { + "constant": false, + "id": 908, + "name": "i", + "nodeType": "VariableDeclaration", + "scope": 947, + "src": "8024:6:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 907, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "8024:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 910, + "initialValue": { + "argumentTypes": null, + "hexValue": "30", + "id": 909, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8033:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "nodeType": "VariableDeclarationStatement", + "src": "8024:10:0" + }, + "loopExpression": { + "expression": { + "argumentTypes": null, + "id": 918, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "8062:3:0", + "subExpression": { + "argumentTypes": null, + "id": 917, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 908, + "src": "8062:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 919, + "nodeType": "ExpressionStatement", + "src": "8062:3:0" + }, + "nodeType": "ForStatement", + "src": "8019:253:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 957, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "delete", + "prefix": true, + "src": "8281:57:0", + "subExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 948, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "8288:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 950, + "indexExpression": { + "argumentTypes": null, + "id": 949, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "8295:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "8288:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 951, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "validators", + "nodeType": "MemberAccess", + "referencedDeclaration": 35, + "src": "8288:28:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 956, + "indexExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 955, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 952, + "name": "getNextParties", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 541, + "src": "8317:14:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 953, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8317:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 954, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8336:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "8317:20:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "8288:50:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 958, + "nodeType": "ExpressionStatement", + "src": "8281:57:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 964, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "--", + "prefix": false, + "src": "8348:37:0", + "subExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 959, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "8348:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 961, + "indexExpression": { + "argumentTypes": null, + "id": 960, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "8355:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "8348:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 962, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "validators", + "nodeType": "MemberAccess", + "referencedDeclaration": 35, + "src": "8348:28:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 963, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "8348:35:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 965, + "nodeType": "ExpressionStatement", + "src": "8348:37:0" + } + ] + }, + "documentation": null, + "id": 967, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_removeValidator", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 905, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 904, + "name": "validator", + "nodeType": "VariableDeclaration", + "scope": 967, + "src": "7982:17:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 903, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7982:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "7981:19:0" + }, + "returnParameters": { + "id": 906, + "nodeType": "ParameterList", + "parameters": [], + "src": "8009:0:0" + }, + "scope": 1340, + "src": "7956:436:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "private" + }, + { + "body": { + "id": 990, + "nodeType": "Block", + "src": "8474:127:0", + "statements": [ + { + "condition": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 977, + "name": "Vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 64, + "src": "8496:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", + "typeString": "type(enum Bridge.Vote)" + } + }, + "id": 978, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "CHANGE_THRESHOLD", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "8496:21:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + { + "argumentTypes": null, + "id": 979, + "name": "threshold", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 969, + "src": "8519:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 976, + "name": "tryVote", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 1084, + 1109, + 1134, + 1164 + ], + "referencedDeclaration": 1134, + "src": "8488:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$_t_uint256_$returns$_t_bool_$", + "typeString": "function (enum Bridge.Vote,uint256) returns (bool)" + } + }, + "id": 980, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8488:41:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 989, + "nodeType": "IfStatement", + "src": "8484:111:0", + "trueBody": { + "id": 988, + "nodeType": "Block", + "src": "8531:64:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 986, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 981, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "8545:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 983, + "indexExpression": { + "argumentTypes": null, + "id": 982, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "8552:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "8545:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 984, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "threshold", + "nodeType": "MemberAccess", + "referencedDeclaration": 37, + "src": "8545:27:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 985, + "name": "threshold", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 969, + "src": "8575:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "8545:39:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 987, + "nodeType": "ExpressionStatement", + "src": "8545:39:0" + } + ] + } + } + ] + }, + "documentation": null, + "id": 991, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 972, + "modifierName": { + "argumentTypes": null, + "id": 971, + "name": "voting", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 225, + "src": "8450:6:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "8450:6:0" + }, + { + "arguments": null, + "id": 974, + "modifierName": { + "argumentTypes": null, + "id": 973, + "name": "currentValidator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 261, + "src": "8457:16:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "8457:16:0" + } + ], + "name": "voteChangeThreshold", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 970, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 969, + "name": "threshold", + "nodeType": "VariableDeclaration", + "scope": 991, + "src": "8427:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 968, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "8427:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "8426:16:0" + }, + "returnParameters": { + "id": 975, + "nodeType": "ParameterList", + "parameters": [], + "src": "8474:0:0" + }, + "scope": 1340, + "src": "8398:203:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 1014, + "nodeType": "Block", + "src": "8683:128:0", + "statements": [ + { + "condition": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1001, + "name": "Vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 64, + "src": "8705:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", + "typeString": "type(enum Bridge.Vote)" + } + }, + "id": 1002, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "CHANGE_RANGE_SIZE", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "8705:22:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + { + "argumentTypes": null, + "id": 1003, + "name": "rangeSize", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 993, + "src": "8729:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 1000, + "name": "tryVote", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 1084, + 1109, + 1134, + 1164 + ], + "referencedDeclaration": 1134, + "src": "8697:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$_t_uint256_$returns$_t_bool_$", + "typeString": "function (enum Bridge.Vote,uint256) returns (bool)" + } + }, + "id": 1004, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8697:42:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 1013, + "nodeType": "IfStatement", + "src": "8693:112:0", + "trueBody": { + "id": 1012, + "nodeType": "Block", + "src": "8741:64:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 1010, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1005, + "name": "states", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "8755:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", + "typeString": "mapping(uint256 => struct Bridge.State storage ref)" + } + }, + "id": 1007, + "indexExpression": { + "argumentTypes": null, + "id": 1006, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "8762:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "8755:17:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$48_storage", + "typeString": "struct Bridge.State storage ref" + } + }, + "id": 1008, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "rangeSize", + "nodeType": "MemberAccess", + "referencedDeclaration": 39, + "src": "8755:27:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 1009, + "name": "rangeSize", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 993, + "src": "8785:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "8755:39:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 1011, + "nodeType": "ExpressionStatement", + "src": "8755:39:0" + } + ] + } + } + ] + }, + "documentation": null, + "id": 1015, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 996, + "modifierName": { + "argumentTypes": null, + "id": 995, + "name": "voting", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 225, + "src": "8659:6:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "8659:6:0" + }, + { + "arguments": null, + "id": 998, + "modifierName": { + "argumentTypes": null, + "id": 997, + "name": "currentValidator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 261, + "src": "8666:16:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "8666:16:0" + } + ], + "name": "voteChangeRangeSize", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 994, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 993, + "name": "rangeSize", + "nodeType": "VariableDeclaration", + "scope": 1015, + "src": "8636:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 992, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "8636:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "8635:16:0" + }, + "returnParameters": { + "id": 999, + "nodeType": "ParameterList", + "parameters": [], + "src": "8683:0:0" + }, + "scope": 1340, + "src": "8607:204:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 1038, + "nodeType": "Block", + "src": "8875:141:0", + "statements": [ + { + "condition": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1023, + "name": "Vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 64, + "src": "8897:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", + "typeString": "type(enum Bridge.Vote)" + } + }, + "id": 1024, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "START_KEYGEN", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "8897:17:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + ], + "id": 1022, + "name": "tryVote", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 1084, + 1109, + 1134, + 1164 + ], + "referencedDeclaration": 1084, + "src": "8889:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$returns$_t_bool_$", + "typeString": "function (enum Bridge.Vote) returns (bool)" + } + }, + "id": 1025, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8889:26:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 1037, + "nodeType": "IfStatement", + "src": "8885:125:0", + "trueBody": { + "id": 1036, + "nodeType": "Block", + "src": "8917:93:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 1029, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 1026, + "name": "status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 90, + "src": "8931:6:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1027, + "name": "Status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "8940:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Status_$53_$", + "typeString": "type(enum Bridge.Status)" + } + }, + "id": 1028, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "KEYGEN", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "8940:13:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "src": "8931:22:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "id": 1030, + "nodeType": "ExpressionStatement", + "src": "8931:22:0" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1032, + "name": "epoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 92, + "src": "8982:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 1033, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "8989:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 1031, + "name": "NewEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14, + "src": "8973:8:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$returns$__$", + "typeString": "function (uint256,uint256)" + } + }, + "id": 1034, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8973:26:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1035, + "nodeType": "EmitStatement", + "src": "8968:31:0" + } + ] + } + } + ] + }, + "documentation": null, + "id": 1039, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 1018, + "modifierName": { + "argumentTypes": null, + "id": 1017, + "name": "voting", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 225, + "src": "8851:6:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "8851:6:0" + }, + { + "arguments": null, + "id": 1020, + "modifierName": { + "argumentTypes": null, + "id": 1019, + "name": "currentValidator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 261, + "src": "8858:16:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "8858:16:0" + } + ], + "name": "voteStartKeygen", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1016, + "nodeType": "ParameterList", + "parameters": [], + "src": "8841:2:0" + }, + "returnParameters": { + "id": 1021, + "nodeType": "ParameterList", + "parameters": [], + "src": "8875:0:0" + }, + "scope": 1340, + "src": "8817:199:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 1061, + "nodeType": "Block", + "src": "9081:144:0", + "statements": [ + { + "condition": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1047, + "name": "Vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 64, + "src": "9103:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", + "typeString": "type(enum Bridge.Vote)" + } + }, + "id": 1048, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "CANCEL_KEYGEN", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "9103:18:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + ], + "id": 1046, + "name": "tryVote", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 1084, + 1109, + 1134, + 1164 + ], + "referencedDeclaration": 1084, + "src": "9095:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$returns$_t_bool_$", + "typeString": "function (enum Bridge.Vote) returns (bool)" + } + }, + "id": 1049, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9095:27:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 1060, + "nodeType": "IfStatement", + "src": "9091:128:0", + "trueBody": { + "id": 1059, + "nodeType": "Block", + "src": "9124:95:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 1053, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 1050, + "name": "status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 90, + "src": "9138:6:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1051, + "name": "Status", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "9147:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Status_$53_$", + "typeString": "type(enum Bridge.Status)" + } + }, + "id": 1052, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "VOTING", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "9147:13:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "src": "9138:22:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Status_$53", + "typeString": "enum Bridge.Status" + } + }, + "id": 1054, + "nodeType": "ExpressionStatement", + "src": "9138:22:0" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1056, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "9198:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 1055, + "name": "NewEpochCancelled", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 18, + "src": "9180:17:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 1057, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9180:28:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1058, + "nodeType": "EmitStatement", + "src": "9175:33:0" + } + ] + } + } + ] + }, + "documentation": null, + "id": 1062, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 1042, + "modifierName": { + "argumentTypes": null, + "id": 1041, + "name": "keygen", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 237, + "src": "9057:6:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "9057:6:0" + }, + { + "arguments": null, + "id": 1044, + "modifierName": { + "argumentTypes": null, + "id": 1043, + "name": "currentValidator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 261, + "src": "9064:16:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "9064:16:0" + } + ], + "name": "voteCancelKeygen", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1040, + "nodeType": "ParameterList", + "parameters": [], + "src": "9047:2:0" + }, + "returnParameters": { + "id": 1045, + "nodeType": "ParameterList", + "parameters": [], + "src": "9081:0:0" + }, + "scope": 1340, + "src": "9022:203:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 1083, + "nodeType": "Block", + "src": "9286:110:0", + "statements": [ + { + "assignments": [ + 1070 + ], + "declarations": [ + { + "constant": false, + "id": 1070, + "name": "vote", + "nodeType": "VariableDeclaration", + "scope": 1083, + "src": "9296:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1069, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "9296:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1078, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1074, + "name": "voteType", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1064, + "src": "9338:8:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + { + "argumentTypes": null, + "id": 1075, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "9348:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "id": 1072, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13075, + "src": "9321:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 1073, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "9321:16:0", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 1076, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9321:37:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 1071, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13082, + "src": "9311:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 1077, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9311:48:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "9296:63:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1080, + "name": "vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1070, + "src": "9384:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 1079, + "name": "putVote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1268, + "src": "9376:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$_t_bool_$", + "typeString": "function (bytes32) returns (bool)" + } + }, + "id": 1081, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9376:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 1068, + "id": 1082, + "nodeType": "Return", + "src": "9369:20:0" + } + ] + }, + "documentation": null, + "id": 1084, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "tryVote", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1065, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1064, + "name": "voteType", + "nodeType": "VariableDeclaration", + "scope": 1084, + "src": "9248:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + "typeName": { + "contractScope": null, + "id": 1063, + "name": "Vote", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 64, + "src": "9248:4:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "9247:15:0" + }, + "returnParameters": { + "id": 1068, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1067, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 1084, + "src": "9280:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 1066, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "9280:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "9279:6:0" + }, + "scope": 1340, + "src": "9231:165:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "private" + }, + { + "body": { + "id": 1108, + "nodeType": "Block", + "src": "9471:116:0", + "statements": [ + { + "assignments": [ + 1094 + ], + "declarations": [ + { + "constant": false, + "id": 1094, + "name": "vote", + "nodeType": "VariableDeclaration", + "scope": 1108, + "src": "9481:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1093, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "9481:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1103, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1098, + "name": "voteType", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1086, + "src": "9523:8:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + { + "argumentTypes": null, + "id": 1099, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "9533:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 1100, + "name": "addr", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1088, + "src": "9544:4:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "expression": { + "argumentTypes": null, + "id": 1096, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13075, + "src": "9506:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 1097, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "9506:16:0", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 1101, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9506:43:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 1095, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13082, + "src": "9496:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 1102, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9496:54:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "9481:69:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1105, + "name": "vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1094, + "src": "9575:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 1104, + "name": "putVote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1268, + "src": "9567:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$_t_bool_$", + "typeString": "function (bytes32) returns (bool)" + } + }, + "id": 1106, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9567:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 1092, + "id": 1107, + "nodeType": "Return", + "src": "9560:20:0" + } + ] + }, + "documentation": null, + "id": 1109, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "tryVote", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1089, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1086, + "name": "voteType", + "nodeType": "VariableDeclaration", + "scope": 1109, + "src": "9419:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + "typeName": { + "contractScope": null, + "id": 1085, + "name": "Vote", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 64, + "src": "9419:4:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1088, + "name": "addr", + "nodeType": "VariableDeclaration", + "scope": 1109, + "src": "9434:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1087, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "9434:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "9418:29:0" + }, + "returnParameters": { + "id": 1092, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1091, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 1109, + "src": "9465:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 1090, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "9465:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "9464:6:0" + }, + "scope": 1340, + "src": "9402:185:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "private" + }, + { + "body": { + "id": 1133, + "nodeType": "Block", + "src": "9658:115:0", + "statements": [ + { + "assignments": [ + 1119 + ], + "declarations": [ + { + "constant": false, + "id": 1119, + "name": "vote", + "nodeType": "VariableDeclaration", + "scope": 1133, + "src": "9668:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1118, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "9668:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1128, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1123, + "name": "voteType", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1111, + "src": "9710:8:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + { + "argumentTypes": null, + "id": 1124, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "9720:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 1125, + "name": "num", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1113, + "src": "9731:3:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "id": 1121, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13075, + "src": "9693:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 1122, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "9693:16:0", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 1126, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9693:42:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 1120, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13082, + "src": "9683:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 1127, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9683:53:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "9668:68:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1130, + "name": "vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1119, + "src": "9761:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 1129, + "name": "putVote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1268, + "src": "9753:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$_t_bool_$", + "typeString": "function (bytes32) returns (bool)" + } + }, + "id": 1131, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9753:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 1117, + "id": 1132, + "nodeType": "Return", + "src": "9746:20:0" + } + ] + }, + "documentation": null, + "id": 1134, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "tryVote", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1114, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1111, + "name": "voteType", + "nodeType": "VariableDeclaration", + "scope": 1134, + "src": "9610:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + "typeName": { + "contractScope": null, + "id": 1110, + "name": "Vote", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 64, + "src": "9610:4:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1113, + "name": "num", + "nodeType": "VariableDeclaration", + "scope": 1134, + "src": "9625:8:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1112, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "9625:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "9609:25:0" + }, + "returnParameters": { + "id": 1117, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1116, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 1134, + "src": "9652:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 1115, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "9652:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "9651:6:0" + }, + "scope": 1340, + "src": "9593:180:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "private" + }, + { + "body": { + "id": 1163, + "nodeType": "Block", + "src": "9872:116:0", + "statements": [ + { + "assignments": [ + 1148 + ], + "declarations": [ + { + "constant": false, + "id": 1148, + "name": "vote", + "nodeType": "VariableDeclaration", + "scope": 1163, + "src": "9882:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1147, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "9882:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1158, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1152, + "name": "voteType", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1136, + "src": "9924:8:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + { + "argumentTypes": null, + "id": 1153, + "name": "hash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1138, + "src": "9934:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "argumentTypes": null, + "id": 1154, + "name": "to", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1140, + "src": "9940:2:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 1155, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1142, + "src": "9944:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "id": 1150, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13075, + "src": "9907:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 1151, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "9907:16:0", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 1156, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9907:43:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 1149, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13082, + "src": "9897:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 1157, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9897:54:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "9882:69:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1160, + "name": "vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1148, + "src": "9976:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 1159, + "name": "putVote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1268, + "src": "9968:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$_t_bool_$", + "typeString": "function (bytes32) returns (bool)" + } + }, + "id": 1161, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9968:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 1146, + "id": 1162, + "nodeType": "Return", + "src": "9961:20:0" + } + ] + }, + "documentation": null, + "id": 1164, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "tryVote", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1143, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1136, + "name": "voteType", + "nodeType": "VariableDeclaration", + "scope": 1164, + "src": "9796:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + "typeName": { + "contractScope": null, + "id": 1135, + "name": "Vote", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 64, + "src": "9796:4:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1138, + "name": "hash", + "nodeType": "VariableDeclaration", + "scope": 1164, + "src": "9811:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1137, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "9811:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1140, + "name": "to", + "nodeType": "VariableDeclaration", + "scope": 1164, + "src": "9825:10:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1139, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "9825:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1142, + "name": "value", + "nodeType": "VariableDeclaration", + "scope": 1164, + "src": "9837:10:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1141, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "9837:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "9795:53:0" + }, + "returnParameters": { + "id": 1146, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1145, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 1164, + "src": "9866:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 1144, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "9866:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "9865:6:0" + }, + "scope": 1340, + "src": "9779:209:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "private" + }, + { + "body": { + "id": 1185, + "nodeType": "Block", + "src": "10052:113:0", + "statements": [ + { + "assignments": [ + 1172 + ], + "declarations": [ + { + "constant": false, + "id": 1172, + "name": "vote", + "nodeType": "VariableDeclaration", + "scope": 1185, + "src": "10062:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1171, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "10062:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1180, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1176, + "name": "voteType", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1166, + "src": "10104:8:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + { + "argumentTypes": null, + "id": 1177, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "10114:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "id": 1174, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13075, + "src": "10087:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 1175, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "10087:16:0", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 1178, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10087:37:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 1173, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13082, + "src": "10077:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 1179, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10077:48:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "10062:63:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1182, + "name": "vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1172, + "src": "10153:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 1181, + "name": "putConfirm", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1322, + "src": "10142:10:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$_t_bool_$", + "typeString": "function (bytes32) returns (bool)" + } + }, + "id": 1183, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10142:16:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 1170, + "id": 1184, + "nodeType": "Return", + "src": "10135:23:0" + } + ] + }, + "documentation": null, + "id": 1186, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "tryConfirm", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1167, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1166, + "name": "voteType", + "nodeType": "VariableDeclaration", + "scope": 1186, + "src": "10014:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + "typeName": { + "contractScope": null, + "id": 1165, + "name": "Vote", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 64, + "src": "10014:4:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "10013:15:0" + }, + "returnParameters": { + "id": 1170, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1169, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 1186, + "src": "10046:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 1168, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "10046:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "10045:6:0" + }, + "scope": 1340, + "src": "9994:171:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "private" + }, + { + "body": { + "id": 1213, + "nodeType": "Block", + "src": "10245:119:0", + "statements": [ + { + "assignments": [ + 1198 + ], + "declarations": [ + { + "constant": false, + "id": 1198, + "name": "vote", + "nodeType": "VariableDeclaration", + "scope": 1213, + "src": "10255:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1197, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "10255:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1208, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1202, + "name": "voteType", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1188, + "src": "10297:8:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + { + "argumentTypes": null, + "id": 1203, + "name": "nextEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "10307:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 1204, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1190, + "src": "10318:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 1205, + "name": "y", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1192, + "src": "10321:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "id": 1200, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13075, + "src": "10280:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 1201, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "10280:16:0", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 1206, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10280:43:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 1199, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13082, + "src": "10270:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 1207, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10270:54:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "10255:69:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1210, + "name": "vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1198, + "src": "10352:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 1209, + "name": "putConfirm", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1322, + "src": "10341:10:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$_t_bool_$", + "typeString": "function (bytes32) returns (bool)" + } + }, + "id": 1211, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10341:16:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 1196, + "id": 1212, + "nodeType": "Return", + "src": "10334:23:0" + } + ] + }, + "documentation": null, + "id": 1214, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "tryConfirm", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1193, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1188, + "name": "voteType", + "nodeType": "VariableDeclaration", + "scope": 1214, + "src": "10191:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + }, + "typeName": { + "contractScope": null, + "id": 1187, + "name": "Vote", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 64, + "src": "10191:4:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Vote_$64", + "typeString": "enum Bridge.Vote" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1190, + "name": "x", + "nodeType": "VariableDeclaration", + "scope": 1214, + "src": "10206:6:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1189, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "10206:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1192, + "name": "y", + "nodeType": "VariableDeclaration", + "scope": 1214, + "src": "10214:6:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1191, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "10214:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "10190:31:0" + }, + "returnParameters": { + "id": 1196, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1195, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 1214, + "src": "10239:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 1194, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "10239:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "10238:6:0" + }, + "scope": 1340, + "src": "10171:193:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "private" + }, + { + "body": { + "id": 1267, + "nodeType": "Block", + "src": "10424:355:0", + "statements": [ + { + "assignments": [ + 1222 + ], + "declarations": [ + { + "constant": false, + "id": 1222, + "name": "personalVote", + "nodeType": "VariableDeclaration", + "scope": 1267, + "src": "10434:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1221, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "10434:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1226, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1224, + "name": "vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1216, + "src": "10473:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 1223, + "name": "personalizeVote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1339, + "src": "10457:15:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_bytes32_$", + "typeString": "function (bytes32) view returns (bytes32)" + } + }, + "id": 1225, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10457:21:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "10434:44:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1231, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "10496:20:0", + "subExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1228, + "name": "votes", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 84, + "src": "10497:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", + "typeString": "mapping(bytes32 => bool)" + } + }, + "id": 1230, + "indexExpression": { + "argumentTypes": null, + "id": 1229, + "name": "personalVote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1222, + "src": "10503:12:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "10497:19:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "566f74656420616c7265616479", + "id": 1232, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10518:15:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_230c30109b60c15b21799291aaf5c571045da3dc3f224d8bbd2f2e688c149a47", + "typeString": "literal_string \"Voted already\"" + }, + "value": "Voted already" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_230c30109b60c15b21799291aaf5c571045da3dc3f224d8bbd2f2e688c149a47", + "typeString": "literal_string \"Voted already\"" + } + ], + "id": 1227, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 13091, + 13092 + ], + "referencedDeclaration": 13092, + "src": "10488:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1233, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10488:46:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1234, + "nodeType": "ExpressionStatement", + "src": "10488:46:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 1239, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1235, + "name": "votes", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 84, + "src": "10545:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", + "typeString": "mapping(bytes32 => bool)" + } + }, + "id": 1237, + "indexExpression": { + "argumentTypes": null, + "id": 1236, + "name": "personalVote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1222, + "src": "10551:12:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "10545:19:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "74727565", + "id": 1238, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10567:4:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + "src": "10545:26:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 1240, + "nodeType": "ExpressionStatement", + "src": "10545:26:0" + }, + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 1246, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1241, + "name": "votesCount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 80, + "src": "10585:10:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + } + }, + "id": 1243, + "indexExpression": { + "argumentTypes": null, + "id": 1242, + "name": "vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1216, + "src": "10596:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "10585:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 1244, + "name": "getThreshold", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 565, + 588 + ], + "referencedDeclaration": 565, + "src": "10605:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 1245, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10605:14:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "10585:34:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "id": 1265, + "nodeType": "Block", + "src": "10704:69:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 1261, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "10718:18:0", + "subExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1258, + "name": "votesCount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 80, + "src": "10718:10:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + } + }, + "id": 1260, + "indexExpression": { + "argumentTypes": null, + "id": 1259, + "name": "vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1216, + "src": "10729:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "10718:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 1262, + "nodeType": "ExpressionStatement", + "src": "10718:18:0" + }, + { + "expression": { + "argumentTypes": null, + "hexValue": "66616c7365", + "id": 1263, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10757:5:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + }, + "functionReturnParameters": 1220, + "id": 1264, + "nodeType": "Return", + "src": "10750:12:0" + } + ] + }, + "id": 1266, + "nodeType": "IfStatement", + "src": "10581:192:0", + "trueBody": { + "id": 1257, + "nodeType": "Block", + "src": "10621:77:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 1253, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1247, + "name": "votesCount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 80, + "src": "10635:10:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + } + }, + "id": 1249, + "indexExpression": { + "argumentTypes": null, + "id": 1248, + "name": "vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1216, + "src": "10646:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "10635:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_rational_57896044618658097711785492504343953926634992332820282019728792003956564819968_by_1", + "typeString": "int_const 5789...(69 digits omitted)...9968" + }, + "id": 1252, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "hexValue": "32", + "id": 1250, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10654:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" + }, + "nodeType": "BinaryOperation", + "operator": "**", + "rightExpression": { + "argumentTypes": null, + "hexValue": "323535", + "id": 1251, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10659:3:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_255_by_1", + "typeString": "int_const 255" + }, + "value": "255" + }, + "src": "10654:8:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_57896044618658097711785492504343953926634992332820282019728792003956564819968_by_1", + "typeString": "int_const 5789...(69 digits omitted)...9968" + } + }, + "src": "10635:27:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 1254, + "nodeType": "ExpressionStatement", + "src": "10635:27:0" + }, + { + "expression": { + "argumentTypes": null, + "hexValue": "74727565", + "id": 1255, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10683:4:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + "functionReturnParameters": 1220, + "id": 1256, + "nodeType": "Return", + "src": "10676:11:0" + } + ] + } + } + ] + }, + "documentation": null, + "id": 1268, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "putVote", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1217, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1216, + "name": "vote", + "nodeType": "VariableDeclaration", + "scope": 1268, + "src": "10387:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1215, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "10387:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "10386:14:0" + }, + "returnParameters": { + "id": 1220, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1219, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 1268, + "src": "10418:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 1218, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "10418:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "10417:6:0" + }, + "scope": 1340, + "src": "10370:409:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "private" + }, + { + "body": { + "id": 1321, + "nodeType": "Block", + "src": "10842:363:0", + "statements": [ + { + "assignments": [ + 1276 + ], + "declarations": [ + { + "constant": false, + "id": 1276, + "name": "personalVote", + "nodeType": "VariableDeclaration", + "scope": 1321, + "src": "10852:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1275, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "10852:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1280, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1278, + "name": "vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1270, + "src": "10891:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 1277, + "name": "personalizeVote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1339, + "src": "10875:15:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_bytes32_$", + "typeString": "function (bytes32) view returns (bytes32)" + } + }, + "id": 1279, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10875:21:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "10852:44:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1285, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "10914:20:0", + "subExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1282, + "name": "votes", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 84, + "src": "10915:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", + "typeString": "mapping(bytes32 => bool)" + } + }, + "id": 1284, + "indexExpression": { + "argumentTypes": null, + "id": 1283, + "name": "personalVote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1276, + "src": "10921:12:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "10915:19:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "436f6e6669726d656420616c7265616479", + "id": 1286, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10936:19:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_762a97ce67d271844ad9c09d89a5271fde7fe7537af208da055a904cd67ac7bc", + "typeString": "literal_string \"Confirmed already\"" + }, + "value": "Confirmed already" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_762a97ce67d271844ad9c09d89a5271fde7fe7537af208da055a904cd67ac7bc", + "typeString": "literal_string \"Confirmed already\"" + } + ], + "id": 1281, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 13091, + 13092 + ], + "referencedDeclaration": 13092, + "src": "10906:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1287, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10906:50:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1288, + "nodeType": "ExpressionStatement", + "src": "10906:50:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 1293, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1289, + "name": "votes", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 84, + "src": "10967:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", + "typeString": "mapping(bytes32 => bool)" + } + }, + "id": 1291, + "indexExpression": { + "argumentTypes": null, + "id": 1290, + "name": "personalVote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1276, + "src": "10973:12:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "10967:19:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "74727565", + "id": 1292, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10989:4:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + "src": "10967:26:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 1294, + "nodeType": "ExpressionStatement", + "src": "10967:26:0" + }, + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 1300, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1295, + "name": "votesCount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 80, + "src": "11007:10:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + } + }, + "id": 1297, + "indexExpression": { + "argumentTypes": null, + "id": 1296, + "name": "vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1270, + "src": "11018:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "11007:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 1298, + "name": "getNextThreshold", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 575, + "src": "11027:16:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 1299, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11027:18:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "11007:38:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "id": 1319, + "nodeType": "Block", + "src": "11130:69:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 1315, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "11144:18:0", + "subExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1312, + "name": "votesCount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 80, + "src": "11144:10:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + } + }, + "id": 1314, + "indexExpression": { + "argumentTypes": null, + "id": 1313, + "name": "vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1270, + "src": "11155:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "11144:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 1316, + "nodeType": "ExpressionStatement", + "src": "11144:18:0" + }, + { + "expression": { + "argumentTypes": null, + "hexValue": "66616c7365", + "id": 1317, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "11183:5:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + }, + "functionReturnParameters": 1274, + "id": 1318, + "nodeType": "Return", + "src": "11176:12:0" + } + ] + }, + "id": 1320, + "nodeType": "IfStatement", + "src": "11003:196:0", + "trueBody": { + "id": 1311, + "nodeType": "Block", + "src": "11047:77:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 1307, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1301, + "name": "votesCount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 80, + "src": "11061:10:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + } + }, + "id": 1303, + "indexExpression": { + "argumentTypes": null, + "id": 1302, + "name": "vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1270, + "src": "11072:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "11061:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_rational_57896044618658097711785492504343953926634992332820282019728792003956564819968_by_1", + "typeString": "int_const 5789...(69 digits omitted)...9968" + }, + "id": 1306, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "hexValue": "32", + "id": 1304, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "11080:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" + }, + "nodeType": "BinaryOperation", + "operator": "**", + "rightExpression": { + "argumentTypes": null, + "hexValue": "323535", + "id": 1305, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "11085:3:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_255_by_1", + "typeString": "int_const 255" + }, + "value": "255" + }, + "src": "11080:8:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_57896044618658097711785492504343953926634992332820282019728792003956564819968_by_1", + "typeString": "int_const 5789...(69 digits omitted)...9968" + } + }, + "src": "11061:27:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 1308, + "nodeType": "ExpressionStatement", + "src": "11061:27:0" + }, + { + "expression": { + "argumentTypes": null, + "hexValue": "74727565", + "id": 1309, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "11109:4:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + "functionReturnParameters": 1274, + "id": 1310, + "nodeType": "Return", + "src": "11102:11:0" + } + ] + } + } + ] + }, + "documentation": null, + "id": 1322, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "putConfirm", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1271, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1270, + "name": "vote", + "nodeType": "VariableDeclaration", + "scope": 1322, + "src": "10805:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1269, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "10805:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "10804:14:0" + }, + "returnParameters": { + "id": 1274, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1273, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 1322, + "src": "10836:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 1272, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "10836:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "10835:6:0" + }, + "scope": 1340, + "src": "10785:420:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "private" + }, + { + "body": { + "id": 1338, + "nodeType": "Block", + "src": "11281:69:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1332, + "name": "vote", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1324, + "src": "11325:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1333, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13088, + "src": "11331:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1334, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "11331:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + ], + "expression": { + "argumentTypes": null, + "id": 1330, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13075, + "src": "11308:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 1331, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "11308:16:0", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 1335, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11308:34:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 1329, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13082, + "src": "11298:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 1336, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11298:45:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "functionReturnParameters": 1328, + "id": 1337, + "nodeType": "Return", + "src": "11291:52:0" + } + ] + }, + "documentation": null, + "id": 1339, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "personalizeVote", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1325, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1324, + "name": "vote", + "nodeType": "VariableDeclaration", + "scope": 1339, + "src": "11236:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1323, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "11236:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "11235:14:0" + }, + "returnParameters": { + "id": 1328, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1327, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 1339, + "src": "11272:7:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1326, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "11272:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "11271:9:0" + }, + "scope": 1340, + "src": "11211:139:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "private" + } + ], + "scope": 1341, + "src": "93:11259:0" + } + ], + "src": "0:11353:0" + }, + "compiler": { + "name": "solc", + "version": "0.5.9+commit.e560f70d.Emscripten.clang" + }, + "networks": { + "44": { + "events": { + "0x3ef85928df9ae51bdb3eb4c00ec73b92b82307f319ac1b029de14796a0972609": { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "oldEpoch", + "type": "uint256" + }, + { + "indexed": true, + "name": "newEpoch", + "type": "uint256" + } + ], + "name": "NewEpoch", + "type": "event", + "signature": "0x3ef85928df9ae51bdb3eb4c00ec73b92b82307f319ac1b029de14796a0972609" + }, + "0xddbb65cfe1ae4aec03cef0f9667c6d7ba3740927d0c60f4dd4d7104cc31d180a": { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "epoch", + "type": "uint256" + } + ], + "name": "NewEpochCancelled", + "type": "event", + "signature": "0xddbb65cfe1ae4aec03cef0f9667c6d7ba3740927d0c60f4dd4d7104cc31d180a" + }, + "0xf4735b85cc98f9a712832825ecab4cfb1649d658f9a73c57a00ea7dde735c79b": { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "oldEpoch", + "type": "uint256" + }, + { + "indexed": true, + "name": "newEpoch", + "type": "uint256" + } + ], + "name": "NewFundsTransfer", + "type": "event", + "signature": "0xf4735b85cc98f9a712832825ecab4cfb1649d658f9a73c57a00ea7dde735c79b" + }, + "0xc33272939f066c227e913a4b3434d860794f185c551685c29451a3a38b9b259c": { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "epoch", + "type": "uint256" + }, + { + "indexed": false, + "name": "x", + "type": "uint256" + }, + { + "indexed": false, + "name": "y", + "type": "uint256" + } + ], + "name": "EpochStart", + "type": "event", + "signature": "0xc33272939f066c227e913a4b3434d860794f185c551685c29451a3a38b9b259c" + }, + "0x62e1f484b3909b2c013673bad76a9f14b010600ba983f11ad26e83082883570e": { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "value", + "type": "uint256" + } + ], + "name": "ExchangeRequest", + "type": "event", + "signature": "0x62e1f484b3909b2c013673bad76a9f14b010600ba983f11ad26e83082883570e" + }, + "0x9273b6f22cee1ef3d7cdc2a9c031936003526bae368886259511f7dd40044b02": { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "value", + "type": "uint256" + }, + { + "indexed": false, + "name": "nonce", + "type": "uint256" + } + ], + "name": "ExchangeRequest", + "type": "event", + "signature": "0x9273b6f22cee1ef3d7cdc2a9c031936003526bae368886259511f7dd40044b02" + } + }, + "links": {}, + "address": "0x44c158FE850821ae69DaF37AADF5c539e9d0025B", + "transactionHash": "0x912e1b3c5341609e1d0c0cd5d81ff6b7d9b2e8f497bd393ea91af1a4038cba78" + } + }, + "schemaVersion": "3.0.11", + "updatedAt": "2019-10-28T13:22:54.868Z", + "devdoc": { + "methods": {} + }, + "userdoc": { + "methods": {} + } +} \ No newline at end of file diff --git a/src/oracle/proxy/Dockerfile b/src/oracle/proxy/Dockerfile index e2cac6c..0e226c0 100644 --- a/src/oracle/proxy/Dockerfile +++ b/src/oracle/proxy/Dockerfile @@ -7,5 +7,6 @@ COPY ./proxy/package.json /proxy/ RUN npm install COPY ./proxy/index.js ./proxy/encode.js ./proxy/decode.js ./proxy/sendTx.js ./shared/logger.js ./shared/crypto.js /proxy/ +COPY ./proxy/Bridge.json ./proxy/IERC20.json ./proxy/SharedDB.json /proxy/contracts_data/ ENTRYPOINT ["node", "index.js"] diff --git a/src/oracle/proxy/IERC20.json b/src/oracle/proxy/IERC20.json new file mode 100644 index 0000000..38bf614 --- /dev/null +++ b/src/oracle/proxy/IERC20.json @@ -0,0 +1,1884 @@ +{ + "contractName": "IERC20", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "from", + "type": "address" + }, + { + "indexed": true, + "name": "to", + "type": "address" + }, + { + "indexed": false, + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "constant": true, + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "recipient", + "type": "address" + }, + { + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "owner", + "type": "address" + }, + { + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "spender", + "type": "address" + }, + { + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "sender", + "type": "address" + }, + { + "name": "recipient", + "type": "address" + }, + { + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + } + ], + "metadata": "{\"compiler\":{\"version\":\"0.5.9+commit.e560f70d\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":false,\"inputs\":[{\"name\":\"spender\",\"type\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"sender\",\"type\":\"address\"},{\"name\":\"recipient\",\"type\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"recipient\",\"type\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"owner\",\"type\":\"address\"},{\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"}],\"devdoc\":{\"details\":\"Interface of the ERC20 standard as defined in the EIP. Does not include the optional functions; to access them see `ERC20Detailed`.\",\"methods\":{\"allowance(address,address)\":{\"details\":\"Returns the remaining number of tokens that `spender` will be allowed to spend on behalf of `owner` through `transferFrom`. This is zero by default. * This value changes when `approve` or `transferFrom` are called.\"},\"approve(address,uint256)\":{\"details\":\"Sets `amount` as the allowance of `spender` over the caller's tokens. * Returns a boolean value indicating whether the operation succeeded. * > Beware that changing an allowance with this method brings the risk that someone may use both the old and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * Emits an `Approval` event.\"},\"balanceOf(address)\":{\"details\":\"Returns the amount of tokens owned by `account`.\"},\"totalSupply()\":{\"details\":\"Returns the amount of tokens in existence.\"},\"transfer(address,uint256)\":{\"details\":\"Moves `amount` tokens from the caller's account to `recipient`. * Returns a boolean value indicating whether the operation succeeded. * Emits a `Transfer` event.\"},\"transferFrom(address,address,uint256)\":{\"details\":\"Moves `amount` tokens from `sender` to `recipient` using the allowance mechanism. `amount` is then deducted from the caller's allowance. * Returns a boolean value indicating whether the operation succeeded. * Emits a `Transfer` event.\"}}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/build/contracts/openzeppelin-solidity/contracts/token/ERC20/IERC20.sol\":\"IERC20\"},\"evmVersion\":\"petersburg\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":3},\"remappings\":[]},\"sources\":{\"/build/contracts/openzeppelin-solidity/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0x90e8c2521653bbb1768b05889c5760031e688d9cd361f167489b89215e201b95\",\"urls\":[\"bzzr://aa8b45b57edafc3d67bc5d916327ea16807fae33f753ca163ae0c4061b789766\",\"dweb:/ipfs/QmP5NaEwZthQeM2ESz4WTT3osrP7jhbvu7ocbttBi2JAw6\"]}},\"version\":1}", + "bytecode": "0x", + "deployedBytecode": "0x", + "sourceMap": "", + "deployedSourceMap": "", + "source": "pragma solidity ^0.5.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP. Does not include\n * the optional functions; to access them see `ERC20Detailed`.\n */\ninterface IERC20 {\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a `Transfer` event.\n */\n function transfer(address recipient, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through `transferFrom`. This is\n * zero by default.\n *\n * This value changes when `approve` or `transferFrom` are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * > Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an `Approval` event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a `Transfer` event.\n */\n function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);\n\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to `approve`. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n}\n", + "sourcePath": "/build/contracts/openzeppelin-solidity/contracts/token/ERC20/IERC20.sol", + "ast": { + "absolutePath": "/build/contracts/openzeppelin-solidity/contracts/token/ERC20/IERC20.sol", + "exportedSymbols": { + "IERC20": [ + 8691 + ] + }, + "id": 8692, + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 8624, + "literals": [ + "solidity", + "^", + "0.5", + ".0" + ], + "nodeType": "PragmaDirective", + "src": "0:23:113" + }, + { + "baseContracts": [], + "contractDependencies": [], + "contractKind": "interface", + "documentation": "@dev Interface of the ERC20 standard as defined in the EIP. Does not include\nthe optional functions; to access them see `ERC20Detailed`.", + "fullyImplemented": false, + "id": 8691, + "linearizedBaseContracts": [ + 8691 + ], + "name": "IERC20", + "nodeType": "ContractDefinition", + "nodes": [ + { + "body": null, + "documentation": "@dev Returns the amount of tokens in existence.", + "id": 8629, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "totalSupply", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 8625, + "nodeType": "ParameterList", + "parameters": [], + "src": "290:2:113" + }, + "returnParameters": { + "id": 8628, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8627, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 8629, + "src": "316:7:113", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8626, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "316:7:113", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "315:9:113" + }, + "scope": 8691, + "src": "270:55:113", + "stateMutability": "view", + "superFunction": 11425, + "visibility": "external" + }, + { + "body": null, + "documentation": "@dev Returns the amount of tokens owned by `account`.", + "id": 8636, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "balanceOf", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 8632, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8631, + "name": "account", + "nodeType": "VariableDeclaration", + "scope": 8636, + "src": "427:15:113", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 8630, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "427:7:113", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "426:17:113" + }, + "returnParameters": { + "id": 8635, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8634, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 8636, + "src": "467:7:113", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8633, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "467:7:113", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "466:9:113" + }, + "scope": 8691, + "src": "408:68:113", + "stateMutability": "view", + "superFunction": 11432, + "visibility": "external" + }, + { + "body": null, + "documentation": "@dev Moves `amount` tokens from the caller's account to `recipient`.\n * Returns a boolean value indicating whether the operation succeeded.\n * Emits a `Transfer` event.", + "id": 8645, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "transfer", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 8641, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8638, + "name": "recipient", + "nodeType": "VariableDeclaration", + "scope": 8645, + "src": "714:17:113", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 8637, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "714:7:113", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 8640, + "name": "amount", + "nodeType": "VariableDeclaration", + "scope": 8645, + "src": "733:14:113", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8639, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "733:7:113", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "713:35:113" + }, + "returnParameters": { + "id": 8644, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8643, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 8645, + "src": "767:4:113", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 8642, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "767:4:113", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "766:6:113" + }, + "scope": 8691, + "src": "696:77:113", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": null, + "documentation": "@dev Returns the remaining number of tokens that `spender` will be\nallowed to spend on behalf of `owner` through `transferFrom`. This is\nzero by default.\n * This value changes when `approve` or `transferFrom` are called.", + "id": 8654, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "allowance", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 8650, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8647, + "name": "owner", + "nodeType": "VariableDeclaration", + "scope": 8654, + "src": "1067:13:113", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 8646, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1067:7:113", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 8649, + "name": "spender", + "nodeType": "VariableDeclaration", + "scope": 8654, + "src": "1082:15:113", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 8648, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1082:7:113", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1066:32:113" + }, + "returnParameters": { + "id": 8653, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8652, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 8654, + "src": "1122:7:113", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8651, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1122:7:113", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1121:9:113" + }, + "scope": 8691, + "src": "1048:83:113", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + }, + { + "body": null, + "documentation": "@dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n * Returns a boolean value indicating whether the operation succeeded.\n * > Beware that changing an allowance with this method brings the risk\nthat someone may use both the old and the new allowance by unfortunate\ntransaction ordering. One possible solution to mitigate this race\ncondition is to first reduce the spender's allowance to 0 and set the\ndesired value afterwards:\nhttps://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n * Emits an `Approval` event.", + "id": 8663, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "approve", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 8659, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8656, + "name": "spender", + "nodeType": "VariableDeclaration", + "scope": 8663, + "src": "1792:15:113", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 8655, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1792:7:113", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 8658, + "name": "amount", + "nodeType": "VariableDeclaration", + "scope": 8663, + "src": "1809:14:113", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8657, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1809:7:113", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1791:33:113" + }, + "returnParameters": { + "id": 8662, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8661, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 8663, + "src": "1843:4:113", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 8660, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "1843:4:113", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1842:6:113" + }, + "scope": 8691, + "src": "1775:74:113", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": null, + "documentation": "@dev Moves `amount` tokens from `sender` to `recipient` using the\nallowance mechanism. `amount` is then deducted from the caller's\nallowance.\n * Returns a boolean value indicating whether the operation succeeded.\n * Emits a `Transfer` event.", + "id": 8674, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "transferFrom", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 8670, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8665, + "name": "sender", + "nodeType": "VariableDeclaration", + "scope": 8674, + "src": "2178:14:113", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 8664, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2178:7:113", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 8667, + "name": "recipient", + "nodeType": "VariableDeclaration", + "scope": 8674, + "src": "2194:17:113", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 8666, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2194:7:113", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 8669, + "name": "amount", + "nodeType": "VariableDeclaration", + "scope": 8674, + "src": "2213:14:113", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8668, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2213:7:113", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "2177:51:113" + }, + "returnParameters": { + "id": 8673, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8672, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 8674, + "src": "2247:4:113", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 8671, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "2247:4:113", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "2246:6:113" + }, + "scope": 8691, + "src": "2156:97:113", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "anonymous": false, + "documentation": "@dev Emitted when `value` tokens are moved from one account (`from`) to\nanother (`to`).\n * Note that `value` may be zero.", + "id": 8682, + "name": "Transfer", + "nodeType": "EventDefinition", + "parameters": { + "id": 8681, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8676, + "indexed": true, + "name": "from", + "nodeType": "VariableDeclaration", + "scope": 8682, + "src": "2437:20:113", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 8675, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2437:7:113", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 8678, + "indexed": true, + "name": "to", + "nodeType": "VariableDeclaration", + "scope": 8682, + "src": "2459:18:113", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 8677, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2459:7:113", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 8680, + "indexed": false, + "name": "value", + "nodeType": "VariableDeclaration", + "scope": 8682, + "src": "2479:13:113", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8679, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2479:7:113", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "2436:57:113" + }, + "src": "2422:72:113" + }, + { + "anonymous": false, + "documentation": "@dev Emitted when the allowance of a `spender` for an `owner` is set by\na call to `approve`. `value` is the new allowance.", + "id": 8690, + "name": "Approval", + "nodeType": "EventDefinition", + "parameters": { + "id": 8689, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8684, + "indexed": true, + "name": "owner", + "nodeType": "VariableDeclaration", + "scope": 8690, + "src": "2668:21:113", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 8683, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2668:7:113", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 8686, + "indexed": true, + "name": "spender", + "nodeType": "VariableDeclaration", + "scope": 8690, + "src": "2691:23:113", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 8685, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2691:7:113", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 8688, + "indexed": false, + "name": "value", + "nodeType": "VariableDeclaration", + "scope": 8690, + "src": "2716:13:113", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8687, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2716:7:113", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "2667:63:113" + }, + "src": "2653:78:113" + } + ], + "scope": 8692, + "src": "176:2557:113" + } + ], + "src": "0:2734:113" + }, + "legacyAST": { + "absolutePath": "/build/contracts/openzeppelin-solidity/contracts/token/ERC20/IERC20.sol", + "exportedSymbols": { + "IERC20": [ + 8691 + ] + }, + "id": 8692, + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 8624, + "literals": [ + "solidity", + "^", + "0.5", + ".0" + ], + "nodeType": "PragmaDirective", + "src": "0:23:113" + }, + { + "baseContracts": [], + "contractDependencies": [], + "contractKind": "interface", + "documentation": "@dev Interface of the ERC20 standard as defined in the EIP. Does not include\nthe optional functions; to access them see `ERC20Detailed`.", + "fullyImplemented": false, + "id": 8691, + "linearizedBaseContracts": [ + 8691 + ], + "name": "IERC20", + "nodeType": "ContractDefinition", + "nodes": [ + { + "body": null, + "documentation": "@dev Returns the amount of tokens in existence.", + "id": 8629, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "totalSupply", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 8625, + "nodeType": "ParameterList", + "parameters": [], + "src": "290:2:113" + }, + "returnParameters": { + "id": 8628, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8627, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 8629, + "src": "316:7:113", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8626, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "316:7:113", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "315:9:113" + }, + "scope": 8691, + "src": "270:55:113", + "stateMutability": "view", + "superFunction": 11425, + "visibility": "external" + }, + { + "body": null, + "documentation": "@dev Returns the amount of tokens owned by `account`.", + "id": 8636, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "balanceOf", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 8632, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8631, + "name": "account", + "nodeType": "VariableDeclaration", + "scope": 8636, + "src": "427:15:113", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 8630, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "427:7:113", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "426:17:113" + }, + "returnParameters": { + "id": 8635, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8634, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 8636, + "src": "467:7:113", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8633, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "467:7:113", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "466:9:113" + }, + "scope": 8691, + "src": "408:68:113", + "stateMutability": "view", + "superFunction": 11432, + "visibility": "external" + }, + { + "body": null, + "documentation": "@dev Moves `amount` tokens from the caller's account to `recipient`.\n * Returns a boolean value indicating whether the operation succeeded.\n * Emits a `Transfer` event.", + "id": 8645, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "transfer", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 8641, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8638, + "name": "recipient", + "nodeType": "VariableDeclaration", + "scope": 8645, + "src": "714:17:113", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 8637, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "714:7:113", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 8640, + "name": "amount", + "nodeType": "VariableDeclaration", + "scope": 8645, + "src": "733:14:113", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8639, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "733:7:113", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "713:35:113" + }, + "returnParameters": { + "id": 8644, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8643, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 8645, + "src": "767:4:113", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 8642, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "767:4:113", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "766:6:113" + }, + "scope": 8691, + "src": "696:77:113", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": null, + "documentation": "@dev Returns the remaining number of tokens that `spender` will be\nallowed to spend on behalf of `owner` through `transferFrom`. This is\nzero by default.\n * This value changes when `approve` or `transferFrom` are called.", + "id": 8654, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "allowance", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 8650, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8647, + "name": "owner", + "nodeType": "VariableDeclaration", + "scope": 8654, + "src": "1067:13:113", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 8646, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1067:7:113", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 8649, + "name": "spender", + "nodeType": "VariableDeclaration", + "scope": 8654, + "src": "1082:15:113", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 8648, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1082:7:113", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1066:32:113" + }, + "returnParameters": { + "id": 8653, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8652, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 8654, + "src": "1122:7:113", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8651, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1122:7:113", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1121:9:113" + }, + "scope": 8691, + "src": "1048:83:113", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + }, + { + "body": null, + "documentation": "@dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n * Returns a boolean value indicating whether the operation succeeded.\n * > Beware that changing an allowance with this method brings the risk\nthat someone may use both the old and the new allowance by unfortunate\ntransaction ordering. One possible solution to mitigate this race\ncondition is to first reduce the spender's allowance to 0 and set the\ndesired value afterwards:\nhttps://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n * Emits an `Approval` event.", + "id": 8663, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "approve", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 8659, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8656, + "name": "spender", + "nodeType": "VariableDeclaration", + "scope": 8663, + "src": "1792:15:113", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 8655, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1792:7:113", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 8658, + "name": "amount", + "nodeType": "VariableDeclaration", + "scope": 8663, + "src": "1809:14:113", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8657, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1809:7:113", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1791:33:113" + }, + "returnParameters": { + "id": 8662, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8661, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 8663, + "src": "1843:4:113", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 8660, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "1843:4:113", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1842:6:113" + }, + "scope": 8691, + "src": "1775:74:113", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": null, + "documentation": "@dev Moves `amount` tokens from `sender` to `recipient` using the\nallowance mechanism. `amount` is then deducted from the caller's\nallowance.\n * Returns a boolean value indicating whether the operation succeeded.\n * Emits a `Transfer` event.", + "id": 8674, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "transferFrom", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 8670, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8665, + "name": "sender", + "nodeType": "VariableDeclaration", + "scope": 8674, + "src": "2178:14:113", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 8664, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2178:7:113", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 8667, + "name": "recipient", + "nodeType": "VariableDeclaration", + "scope": 8674, + "src": "2194:17:113", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 8666, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2194:7:113", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 8669, + "name": "amount", + "nodeType": "VariableDeclaration", + "scope": 8674, + "src": "2213:14:113", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8668, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2213:7:113", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "2177:51:113" + }, + "returnParameters": { + "id": 8673, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8672, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 8674, + "src": "2247:4:113", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 8671, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "2247:4:113", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "2246:6:113" + }, + "scope": 8691, + "src": "2156:97:113", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "anonymous": false, + "documentation": "@dev Emitted when `value` tokens are moved from one account (`from`) to\nanother (`to`).\n * Note that `value` may be zero.", + "id": 8682, + "name": "Transfer", + "nodeType": "EventDefinition", + "parameters": { + "id": 8681, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8676, + "indexed": true, + "name": "from", + "nodeType": "VariableDeclaration", + "scope": 8682, + "src": "2437:20:113", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 8675, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2437:7:113", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 8678, + "indexed": true, + "name": "to", + "nodeType": "VariableDeclaration", + "scope": 8682, + "src": "2459:18:113", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 8677, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2459:7:113", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 8680, + "indexed": false, + "name": "value", + "nodeType": "VariableDeclaration", + "scope": 8682, + "src": "2479:13:113", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8679, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2479:7:113", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "2436:57:113" + }, + "src": "2422:72:113" + }, + { + "anonymous": false, + "documentation": "@dev Emitted when the allowance of a `spender` for an `owner` is set by\na call to `approve`. `value` is the new allowance.", + "id": 8690, + "name": "Approval", + "nodeType": "EventDefinition", + "parameters": { + "id": 8689, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8684, + "indexed": true, + "name": "owner", + "nodeType": "VariableDeclaration", + "scope": 8690, + "src": "2668:21:113", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 8683, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2668:7:113", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 8686, + "indexed": true, + "name": "spender", + "nodeType": "VariableDeclaration", + "scope": 8690, + "src": "2691:23:113", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 8685, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2691:7:113", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 8688, + "indexed": false, + "name": "value", + "nodeType": "VariableDeclaration", + "scope": 8690, + "src": "2716:13:113", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8687, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2716:7:113", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "2667:63:113" + }, + "src": "2653:78:113" + } + ], + "scope": 8692, + "src": "176:2557:113" + } + ], + "src": "0:2734:113" + }, + "compiler": { + "name": "solc", + "version": "0.5.9+commit.e560f70d.Emscripten.clang" + }, + "networks": {}, + "schemaVersion": "3.0.11", + "updatedAt": "2019-09-17T15:35:53.888Z", + "devdoc": { + "details": "Interface of the ERC20 standard as defined in the EIP. Does not include the optional functions; to access them see `ERC20Detailed`.", + "methods": { + "allowance(address,address)": { + "details": "Returns the remaining number of tokens that `spender` will be allowed to spend on behalf of `owner` through `transferFrom`. This is zero by default. * This value changes when `approve` or `transferFrom` are called." + }, + "approve(address,uint256)": { + "details": "Sets `amount` as the allowance of `spender` over the caller's tokens. * Returns a boolean value indicating whether the operation succeeded. * > Beware that changing an allowance with this method brings the risk that someone may use both the old and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * Emits an `Approval` event." + }, + "balanceOf(address)": { + "details": "Returns the amount of tokens owned by `account`." + }, + "totalSupply()": { + "details": "Returns the amount of tokens in existence." + }, + "transfer(address,uint256)": { + "details": "Moves `amount` tokens from the caller's account to `recipient`. * Returns a boolean value indicating whether the operation succeeded. * Emits a `Transfer` event." + }, + "transferFrom(address,address,uint256)": { + "details": "Moves `amount` tokens from `sender` to `recipient` using the allowance mechanism. `amount` is then deducted from the caller's allowance. * Returns a boolean value indicating whether the operation succeeded. * Emits a `Transfer` event." + } + } + }, + "userdoc": { + "methods": {} + } +} \ No newline at end of file diff --git a/src/oracle/proxy/SharedDB.json b/src/oracle/proxy/SharedDB.json new file mode 100644 index 0000000..9e3494b --- /dev/null +++ b/src/oracle/proxy/SharedDB.json @@ -0,0 +1,6274 @@ +{ + "contractName": "SharedDB", + "abi": [ + { + "constant": true, + "inputs": [ + { + "name": "", + "type": "bytes32" + } + ], + "name": "dbSignups", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "", + "type": "bytes32" + } + ], + "name": "signupsCount", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "", + "type": "bytes32" + } + ], + "name": "db", + "outputs": [ + { + "name": "", + "type": "bytes" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "hash", + "type": "bytes32" + } + ], + "name": "signupSign", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "hash", + "type": "bytes32" + }, + { + "name": "validators", + "type": "address[]" + }, + { + "name": "validator", + "type": "address" + } + ], + "name": "getSignupNumber", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "hash", + "type": "bytes32" + }, + { + "name": "validators", + "type": "address[]" + }, + { + "name": "signupNumber", + "type": "uint256" + } + ], + "name": "getSignupAddress", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "hash", + "type": "bytes32" + }, + { + "name": "key", + "type": "bytes32" + }, + { + "name": "data", + "type": "bytes" + } + ], + "name": "setData", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "from", + "type": "address" + }, + { + "name": "hash", + "type": "bytes32" + }, + { + "name": "key", + "type": "bytes32" + } + ], + "name": "getData", + "outputs": [ + { + "name": "", + "type": "bytes" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + } + ], + "metadata": "{\"compiler\":{\"version\":\"0.5.9+commit.e560f70d\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":true,\"inputs\":[{\"name\":\"hash\",\"type\":\"bytes32\"},{\"name\":\"validators\",\"type\":\"address[]\"},{\"name\":\"signupNumber\",\"type\":\"uint256\"}],\"name\":\"getSignupAddress\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"from\",\"type\":\"address\"},{\"name\":\"hash\",\"type\":\"bytes32\"},{\"name\":\"key\",\"type\":\"bytes32\"}],\"name\":\"getData\",\"outputs\":[{\"name\":\"\",\"type\":\"bytes\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"hash\",\"type\":\"bytes32\"}],\"name\":\"signupSign\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"dbSignups\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"signupsCount\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"hash\",\"type\":\"bytes32\"},{\"name\":\"validators\",\"type\":\"address[]\"},{\"name\":\"validator\",\"type\":\"address\"}],\"name\":\"getSignupNumber\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"db\",\"outputs\":[{\"name\":\"\",\"type\":\"bytes\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"hash\",\"type\":\"bytes32\"},{\"name\":\"key\",\"type\":\"bytes32\"},{\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"setData\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/build/contracts/SharedDB.sol\":\"SharedDB\"},\"evmVersion\":\"petersburg\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":3},\"remappings\":[]},\"sources\":{\"/build/contracts/SharedDB.sol\":{\"keccak256\":\"0x94e823a0aa4d7aaca55e82121659cc162ce5ee7772b98e3d0c983b65ebabe22b\",\"urls\":[\"bzzr://ad1ac5702de081e8516595760054a0b4d8eaab39b75a002554ddb43ae738f37b\",\"dweb:/ipfs/QmRLrhNxxeoeJKpLpT2CakVxkmwuRQuvyVjZjF6cqKkz4f\"]}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b5061093b806100206000396000f3fe608060405234801561001057600080fd5b50600436106100785760003560e01c80631aaaffbd1461007d57806348b2865e1461014357806374ce45e1146101ea5780637ad5f33d1461020957806399648b3214610238578063ca2a834714610255578063ecf265bc14610308578063f865c6fc14610325575b600080fd5b6101276004803603606081101561009357600080fd5b81359190810190604081016020820135600160201b8111156100b457600080fd5b8201836020820111156100c657600080fd5b803590602001918460208302840111600160201b831117156100e757600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092955050913592506103d5915050565b604080516001600160a01b039092168252519081900360200190f35b6101756004803603606081101561015957600080fd5b506001600160a01b038135169060208101359060400135610438565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101af578181015183820152602001610197565b50505050905090810190601f1680156101dc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102076004803603602081101561020057600080fd5b5035610516565b005b6102266004803603602081101561021f57600080fd5b50356105eb565b60408051918252519081900360200190f35b6102266004803603602081101561024e57600080fd5b50356105fd565b6102266004803603606081101561026b57600080fd5b81359190810190604081016020820135600160201b81111561028c57600080fd5b82018360208201111561029e57600080fd5b803590602001918460208302840111600160201b831117156102bf57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550505090356001600160a01b0316915061060f9050565b6101756004803603602081101561031e57600080fd5b5035610777565b6102076004803603606081101561033b57600080fd5b813591602081013591810190606081016040820135600160201b81111561036157600080fd5b82018360208201111561037357600080fd5b803590602001918460018302840111600160201b8311171561039457600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610811945050505050565b6000805b835181101561042b578261040186868785815181106103f457fe5b602002602001015161060f565b14156104235783818151811061041357fe5b6020026020010151915050610431565b6001016103d9565b50600090505b9392505050565b60408051606085811b6001600160601b03191660208084019190915260348301869052605480840186905284518085039091018152607484018086528151918301919091206000908152808352859020805460026001821615610100026000190190911604601f8101849004909302850160949081019096528282529294909301828280156105085780601f106104dd57610100808354040283529160200191610508565b820191906000526020600020905b8154815290600101906020018083116104eb57829003601f168201915b505050505090509392505050565b604080513360601b602080830191909152603480830185905283518084039091018152605490920183528151918101919091206000908152600290915220541561059a576040805162461bcd60e51b815260206004820152601060248201526f105b1c9958591e481cda59db9d5c195960821b604482015290519081900360640190fd5b600081815260016020818152604080842080549093019283905580513360601b8184015260348082019690965281518082039096018652605401815284519482019490942083526002905291902055565b60026020526000908152604090205481565b60016020526000908152604090205481565b600060026000838660405160200180836001600160a01b03166001600160a01b031660601b815260140182815260200192505050604051602081830303815290604052805190602001208152602001908152602001600020546000141561067857506000610431565b600160005b845181101561076e5760006002600087848151811061069857fe5b60200260200101518960405160200180836001600160a01b03166001600160a01b031660601b815260140182815260200192505050604051602081830303815290604052805190602001208152602001908152602001600020549050600081118015610759575060026000868960405160200180836001600160a01b03166001600160a01b031660601b8152601401828152602001925050506040516020818303038152906040528051906020012081526020019081526020016000205481105b15610765576001909201915b5060010161067d565b50949350505050565b600060208181529181526040908190208054825160026001831615610100026000190190921691909104601f8101859004850282018501909352828152929091908301828280156108095780601f106107de57610100808354040283529160200191610809565b820191906000526020600020905b8154815290600101906020018083116107ec57829003601f168201915b505050505081565b604080513360601b602080830191909152603482018690526054808301869052835180840390910181526074909201835281519181019190912060009081528082529190912082516108659284019061086b565b50505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106108ac57805160ff19168380011785556108d9565b828001600101855582156108d9579182015b828111156108d95782518255916020019190600101906108be565b506108e59291506108e9565b5090565b61090391905b808211156108e557600081556001016108ef565b9056fea265627a7a723058203b87ffa77e3c8cbdec6d449f68f04dffd78ea0048b5bc86e3b9a1073187a6e1f64736f6c63430005090032", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100785760003560e01c80631aaaffbd1461007d57806348b2865e1461014357806374ce45e1146101ea5780637ad5f33d1461020957806399648b3214610238578063ca2a834714610255578063ecf265bc14610308578063f865c6fc14610325575b600080fd5b6101276004803603606081101561009357600080fd5b81359190810190604081016020820135600160201b8111156100b457600080fd5b8201836020820111156100c657600080fd5b803590602001918460208302840111600160201b831117156100e757600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092955050913592506103d5915050565b604080516001600160a01b039092168252519081900360200190f35b6101756004803603606081101561015957600080fd5b506001600160a01b038135169060208101359060400135610438565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101af578181015183820152602001610197565b50505050905090810190601f1680156101dc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102076004803603602081101561020057600080fd5b5035610516565b005b6102266004803603602081101561021f57600080fd5b50356105eb565b60408051918252519081900360200190f35b6102266004803603602081101561024e57600080fd5b50356105fd565b6102266004803603606081101561026b57600080fd5b81359190810190604081016020820135600160201b81111561028c57600080fd5b82018360208201111561029e57600080fd5b803590602001918460208302840111600160201b831117156102bf57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550505090356001600160a01b0316915061060f9050565b6101756004803603602081101561031e57600080fd5b5035610777565b6102076004803603606081101561033b57600080fd5b813591602081013591810190606081016040820135600160201b81111561036157600080fd5b82018360208201111561037357600080fd5b803590602001918460018302840111600160201b8311171561039457600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610811945050505050565b6000805b835181101561042b578261040186868785815181106103f457fe5b602002602001015161060f565b14156104235783818151811061041357fe5b6020026020010151915050610431565b6001016103d9565b50600090505b9392505050565b60408051606085811b6001600160601b03191660208084019190915260348301869052605480840186905284518085039091018152607484018086528151918301919091206000908152808352859020805460026001821615610100026000190190911604601f8101849004909302850160949081019096528282529294909301828280156105085780601f106104dd57610100808354040283529160200191610508565b820191906000526020600020905b8154815290600101906020018083116104eb57829003601f168201915b505050505090509392505050565b604080513360601b602080830191909152603480830185905283518084039091018152605490920183528151918101919091206000908152600290915220541561059a576040805162461bcd60e51b815260206004820152601060248201526f105b1c9958591e481cda59db9d5c195960821b604482015290519081900360640190fd5b600081815260016020818152604080842080549093019283905580513360601b8184015260348082019690965281518082039096018652605401815284519482019490942083526002905291902055565b60026020526000908152604090205481565b60016020526000908152604090205481565b600060026000838660405160200180836001600160a01b03166001600160a01b031660601b815260140182815260200192505050604051602081830303815290604052805190602001208152602001908152602001600020546000141561067857506000610431565b600160005b845181101561076e5760006002600087848151811061069857fe5b60200260200101518960405160200180836001600160a01b03166001600160a01b031660601b815260140182815260200192505050604051602081830303815290604052805190602001208152602001908152602001600020549050600081118015610759575060026000868960405160200180836001600160a01b03166001600160a01b031660601b8152601401828152602001925050506040516020818303038152906040528051906020012081526020019081526020016000205481105b15610765576001909201915b5060010161067d565b50949350505050565b600060208181529181526040908190208054825160026001831615610100026000190190921691909104601f8101859004850282018501909352828152929091908301828280156108095780601f106107de57610100808354040283529160200191610809565b820191906000526020600020905b8154815290600101906020018083116107ec57829003601f168201915b505050505081565b604080513360601b602080830191909152603482018690526054808301869052835180840390910181526074909201835281519181019190912060009081528082529190912082516108659284019061086b565b50505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106108ac57805160ff19168380011785556108d9565b828001600101855582156108d9579182015b828111156108d95782518255916020019190600101906108be565b506108e59291506108e9565b5090565b61090391905b808211156108e557600081556001016108ef565b9056fea265627a7a723058203b87ffa77e3c8cbdec6d449f68f04dffd78ea0048b5bc86e3b9a1073187a6e1f64736f6c63430005090032", + "sourceMap": "25:1611:1:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;25:1611:1;;;;;;;", + "deployedSourceMap": "25:1611:1:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;25:1611:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;956:353;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;956:353:1;;;;;;;;;;;;;;-1:-1:-1;;;5:28;;2:2;;;46:1;43;36:12;2:2;956:353:1;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;956:353:1;;;;;;101:9:-1;95:2;81:12;77:21;67:8;63:36;60:51;-1:-1;;;25:12;22:29;11:108;8:2;;;132:1;129;122:12;8:2;956:353:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;81:16;;74:27;;;;-1:-1;956:353:1;;-1:-1:-1;;956:353:1;;;-1:-1:-1;956:353:1;;-1:-1:-1;;956:353:1:i;:::-;;;;-1:-1:-1;;;;;956:353:1;;;;;;;;;;;;;;1469:165;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;1469:165:1;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:100:-1;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;1469:165:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;188:238;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;188:238:1;;:::i;:::-;;140:41;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;140:41:1;;:::i;:::-;;;;;;;;;;;;;;;;90:44;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;90:44:1;;:::i;432:518::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;432:518:1;;;;;;;;;;;;;;-1:-1:-1;;;5:28;;2:2;;;46:1;43;36:12;2:2;432:518:1;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;432:518:1;;;;;;101:9:-1;95:2;81:12;77:21;67:8;63:36;60:51;-1:-1;;;25:12;22:29;11:108;8:2;;;132:1;129;122:12;8:2;432:518:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;81:16;;74:27;;;;-1:-1;432:518:1;;-1:-1:-1;;;432:518:1;;-1:-1:-1;;;;;432:518:1;;-1:-1:-1;432:518:1;;-1:-1:-1;432:518:1:i;49:35::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;49:35:1;;:::i;1315:148::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;1315:148:1;;;;;;;;;;;;;;;;;;-1:-1:-1;;;5:28;;2:2;;;46:1;43;36:12;2:2;1315:148:1;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;1315:148:1;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;-1:-1;;;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;1315:148:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;81:16;;74:27;;;;-1:-1;1315:148:1;;-1:-1:-1;1315:148:1;;-1:-1:-1;;;;;1315:148:1:i;956:353::-;1065:7;;1084:192;1105:10;:17;1101:1;:21;1084:192;;;1199:12;1147:48;1163:4;1169:10;1181;1192:1;1181:13;;;;;;;;;;;;;;1147:15;:48::i;:::-;:64;1143:123;;;1238:10;1249:1;1238:13;;;;;;;;;;;;;;1231:20;;;;;1143:123;1124:3;;1084:192;;;;1300:1;1285:17;;956:353;;;;;;:::o;1469:165::-;1592:33;;;1548:12;1592:33;;;-1:-1:-1;;;;;;1592:33:1;;;;;;;;;;;;;;;;;;;;;;;;26:21:-1;;;22:32;;;6:49;;1592:33:1;;;;;;1582:44;;;;;;;;;-1:-1:-1;1579:48:1;;;;;;;;;1572:55;;;;;;;;;-1:-1:-1;;1572:55:1;;;;;;;;;;;;;;;;;;;;;;;;;;1548:12;;1592:33;;1572:55;1579:48;1572:55;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1469:165;;;;;:::o;188:238::-;267:34;;;284:10;267:34;;;;;;;;;;;;;;;;;;;26:21:-1;;;22:32;;;6:49;;267:34:1;;;;;;257:45;;;;;;;;;247:56;;;;:9;:56;;;;;:61;239:90;;;;;-1:-1:-1;;;239:90:1;;;;;;;;;;;;-1:-1:-1;;;239:90:1;;;;;;;;;;;;;;;401:18;;;;:12;:18;;;;;;;;399:20;;;;;;;;;360:34;;377:10;360:34;;;;;;;;;;;;;;;;26:21:-1;;;22:32;;;6:49;;360:34:1;;;;350:45;;;;;;;;;340:56;;:9;:56;;;;;:79;188:238::o;140:41::-;;;;;;;;;;;;;:::o;90:44::-;;;;;;;;;;;;;:::o;432:518::-;540:4;560:9;:55;597:9;608:4;580:33;;;;;;-1:-1:-1;;;;;580:33:1;-1:-1:-1;;;;;580:33:1;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;580:33:1;;;570:44;;;;;;560:55;;;;;;;;;;;;619:1;560:60;556:86;;;-1:-1:-1;641:1:1;634:8;;556:86;662:1;652:7;673:252;694:10;:17;690:1;:21;673:252;;;732:8;743:9;:59;780:10;791:1;780:13;;;;;;;;;;;;;;795:4;763:37;;;;;;-1:-1:-1;;;;;763:37:1;-1:-1:-1;;;;;763:37:1;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;763:37:1;;;753:48;;;;;;743:59;;;;;;;;;;;;732:70;;826:1;820:3;:7;:72;;;;;837:9;:55;874:9;885:4;857:33;;;;;;-1:-1:-1;;;;;857:33:1;-1:-1:-1;;;;;857:33:1;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;857:33:1;;;847:44;;;;;;837:55;;;;;;;;;;;;831:3;:61;820:72;816:98;;;910:4;;;;;816:98;-1:-1:-1;713:3:1;;673:252;;;-1:-1:-1;941:2:1;432:518;-1:-1:-1;;;;432:518:1:o;49:35::-;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;49:35:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;1315:148::-;1408:39;;;1425:10;1408:39;;;;;;;;;;;;;;;;;;;;;;;;;26:21:-1;;;22:32;;;6:49;;1408:39:1;;;;;;1398:50;;;;;;;;;1395:2;:54;;;;;;;;;;:61;;;;;;;;:::i;:::-;;1315:148;;;:::o;25:1611::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;25:1611:1;;;-1:-1:-1;25:1611:1;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;:::o", + "source": "pragma solidity ^0.5.0;\n\ncontract SharedDB {\n mapping(bytes32 => bytes) public db;\n mapping(bytes32 => uint) public signupsCount;\n mapping(bytes32 => uint) public dbSignups;\n\n function signupSign(bytes32 hash) public {\n require(dbSignups[keccak256(abi.encodePacked(msg.sender, hash))] == 0, \"Already signuped\");\n\n dbSignups[keccak256(abi.encodePacked(msg.sender, hash))] = ++signupsCount[hash];\n }\n\n function getSignupNumber(bytes32 hash, address[] memory validators, address validator) view public returns (uint) {\n if (dbSignups[keccak256(abi.encodePacked(validator, hash))] == 0)\n return 0;\n uint id = 1;\n for (uint i = 0; i < validators.length; i++) {\n uint vid = dbSignups[keccak256(abi.encodePacked(validators[i], hash))];\n if (vid > 0 && vid < dbSignups[keccak256(abi.encodePacked(validator, hash))])\n id++;\n }\n return id;\n }\n\n function getSignupAddress(bytes32 hash, address[] memory validators, uint signupNumber) view public returns (address) {\n for (uint i = 0; i < validators.length; i++) {\n if (getSignupNumber(hash, validators, validators[i]) == signupNumber) {\n return validators[i];\n }\n }\n return address(0);\n }\n\n function setData(bytes32 hash, bytes32 key, bytes memory data) public {\n db[keccak256(abi.encodePacked(msg.sender, hash, key))] = data;\n }\n\n function getData(address from, bytes32 hash, bytes32 key) view public returns (bytes memory) {\n return db[keccak256(abi.encodePacked(from, hash, key))];\n }\n}\n", + "sourcePath": "/build/contracts/SharedDB.sol", + "ast": { + "absolutePath": "/build/contracts/SharedDB.sol", + "exportedSymbols": { + "SharedDB": [ + 280 + ] + }, + "id": 281, + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 58, + "literals": [ + "solidity", + "^", + "0.5", + ".0" + ], + "nodeType": "PragmaDirective", + "src": "0:23:1" + }, + { + "baseContracts": [], + "contractDependencies": [], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "id": 280, + "linearizedBaseContracts": [ + 280 + ], + "name": "SharedDB", + "nodeType": "ContractDefinition", + "nodes": [ + { + "constant": false, + "id": 62, + "name": "db", + "nodeType": "VariableDeclaration", + "scope": 280, + "src": "49:35:1", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes_storage_$", + "typeString": "mapping(bytes32 => bytes)" + }, + "typeName": { + "id": 61, + "keyType": { + "id": 59, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "57:7:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "Mapping", + "src": "49:25:1", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes_storage_$", + "typeString": "mapping(bytes32 => bytes)" + }, + "valueType": { + "id": 60, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "68:5:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + } + }, + "value": null, + "visibility": "public" + }, + { + "constant": false, + "id": 66, + "name": "signupsCount", + "nodeType": "VariableDeclaration", + "scope": 280, + "src": "90:44:1", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + }, + "typeName": { + "id": 65, + "keyType": { + "id": 63, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "98:7:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "Mapping", + "src": "90:24:1", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + }, + "valueType": { + "id": 64, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "109:4:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + }, + "value": null, + "visibility": "public" + }, + { + "constant": false, + "id": 70, + "name": "dbSignups", + "nodeType": "VariableDeclaration", + "scope": 280, + "src": "140:41:1", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + }, + "typeName": { + "id": 69, + "keyType": { + "id": 67, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "148:7:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "Mapping", + "src": "140:24:1", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + }, + "valueType": { + "id": 68, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "159:4:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + }, + "value": null, + "visibility": "public" + }, + { + "body": { + "id": 107, + "nodeType": "Block", + "src": "229:197:1", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 87, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 76, + "name": "dbSignups", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 70, + "src": "247:9:1", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + } + }, + "id": 85, + "indexExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 80, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 295, + "src": "284:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 81, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "284:10:1", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 82, + "name": "hash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 72, + "src": "296:4:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "expression": { + "argumentTypes": null, + "id": 78, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 282, + "src": "267:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 79, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "267:16:1", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 83, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "267:34:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 77, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 289, + "src": "257:9:1", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 84, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "257:45:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "247:56:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 86, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "307:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "247:61:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "416c7265616479207369676e75706564", + "id": 88, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "310:18:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_0f787a2da91c95ceebba72e41285d8837122ce3874f0bcdf553fa97876cf60b0", + "typeString": "literal_string \"Already signuped\"" + }, + "value": "Already signuped" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_0f787a2da91c95ceebba72e41285d8837122ce3874f0bcdf553fa97876cf60b0", + "typeString": "literal_string \"Already signuped\"" + } + ], + "id": 75, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 298, + 299 + ], + "referencedDeclaration": 299, + "src": "239:7:1", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 89, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "239:90:1", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 90, + "nodeType": "ExpressionStatement", + "src": "239:90:1" + }, + { + "expression": { + "argumentTypes": null, + "id": 105, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 91, + "name": "dbSignups", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 70, + "src": "340:9:1", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + } + }, + "id": 100, + "indexExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 95, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 295, + "src": "377:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 96, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "377:10:1", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 97, + "name": "hash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 72, + "src": "389:4:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "expression": { + "argumentTypes": null, + "id": 93, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 282, + "src": "360:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 94, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "360:16:1", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 98, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "360:34:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 92, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 289, + "src": "350:9:1", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 99, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "350:45:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "340:56:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 104, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": true, + "src": "399:20:1", + "subExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 101, + "name": "signupsCount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 66, + "src": "401:12:1", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + } + }, + "id": 103, + "indexExpression": { + "argumentTypes": null, + "id": 102, + "name": "hash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 72, + "src": "414:4:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "401:18:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "340:79:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 106, + "nodeType": "ExpressionStatement", + "src": "340:79:1" + } + ] + }, + "documentation": null, + "id": 108, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "signupSign", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 73, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 72, + "name": "hash", + "nodeType": "VariableDeclaration", + "scope": 108, + "src": "208:12:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 71, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "208:7:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "207:14:1" + }, + "returnParameters": { + "id": 74, + "nodeType": "ParameterList", + "parameters": [], + "src": "229:0:1" + }, + "scope": 280, + "src": "188:238:1", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 186, + "nodeType": "Block", + "src": "546:404:1", + "statements": [ + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 130, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 120, + "name": "dbSignups", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 70, + "src": "560:9:1", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + } + }, + "id": 128, + "indexExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 124, + "name": "validator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 115, + "src": "597:9:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 125, + "name": "hash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 110, + "src": "608:4:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "expression": { + "argumentTypes": null, + "id": 122, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 282, + "src": "580:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 123, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "580:16:1", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 126, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "580:33:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 121, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 289, + "src": "570:9:1", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 127, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "570:44:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "560:55:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 129, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "619:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "560:60:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 133, + "nodeType": "IfStatement", + "src": "556:86:1", + "trueBody": { + "expression": { + "argumentTypes": null, + "hexValue": "30", + "id": 131, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "641:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "functionReturnParameters": 119, + "id": 132, + "nodeType": "Return", + "src": "634:8:1" + } + }, + { + "assignments": [ + 135 + ], + "declarations": [ + { + "constant": false, + "id": 135, + "name": "id", + "nodeType": "VariableDeclaration", + "scope": 186, + "src": "652:7:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 134, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "652:4:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 137, + "initialValue": { + "argumentTypes": null, + "hexValue": "31", + "id": 136, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "662:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "nodeType": "VariableDeclarationStatement", + "src": "652:11:1" + }, + { + "body": { + "id": 182, + "nodeType": "Block", + "src": "718:207:1", + "statements": [ + { + "assignments": [ + 150 + ], + "declarations": [ + { + "constant": false, + "id": 150, + "name": "vid", + "nodeType": "VariableDeclaration", + "scope": 182, + "src": "732:8:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 149, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "732:4:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 162, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 151, + "name": "dbSignups", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 70, + "src": "743:9:1", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + } + }, + "id": 161, + "indexExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 155, + "name": "validators", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 113, + "src": "780:10:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "id": 157, + "indexExpression": { + "argumentTypes": null, + "id": 156, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 139, + "src": "791:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "780:13:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 158, + "name": "hash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 110, + "src": "795:4:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "expression": { + "argumentTypes": null, + "id": 153, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 282, + "src": "763:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 154, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "763:16:1", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 159, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "763:37:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 152, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 289, + "src": "753:9:1", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 160, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "753:48:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "743:59:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "732:70:1" + }, + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 177, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 165, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 163, + "name": "vid", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 150, + "src": "820:3:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 164, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "826:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "820:7:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 176, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 166, + "name": "vid", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 150, + "src": "831:3:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 167, + "name": "dbSignups", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 70, + "src": "837:9:1", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + } + }, + "id": 175, + "indexExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 171, + "name": "validator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 115, + "src": "874:9:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 172, + "name": "hash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 110, + "src": "885:4:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "expression": { + "argumentTypes": null, + "id": 169, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 282, + "src": "857:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 170, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "857:16:1", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 173, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "857:33:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 168, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 289, + "src": "847:9:1", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 174, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "847:44:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "837:55:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "831:61:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "820:72:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 181, + "nodeType": "IfStatement", + "src": "816:98:1", + "trueBody": { + "expression": { + "argumentTypes": null, + "id": 179, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "910:4:1", + "subExpression": { + "argumentTypes": null, + "id": 178, + "name": "id", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 135, + "src": "910:2:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 180, + "nodeType": "ExpressionStatement", + "src": "910:4:1" + } + } + ] + }, + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 145, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 142, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 139, + "src": "690:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 143, + "name": "validators", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 113, + "src": "694:10:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "id": 144, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "694:17:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "690:21:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 183, + "initializationExpression": { + "assignments": [ + 139 + ], + "declarations": [ + { + "constant": false, + "id": 139, + "name": "i", + "nodeType": "VariableDeclaration", + "scope": 183, + "src": "678:6:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 138, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "678:4:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 141, + "initialValue": { + "argumentTypes": null, + "hexValue": "30", + "id": 140, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "687:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "nodeType": "VariableDeclarationStatement", + "src": "678:10:1" + }, + "loopExpression": { + "expression": { + "argumentTypes": null, + "id": 147, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "713:3:1", + "subExpression": { + "argumentTypes": null, + "id": 146, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 139, + "src": "713:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 148, + "nodeType": "ExpressionStatement", + "src": "713:3:1" + }, + "nodeType": "ForStatement", + "src": "673:252:1" + }, + { + "expression": { + "argumentTypes": null, + "id": 184, + "name": "id", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 135, + "src": "941:2:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 119, + "id": 185, + "nodeType": "Return", + "src": "934:9:1" + } + ] + }, + "documentation": null, + "id": 187, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getSignupNumber", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 116, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 110, + "name": "hash", + "nodeType": "VariableDeclaration", + "scope": 187, + "src": "457:12:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 109, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "457:7:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 113, + "name": "validators", + "nodeType": "VariableDeclaration", + "scope": 187, + "src": "471:27:1", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[]" + }, + "typeName": { + "baseType": { + "id": 111, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "471:7:1", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 112, + "length": null, + "nodeType": "ArrayTypeName", + "src": "471:9:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 115, + "name": "validator", + "nodeType": "VariableDeclaration", + "scope": 187, + "src": "500:17:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 114, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "500:7:1", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "456:62:1" + }, + "returnParameters": { + "id": 119, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 118, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 187, + "src": "540:4:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 117, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "540:4:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "539:6:1" + }, + "scope": 280, + "src": "432:518:1", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 231, + "nodeType": "Block", + "src": "1074:235:1", + "statements": [ + { + "body": { + "id": 225, + "nodeType": "Block", + "src": "1129:147:1", + "statements": [ + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 218, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 211, + "name": "hash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 189, + "src": "1163:4:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "argumentTypes": null, + "id": 212, + "name": "validators", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 192, + "src": "1169:10:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 213, + "name": "validators", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 192, + "src": "1181:10:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "id": 215, + "indexExpression": { + "argumentTypes": null, + "id": 214, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 200, + "src": "1192:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "1181:13:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 210, + "name": "getSignupNumber", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 187, + "src": "1147:15:1", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_bytes32_$_t_array$_t_address_$dyn_memory_ptr_$_t_address_$returns$_t_uint256_$", + "typeString": "function (bytes32,address[] memory,address) view returns (uint256)" + } + }, + "id": 216, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1147:48:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 217, + "name": "signupNumber", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 194, + "src": "1199:12:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1147:64:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 224, + "nodeType": "IfStatement", + "src": "1143:123:1", + "trueBody": { + "id": 223, + "nodeType": "Block", + "src": "1213:53:1", + "statements": [ + { + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 219, + "name": "validators", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 192, + "src": "1238:10:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "id": 221, + "indexExpression": { + "argumentTypes": null, + "id": 220, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 200, + "src": "1249:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "1238:13:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "functionReturnParameters": 198, + "id": 222, + "nodeType": "Return", + "src": "1231:20:1" + } + ] + } + } + ] + }, + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 206, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 203, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 200, + "src": "1101:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 204, + "name": "validators", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 192, + "src": "1105:10:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "id": 205, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "1105:17:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1101:21:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 226, + "initializationExpression": { + "assignments": [ + 200 + ], + "declarations": [ + { + "constant": false, + "id": 200, + "name": "i", + "nodeType": "VariableDeclaration", + "scope": 226, + "src": "1089:6:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 199, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1089:4:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 202, + "initialValue": { + "argumentTypes": null, + "hexValue": "30", + "id": 201, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1098:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "nodeType": "VariableDeclarationStatement", + "src": "1089:10:1" + }, + "loopExpression": { + "expression": { + "argumentTypes": null, + "id": 208, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "1124:3:1", + "subExpression": { + "argumentTypes": null, + "id": 207, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 200, + "src": "1124:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 209, + "nodeType": "ExpressionStatement", + "src": "1124:3:1" + }, + "nodeType": "ForStatement", + "src": "1084:192:1" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "hexValue": "30", + "id": 228, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1300:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 227, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "1292:7:1", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 229, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1292:10:1", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "functionReturnParameters": 198, + "id": 230, + "nodeType": "Return", + "src": "1285:17:1" + } + ] + }, + "documentation": null, + "id": 232, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getSignupAddress", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 195, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 189, + "name": "hash", + "nodeType": "VariableDeclaration", + "scope": 232, + "src": "982:12:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 188, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "982:7:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 192, + "name": "validators", + "nodeType": "VariableDeclaration", + "scope": 232, + "src": "996:27:1", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[]" + }, + "typeName": { + "baseType": { + "id": 190, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "996:7:1", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 191, + "length": null, + "nodeType": "ArrayTypeName", + "src": "996:9:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 194, + "name": "signupNumber", + "nodeType": "VariableDeclaration", + "scope": 232, + "src": "1025:17:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 193, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1025:4:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "981:62:1" + }, + "returnParameters": { + "id": 198, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 197, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 232, + "src": "1065:7:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 196, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1065:7:1", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1064:9:1" + }, + "scope": 280, + "src": "956:353:1", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 255, + "nodeType": "Block", + "src": "1385:78:1", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 253, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 241, + "name": "db", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 62, + "src": "1395:2:1", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes_storage_$", + "typeString": "mapping(bytes32 => bytes storage ref)" + } + }, + "id": 251, + "indexExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 245, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 295, + "src": "1425:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 246, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "1425:10:1", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 247, + "name": "hash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 234, + "src": "1437:4:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "argumentTypes": null, + "id": 248, + "name": "key", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 236, + "src": "1443:3:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "expression": { + "argumentTypes": null, + "id": 243, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 282, + "src": "1408:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 244, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "1408:16:1", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 249, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1408:39:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 242, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 289, + "src": "1398:9:1", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 250, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1398:50:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "1395:54:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage", + "typeString": "bytes storage ref" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 252, + "name": "data", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 238, + "src": "1452:4:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "src": "1395:61:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage", + "typeString": "bytes storage ref" + } + }, + "id": 254, + "nodeType": "ExpressionStatement", + "src": "1395:61:1" + } + ] + }, + "documentation": null, + "id": 256, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "setData", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 239, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 234, + "name": "hash", + "nodeType": "VariableDeclaration", + "scope": 256, + "src": "1332:12:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 233, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1332:7:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 236, + "name": "key", + "nodeType": "VariableDeclaration", + "scope": 256, + "src": "1346:11:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 235, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1346:7:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 238, + "name": "data", + "nodeType": "VariableDeclaration", + "scope": 256, + "src": "1359:17:1", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 237, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "1359:5:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1331:46:1" + }, + "returnParameters": { + "id": 240, + "nodeType": "ParameterList", + "parameters": [], + "src": "1385:0:1" + }, + "scope": 280, + "src": "1315:148:1", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 278, + "nodeType": "Block", + "src": "1562:72:1", + "statements": [ + { + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 267, + "name": "db", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 62, + "src": "1579:2:1", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes_storage_$", + "typeString": "mapping(bytes32 => bytes storage ref)" + } + }, + "id": 276, + "indexExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 271, + "name": "from", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 258, + "src": "1609:4:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 272, + "name": "hash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 260, + "src": "1615:4:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "argumentTypes": null, + "id": 273, + "name": "key", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 262, + "src": "1621:3:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "expression": { + "argumentTypes": null, + "id": 269, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 282, + "src": "1592:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 270, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "1592:16:1", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 274, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1592:33:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 268, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 289, + "src": "1582:9:1", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 275, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1582:44:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "1579:48:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage", + "typeString": "bytes storage ref" + } + }, + "functionReturnParameters": 266, + "id": 277, + "nodeType": "Return", + "src": "1572:55:1" + } + ] + }, + "documentation": null, + "id": 279, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getData", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 263, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 258, + "name": "from", + "nodeType": "VariableDeclaration", + "scope": 279, + "src": "1486:12:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 257, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1486:7:1", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 260, + "name": "hash", + "nodeType": "VariableDeclaration", + "scope": 279, + "src": "1500:12:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 259, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1500:7:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 262, + "name": "key", + "nodeType": "VariableDeclaration", + "scope": 279, + "src": "1514:11:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 261, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1514:7:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1485:41:1" + }, + "returnParameters": { + "id": 266, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 265, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 279, + "src": "1548:12:1", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 264, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "1548:5:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1547:14:1" + }, + "scope": 280, + "src": "1469:165:1", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + } + ], + "scope": 281, + "src": "25:1611:1" + } + ], + "src": "0:1637:1" + }, + "legacyAST": { + "absolutePath": "/build/contracts/SharedDB.sol", + "exportedSymbols": { + "SharedDB": [ + 280 + ] + }, + "id": 281, + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 58, + "literals": [ + "solidity", + "^", + "0.5", + ".0" + ], + "nodeType": "PragmaDirective", + "src": "0:23:1" + }, + { + "baseContracts": [], + "contractDependencies": [], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "id": 280, + "linearizedBaseContracts": [ + 280 + ], + "name": "SharedDB", + "nodeType": "ContractDefinition", + "nodes": [ + { + "constant": false, + "id": 62, + "name": "db", + "nodeType": "VariableDeclaration", + "scope": 280, + "src": "49:35:1", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes_storage_$", + "typeString": "mapping(bytes32 => bytes)" + }, + "typeName": { + "id": 61, + "keyType": { + "id": 59, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "57:7:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "Mapping", + "src": "49:25:1", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes_storage_$", + "typeString": "mapping(bytes32 => bytes)" + }, + "valueType": { + "id": 60, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "68:5:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + } + }, + "value": null, + "visibility": "public" + }, + { + "constant": false, + "id": 66, + "name": "signupsCount", + "nodeType": "VariableDeclaration", + "scope": 280, + "src": "90:44:1", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + }, + "typeName": { + "id": 65, + "keyType": { + "id": 63, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "98:7:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "Mapping", + "src": "90:24:1", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + }, + "valueType": { + "id": 64, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "109:4:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + }, + "value": null, + "visibility": "public" + }, + { + "constant": false, + "id": 70, + "name": "dbSignups", + "nodeType": "VariableDeclaration", + "scope": 280, + "src": "140:41:1", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + }, + "typeName": { + "id": 69, + "keyType": { + "id": 67, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "148:7:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "Mapping", + "src": "140:24:1", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + }, + "valueType": { + "id": 68, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "159:4:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + }, + "value": null, + "visibility": "public" + }, + { + "body": { + "id": 107, + "nodeType": "Block", + "src": "229:197:1", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 87, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 76, + "name": "dbSignups", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 70, + "src": "247:9:1", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + } + }, + "id": 85, + "indexExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 80, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 295, + "src": "284:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 81, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "284:10:1", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 82, + "name": "hash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 72, + "src": "296:4:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "expression": { + "argumentTypes": null, + "id": 78, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 282, + "src": "267:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 79, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "267:16:1", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 83, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "267:34:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 77, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 289, + "src": "257:9:1", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 84, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "257:45:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "247:56:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 86, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "307:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "247:61:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "416c7265616479207369676e75706564", + "id": 88, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "310:18:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_0f787a2da91c95ceebba72e41285d8837122ce3874f0bcdf553fa97876cf60b0", + "typeString": "literal_string \"Already signuped\"" + }, + "value": "Already signuped" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_0f787a2da91c95ceebba72e41285d8837122ce3874f0bcdf553fa97876cf60b0", + "typeString": "literal_string \"Already signuped\"" + } + ], + "id": 75, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 298, + 299 + ], + "referencedDeclaration": 299, + "src": "239:7:1", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 89, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "239:90:1", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 90, + "nodeType": "ExpressionStatement", + "src": "239:90:1" + }, + { + "expression": { + "argumentTypes": null, + "id": 105, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 91, + "name": "dbSignups", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 70, + "src": "340:9:1", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + } + }, + "id": 100, + "indexExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 95, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 295, + "src": "377:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 96, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "377:10:1", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 97, + "name": "hash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 72, + "src": "389:4:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "expression": { + "argumentTypes": null, + "id": 93, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 282, + "src": "360:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 94, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "360:16:1", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 98, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "360:34:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 92, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 289, + "src": "350:9:1", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 99, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "350:45:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "340:56:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 104, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": true, + "src": "399:20:1", + "subExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 101, + "name": "signupsCount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 66, + "src": "401:12:1", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + } + }, + "id": 103, + "indexExpression": { + "argumentTypes": null, + "id": 102, + "name": "hash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 72, + "src": "414:4:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "401:18:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "340:79:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 106, + "nodeType": "ExpressionStatement", + "src": "340:79:1" + } + ] + }, + "documentation": null, + "id": 108, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "signupSign", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 73, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 72, + "name": "hash", + "nodeType": "VariableDeclaration", + "scope": 108, + "src": "208:12:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 71, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "208:7:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "207:14:1" + }, + "returnParameters": { + "id": 74, + "nodeType": "ParameterList", + "parameters": [], + "src": "229:0:1" + }, + "scope": 280, + "src": "188:238:1", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 186, + "nodeType": "Block", + "src": "546:404:1", + "statements": [ + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 130, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 120, + "name": "dbSignups", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 70, + "src": "560:9:1", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + } + }, + "id": 128, + "indexExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 124, + "name": "validator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 115, + "src": "597:9:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 125, + "name": "hash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 110, + "src": "608:4:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "expression": { + "argumentTypes": null, + "id": 122, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 282, + "src": "580:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 123, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "580:16:1", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 126, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "580:33:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 121, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 289, + "src": "570:9:1", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 127, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "570:44:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "560:55:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 129, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "619:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "560:60:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 133, + "nodeType": "IfStatement", + "src": "556:86:1", + "trueBody": { + "expression": { + "argumentTypes": null, + "hexValue": "30", + "id": 131, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "641:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "functionReturnParameters": 119, + "id": 132, + "nodeType": "Return", + "src": "634:8:1" + } + }, + { + "assignments": [ + 135 + ], + "declarations": [ + { + "constant": false, + "id": 135, + "name": "id", + "nodeType": "VariableDeclaration", + "scope": 186, + "src": "652:7:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 134, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "652:4:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 137, + "initialValue": { + "argumentTypes": null, + "hexValue": "31", + "id": 136, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "662:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "nodeType": "VariableDeclarationStatement", + "src": "652:11:1" + }, + { + "body": { + "id": 182, + "nodeType": "Block", + "src": "718:207:1", + "statements": [ + { + "assignments": [ + 150 + ], + "declarations": [ + { + "constant": false, + "id": 150, + "name": "vid", + "nodeType": "VariableDeclaration", + "scope": 182, + "src": "732:8:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 149, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "732:4:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 162, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 151, + "name": "dbSignups", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 70, + "src": "743:9:1", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + } + }, + "id": 161, + "indexExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 155, + "name": "validators", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 113, + "src": "780:10:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "id": 157, + "indexExpression": { + "argumentTypes": null, + "id": 156, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 139, + "src": "791:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "780:13:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 158, + "name": "hash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 110, + "src": "795:4:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "expression": { + "argumentTypes": null, + "id": 153, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 282, + "src": "763:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 154, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "763:16:1", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 159, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "763:37:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 152, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 289, + "src": "753:9:1", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 160, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "753:48:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "743:59:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "732:70:1" + }, + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 177, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 165, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 163, + "name": "vid", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 150, + "src": "820:3:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 164, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "826:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "820:7:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 176, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 166, + "name": "vid", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 150, + "src": "831:3:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 167, + "name": "dbSignups", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 70, + "src": "837:9:1", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + } + }, + "id": 175, + "indexExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 171, + "name": "validator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 115, + "src": "874:9:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 172, + "name": "hash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 110, + "src": "885:4:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "expression": { + "argumentTypes": null, + "id": 169, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 282, + "src": "857:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 170, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "857:16:1", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 173, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "857:33:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 168, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 289, + "src": "847:9:1", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 174, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "847:44:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "837:55:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "831:61:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "820:72:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 181, + "nodeType": "IfStatement", + "src": "816:98:1", + "trueBody": { + "expression": { + "argumentTypes": null, + "id": 179, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "910:4:1", + "subExpression": { + "argumentTypes": null, + "id": 178, + "name": "id", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 135, + "src": "910:2:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 180, + "nodeType": "ExpressionStatement", + "src": "910:4:1" + } + } + ] + }, + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 145, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 142, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 139, + "src": "690:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 143, + "name": "validators", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 113, + "src": "694:10:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "id": 144, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "694:17:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "690:21:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 183, + "initializationExpression": { + "assignments": [ + 139 + ], + "declarations": [ + { + "constant": false, + "id": 139, + "name": "i", + "nodeType": "VariableDeclaration", + "scope": 183, + "src": "678:6:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 138, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "678:4:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 141, + "initialValue": { + "argumentTypes": null, + "hexValue": "30", + "id": 140, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "687:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "nodeType": "VariableDeclarationStatement", + "src": "678:10:1" + }, + "loopExpression": { + "expression": { + "argumentTypes": null, + "id": 147, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "713:3:1", + "subExpression": { + "argumentTypes": null, + "id": 146, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 139, + "src": "713:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 148, + "nodeType": "ExpressionStatement", + "src": "713:3:1" + }, + "nodeType": "ForStatement", + "src": "673:252:1" + }, + { + "expression": { + "argumentTypes": null, + "id": 184, + "name": "id", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 135, + "src": "941:2:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 119, + "id": 185, + "nodeType": "Return", + "src": "934:9:1" + } + ] + }, + "documentation": null, + "id": 187, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getSignupNumber", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 116, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 110, + "name": "hash", + "nodeType": "VariableDeclaration", + "scope": 187, + "src": "457:12:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 109, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "457:7:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 113, + "name": "validators", + "nodeType": "VariableDeclaration", + "scope": 187, + "src": "471:27:1", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[]" + }, + "typeName": { + "baseType": { + "id": 111, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "471:7:1", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 112, + "length": null, + "nodeType": "ArrayTypeName", + "src": "471:9:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 115, + "name": "validator", + "nodeType": "VariableDeclaration", + "scope": 187, + "src": "500:17:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 114, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "500:7:1", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "456:62:1" + }, + "returnParameters": { + "id": 119, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 118, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 187, + "src": "540:4:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 117, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "540:4:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "539:6:1" + }, + "scope": 280, + "src": "432:518:1", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 231, + "nodeType": "Block", + "src": "1074:235:1", + "statements": [ + { + "body": { + "id": 225, + "nodeType": "Block", + "src": "1129:147:1", + "statements": [ + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 218, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 211, + "name": "hash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 189, + "src": "1163:4:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "argumentTypes": null, + "id": 212, + "name": "validators", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 192, + "src": "1169:10:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 213, + "name": "validators", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 192, + "src": "1181:10:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "id": 215, + "indexExpression": { + "argumentTypes": null, + "id": 214, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 200, + "src": "1192:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "1181:13:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 210, + "name": "getSignupNumber", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 187, + "src": "1147:15:1", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_bytes32_$_t_array$_t_address_$dyn_memory_ptr_$_t_address_$returns$_t_uint256_$", + "typeString": "function (bytes32,address[] memory,address) view returns (uint256)" + } + }, + "id": 216, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1147:48:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 217, + "name": "signupNumber", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 194, + "src": "1199:12:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1147:64:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 224, + "nodeType": "IfStatement", + "src": "1143:123:1", + "trueBody": { + "id": 223, + "nodeType": "Block", + "src": "1213:53:1", + "statements": [ + { + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 219, + "name": "validators", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 192, + "src": "1238:10:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "id": 221, + "indexExpression": { + "argumentTypes": null, + "id": 220, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 200, + "src": "1249:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "1238:13:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "functionReturnParameters": 198, + "id": 222, + "nodeType": "Return", + "src": "1231:20:1" + } + ] + } + } + ] + }, + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 206, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 203, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 200, + "src": "1101:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 204, + "name": "validators", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 192, + "src": "1105:10:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "id": 205, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "1105:17:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1101:21:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 226, + "initializationExpression": { + "assignments": [ + 200 + ], + "declarations": [ + { + "constant": false, + "id": 200, + "name": "i", + "nodeType": "VariableDeclaration", + "scope": 226, + "src": "1089:6:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 199, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1089:4:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 202, + "initialValue": { + "argumentTypes": null, + "hexValue": "30", + "id": 201, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1098:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "nodeType": "VariableDeclarationStatement", + "src": "1089:10:1" + }, + "loopExpression": { + "expression": { + "argumentTypes": null, + "id": 208, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "1124:3:1", + "subExpression": { + "argumentTypes": null, + "id": 207, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 200, + "src": "1124:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 209, + "nodeType": "ExpressionStatement", + "src": "1124:3:1" + }, + "nodeType": "ForStatement", + "src": "1084:192:1" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "hexValue": "30", + "id": 228, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1300:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 227, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "1292:7:1", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 229, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1292:10:1", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "functionReturnParameters": 198, + "id": 230, + "nodeType": "Return", + "src": "1285:17:1" + } + ] + }, + "documentation": null, + "id": 232, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getSignupAddress", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 195, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 189, + "name": "hash", + "nodeType": "VariableDeclaration", + "scope": 232, + "src": "982:12:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 188, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "982:7:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 192, + "name": "validators", + "nodeType": "VariableDeclaration", + "scope": 232, + "src": "996:27:1", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[]" + }, + "typeName": { + "baseType": { + "id": 190, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "996:7:1", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 191, + "length": null, + "nodeType": "ArrayTypeName", + "src": "996:9:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 194, + "name": "signupNumber", + "nodeType": "VariableDeclaration", + "scope": 232, + "src": "1025:17:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 193, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1025:4:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "981:62:1" + }, + "returnParameters": { + "id": 198, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 197, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 232, + "src": "1065:7:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 196, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1065:7:1", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1064:9:1" + }, + "scope": 280, + "src": "956:353:1", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 255, + "nodeType": "Block", + "src": "1385:78:1", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 253, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 241, + "name": "db", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 62, + "src": "1395:2:1", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes_storage_$", + "typeString": "mapping(bytes32 => bytes storage ref)" + } + }, + "id": 251, + "indexExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 245, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 295, + "src": "1425:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 246, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "1425:10:1", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 247, + "name": "hash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 234, + "src": "1437:4:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "argumentTypes": null, + "id": 248, + "name": "key", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 236, + "src": "1443:3:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "expression": { + "argumentTypes": null, + "id": 243, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 282, + "src": "1408:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 244, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "1408:16:1", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 249, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1408:39:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 242, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 289, + "src": "1398:9:1", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 250, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1398:50:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "1395:54:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage", + "typeString": "bytes storage ref" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 252, + "name": "data", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 238, + "src": "1452:4:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "src": "1395:61:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage", + "typeString": "bytes storage ref" + } + }, + "id": 254, + "nodeType": "ExpressionStatement", + "src": "1395:61:1" + } + ] + }, + "documentation": null, + "id": 256, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "setData", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 239, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 234, + "name": "hash", + "nodeType": "VariableDeclaration", + "scope": 256, + "src": "1332:12:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 233, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1332:7:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 236, + "name": "key", + "nodeType": "VariableDeclaration", + "scope": 256, + "src": "1346:11:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 235, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1346:7:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 238, + "name": "data", + "nodeType": "VariableDeclaration", + "scope": 256, + "src": "1359:17:1", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 237, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "1359:5:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1331:46:1" + }, + "returnParameters": { + "id": 240, + "nodeType": "ParameterList", + "parameters": [], + "src": "1385:0:1" + }, + "scope": 280, + "src": "1315:148:1", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 278, + "nodeType": "Block", + "src": "1562:72:1", + "statements": [ + { + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 267, + "name": "db", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 62, + "src": "1579:2:1", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes_storage_$", + "typeString": "mapping(bytes32 => bytes storage ref)" + } + }, + "id": 276, + "indexExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 271, + "name": "from", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 258, + "src": "1609:4:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 272, + "name": "hash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 260, + "src": "1615:4:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "argumentTypes": null, + "id": 273, + "name": "key", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 262, + "src": "1621:3:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "expression": { + "argumentTypes": null, + "id": 269, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 282, + "src": "1592:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 270, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "1592:16:1", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 274, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1592:33:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 268, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 289, + "src": "1582:9:1", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 275, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1582:44:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "1579:48:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage", + "typeString": "bytes storage ref" + } + }, + "functionReturnParameters": 266, + "id": 277, + "nodeType": "Return", + "src": "1572:55:1" + } + ] + }, + "documentation": null, + "id": 279, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getData", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 263, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 258, + "name": "from", + "nodeType": "VariableDeclaration", + "scope": 279, + "src": "1486:12:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 257, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1486:7:1", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 260, + "name": "hash", + "nodeType": "VariableDeclaration", + "scope": 279, + "src": "1500:12:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 259, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1500:7:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 262, + "name": "key", + "nodeType": "VariableDeclaration", + "scope": 279, + "src": "1514:11:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 261, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1514:7:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1485:41:1" + }, + "returnParameters": { + "id": 266, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 265, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 279, + "src": "1548:12:1", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 264, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "1548:5:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1547:14:1" + }, + "scope": 280, + "src": "1469:165:1", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + } + ], + "scope": 281, + "src": "25:1611:1" + } + ], + "src": "0:1637:1" + }, + "compiler": { + "name": "solc", + "version": "0.5.9+commit.e560f70d.Emscripten.clang" + }, + "networks": { + "33": { + "events": {}, + "links": {}, + "address": "0xd5fE0D28e058D375b0b038fFbB446Da37E85fFdc", + "transactionHash": "0xfc024dbdc05c6deb0bd921701809dec226f03100b24e7a91d8de4ccb76467f21" + } + }, + "schemaVersion": "3.0.11", + "updatedAt": "2019-10-28T13:23:05.363Z", + "devdoc": { + "methods": {} + }, + "userdoc": { + "methods": {} + } +} \ No newline at end of file diff --git a/src/oracle/redis/Dockerfile b/src/oracle/redis/Dockerfile new file mode 100644 index 0000000..1c50b38 --- /dev/null +++ b/src/oracle/redis/Dockerfile @@ -0,0 +1,5 @@ +FROM redis:5.0.5-alpine + +COPY ./redis/redis.conf /usr/local/etc/redis/ + +CMD ["redis-server", "/usr/local/etc/redis/redis.conf"] diff --git a/src/oracle/configs/redis.conf b/src/oracle/redis/redis.conf similarity index 100% rename from src/oracle/configs/redis.conf rename to src/oracle/redis/redis.conf From 43cda189eacd271f1caa8fafc0005f839370467e Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Mon, 28 Oct 2019 19:14:57 +0300 Subject: [PATCH 024/129] Replaced mkdir with mkdir -p --- .circleci/config.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 24d16e7..4d73554 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -27,7 +27,7 @@ orbs: - run: name: "Backup blockchains data using temporary container" command: | - mkdir ./workspace + mkdir -p ./workspace docker run --rm -v "ganache_side_data:/ganache_side_data" -v "ganache_home_data:/ganache_home_data" -itd --name tmp alpine:3.9.4 docker cp "tmp:/ganache_side_data" "./workspace/ganache_side_data" docker cp "tmp:/ganache_home_data" "./workspace/ganache_home_data" @@ -55,13 +55,14 @@ orbs: - restore_cache: name: "Restore tss image from cache" key: "tss-v1-{{ .Branch }}" + - load_tss save_tss: description: "Save tss image to workspace" steps: - run: name: "Save tss image to archive" command: | - mkdir ./workspace + mkdir -p ./workspace docker save tss | gzip > ./workspace/tss.tar.gz - persist_to_workspace: name: "Save tss image to workspace" From ceb370a217871cab79ac30b9637e34d10ec66fc5 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Mon, 28 Oct 2019 21:22:48 +0300 Subject: [PATCH 025/129] Trying to figure out why eth watcher does not work properly on CI env --- .circleci/config.yml | 4 ++++ src/oracle/ethWatcher/ethWatcher.js | 3 +++ 2 files changed, 7 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4d73554..38627e7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -197,6 +197,10 @@ jobs: - run: name: "Run tests" command: docker start -a tests + - run: + name: "Check alive docker containers" + command: docker ps + when: always - bridge/save_artifacts workflows: version: 2 diff --git a/src/oracle/ethWatcher/ethWatcher.js b/src/oracle/ethWatcher/ethWatcher.js index cc4bb4f..9de806e 100644 --- a/src/oracle/ethWatcher/ethWatcher.js +++ b/src/oracle/ethWatcher/ethWatcher.js @@ -12,6 +12,8 @@ const abiBridge = require('./contracts_data/Bridge.json').abi const { HOME_RPC_URL, HOME_BRIDGE_ADDRESS, RABBITMQ_URL, HOME_START_BLOCK, VALIDATOR_PRIVATE_KEY } = process.env +logger.debug('%o', process.env) + const homeWeb3 = new Web3(HOME_RPC_URL) const bridge = new homeWeb3.eth.Contract(abiBridge, HOME_BRIDGE_ADDRESS) const validatorAddress = homeWeb3.eth.accounts.privateKeyToAccount(`0x${VALIDATOR_PRIVATE_KEY}`).address @@ -94,6 +96,7 @@ async function initialize () { blockNumber = saved foreignNonce[epoch] = parseInt(await redis.get(`foreignNonce${epoch}`)) || 0 } + logger.debug('Checking if current validator') isCurrentValidator = (await bridge.methods.getValidators().call()).includes(validatorAddress) if (isCurrentValidator) { logger.info(`${validatorAddress} is a current validator`) From cee521f079f6fb623ab69d0f78880110ac8c8180 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Mon, 28 Oct 2019 23:25:45 +0300 Subject: [PATCH 026/129] Trying to figure out why eth watcher does not work properly on CI env 2 --- src/oracle/ethWatcher/Dockerfile | 2 +- src/oracle/ethWatcher/ethWatcher.js | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/oracle/ethWatcher/Dockerfile b/src/oracle/ethWatcher/Dockerfile index fa11564..2eb0bfa 100644 --- a/src/oracle/ethWatcher/Dockerfile +++ b/src/oracle/ethWatcher/Dockerfile @@ -10,6 +10,6 @@ COPY ./ethWatcher/package.json /watcher/ RUN npm install COPY ./ethWatcher/ethWatcher.js ./shared/db.js ./shared/logger.js ./shared/amqp.js ./shared/crypto.js /watcher/ -COPY ./proxy/Bridge.json /watcher/contracts_data/ +COPY ./ethWatcher/Bridge.json /watcher/contracts_data/ ENTRYPOINT ["node", "ethWatcher.js"] diff --git a/src/oracle/ethWatcher/ethWatcher.js b/src/oracle/ethWatcher/ethWatcher.js index 9de806e..db444a0 100644 --- a/src/oracle/ethWatcher/ethWatcher.js +++ b/src/oracle/ethWatcher/ethWatcher.js @@ -10,9 +10,12 @@ const { publicKeyToAddress } = require('./crypto') const abiBridge = require('./contracts_data/Bridge.json').abi -const { HOME_RPC_URL, HOME_BRIDGE_ADDRESS, RABBITMQ_URL, HOME_START_BLOCK, VALIDATOR_PRIVATE_KEY } = process.env +logger.debug('%o', abiBridge) +setInterval(() => { + logger.debug("alive", 5000) +}) -logger.debug('%o', process.env) +const { HOME_RPC_URL, HOME_BRIDGE_ADDRESS, RABBITMQ_URL, HOME_START_BLOCK, VALIDATOR_PRIVATE_KEY } = process.env const homeWeb3 = new Web3(HOME_RPC_URL) const bridge = new homeWeb3.eth.Contract(abiBridge, HOME_BRIDGE_ADDRESS) From e29ea876f5f8c6980daa63e59c315ddfc658af7e Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Mon, 28 Oct 2019 23:29:58 +0300 Subject: [PATCH 027/129] Trying to figure out why eth watcher does not work properly on CI env 3 --- .circleci/config.yml | 2 ++ src/oracle/ethWatcher/ethWatcher.js | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 38627e7..527b6b9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -49,6 +49,8 @@ orbs: docker cp "./workspace/ganache_side_data" "tmp:/ganache_side_data" docker cp "./workspace/ganache_home_data" "tmp:/ganache_home_data" docker kill tmp + ls ./workspace/ganache_side_data + ls ./workspace/ganache_home_data restore_tss_image: description: "Restores tss image from cache" steps: diff --git a/src/oracle/ethWatcher/ethWatcher.js b/src/oracle/ethWatcher/ethWatcher.js index db444a0..9ffbe34 100644 --- a/src/oracle/ethWatcher/ethWatcher.js +++ b/src/oracle/ethWatcher/ethWatcher.js @@ -12,8 +12,8 @@ const abiBridge = require('./contracts_data/Bridge.json').abi logger.debug('%o', abiBridge) setInterval(() => { - logger.debug("alive", 5000) -}) + logger.debug("alive") +}, 5000) const { HOME_RPC_URL, HOME_BRIDGE_ADDRESS, RABBITMQ_URL, HOME_START_BLOCK, VALIDATOR_PRIVATE_KEY } = process.env From adbb1f09c746a194a427ee2740d2c2170e22951b Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Tue, 29 Oct 2019 12:41:41 +0300 Subject: [PATCH 028/129] Trying to figure out why eth watcher does not work properly on CI env 4 --- src/oracle/ethWatcher/ethWatcher.js | 14 +++++++++----- src/oracle/proxy/index.js | 7 +++++-- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/oracle/ethWatcher/ethWatcher.js b/src/oracle/ethWatcher/ethWatcher.js index 9ffbe34..b64b9ef 100644 --- a/src/oracle/ethWatcher/ethWatcher.js +++ b/src/oracle/ethWatcher/ethWatcher.js @@ -10,13 +10,17 @@ const { publicKeyToAddress } = require('./crypto') const abiBridge = require('./contracts_data/Bridge.json').abi -logger.debug('%o', abiBridge) -setInterval(() => { - logger.debug("alive") -}, 5000) - const { HOME_RPC_URL, HOME_BRIDGE_ADDRESS, RABBITMQ_URL, HOME_START_BLOCK, VALIDATOR_PRIVATE_KEY } = process.env +setInterval(() => { + axios.post(HOME_RPC_URL, { + jsonrpc: '2.0', + method: "eth_blockNumber", + params: [], + id: 1 + }).then(console.log, console.log) +}, 5000) + const homeWeb3 = new Web3(HOME_RPC_URL) const bridge = new homeWeb3.eth.Contract(abiBridge, HOME_BRIDGE_ADDRESS) const validatorAddress = homeWeb3.eth.accounts.privateKeyToAccount(`0x${VALIDATOR_PRIVATE_KEY}`).address diff --git a/src/oracle/proxy/index.js b/src/oracle/proxy/index.js index cc505a6..00eba0c 100644 --- a/src/oracle/proxy/index.js +++ b/src/oracle/proxy/index.js @@ -336,7 +336,7 @@ async function info (req, res) { ]) const foreignAddress = publicKeyToAddress({ x, y }) const balances = await getForeignBalances(foreignAddress) - res.send({ + const msg = { epoch, rangeSize, nextRangeSize, @@ -357,8 +357,11 @@ async function info (req, res) { votesForKeygen, votesForCancelKeygen, confirmationsForFundsTransfer - }) + } + logger.debug('%o', msg) + res.send(msg) } catch (e) { + logger.debug('%o', { message: 'Something went wrong, resend request', error: e }) res.send({ message: 'Something went wrong, resend request', error: e }) } logger.debug('Info end') From 935b8c87a8199afe2af661d950a545d7dbe2cc07 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Tue, 29 Oct 2019 13:19:32 +0300 Subject: [PATCH 029/129] Trying to figure out why eth watcher does not work properly on CI env 5 --- .circleci/config.yml | 2 -- demo/start-environment.sh | 4 ++-- src/oracle/ethWatcher/ethWatcher.js | 24 +++++++++++++++--------- tests/.mocharc.yml | 1 + 4 files changed, 18 insertions(+), 13 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 527b6b9..38627e7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -49,8 +49,6 @@ orbs: docker cp "./workspace/ganache_side_data" "tmp:/ganache_side_data" docker cp "./workspace/ganache_home_data" "tmp:/ganache_home_data" docker kill tmp - ls ./workspace/ganache_side_data - ls ./workspace/ganache_home_data restore_tss_image: description: "Restores tss image from cache" steps: diff --git a/demo/start-environment.sh b/demo/start-environment.sh index 2a3b775..760c6f3 100755 --- a/demo/start-environment.sh +++ b/demo/start-environment.sh @@ -22,7 +22,7 @@ start_dev_blockchain_networks() { docker run -d --network blockchain_side --rm --name ganache_side -v "ganache_side_data:/app/db" \ -p "7545:8545" \ trufflesuite/ganache-cli:latest \ - -m "shrug dwarf easily blade trigger lucky reopen cage lake scatter desk boat" -i 33 -q --db /app/db -b "$BLOCK_TIME" --noVMErrorsOnRPCResponse + -m "shrug dwarf easily blade trigger lucky reopen cage lake scatter desk boat" -i 33 --db /app/db -b "$BLOCK_TIME" --noVMErrorsOnRPCResponse echo "Starting home test blockchain" @@ -32,7 +32,7 @@ start_dev_blockchain_networks() { docker run -d --network blockchain_home --rm --name ganache_home -v "ganache_home_data:/app/db" \ -p "8545:8545" \ trufflesuite/ganache-cli:latest \ - -m "shrug dwarf easily blade trigger lucky reopen cage lake scatter desk boat" -i 44 -q --db /app/db -b "$BLOCK_TIME" --noVMErrorsOnRPCResponse + -m "shrug dwarf easily blade trigger lucky reopen cage lake scatter desk boat" -i 44 --db /app/db -b "$BLOCK_TIME" --noVMErrorsOnRPCResponse sleep 4 } diff --git a/src/oracle/ethWatcher/ethWatcher.js b/src/oracle/ethWatcher/ethWatcher.js index b64b9ef..3eb9878 100644 --- a/src/oracle/ethWatcher/ethWatcher.js +++ b/src/oracle/ethWatcher/ethWatcher.js @@ -12,14 +12,12 @@ const abiBridge = require('./contracts_data/Bridge.json').abi const { HOME_RPC_URL, HOME_BRIDGE_ADDRESS, RABBITMQ_URL, HOME_START_BLOCK, VALIDATOR_PRIVATE_KEY } = process.env -setInterval(() => { - axios.post(HOME_RPC_URL, { - jsonrpc: '2.0', - method: "eth_blockNumber", - params: [], - id: 1 - }).then(console.log, console.log) -}, 5000) +axios.post(HOME_RPC_URL, { + jsonrpc: '2.0', + method: 'eth_getCode', + params: [ HOME_BRIDGE_ADDRESS, 'latest' ], + id: 1 +}).then(x => console.log(x.data), console.log) const homeWeb3 = new Web3(HOME_RPC_URL) const bridge = new homeWeb3.eth.Contract(abiBridge, HOME_BRIDGE_ADDRESS) @@ -104,7 +102,15 @@ async function initialize () { foreignNonce[epoch] = parseInt(await redis.get(`foreignNonce${epoch}`)) || 0 } logger.debug('Checking if current validator') - isCurrentValidator = (await bridge.methods.getValidators().call()).includes(validatorAddress) + let currentValidators = [] + try { + logger.debug('1') + currentValidators = await bridge.methods.getValidators().call() + logger.debug('2') + } catch (e) { + logger.debug('%o', e) + } + isCurrentValidator = (currentValidators).includes(validatorAddress) if (isCurrentValidator) { logger.info(`${validatorAddress} is a current validator`) } else { diff --git a/tests/.mocharc.yml b/tests/.mocharc.yml index b43d42d..f085534 100644 --- a/tests/.mocharc.yml +++ b/tests/.mocharc.yml @@ -1,3 +1,4 @@ +exit: true reporter: mocha-multi-reporters reporter-option: - configFile=./reportersConfig.json From adba55bae00234118f4c07c609079d7ca40c4d16 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Tue, 29 Oct 2019 13:57:41 +0300 Subject: [PATCH 030/129] Added more debug logs --- .circleci/config.yml | 16 +++++++++++++++- src/oracle/ethWatcher/ethWatcher.js | 3 +++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 38627e7..1d40699 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -32,6 +32,10 @@ orbs: docker cp "tmp:/ganache_side_data" "./workspace/ganache_side_data" docker cp "tmp:/ganache_home_data" "./workspace/ganache_home_data" docker kill tmp + du -sh ./workspace/ganache_side_data + du -sh ./workspace/ganache_home_data + ls ./workspace/ganache_side_data + ls ./workspace/ganache_home_data - persist_to_workspace: root: ./workspace paths: @@ -43,6 +47,10 @@ orbs: - run: name: "Restore blockchains data from backup using temporary container" command: | + du -sh ./workspace/ganache_side_data + du -sh ./workspace/ganache_home_data + ls ./workspace/ganache_side_data + ls ./workspace/ganache_home_data docker volume create ganache_side_data docker volume create ganache_home_data docker run --rm -v "ganache_side_data:/ganache_side_data" -v "ganache_home_data:/ganache_home_data" -itd --name tmp alpine:3.9.4 @@ -149,8 +157,11 @@ jobs: - run: name: "Run dev environment, deploy contracts, prefund accounts" command: | - BLOCK_TIME=1 ./demo/start-environment.sh + BLOCK_TIME=3 ./demo/start-environment.sh cat ./tests/config.json | jq .users[].ethAddress | xargs -I {} ./src/test-services/ethereumSend/run.sh {} 100 + - run: + name: "Get bridge deployed code" + command: docker run --network blockchain_home --entrypoint ash appropriate/curl:latest -c "curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getCode","params":["0x44c158FE850821ae69DaF37AADF5c539e9d0025B", "latest"],"id":1} http://ganache_home:8545" - run: name: "Stop dev environment" command: docker kill ganache_side ganache_home @@ -177,6 +188,9 @@ jobs: N=2 ./demo/validator-demo.sh -d N=3 ./demo/validator-demo.sh -d docker ps + - run: + name: "Get bridge deployed code" + command: docker run --network blockchain_home --entrypoint ash appropriate/curl:latest -c "curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getCode","params":["0x44c158FE850821ae69DaF37AADF5c539e9d0025B", "latest"],"id":1} http://ganache_home:8545" - run: name: "Wait until validator nodes are ready" command: | diff --git a/src/oracle/ethWatcher/ethWatcher.js b/src/oracle/ethWatcher/ethWatcher.js index 3eb9878..b87f100 100644 --- a/src/oracle/ethWatcher/ethWatcher.js +++ b/src/oracle/ethWatcher/ethWatcher.js @@ -12,6 +12,7 @@ const abiBridge = require('./contracts_data/Bridge.json').abi const { HOME_RPC_URL, HOME_BRIDGE_ADDRESS, RABBITMQ_URL, HOME_START_BLOCK, VALIDATOR_PRIVATE_KEY } = process.env +logger.debug(`${HOME_RPC_URL} ${HOME_BRIDGE_ADDRESS}`) axios.post(HOME_RPC_URL, { jsonrpc: '2.0', method: 'eth_getCode', @@ -107,10 +108,12 @@ async function initialize () { logger.debug('1') currentValidators = await bridge.methods.getValidators().call() logger.debug('2') + logger.debug('%o', currentValidators) } catch (e) { logger.debug('%o', e) } isCurrentValidator = (currentValidators).includes(validatorAddress) + logger.debug(`${isCurrentValidator}`) if (isCurrentValidator) { logger.info(`${validatorAddress} is a current validator`) } else { From 4db5f2ac93b2ee98513cea78f3d448699530ddf5 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Tue, 29 Oct 2019 17:28:28 +0300 Subject: [PATCH 031/129] Added more debug logs 2 --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1d40699..7ab69ae 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -161,7 +161,7 @@ jobs: cat ./tests/config.json | jq .users[].ethAddress | xargs -I {} ./src/test-services/ethereumSend/run.sh {} 100 - run: name: "Get bridge deployed code" - command: docker run --network blockchain_home --entrypoint ash appropriate/curl:latest -c "curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getCode","params":["0x44c158FE850821ae69DaF37AADF5c539e9d0025B", "latest"],"id":1} http://ganache_home:8545" + command: docker run --network blockchain_home --entrypoint ash appropriate/curl:latest -c "curl -X POST --data \{\"jsonrpc\":\"2.0\",\"method\":\"eth_getCode\",\"params\":[\"0x44c158FE850821ae69DaF37AADF5c539e9d0025B\",\"latest\"],\"id\":1\} http://ganache_home:8545" - run: name: "Stop dev environment" command: docker kill ganache_side ganache_home @@ -190,7 +190,7 @@ jobs: docker ps - run: name: "Get bridge deployed code" - command: docker run --network blockchain_home --entrypoint ash appropriate/curl:latest -c "curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getCode","params":["0x44c158FE850821ae69DaF37AADF5c539e9d0025B", "latest"],"id":1} http://ganache_home:8545" + command: docker run --network blockchain_home --entrypoint ash appropriate/curl:latest -c "curl -X POST --data \{\"jsonrpc\":\"2.0\",\"method\":\"eth_getCode\",\"params\":[\"0x44c158FE850821ae69DaF37AADF5c539e9d0025B\",\"latest\"],\"id\":1\} http://ganache_home:8545" - run: name: "Wait until validator nodes are ready" command: | From de76a1aaadec9c47e6de6d556155258e0ccfc246 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Tue, 29 Oct 2019 18:24:38 +0300 Subject: [PATCH 032/129] Eth watcher should now work on ci env --- .circleci/config.yml | 25 ++++++------------------- src/oracle/ethWatcher/ethWatcher.js | 13 ++----------- src/oracle/proxy/index.js | 4 ++-- 3 files changed, 10 insertions(+), 32 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7ab69ae..0da713c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -27,15 +27,12 @@ orbs: - run: name: "Backup blockchains data using temporary container" command: | - mkdir -p ./workspace + mkdir -p ./workspace/ganache_side_data + mkdir -p ./workspace/ganache_home_data docker run --rm -v "ganache_side_data:/ganache_side_data" -v "ganache_home_data:/ganache_home_data" -itd --name tmp alpine:3.9.4 - docker cp "tmp:/ganache_side_data" "./workspace/ganache_side_data" - docker cp "tmp:/ganache_home_data" "./workspace/ganache_home_data" + docker cp "tmp:/ganache_side_data/." "./workspace/ganache_side_data" + docker cp "tmp:/ganache_home_data/." "./workspace/ganache_home_data" docker kill tmp - du -sh ./workspace/ganache_side_data - du -sh ./workspace/ganache_home_data - ls ./workspace/ganache_side_data - ls ./workspace/ganache_home_data - persist_to_workspace: root: ./workspace paths: @@ -47,15 +44,11 @@ orbs: - run: name: "Restore blockchains data from backup using temporary container" command: | - du -sh ./workspace/ganache_side_data - du -sh ./workspace/ganache_home_data - ls ./workspace/ganache_side_data - ls ./workspace/ganache_home_data docker volume create ganache_side_data docker volume create ganache_home_data docker run --rm -v "ganache_side_data:/ganache_side_data" -v "ganache_home_data:/ganache_home_data" -itd --name tmp alpine:3.9.4 - docker cp "./workspace/ganache_side_data" "tmp:/ganache_side_data" - docker cp "./workspace/ganache_home_data" "tmp:/ganache_home_data" + docker cp "./workspace/ganache_side_data/." "tmp:/ganache_side_data" + docker cp "./workspace/ganache_home_data/." "tmp:/ganache_home_data" docker kill tmp restore_tss_image: description: "Restores tss image from cache" @@ -159,9 +152,6 @@ jobs: command: | BLOCK_TIME=3 ./demo/start-environment.sh cat ./tests/config.json | jq .users[].ethAddress | xargs -I {} ./src/test-services/ethereumSend/run.sh {} 100 - - run: - name: "Get bridge deployed code" - command: docker run --network blockchain_home --entrypoint ash appropriate/curl:latest -c "curl -X POST --data \{\"jsonrpc\":\"2.0\",\"method\":\"eth_getCode\",\"params\":[\"0x44c158FE850821ae69DaF37AADF5c539e9d0025B\",\"latest\"],\"id\":1\} http://ganache_home:8545" - run: name: "Stop dev environment" command: docker kill ganache_side ganache_home @@ -188,9 +178,6 @@ jobs: N=2 ./demo/validator-demo.sh -d N=3 ./demo/validator-demo.sh -d docker ps - - run: - name: "Get bridge deployed code" - command: docker run --network blockchain_home --entrypoint ash appropriate/curl:latest -c "curl -X POST --data \{\"jsonrpc\":\"2.0\",\"method\":\"eth_getCode\",\"params\":[\"0x44c158FE850821ae69DaF37AADF5c539e9d0025B\",\"latest\"],\"id\":1\} http://ganache_home:8545" - run: name: "Wait until validator nodes are ready" command: | diff --git a/src/oracle/ethWatcher/ethWatcher.js b/src/oracle/ethWatcher/ethWatcher.js index b87f100..aec54e3 100644 --- a/src/oracle/ethWatcher/ethWatcher.js +++ b/src/oracle/ethWatcher/ethWatcher.js @@ -103,16 +103,7 @@ async function initialize () { foreignNonce[epoch] = parseInt(await redis.get(`foreignNonce${epoch}`)) || 0 } logger.debug('Checking if current validator') - let currentValidators = [] - try { - logger.debug('1') - currentValidators = await bridge.methods.getValidators().call() - logger.debug('2') - logger.debug('%o', currentValidators) - } catch (e) { - logger.debug('%o', e) - } - isCurrentValidator = (currentValidators).includes(validatorAddress) + isCurrentValidator = (await bridge.methods.getValidators().call()).includes(validatorAddress) logger.debug(`${isCurrentValidator}`) if (isCurrentValidator) { logger.info(`${validatorAddress} is a current validator`) @@ -183,7 +174,7 @@ initialize().then(async () => { while (true) { await main() } -}) +}, e => logger.warn('Initialization failed %o', e)) async function sendKeygen (event) { const newEpoch = event.returnValues.newEpoch.toNumber() diff --git a/src/oracle/proxy/index.js b/src/oracle/proxy/index.js index 00eba0c..8fb3454 100644 --- a/src/oracle/proxy/index.js +++ b/src/oracle/proxy/index.js @@ -358,10 +358,10 @@ async function info (req, res) { votesForCancelKeygen, confirmationsForFundsTransfer } - logger.debug('%o', msg) + logger.trace('%o', msg) res.send(msg) } catch (e) { - logger.debug('%o', { message: 'Something went wrong, resend request', error: e }) + logger.debug('%o', e) res.send({ message: 'Something went wrong, resend request', error: e }) } logger.debug('Info end') From 592663aeac95ee3637a4792b074a433e04a2e341 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Tue, 29 Oct 2019 18:47:21 +0300 Subject: [PATCH 033/129] Fixed unnecessary --rm --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0da713c..e14745e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -13,7 +13,7 @@ orbs: steps: - checkout - run: - name: "Initializing submodules" + name: "Initialize submodules" command: git submodule update --init setup_docker: description: "Set up remote docker engine" @@ -189,7 +189,7 @@ jobs: name: "Build and prepare tests container" command: | docker build -t tests ./tests - docker create --rm --env-file ./tests/.env -e FOREIGN_PRIVATE_KEY --name tests tests + docker create --env-file ./tests/.env -e FOREIGN_PRIVATE_KEY --name tests tests docker network connect blockchain_side tests docker network connect blockchain_home tests docker network connect validator1_test_network tests From 003a59c6aecce142c2245de13b6ecffd7b4fe0d9 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Tue, 29 Oct 2019 21:07:11 +0300 Subject: [PATCH 034/129] Wrote tests for removing validator --- tests/.mocharc.yml | 2 + tests/config.json | 5 ++ tests/test/bncToEth.js | 2 - tests/test/ethToBnc.js | 9 +--- tests/test/index.js | 109 ++++++++++++++++++++++++++++++++++++--- tests/test/utils/user.js | 2 + 6 files changed, 113 insertions(+), 16 deletions(-) diff --git a/tests/.mocharc.yml b/tests/.mocharc.yml index f085534..c7ff00a 100644 --- a/tests/.mocharc.yml +++ b/tests/.mocharc.yml @@ -1,4 +1,6 @@ exit: true +timeout: 60000 +bail: true reporter: mocha-multi-reporters reporter-option: - configFile=./reportersConfig.json diff --git a/tests/config.json b/tests/config.json index fa49f75..8307d15 100644 --- a/tests/config.json +++ b/tests/config.json @@ -15,5 +15,10 @@ "ethAddress": "0xad6c8127143032d843a260c5d379d8d9b3d51f15", "bncAddress": "tbnb12epcy4p7ktas0nlyrfuektcyh0e83dwzuq73f4" } + ], + "validators": [ + "0x99Eb3D86663c6Db090eFFdBC20510Ca9f836DCE3", + "0xAa006899B0EC407De930bA8A166DEfe59bBfd3DC", + "0x6352e3e6038e05b9da00C84AE851308f9774F883" ] } diff --git a/tests/test/bncToEth.js b/tests/test/bncToEth.js index 303ce4e..5d9d1fc 100644 --- a/tests/test/bncToEth.js +++ b/tests/test/bncToEth.js @@ -7,7 +7,6 @@ module.exports = (usersFunc, foreignBridgeAddressFunc) => { let ethBalances before(async function () { - this.timeout(60000) users = usersFunc() foreignBridgeAddress = foreignBridgeAddressFunc() ethBalances = await Promise.all(users.map(user => user.getEthBalance())) @@ -16,7 +15,6 @@ module.exports = (usersFunc, foreignBridgeAddressFunc) => { }) it('should make coorect exchange transactions on eth side', async function () { - this.timeout(60000) for (let i = 0; i < 3; i++) { do { const user = users[i] diff --git a/tests/test/ethToBnc.js b/tests/test/ethToBnc.js index 25a7fd3..f442263 100644 --- a/tests/test/ethToBnc.js +++ b/tests/test/ethToBnc.js @@ -2,8 +2,6 @@ const assert = require('assert') const { getSequence } = require('./utils/bncController') const { waitPromise } = require('./utils/wait') -const usersConfig = require('../config').users - const { HOME_BRIDGE_ADDRESS } = process.env module.exports = (usersFunc, foreignBridgeAddressFunc) => { @@ -15,7 +13,6 @@ module.exports = (usersFunc, foreignBridgeAddressFunc) => { let bncBridgeSequence before(async function () { - this.timeout(60000) users = usersFunc() foreignBridgeAddress = foreignBridgeAddressFunc() ethBalances = await Promise.all(users.map(user => user.getEthBalance())) @@ -26,11 +23,10 @@ module.exports = (usersFunc, foreignBridgeAddressFunc) => { }) it('should accept exchange requests', async function () { - this.timeout(60000) await Promise.all(users.map((user, i) => user.exchangeEth(5 + i))) const newEthBalances = await Promise.all(users.map(user => user.getEthBalance())) for (let i = 0; i < 3; i++) { - assert(newEthBalances[i] === ethBalances[i] - 5 - i, `Balance of ${usersConfig[i].ethAddress} did not updated as expected`) + assert.strictEqual(newEthBalances[i], ethBalances[i] - 5 - i, `Balance of ${users[i].ethAddress} did not updated as expected`) } }) @@ -40,10 +36,9 @@ module.exports = (usersFunc, foreignBridgeAddressFunc) => { }) it('should make correct exchange transaction', async function () { - this.timeout(60000) const newBncBalances = await Promise.all(users.map(user => user.getBncBalance())) for (let i = 0; i < 3; i++) { - assert(newBncBalances[i] === bncBalances[i] + 5 + i, `Balance of ${usersConfig[i].bncAddress} did not updated as expected`) + assert.strictEqual(newBncBalances[i], bncBalances[i] + 5 + i, `Balance of ${users[i].bncAddress} did not updated as expected`) } }) }) diff --git a/tests/test/index.js b/tests/test/index.js index a6dafec..0b3628b 100644 --- a/tests/test/index.js +++ b/tests/test/index.js @@ -1,43 +1,138 @@ +const assert = require('assert') + const createController = require('./utils/proxyController') const createUser = require('./utils/user') -const { waitPromise } = require('./utils/wait') +const { waitPromise, delay } = require('./utils/wait') +const { getBalance } = require('./utils/bncController') const testEthToBnc = require('./ethToBnc') const testBncToEth = require('./bncToEth') const usersConfig = require('../config').users +const validatorsConfig = require('../config').validators const { FOREIGN_PRIVATE_KEY } = process.env -let { getInfo } = createController(1) +const controller1 = createController(1) +const controller2 = createController(2) +const controller3 = createController(3) describe('bridge tests', function () { let users let foreignPrefundedUser let info + let prevForeignBridgeBalance + let prevForeignBridgeAddress - before(async function() { - this.timeout(60000) + before(async function () { users = await usersConfig.seqMap(user => createUser(user.privateKey)) }) describe('generation of initial epoch keys', function () { before(async function () { - this.timeout(60000) foreignPrefundedUser = await createUser(FOREIGN_PRIVATE_KEY) }) it('should generate keys', async function () { this.timeout(120000) - info = await waitPromise(getInfo, info => info.epoch === 1) + info = await waitPromise(controller1.getInfo, info => info.epoch === 1) }) after(async function () { - this.timeout(60000) await foreignPrefundedUser.transferBnc(info.foreignBridgeAddress, 50, 0.1) }) }) testEthToBnc(() => users, () => info.foreignBridgeAddress) testBncToEth(() => users, () => info.foreignBridgeAddress) + + describe('remove validator', function () { + before(function () { + prevForeignBridgeBalance = info.foreignBalanceTokens + prevForeignBridgeAddress = info.foreignBridgeAddress + }) + + it('should start voting process', async function () { + await controller1.voteStartVoting() + await delay(5000) + info = await controller1.getInfo() + assert.strictEqual(info.bridgeStatus, 'ready', 'Should not change state after one vote') + + await controller2.voteStartVoting() + info = await waitPromise(controller1.getInfo, info => info.bridgeStatus === 'voting') + assert.deepStrictEqual(info.epoch, 1, 'Current epoch is not set correctly') + assert.deepStrictEqual(info.nextEpoch, 2, 'Next epoch is not set correctly') + assert.deepStrictEqual(info.nextValidators, validatorsConfig, 'Next validators are not set correctly') + + await controller3.voteStartVoting() + await delay(5000) + info = await controller1.getInfo() + assert.strictEqual(info.bridgeStatus, 'voting', 'Should not do anything after third vote') + assert.deepStrictEqual(info.epoch, 1, 'Current epoch is not set correctly') + assert.deepStrictEqual(info.nextEpoch, 2, 'Next epoch is not set correctly') + assert.deepStrictEqual(info.nextValidators, validatorsConfig, 'Incorrect set of next validators after third vote') + }) + + it('should remove validator', async function () { + await controller1.voteRemoveValidator(validatorsConfig[1]) + await delay(5000) + info = await controller1.getInfo() + assert.strictEqual(info.bridgeStatus, 'voting', 'Should not change state after one vote') + assert.deepStrictEqual(info.validators, validatorsConfig, 'Validators are not set correctly') + assert.deepStrictEqual(info.nextValidators, validatorsConfig, 'Next validators are not set correctly') + + await controller2.voteRemoveValidator(validatorsConfig[1]) + info = await waitPromise(controller1.getInfo, info => info.nextValidators.length === 2) + assert.deepStrictEqual(info.validators, validatorsConfig, 'Validators are not set correctly') + assert.deepStrictEqual(info.nextValidators, [ validatorsConfig[0], validatorsConfig[2] ], 'Next validators are not set correctly') + + await controller3.voteRemoveValidator(validatorsConfig[1]) + await delay(5000) + info = await controller1.getInfo() + assert.strictEqual(info.bridgeStatus, 'voting', 'Should not do anything after third vote') + assert.deepStrictEqual(info.epoch, 1, 'Current epoch is not set correctly') + assert.deepStrictEqual(info.nextEpoch, 2, 'Next epoch is not set correctly') + assert.deepStrictEqual(info.validators, validatorsConfig, 'Validators are not set correctly') + assert.deepStrictEqual(info.nextValidators, [ validatorsConfig[0], validatorsConfig[2] ], 'Incorrect set of next validators after third vote') + }) + + it('should start keygen process', async function () { + await controller1.voteStartKeygen() + await delay(5000) + info = await controller1.getInfo() + assert.strictEqual(info.bridgeStatus, 'voting', 'Should not change state after one vote') + + await controller2.voteStartKeygen() + info = await waitPromise(controller1.getInfo, info => info.bridgeStatus === 'keygen') + + await controller3.voteStartKeygen() + await delay(5000) + info = await controller1.getInfo() + assert.strictEqual(info.bridgeStatus, 'keygen', 'Should not do anything after third vote') + assert.deepStrictEqual(info.epoch, 1, 'Current epoch is not set correctly') + assert.deepStrictEqual(info.nextEpoch, 2, 'Next epoch is not set correctly') + assert.deepStrictEqual(info.validators, validatorsConfig, 'Validators are not set correctly') + assert.deepStrictEqual(info.nextValidators, [ validatorsConfig[0], validatorsConfig[2] ], 'Incorrect set of next validators after third vote') + }) + + it('should finish keygen process and start funds transfer', async function () { + this.timeout(120000) + info = await waitPromise(controller1.getInfo, info => info.bridgeStatus === 'funds_transfer') + }) + + it('should transfer all funds to new account and start new epoch', async function () { + this.timeout(300000) + info = await waitPromise(controller1.getInfo, info => info.epoch === 2) + assert.deepStrictEqual(info.validators, [ validatorsConfig[0], validatorsConfig[2] ], 'Incorrect set of validators in epoch 2') + assert.strictEqual(info.nextEpoch, 2, 'Incorrect next epoch') + assert.strictEqual(info.bridgeStatus, 'ready', 'Incorrect bridge state in new epoch') + const prevBalance = await getBalance(prevForeignBridgeAddress) + const newBalance = await getBalance(info.foreignBridgeAddress) + assert.strictEqual(prevBalance, 0, "Did not transfer all funds") + assert.strictEqual(newBalance, prevForeignBridgeBalance, "Funds are lost somewhere") + }) + }) + + testEthToBnc(() => users, () => info.foreignBridgeAddress) + testBncToEth(() => users, () => info.foreignBridgeAddress) }) diff --git a/tests/test/utils/user.js b/tests/test/utils/user.js index c2889a3..8294581 100644 --- a/tests/test/utils/user.js +++ b/tests/test/utils/user.js @@ -21,6 +21,8 @@ module.exports = async function (privateKey) { const bncClient = await createBncClient(privateKey) return { + ethAddress, + bncAddress, getEthBalance: async function () { const balance = await token.balanceOf(ethAddress) return parseFloat(new BN(balance).dividedBy(10 ** 18).toFixed(8, 3)) From 5359ac8b3c071444ee8b81ae4eee6540a669168f Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Tue, 29 Oct 2019 23:46:18 +0300 Subject: [PATCH 035/129] Added delay before fetching data from bnc api, for consistency --- tests/test/bncToEth.js | 2 +- tests/test/ethToBnc.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/test/bncToEth.js b/tests/test/bncToEth.js index 5d9d1fc..4afb347 100644 --- a/tests/test/bncToEth.js +++ b/tests/test/bncToEth.js @@ -22,7 +22,7 @@ module.exports = (usersFunc, foreignBridgeAddressFunc) => { if (newEthBalance === ethBalances[i] + 3 + i) { break } - delay(500) + await delay(500) } while (true) } }) diff --git a/tests/test/ethToBnc.js b/tests/test/ethToBnc.js index f442263..5e81d5d 100644 --- a/tests/test/ethToBnc.js +++ b/tests/test/ethToBnc.js @@ -1,6 +1,6 @@ const assert = require('assert') const { getSequence } = require('./utils/bncController') -const { waitPromise } = require('./utils/wait') +const { waitPromise, delay } = require('./utils/wait') const { HOME_BRIDGE_ADDRESS } = process.env @@ -36,6 +36,7 @@ module.exports = (usersFunc, foreignBridgeAddressFunc) => { }) it('should make correct exchange transaction', async function () { + await delay(10000) const newBncBalances = await Promise.all(users.map(user => user.getBncBalance())) for (let i = 0; i < 3; i++) { assert.strictEqual(newBncBalances[i], bncBalances[i] + 5 + i, `Balance of ${users[i].bncAddress} did not updated as expected`) From e44b3915d197ee2a937f4fbbfcbb1f01a91a8c0d Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Wed, 30 Oct 2019 11:51:22 +0300 Subject: [PATCH 036/129] Fixed extra votes processing. Added delay before getting binance balance. --- src/oracle/proxy/index.js | 14 ++++++++------ src/oracle/proxy/sendTx.js | 2 +- tests/test/index.js | 4 +++- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/oracle/proxy/index.js b/src/oracle/proxy/index.js index 8fb3454..f1613e3 100644 --- a/src/oracle/proxy/index.js +++ b/src/oracle/proxy/index.js @@ -222,7 +222,8 @@ function parseError (message) { async function sendVote (query, req, res, waitFlag = false) { try { - let { txHash, gasLimit } = await homeSendQuery(query) + const sentQuery = await homeSendQuery(query) + let { txHash, gasLimit } = sentQuery if (txHash) { while (waitFlag) { const { status, gasUsed } = await waitForReceipt(HOME_RPC_URL, txHash) @@ -232,14 +233,16 @@ async function sendVote (query, req, res, waitFlag = false) { } if (gasLimit === gasUsed) { logger.info('Sending vote failed due to out of gas revert, retrying with more gas') - const nexTx = await homeSendQuery(query) - txHash = nexTx.txHash - gasLimit = nexTx.gasLimit + const nextTx = await homeSendQuery(query) + txHash = nextTx.txHash + gasLimit = nextTx.gasLimit } else { logger.warn(`Vote tx was reverted, txHash ${txHash}`) break } } + } + if (sentQuery) { res.send('Voted\n') logger.info('Voted successfully') } else { @@ -300,8 +303,7 @@ function decodeStatus (status) { } } - -function boundX(x) { +function boundX (x) { try { return x.toNumber() } catch (e) { diff --git a/src/oracle/proxy/sendTx.js b/src/oracle/proxy/sendTx.js index aa6b1d5..4d526eb 100644 --- a/src/oracle/proxy/sendTx.js +++ b/src/oracle/proxy/sendTx.js @@ -50,7 +50,7 @@ async function createSender (url, privateKey) { if (estimate.error) { logger.debug('Gas estimate failed %o', estimate.error) - return false + return true } const gasLimit = BN.min(new BN(estimate.result, 16).multipliedBy(GAS_LIMIT_FACTOR), MAX_GAS_LIMIT) tx.gasLimit = `0x${new BN(gasLimit).toString(16)}` diff --git a/tests/test/index.js b/tests/test/index.js index 0b3628b..17782e8 100644 --- a/tests/test/index.js +++ b/tests/test/index.js @@ -47,7 +47,8 @@ describe('bridge tests', function () { testBncToEth(() => users, () => info.foreignBridgeAddress) describe('remove validator', function () { - before(function () { + before(async function () { + info = await controller1.getInfo() prevForeignBridgeBalance = info.foreignBalanceTokens prevForeignBridgeAddress = info.foreignBridgeAddress }) @@ -126,6 +127,7 @@ describe('bridge tests', function () { assert.deepStrictEqual(info.validators, [ validatorsConfig[0], validatorsConfig[2] ], 'Incorrect set of validators in epoch 2') assert.strictEqual(info.nextEpoch, 2, 'Incorrect next epoch') assert.strictEqual(info.bridgeStatus, 'ready', 'Incorrect bridge state in new epoch') + await delay(5000) const prevBalance = await getBalance(prevForeignBridgeAddress) const newBalance = await getBalance(info.foreignBridgeAddress) assert.strictEqual(prevBalance, 0, "Did not transfer all funds") From ef1878a31a45e9fc6925f7e5769891940ddf319c Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Wed, 30 Oct 2019 16:53:43 +0300 Subject: [PATCH 037/129] Tests for removing/adding validators, changing threshold --- tests/test/addValidator.js | 100 +++++++++++++++++++++++ tests/test/bncToEth.js | 10 ++- tests/test/changeThreshold.js | 108 +++++++++++++++++++++++++ tests/test/ethToBnc.js | 12 +-- tests/test/index.js | 119 +++++----------------------- tests/test/removeValidator.js | 100 +++++++++++++++++++++++ tests/test/utils/bncController.js | 2 +- tests/test/utils/proxyController.js | 10 ++- 8 files changed, 349 insertions(+), 112 deletions(-) create mode 100644 tests/test/addValidator.js create mode 100644 tests/test/changeThreshold.js create mode 100644 tests/test/removeValidator.js diff --git a/tests/test/addValidator.js b/tests/test/addValidator.js new file mode 100644 index 0000000..8bfa320 --- /dev/null +++ b/tests/test/addValidator.js @@ -0,0 +1,100 @@ +const assert = require('assert') + +const { waitPromise, delay } = require('./utils/wait') +const { getBalance } = require('./utils/bncController') + +const { controller1, controller3 } = require('./utils/proxyController') + +module.exports = newValidator => { + describe('add validator', function () { + let info + let initialInfo + let nextValidators + + before(async function () { + initialInfo = info = await controller1.getInfo() + nextValidators = [ ...initialInfo.validators, newValidator ] + }) + + it('should start voting process', async function () { + await controller1.voteStartVoting() + await delay(5000) + info = await controller1.getInfo() + assert.strictEqual(info.bridgeStatus, 'ready', 'Should not change state after one vote') + + await controller3.voteStartVoting() + info = await waitPromise(controller1.getInfo, info => info.bridgeStatus === 'voting') + assert.deepStrictEqual(info.epoch, initialInfo.epoch, 'Current epoch is not set correctly') + assert.deepStrictEqual(info.nextEpoch, initialInfo.epoch + 1, 'Next epoch is not set correctly') + assert.deepStrictEqual(info.nextValidators, initialInfo.validators, 'Next validators are not set correctly') + + await controller3.voteStartVoting() + await delay(5000) + info = await controller1.getInfo() + assert.strictEqual(info.bridgeStatus, 'voting', 'Should not do anything after duplicate vote') + assert.deepStrictEqual(info.epoch, initialInfo.epoch, 'Current epoch is not set correctly') + assert.deepStrictEqual(info.nextEpoch, initialInfo.epoch + 1, 'Next epoch is not set correctly') + assert.deepStrictEqual(info.nextValidators, initialInfo.validators, 'Incorrect set of next validators after third vote') + }) + + it('should add validator', async function () { + await controller1.voteAddValidator(newValidator) + await delay(5000) + info = await controller1.getInfo() + assert.strictEqual(info.bridgeStatus, 'voting', 'Should not change state after one vote') + assert.deepStrictEqual(info.validators, initialInfo.validators, 'Validators are not set correctly') + assert.deepStrictEqual(info.nextValidators, initialInfo.validators, 'Next validators are not set correctly') + + await controller3.voteAddValidator(newValidator) + info = await waitPromise(controller1.getInfo, info => info.nextValidators.length === nextValidators.length) + assert.deepStrictEqual(info.validators, initialInfo.validators, 'Validators are not set correctly') + assert.deepStrictEqual(info.nextValidators, nextValidators, 'Next validators are not set correctly') + + await controller3.voteAddValidator(newValidator) + await delay(5000) + info = await controller1.getInfo() + assert.strictEqual(info.bridgeStatus, 'voting', 'Should not do anything after duplicate vote') + assert.deepStrictEqual(info.epoch, initialInfo.epoch, 'Current epoch is not set correctly') + assert.deepStrictEqual(info.nextEpoch, initialInfo.epoch + 1, 'Next epoch is not set correctly') + assert.deepStrictEqual(info.validators, initialInfo.validators, 'Validators are not set correctly') + assert.deepStrictEqual(info.nextValidators, nextValidators, 'Incorrect set of next validators after third vote') + }) + + it('should start keygen process', async function () { + await controller1.voteStartKeygen() + await delay(5000) + info = await controller1.getInfo() + assert.strictEqual(info.bridgeStatus, 'voting', 'Should not change state after one vote') + + await controller3.voteStartKeygen() + info = await waitPromise(controller1.getInfo, info => info.bridgeStatus === 'keygen') + + await controller3.voteStartKeygen() + await delay(5000) + info = await controller1.getInfo() + assert.strictEqual(info.bridgeStatus, 'keygen', 'Should not do anything after duplicate vote') + assert.deepStrictEqual(info.epoch, initialInfo.epoch, 'Current epoch is not set correctly') + assert.deepStrictEqual(info.nextEpoch, initialInfo.epoch + 1, 'Next epoch is not set correctly') + assert.deepStrictEqual(info.validators, initialInfo.validators, 'Validators are not set correctly') + assert.deepStrictEqual(info.nextValidators, nextValidators, 'Incorrect set of next validators after third vote') + }) + + it('should finish keygen process and start funds transfer', async function () { + this.timeout(120000) + info = await waitPromise(controller1.getInfo, info => info.bridgeStatus === 'funds_transfer') + }) + + it('should transfer all funds to new account and start new epoch', async function () { + this.timeout(300000) + info = await waitPromise(controller1.getInfo, info => info.epoch === initialInfo.epoch + 1) + assert.deepStrictEqual(info.validators, nextValidators, 'Incorrect set of validators in new epoch') + assert.strictEqual(info.nextEpoch, initialInfo.epoch + 1, 'Incorrect next epoch') + assert.strictEqual(info.bridgeStatus, 'ready', 'Incorrect bridge state in new epoch') + await delay(5000) + const prevBalance = await getBalance(initialInfo.foreignBridgeAddress) + const newBalance = await getBalance(info.foreignBridgeAddress) + assert.strictEqual(prevBalance, 0, 'Did not transfer all funds') + assert.strictEqual(newBalance, initialInfo.foreignBalanceTokens, 'Funds are lost somewhere') + }) + }) +} diff --git a/tests/test/bncToEth.js b/tests/test/bncToEth.js index 4afb347..1587a87 100644 --- a/tests/test/bncToEth.js +++ b/tests/test/bncToEth.js @@ -1,17 +1,19 @@ const { delay } = require('./utils/wait') -module.exports = (usersFunc, foreignBridgeAddressFunc) => { +const { controller1 } = require('./utils/proxyController') + +module.exports = usersFunc => { describe('exchange of tokens in bnc => eth direction', function () { let users - let foreignBridgeAddress + let info let ethBalances before(async function () { users = usersFunc() - foreignBridgeAddress = foreignBridgeAddressFunc() + info = await controller1.getInfo() ethBalances = await Promise.all(users.map(user => user.getEthBalance())) - await Promise.all(users.map((user, i) => user.exchangeBnc(foreignBridgeAddress, 3 + i))) + await Promise.all(users.map((user, i) => user.exchangeBnc(info.foreignBridgeAddress, 3 + i))) }) it('should make coorect exchange transactions on eth side', async function () { diff --git a/tests/test/changeThreshold.js b/tests/test/changeThreshold.js new file mode 100644 index 0000000..0d3baaf --- /dev/null +++ b/tests/test/changeThreshold.js @@ -0,0 +1,108 @@ +const assert = require('assert') + +const { waitPromise, delay } = require('./utils/wait') +const { getBalance } = require('./utils/bncController') + +const { controller1, controller2, controller3 } = require('./utils/proxyController') + +module.exports = newThreshold => { + describe('change threshold', function () { + let info + let initialInfo + + before(async function () { + initialInfo = info = await controller1.getInfo() + }) + + it('should start voting process', async function () { + await controller1.voteStartVoting() + await delay(5000) + info = await controller1.getInfo() + assert.strictEqual(info.bridgeStatus, 'ready', 'Should not change state after one vote') + + await controller2.voteStartVoting() + info = await waitPromise(controller1.getInfo, info => info.bridgeStatus === 'voting') + assert.deepStrictEqual(info.epoch, initialInfo.epoch, 'Current epoch is not set correctly') + assert.deepStrictEqual(info.nextEpoch, initialInfo.epoch + 1, 'Next epoch is not set correctly') + assert.deepStrictEqual(info.nextValidators, initialInfo.validators, 'Next validators are not set correctly') + + await controller3.voteStartVoting() + await delay(5000) + info = await controller1.getInfo() + assert.strictEqual(info.bridgeStatus, 'voting', 'Should not do anything after third vote') + assert.deepStrictEqual(info.epoch, initialInfo.epoch, 'Current epoch is not set correctly') + assert.deepStrictEqual(info.nextEpoch, initialInfo.epoch + 1, 'Next epoch is not set correctly') + assert.deepStrictEqual(info.nextValidators, initialInfo.validators, 'Incorrect set of next validators after third vote') + }) + + it('should change threshold', async function () { + await controller1.voteChangeThreshold(newThreshold) + await delay(5000) + info = await controller1.getInfo() + assert.strictEqual(info.bridgeStatus, 'voting', 'Should not change state after one vote') + assert.deepStrictEqual(info.validators, initialInfo.validators, 'Validators are not set correctly') + assert.deepStrictEqual(info.nextValidators, initialInfo.validators, 'Next validators are not set correctly') + assert.deepStrictEqual(info.threshold, initialInfo.threshold, 'Threshold not set correctly') + assert.deepStrictEqual(info.nextThreshold, initialInfo.threshold, 'Next threshold is not set correctly') + + await controller2.voteChangeThreshold(newThreshold) + info = await waitPromise(controller1.getInfo, info => info.nextValidators.length === nextValidators.length) + assert.deepStrictEqual(info.validators, initialInfo.validators, 'Validators are not set correctly') + assert.deepStrictEqual(info.nextValidators, initialInfo.validators, 'Next validators are not set correctly') + assert.deepStrictEqual(info.threshold, initialInfo.threshold, 'Threshold not set correctly') + assert.deepStrictEqual(info.nextThreshold, newThreshold, 'Next threshold is not set correctly') + + await controller3.voteChangeThreshold(newThreshold) + await delay(5000) + info = await controller1.getInfo() + assert.strictEqual(info.bridgeStatus, 'voting', 'Should not do anything after third vote') + assert.deepStrictEqual(info.epoch, initialInfo.epoch, 'Current epoch is not set correctly') + assert.deepStrictEqual(info.nextEpoch, initialInfo.epoch + 1, 'Next epoch is not set correctly') + assert.deepStrictEqual(info.validators, initialInfo.validators, 'Validators are not set correctly') + assert.deepStrictEqual(info.nextValidators, initialInfo.validators, 'Incorrect set of next validators after third vote') + assert.deepStrictEqual(info.threshold, initialInfo.threshold, 'Threshold not set correctly') + assert.deepStrictEqual(info.nextThreshold, newThreshold, 'Next threshold is not set correctly') + }) + + it('should start keygen process', async function () { + await controller1.voteStartKeygen() + await delay(5000) + info = await controller1.getInfo() + assert.strictEqual(info.bridgeStatus, 'voting', 'Should not change state after one vote') + + await controller2.voteStartKeygen() + info = await waitPromise(controller1.getInfo, info => info.bridgeStatus === 'keygen') + + await controller3.voteStartKeygen() + await delay(5000) + info = await controller1.getInfo() + assert.strictEqual(info.bridgeStatus, 'keygen', 'Should not do anything after third vote') + assert.deepStrictEqual(info.epoch, initialInfo.epoch, 'Current epoch is not set correctly') + assert.deepStrictEqual(info.nextEpoch, initialInfo.epoch + 1, 'Next epoch is not set correctly') + assert.deepStrictEqual(info.validators, initialInfo.validators, 'Validators are not set correctly') + assert.deepStrictEqual(info.nextValidators, initialInfo.validators, 'Incorrect set of next validators after third vote') + assert.deepStrictEqual(info.threshold, initialInfo.threshold, 'Threshold not set correctly') + assert.deepStrictEqual(info.nextThreshold, newThreshold, 'Next threshold is not set correctly') + }) + + it('should finish keygen process and start funds transfer', async function () { + this.timeout(120000) + info = await waitPromise(controller1.getInfo, info => info.bridgeStatus === 'funds_transfer') + }) + + it('should transfer all funds to new account and start new epoch', async function () { + this.timeout(300000) + info = await waitPromise(controller1.getInfo, info => info.epoch === initialInfo.epoch + 1) + assert.deepStrictEqual(info.validators, initialInfo.validators, 'Incorrect set of validators in new epoch') + assert.strictEqual(info.nextEpoch, initialInfo.epoch + 1, 'Incorrect next epoch') + assert.strictEqual(info.bridgeStatus, 'ready', 'Incorrect bridge state in new epoch') + assert.deepStrictEqual(info.threshold, newThreshold, 'Threshold not set correctly') + assert.deepStrictEqual(info.nextThreshold, newThreshold, 'Next threshold is not set correctly') + await delay(5000) + const prevBalance = await getBalance(initialInfo.foreignBridgeAddress) + const newBalance = await getBalance(info.foreignBridgeAddress) + assert.strictEqual(prevBalance, 0, 'Did not transfer all funds') + assert.strictEqual(newBalance, initialInfo.foreignBalanceTokens, 'Funds are lost somewhere') + }) + }) +} diff --git a/tests/test/ethToBnc.js b/tests/test/ethToBnc.js index 5e81d5d..461b92f 100644 --- a/tests/test/ethToBnc.js +++ b/tests/test/ethToBnc.js @@ -4,21 +4,23 @@ const { waitPromise, delay } = require('./utils/wait') const { HOME_BRIDGE_ADDRESS } = process.env -module.exports = (usersFunc, foreignBridgeAddressFunc) => { +const { controller1 } = require('./utils/proxyController') + +module.exports = usersFunc => { describe('exchange of tokens in eth => bnc direction', function () { + let info let users - let foreignBridgeAddress let ethBalances let bncBalances let bncBridgeSequence before(async function () { users = usersFunc() - foreignBridgeAddress = foreignBridgeAddressFunc() + info = await controller1.getInfo() ethBalances = await Promise.all(users.map(user => user.getEthBalance())) bncBalances = await users.seqMap(user => user.getBncBalance()) - bncBridgeSequence = await getSequence(foreignBridgeAddress) + bncBridgeSequence = await getSequence(info.foreignBridgeAddress) await Promise.all(users.map((user, i) => user.approveEth(HOME_BRIDGE_ADDRESS, 5 + i))) }) @@ -32,7 +34,7 @@ module.exports = (usersFunc, foreignBridgeAddressFunc) => { it('should make exchange transaction on bnc side', async function () { this.timeout(300000) - await waitPromise(() => getSequence(foreignBridgeAddress), sequence => sequence === bncBridgeSequence + 1) + await waitPromise(() => getSequence(info.foreignBridgeAddress), sequence => sequence === bncBridgeSequence + 1) }) it('should make correct exchange transaction', async function () { diff --git a/tests/test/index.js b/tests/test/index.js index 17782e8..60a105c 100644 --- a/tests/test/index.js +++ b/tests/test/index.js @@ -1,34 +1,30 @@ -const assert = require('assert') - -const createController = require('./utils/proxyController') const createUser = require('./utils/user') -const { waitPromise, delay } = require('./utils/wait') -const { getBalance } = require('./utils/bncController') +const { waitPromise } = require('./utils/wait') const testEthToBnc = require('./ethToBnc') const testBncToEth = require('./bncToEth') +const testRemoveValidator = require('./removeValidator') +const testAddValidator = require('./addValidator') +const testChangeThreshold = require('./changeThreshold') const usersConfig = require('../config').users const validatorsConfig = require('../config').validators const { FOREIGN_PRIVATE_KEY } = process.env -const controller1 = createController(1) -const controller2 = createController(2) -const controller3 = createController(3) +const { controller1 } = require('./utils/proxyController') describe('bridge tests', function () { let users - let foreignPrefundedUser - let info - let prevForeignBridgeBalance - let prevForeignBridgeAddress before(async function () { users = await usersConfig.seqMap(user => createUser(user.privateKey)) }) describe('generation of initial epoch keys', function () { + let info + let foreignPrefundedUser + before(async function () { foreignPrefundedUser = await createUser(FOREIGN_PRIVATE_KEY) }) @@ -43,98 +39,21 @@ describe('bridge tests', function () { }) }) - testEthToBnc(() => users, () => info.foreignBridgeAddress) - testBncToEth(() => users, () => info.foreignBridgeAddress) + testEthToBnc(() => users) + testBncToEth(() => users) - describe('remove validator', function () { - before(async function () { - info = await controller1.getInfo() - prevForeignBridgeBalance = info.foreignBalanceTokens - prevForeignBridgeAddress = info.foreignBridgeAddress - }) + testRemoveValidator(validatorsConfig[1]) - it('should start voting process', async function () { - await controller1.voteStartVoting() - await delay(5000) - info = await controller1.getInfo() - assert.strictEqual(info.bridgeStatus, 'ready', 'Should not change state after one vote') + testEthToBnc(() => users) + testBncToEth(() => users) - await controller2.voteStartVoting() - info = await waitPromise(controller1.getInfo, info => info.bridgeStatus === 'voting') - assert.deepStrictEqual(info.epoch, 1, 'Current epoch is not set correctly') - assert.deepStrictEqual(info.nextEpoch, 2, 'Next epoch is not set correctly') - assert.deepStrictEqual(info.nextValidators, validatorsConfig, 'Next validators are not set correctly') + testAddValidator(validatorsConfig[1]) - await controller3.voteStartVoting() - await delay(5000) - info = await controller1.getInfo() - assert.strictEqual(info.bridgeStatus, 'voting', 'Should not do anything after third vote') - assert.deepStrictEqual(info.epoch, 1, 'Current epoch is not set correctly') - assert.deepStrictEqual(info.nextEpoch, 2, 'Next epoch is not set correctly') - assert.deepStrictEqual(info.nextValidators, validatorsConfig, 'Incorrect set of next validators after third vote') - }) + testEthToBnc(() => users) + testBncToEth(() => users) - it('should remove validator', async function () { - await controller1.voteRemoveValidator(validatorsConfig[1]) - await delay(5000) - info = await controller1.getInfo() - assert.strictEqual(info.bridgeStatus, 'voting', 'Should not change state after one vote') - assert.deepStrictEqual(info.validators, validatorsConfig, 'Validators are not set correctly') - assert.deepStrictEqual(info.nextValidators, validatorsConfig, 'Next validators are not set correctly') + testChangeThreshold(2) - await controller2.voteRemoveValidator(validatorsConfig[1]) - info = await waitPromise(controller1.getInfo, info => info.nextValidators.length === 2) - assert.deepStrictEqual(info.validators, validatorsConfig, 'Validators are not set correctly') - assert.deepStrictEqual(info.nextValidators, [ validatorsConfig[0], validatorsConfig[2] ], 'Next validators are not set correctly') - - await controller3.voteRemoveValidator(validatorsConfig[1]) - await delay(5000) - info = await controller1.getInfo() - assert.strictEqual(info.bridgeStatus, 'voting', 'Should not do anything after third vote') - assert.deepStrictEqual(info.epoch, 1, 'Current epoch is not set correctly') - assert.deepStrictEqual(info.nextEpoch, 2, 'Next epoch is not set correctly') - assert.deepStrictEqual(info.validators, validatorsConfig, 'Validators are not set correctly') - assert.deepStrictEqual(info.nextValidators, [ validatorsConfig[0], validatorsConfig[2] ], 'Incorrect set of next validators after third vote') - }) - - it('should start keygen process', async function () { - await controller1.voteStartKeygen() - await delay(5000) - info = await controller1.getInfo() - assert.strictEqual(info.bridgeStatus, 'voting', 'Should not change state after one vote') - - await controller2.voteStartKeygen() - info = await waitPromise(controller1.getInfo, info => info.bridgeStatus === 'keygen') - - await controller3.voteStartKeygen() - await delay(5000) - info = await controller1.getInfo() - assert.strictEqual(info.bridgeStatus, 'keygen', 'Should not do anything after third vote') - assert.deepStrictEqual(info.epoch, 1, 'Current epoch is not set correctly') - assert.deepStrictEqual(info.nextEpoch, 2, 'Next epoch is not set correctly') - assert.deepStrictEqual(info.validators, validatorsConfig, 'Validators are not set correctly') - assert.deepStrictEqual(info.nextValidators, [ validatorsConfig[0], validatorsConfig[2] ], 'Incorrect set of next validators after third vote') - }) - - it('should finish keygen process and start funds transfer', async function () { - this.timeout(120000) - info = await waitPromise(controller1.getInfo, info => info.bridgeStatus === 'funds_transfer') - }) - - it('should transfer all funds to new account and start new epoch', async function () { - this.timeout(300000) - info = await waitPromise(controller1.getInfo, info => info.epoch === 2) - assert.deepStrictEqual(info.validators, [ validatorsConfig[0], validatorsConfig[2] ], 'Incorrect set of validators in epoch 2') - assert.strictEqual(info.nextEpoch, 2, 'Incorrect next epoch') - assert.strictEqual(info.bridgeStatus, 'ready', 'Incorrect bridge state in new epoch') - await delay(5000) - const prevBalance = await getBalance(prevForeignBridgeAddress) - const newBalance = await getBalance(info.foreignBridgeAddress) - assert.strictEqual(prevBalance, 0, "Did not transfer all funds") - assert.strictEqual(newBalance, prevForeignBridgeBalance, "Funds are lost somewhere") - }) - }) - - testEthToBnc(() => users, () => info.foreignBridgeAddress) - testBncToEth(() => users, () => info.foreignBridgeAddress) + testEthToBnc(() => users) + testBncToEth(() => users) }) diff --git a/tests/test/removeValidator.js b/tests/test/removeValidator.js new file mode 100644 index 0000000..c5377bb --- /dev/null +++ b/tests/test/removeValidator.js @@ -0,0 +1,100 @@ +const assert = require('assert') + +const { waitPromise, delay } = require('./utils/wait') +const { getBalance } = require('./utils/bncController') + +const { controller1, controller2, controller3 } = require('./utils/proxyController') + +module.exports = oldValidator => { + describe('remove validator', function () { + let info + let initialInfo + let nextValidators + + before(async function () { + initialInfo = info = await controller1.getInfo() + nextValidators = initialInfo.validators.filter(validator => validator !== oldValidator) + }) + + it('should start voting process', async function () { + await controller1.voteStartVoting() + await delay(5000) + info = await controller1.getInfo() + assert.strictEqual(info.bridgeStatus, 'ready', 'Should not change state after one vote') + + await controller2.voteStartVoting() + info = await waitPromise(controller1.getInfo, info => info.bridgeStatus === 'voting') + assert.deepStrictEqual(info.epoch, initialInfo.epoch, 'Current epoch is not set correctly') + assert.deepStrictEqual(info.nextEpoch, initialInfo.epoch + 1, 'Next epoch is not set correctly') + assert.deepStrictEqual(info.nextValidators, initialInfo.validators, 'Next validators are not set correctly') + + await controller3.voteStartVoting() + await delay(5000) + info = await controller1.getInfo() + assert.strictEqual(info.bridgeStatus, 'voting', 'Should not do anything after third vote') + assert.deepStrictEqual(info.epoch, initialInfo.epoch, 'Current epoch is not set correctly') + assert.deepStrictEqual(info.nextEpoch, initialInfo.epoch + 1, 'Next epoch is not set correctly') + assert.deepStrictEqual(info.nextValidators, initialInfo.validators, 'Incorrect set of next validators after third vote') + }) + + it('should remove validator', async function () { + await controller1.voteRemoveValidator(oldValidator) + await delay(5000) + info = await controller1.getInfo() + assert.strictEqual(info.bridgeStatus, 'voting', 'Should not change state after one vote') + assert.deepStrictEqual(info.validators, initialInfo.validators, 'Validators are not set correctly') + assert.deepStrictEqual(info.nextValidators, initialInfo.validators, 'Next validators are not set correctly') + + await controller2.voteRemoveValidator(oldValidator) + info = await waitPromise(controller1.getInfo, info => info.nextValidators.length === nextValidators.length) + assert.deepStrictEqual(info.validators, initialInfo.validators, 'Validators are not set correctly') + assert.deepStrictEqual(info.nextValidators, nextValidators, 'Next validators are not set correctly') + + await controller3.voteRemoveValidator(oldValidator) + await delay(5000) + info = await controller1.getInfo() + assert.strictEqual(info.bridgeStatus, 'voting', 'Should not do anything after third vote') + assert.deepStrictEqual(info.epoch, initialInfo.epoch, 'Current epoch is not set correctly') + assert.deepStrictEqual(info.nextEpoch, initialInfo.epoch + 1, 'Next epoch is not set correctly') + assert.deepStrictEqual(info.validators, initialInfo.validators, 'Validators are not set correctly') + assert.deepStrictEqual(info.nextValidators, nextValidators, 'Incorrect set of next validators after third vote') + }) + + it('should start keygen process', async function () { + await controller1.voteStartKeygen() + await delay(5000) + info = await controller1.getInfo() + assert.strictEqual(info.bridgeStatus, 'voting', 'Should not change state after one vote') + + await controller2.voteStartKeygen() + info = await waitPromise(controller1.getInfo, info => info.bridgeStatus === 'keygen') + + await controller3.voteStartKeygen() + await delay(5000) + info = await controller1.getInfo() + assert.strictEqual(info.bridgeStatus, 'keygen', 'Should not do anything after third vote') + assert.deepStrictEqual(info.epoch, initialInfo.epoch, 'Current epoch is not set correctly') + assert.deepStrictEqual(info.nextEpoch, initialInfo.epoch + 1, 'Next epoch is not set correctly') + assert.deepStrictEqual(info.validators, initialInfo.validators, 'Validators are not set correctly') + assert.deepStrictEqual(info.nextValidators, nextValidators, 'Incorrect set of next validators after third vote') + }) + + it('should finish keygen process and start funds transfer', async function () { + this.timeout(120000) + info = await waitPromise(controller1.getInfo, info => info.bridgeStatus === 'funds_transfer') + }) + + it('should transfer all funds to new account and start new epoch', async function () { + this.timeout(300000) + info = await waitPromise(controller1.getInfo, info => info.epoch === initialInfo.epoch + 1) + assert.deepStrictEqual(info.validators, nextValidators, 'Incorrect set of validators in new epoch') + assert.strictEqual(info.nextEpoch, initialInfo.epoch + 1, 'Incorrect next epoch') + assert.strictEqual(info.bridgeStatus, 'ready', 'Incorrect bridge state in new epoch') + await delay(5000) + const prevBalance = await getBalance(initialInfo.foreignBridgeAddress) + const newBalance = await getBalance(info.foreignBridgeAddress) + assert.strictEqual(prevBalance, 0, 'Did not transfer all funds') + assert.strictEqual(newBalance, initialInfo.foreignBalanceTokens, 'Funds are lost somewhere') + }) + }) +} diff --git a/tests/test/utils/bncController.js b/tests/test/utils/bncController.js index 589b4a4..99845cd 100644 --- a/tests/test/utils/bncController.js +++ b/tests/test/utils/bncController.js @@ -4,7 +4,7 @@ const { FOREIGN_URL, FOREIGN_ASSET } = process.env const bnc = axios.create({ baseURL: FOREIGN_URL, - timeout: 5000 + timeout: 15000 }) module.exports = { diff --git a/tests/test/utils/proxyController.js b/tests/test/utils/proxyController.js index 1000a5a..b9492c4 100644 --- a/tests/test/utils/proxyController.js +++ b/tests/test/utils/proxyController.js @@ -1,11 +1,11 @@ const axios = require('axios') -module.exports = function (validatorId) { +function createController (validatorId) { const url = `http://validator${validatorId}_proxy_1:8002/` const proxy = axios.create({ baseURL: url, - timeout: 5000 + timeout: 10000 }) return { @@ -29,3 +29,9 @@ module.exports = function (validatorId) { } } } + +module.exports = { + controller1: createController(1), + controller2: createController(2), + controller3: createController(3) +} From e8e42429fb0bc9950f1c1cccb64c3e839b5239db Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Wed, 30 Oct 2019 16:54:09 +0300 Subject: [PATCH 038/129] Removed useless debug output --- src/oracle/ethWatcher/ethWatcher.js | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/oracle/ethWatcher/ethWatcher.js b/src/oracle/ethWatcher/ethWatcher.js index aec54e3..ca9fea6 100644 --- a/src/oracle/ethWatcher/ethWatcher.js +++ b/src/oracle/ethWatcher/ethWatcher.js @@ -12,14 +12,6 @@ const abiBridge = require('./contracts_data/Bridge.json').abi const { HOME_RPC_URL, HOME_BRIDGE_ADDRESS, RABBITMQ_URL, HOME_START_BLOCK, VALIDATOR_PRIVATE_KEY } = process.env -logger.debug(`${HOME_RPC_URL} ${HOME_BRIDGE_ADDRESS}`) -axios.post(HOME_RPC_URL, { - jsonrpc: '2.0', - method: 'eth_getCode', - params: [ HOME_BRIDGE_ADDRESS, 'latest' ], - id: 1 -}).then(x => console.log(x.data), console.log) - const homeWeb3 = new Web3(HOME_RPC_URL) const bridge = new homeWeb3.eth.Contract(abiBridge, HOME_BRIDGE_ADDRESS) const validatorAddress = homeWeb3.eth.accounts.privateKeyToAccount(`0x${VALIDATOR_PRIVATE_KEY}`).address @@ -104,7 +96,6 @@ async function initialize () { } logger.debug('Checking if current validator') isCurrentValidator = (await bridge.methods.getValidators().call()).includes(validatorAddress) - logger.debug(`${isCurrentValidator}`) if (isCurrentValidator) { logger.info(`${validatorAddress} is a current validator`) } else { From cd4928b506474cd80c1cf2ee31499636c6592f2d Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Wed, 30 Oct 2019 16:54:44 +0300 Subject: [PATCH 039/129] Fixed incorrect vote counting for startVoting function --- src/deploy/deploy-home/contracts/Bridge.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/deploy/deploy-home/contracts/Bridge.sol b/src/deploy/deploy-home/contracts/Bridge.sol index da3fe37..a964c28 100644 --- a/src/deploy/deploy-home/contracts/Bridge.sol +++ b/src/deploy/deploy-home/contracts/Bridge.sol @@ -243,7 +243,7 @@ contract Bridge { } function startVoting() public readyOrVoting currentValidator { - if (tryVote(Vote.START_VOTING)) { + if (tryVote(Vote.START_VOTING, epoch)) { nextEpoch++; status = Status.VOTING; states[nextEpoch].threshold = getThreshold(); From 796a0db2d2f057f3f47377db3197398a892e0a1e Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Wed, 30 Oct 2019 16:59:54 +0300 Subject: [PATCH 040/129] Increased timeout for bnc => eth transfers --- tests/test/bncToEth.js | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test/bncToEth.js b/tests/test/bncToEth.js index 1587a87..7da42d3 100644 --- a/tests/test/bncToEth.js +++ b/tests/test/bncToEth.js @@ -17,6 +17,7 @@ module.exports = usersFunc => { }) it('should make coorect exchange transactions on eth side', async function () { + this.timeout(180000) for (let i = 0; i < 3; i++) { do { const user = users[i] From 5557fda6a3b3dd216ed8bac24ce9b89b738bc8dc Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Wed, 30 Oct 2019 20:40:33 +0300 Subject: [PATCH 041/129] Change dev log level to trace, fixed unnecessary update of nonce on failed gas estimate --- demo/validator1/.env.development | 2 +- demo/validator2/.env.development | 2 +- demo/validator3/.env.development | 2 +- src/oracle/proxy/index.js | 16 ++++++++++++---- src/oracle/proxy/sendTx.js | 2 +- 5 files changed, 16 insertions(+), 8 deletions(-) diff --git a/demo/validator1/.env.development b/demo/validator1/.env.development index a79e662..6b8e3c8 100644 --- a/demo/validator1/.env.development +++ b/demo/validator1/.env.development @@ -16,4 +16,4 @@ VOTES_PROXY_PORT=5001 SIGN_RESTART_PORT=6001 -LOG_LEVEL=debug +LOG_LEVEL=trace diff --git a/demo/validator2/.env.development b/demo/validator2/.env.development index 3e88317..c15297e 100644 --- a/demo/validator2/.env.development +++ b/demo/validator2/.env.development @@ -16,4 +16,4 @@ VOTES_PROXY_PORT=5002 SIGN_RESTART_PORT=6002 -LOG_LEVEL=debug +LOG_LEVEL=trace diff --git a/demo/validator3/.env.development b/demo/validator3/.env.development index 3454cd6..be25774 100644 --- a/demo/validator3/.env.development +++ b/demo/validator3/.env.development @@ -16,4 +16,4 @@ VOTES_PROXY_PORT=5003 SIGN_RESTART_PORT=6003 -LOG_LEVEL=debug +LOG_LEVEL=trace diff --git a/src/oracle/proxy/index.js b/src/oracle/proxy/index.js index f1613e3..99122a7 100644 --- a/src/oracle/proxy/index.js +++ b/src/oracle/proxy/index.js @@ -190,11 +190,15 @@ function sideSendQuery (query) { return lock.acquire('home', async () => { logger.debug('Sending side query') const encodedABI = query.encodeABI() - return await sideSender({ + const senderResponse = await sideSender({ data: encodedABI, to: SIDE_SHARED_DB_ADDRESS, - nonce: sideValidatorNonce++ + nonce: sideValidatorNonce }) + if (senderResponse !== true) { + sideValidatorNonce++ + } + return senderResponse }) } @@ -202,11 +206,15 @@ function homeSendQuery (query) { return lock.acquire('home', async () => { logger.debug('Sending home query') const encodedABI = query.encodeABI() - return await homeSender({ + const senderResponse = await homeSender({ data: encodedABI, to: HOME_BRIDGE_ADDRESS, - nonce: homeValidatorNonce++ + nonce: homeValidatorNonce }) + if (senderResponse !== true) { + homeValidatorNonce++ + } + return senderResponse }) } diff --git a/src/oracle/proxy/sendTx.js b/src/oracle/proxy/sendTx.js index 4d526eb..bba562a 100644 --- a/src/oracle/proxy/sendTx.js +++ b/src/oracle/proxy/sendTx.js @@ -49,7 +49,7 @@ async function createSender (url, privateKey) { } ]) if (estimate.error) { - logger.debug('Gas estimate failed %o', estimate.error) + logger.debug('Gas estimate failed %o, skipping tx, reverting nonce', estimate.error) return true } const gasLimit = BN.min(new BN(estimate.result, 16).multipliedBy(GAS_LIMIT_FACTOR), MAX_GAS_LIMIT) From 34ebbdc66e20b1c95e4923ed00fc16d8a0f21473 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Wed, 30 Oct 2019 21:23:04 +0300 Subject: [PATCH 042/129] Fixed threshold test typo --- tests/test/changeThreshold.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/test/changeThreshold.js b/tests/test/changeThreshold.js index 0d3baaf..eb65ec7 100644 --- a/tests/test/changeThreshold.js +++ b/tests/test/changeThreshold.js @@ -46,11 +46,10 @@ module.exports = newThreshold => { assert.deepStrictEqual(info.nextThreshold, initialInfo.threshold, 'Next threshold is not set correctly') await controller2.voteChangeThreshold(newThreshold) - info = await waitPromise(controller1.getInfo, info => info.nextValidators.length === nextValidators.length) + info = await waitPromise(controller1.getInfo, info => info.nextThreshold === newThreshold) assert.deepStrictEqual(info.validators, initialInfo.validators, 'Validators are not set correctly') assert.deepStrictEqual(info.nextValidators, initialInfo.validators, 'Next validators are not set correctly') assert.deepStrictEqual(info.threshold, initialInfo.threshold, 'Threshold not set correctly') - assert.deepStrictEqual(info.nextThreshold, newThreshold, 'Next threshold is not set correctly') await controller3.voteChangeThreshold(newThreshold) await delay(5000) From 1d0186f333b536943a4f8c88aa9489dc9d41e793 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Thu, 31 Oct 2019 12:50:03 +0300 Subject: [PATCH 043/129] Trace logging of found bnc transactions --- src/oracle/bncWatcher/bncWatcher.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/oracle/bncWatcher/bncWatcher.js b/src/oracle/bncWatcher/bncWatcher.js index 29fb3cc..1509acb 100644 --- a/src/oracle/bncWatcher/bncWatcher.js +++ b/src/oracle/bncWatcher/bncWatcher.js @@ -27,10 +27,12 @@ async function main () { return } - if (newTransactions.length) + if (newTransactions.length) { logger.info(`Found ${newTransactions.length} new transactions`) - else + logger.trace('%o', newTransactions) + } else { logger.debug(`Found 0 new transactions`) + } for (const tx of newTransactions.reverse()) { if (tx.memo !== 'funding') { @@ -46,7 +48,7 @@ async function main () { } } -function getTx(hash) { +function getTx (hash) { return foreignHttpClient .get(`/api/v1/tx/${hash}`, { params: { From e11a74c4900cc8514bd1adcf94e4f7d48ef90738 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Thu, 31 Oct 2019 17:57:16 +0300 Subject: [PATCH 044/129] Removed scenarios --- demo/scenarios/macos/main.jxa | 417 ---------------------------------- demo/scenarios/macos/run.sh | 5 - 2 files changed, 422 deletions(-) delete mode 100644 demo/scenarios/macos/main.jxa delete mode 100755 demo/scenarios/macos/run.sh diff --git a/demo/scenarios/macos/main.jxa b/demo/scenarios/macos/main.jxa deleted file mode 100644 index 9b0e127..0000000 --- a/demo/scenarios/macos/main.jxa +++ /dev/null @@ -1,417 +0,0 @@ -ObjC.import('stdlib') - -const terminal = Application('Terminal') -const system = Application('System Events') -const curApp = Application.currentApplication() -curApp.includeStandardAdditions = true - -const validator1 = '0x99Eb3D86663c6Db090eFFdBC20510Ca9f836DCE3' -const validator2 = '0xAa006899B0EC407De930bA8A166DEfe59bBfd3DC' -const validator3 = '0x6352e3e6038e05b9da00C84AE851308f9774F883' - -const userAccounts = [ - { - privateKey: '7ed93ad7753e00b52265a73dfbbcd2296256772965323fcb9a6320b5cd084b89', - ethAddress: '0x4db6b4bd0a3fdc03b027a60f1c48f05c572312aa', - bncAddress: 'tbnb14r3z8xk7qsar3vwj05w8cd8gqwk7g6gfurlt5l' - }, - { - privateKey: '2ad6e3a232ad3ea058b61352302118a99085600ff8b6eec4ccf0066a33756231', - ethAddress: '0xf7ca4aed1795e424433498cef43f6a3825c88731', - bncAddress: 'tbnb1efjg7xt98t67ql2cmwjc5860lgayet9l8m55ym' - }, - { - privateKey: 'eb6dd328677b3fa2822fb8e834507e569bda52e8ffa49266df0f2de239c4ec98', - ethAddress: '0xad6c8127143032d843a260c5d379d8d9b3d51f15', - bncAddress: 'tbnb12epcy4p7ktas0nlyrfuektcyh0e83dwzuq73f4' - } -] - -let bridgeBncAddress - -const windows = terminal.windows() - -const wins = [] - -function saveBlockchainData () { - console.log('Saving blockchain data') - curApp.doShellScript('zip -r ./demo/ganache_home_backup.zip ./demo/ganache_home_db') - curApp.doShellScript('zip -r ./demo/ganache_side_backup.zip ./demo/ganache_side_db') -} - -function reloadBlockchainData () { - console.log('Reloading blockchain data') - curApp.doShellScript('unzip -d . ./demo/ganache_home_backup.zip') - curApp.doShellScript('unzip -d . ./demo/ganache_side_backup.zip') -} - -function closeOldWindows () { - for (let i in windows) { - try { - windows[i].selectedTab() - - if (windows[i].selectedTab().customTitle().startsWith('Validator') || windows[i].selectedTab().customTitle() === 'Services') { - windows[i].close() - } - } catch (e) { - } - } -} - -function killValidators () { - terminal.activate() - for (let i = 0; i < 3; i++) { - wins[i].frontmost = true - delay(0.5) - system.keystroke('c', { using: 'control down' }) - } -} - -function openNewWindows () { - for (let i = 0; i < 3; i++) { - // open new terminal - const tab = terminal.doScript() - // get opened window - const winId = terminal.windows[0].id() - wins[i] = terminal.windows.byId(winId) - tab.customTitle = `Validator ${i + 1}` - } - wins[0].bounds = { x: 0, y: 23, width: 558, height: 1027 } - wins[1].bounds = { x: 559, y: 374, width: 560, height: 676 } - wins[2].bounds = { x: 1120, y: 374, width: 560, height: 676 } - // open new terminal - const tab = terminal.doScript() - // get opened window - const winId = terminal.windows[0].id() - wins[3] = terminal.windows.byId(winId) - tab.customTitle = `Services` - wins[3].bounds = { x: 559, y: 23, width: 1120, height: 350 } - - terminal.activate() - delay(0.5) -} - -function apiRequestBackground (url) { - const response = curApp.doShellScript(`curl -s -X GET "${url}"`) - try { - return JSON.parse(response) - } catch (e) { - return response - } -} - -function exec (n, script) { - terminal.doScript(script, { in: wins[n - 1] }) -} - -function wait (n) { - while (wins[n - 1].selectedTab().busy()) { - delay(0.2) - } -} - -function execSync (n, script) { - exec(n, script) - wait(n) -} - -function waitAll () { - wait(1) - wait(2) - wait(3) - wait(4) -} - -function waitLog (n, log) { - do { - const s = wins[n - 1].selectedTab().contents().split('\n').find(x => x.includes(log)) - if (s) { - return s - } - delay(0.2) - } while (true) -} - -function waitApi (n, url, check) { - do { - const res = apiRequestBackground(`http://localhost:500${n}${url}`) - const checkerRes = check ? check(res) : true - if (checkerRes) - return checkerRes - delay(3) - } while (true) -} - -function prefundEthAddresses () { - for (let { ethAddress } of userAccounts) { - execSync(4, `./src/test-services/ethereumSend/run.sh ${ethAddress} 100`) - } -} - -function prefundBncAddresses () { - for (let { bncAddress } of userAccounts) { - execSync(4, `./src/test-services/binanceSend/run.sh ${bncAddress} 100 0.1`) - } -} - -function initBalances () { - userAccounts.forEach(account => { - account.ethBalance = getEthTokenBalance(account.ethAddress) - account.bncBalance = getBncTokenBalance(account.bncAddress) - }) -} - -function getBncTokenBalance (address) { - const res = curApp.doShellScript(`./src/test-services/binanceBalance/run.sh ${address}`) - return parseFloat(/KFT-94F: [0-9.]+/.exec(res)[0].split(' ')[1]) -} - -function waitBncTokenBalance (address, balance) { - while (true) { - const newBalance = getBncTokenBalance(address) - if (Math.abs(newBalance - balance) < 0.0001) - return newBalance - delay(3) - } -} - -function getEthTokenBalance (address) { - const res = curApp.doShellScript(`./src/test-services/ethereumBalance/run.sh ${address}`) - return parseFloat(/[0-9.]+ tokens/.exec(res)[0].split(' ')[0]) -} - -function waitEthTokenBalance (address, balance) { - while (true) { - const newBalance = getEthTokenBalance(address) - if (Math.abs(newBalance - balance) < 0.0001) - return newBalance - delay(3) - } -} - -function apiRequest (n, url, suffix) { - execSync(4, `curl -s -X GET http://localhost:500${n}${url} ${suffix ? suffix : ''}`) -} - -function printState (msg) { - execSync(4, `echo "${msg}"`) - apiRequest(1, '/info', '| jq .') -} - -function initCwd () { - const cwd = $.getenv('PWD') - - for (let i = 1; i <= 4; i++) { - exec(i, `cd "${cwd}"`) - } - waitAll() -} - -function killDockerContainers () { - execSync(4, `docker kill $(docker ps | grep validator | awk '{print $1}') > /dev/null 2>&1 || true`) - execSync(4, `docker kill ganache_side ganache_home > /dev/null 2>&1 || true`) -} - -function clean () { - killDockerContainers() - execSync(4, `./demo/clean.sh`) - - exec(1, `clear`) - exec(2, `clear`) - exec(3, `clear`) - waitAll() -} - -function testEthToBnc () { - console.log('Testing eth => bnc') - // try token transfer in eth => bnc direction - let prevBridgeHomeBalance - let prevBridgeForeignBalance - waitApi(1, '/info', res => { - prevBridgeHomeBalance = res.homeBalance - prevBridgeForeignBalance = res.foreignBalanceTokens - return true - }) - - userAccounts.forEach((account, i) => { - execSync(4, `PRIVATE_KEY=${account.privateKey} ./src/test-services/ethereumSend/run.sh bridge ${5 + i}`) - account.ethBalance -= 5 + i - }) - - const delta = (9 + userAccounts.length) * userAccounts.length / 2 - waitApi(1, '/info', res => res.homeBalance === prevBridgeHomeBalance + delta && res.foreignBalanceTokens === prevBridgeForeignBalance - delta) - - userAccounts.forEach((account, i) => { - account.bncBalance = waitBncTokenBalance(account.bncAddress, account.bncBalance + 5 + i) - }) - - printState(`Token transfer in eth => bnc direction succeed`) - console.log('Testing eth => bnc is OK') -} - -function testBncToEth () { - console.log('Testing bnc => eth') - // try token transfer in bnc => eth direction - let prevBridgeHomeBalance - let prevBridgeForeignBalance - waitApi(1, '/info', res => { - prevBridgeHomeBalance = res.homeBalance - prevBridgeForeignBalance = res.foreignBalanceTokens - return true - }) - - userAccounts.forEach((account , i) => { - execSync(4, `PRIVATE_KEY=${account.privateKey} ./src/test-services/binanceSend/run.sh ${bridgeBncAddress} ${3 + i}`) - account.bncBalance -= 3 + i - }) - - const delta = (5 + userAccounts.length) * userAccounts.length / 2 - - waitApi(1, '/info', res => res.homeBalance === prevBridgeHomeBalance - delta && res.foreignBalanceTokens === prevBridgeForeignBalance + delta) - - userAccounts.forEach((account, i) => { - account.ethBalance = waitEthTokenBalance(account.ethAddress, account.ethBalance + 3 + i) - }) - - printState(`Token transfer in bnc => eth direction succeed`) - console.log('Testing bnc => eth is OK') -} - -function testRemoveValidator () { - console.log('Testing removing validator') - apiRequest(1, '/vote/startVoting') - apiRequest(2, '/vote/startVoting') - waitApi(1, '/info', res => res.bridgeStatus === 'voting') - apiRequest(1, `/vote/removeValidator/${validator2}`) - apiRequest(3, `/vote/removeValidator/${validator2}`) - waitApi(1, '/info', res => res.nextValidators.length === 2) - apiRequest(1, '/vote/startKeygen') - apiRequest(3, '/vote/startKeygen') - waitApi(1, '/info', res => { - if (res.bridgeStatus === 'ready' && res.epoch === 2 && res.validators.length === 2) { - bridgeBncAddress = res.foreignBridgeAddress - return true - } - return false - }) - printState(`Removing validator succeed`) - console.log('Testing removing validator is OK') -} - -function testAddValidator () { - console.log('Testing adding validator') - apiRequest(1, '/vote/startVoting') - apiRequest(3, '/vote/startVoting') - waitApi(1, '/info', res => res.bridgeStatus === 'voting') - apiRequest(1, `/vote/addValidator/${validator2}`) - apiRequest(3, `/vote/addValidator/${validator2}`) - waitApi(1, '/info', res => res.nextValidators.length === 3) - apiRequest(1, '/vote/startKeygen') - apiRequest(3, '/vote/startKeygen') - waitApi(1, '/info', res => { - if (res.bridgeStatus === 'ready' && res.epoch === 3 && res.validators.length === 3) { - bridgeBncAddress = res.foreignBridgeAddress - return true - } - return false - }) - printState(`Adding validator succeed`) - console.log('Testing adding validator is OK') -} - -function testChangeThreshold () { - console.log('Testing changing threshold') - apiRequest(1, '/vote/startVoting') - apiRequest(3, '/vote/startVoting') - waitApi(1, '/info', res => res.bridgeStatus === 'voting') - apiRequest(2, `/vote/changeThreshold/2`) - apiRequest(3, `/vote/changeThreshold/2`) - waitApi(1, '/info', res => res.nextThreshold === 2) - apiRequest(1, '/vote/startKeygen') - apiRequest(2, '/vote/startKeygen') - waitApi(1, '/info', res => { - if (res.bridgeStatus === 'ready' && res.epoch === 4 && res.threshold === 2) { - bridgeBncAddress = res.foreignBridgeAddress - return true - } - return false - }) - printState(`Changing threshold succeed`) - console.log('Testing changing threshold is OK') -} - -function run () { - closeOldWindows() - - openNewWindows() - - initCwd() - - clean() - - if ($.getenv('RELOAD') !== 'true') { - execSync(4, `./demo/start-environment.sh`) - - prefundEthAddresses() - - saveBlockchainData() - } else { - reloadBlockchainData() - - execSync(4, `./demo/start-environment.sh`) - } - - prefundBncAddresses() - - initBalances() - - exec(1, `N=1 ./demo/validator-demo.sh`) - exec(2, `N=2 ./demo/validator-demo.sh`) - exec(3, `N=3 ./demo/validator-demo.sh`) - - // wait until binance account willl be generated - waitLog(1, 'Generated multisig account in binance chain') - waitApi(1, '/info', res => { - if (res.epoch === 1) { - bridgeBncAddress = res.foreignBridgeAddress - return true - } - return false - }) - - // prefund binance account - execSync(4, `./src/test-services/binanceSend/run.sh ${bridgeBncAddress} 100 0.1`) - - // wait until binance prefund transaction will be processed - waitApi(1, '/info', res => res.foreignBalanceTokens === 100) - - printState(`Binance bridge account at ${bridgeBncAddress} for epoch 1 is generated and prefunded`) - - testEthToBnc() - - testBncToEth() - - testRemoveValidator() - - testEthToBnc() - - testBncToEth() - - testAddValidator() - - testEthToBnc() - - testBncToEth() - - testChangeThreshold() - - testEthToBnc() - - testBncToEth() - - console.log('PASSED ALL TESTS') - - killValidators() - - killDockerContainers() -} diff --git a/demo/scenarios/macos/run.sh b/demo/scenarios/macos/run.sh deleted file mode 100755 index 2351b7a..0000000 --- a/demo/scenarios/macos/run.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -RELOAD=${RELOAD:=false} - -RELOAD="$RELOAD" osascript -l JavaScript ./demo/scenarios/macos/main.jxa From 311db30af9b1d133959cf4df04da0f32921c93f3 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Thu, 31 Oct 2019 17:57:53 +0300 Subject: [PATCH 045/129] Fixed encode/decode bug in round 3 of keygen --- src/oracle/proxy/decode.js | 5 +++-- src/oracle/proxy/encode.js | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/oracle/proxy/decode.js b/src/oracle/proxy/decode.js index 86faecf..b736749 100644 --- a/src/oracle/proxy/decode.js +++ b/src/oracle/proxy/decode.js @@ -52,10 +52,11 @@ const keygenDecoders = [ ciphertext: [], tag: [] } - for (let i = 0; i < 32; i++) { + const ciphertextLength = tokenizer.byte() // probably 32 + for (let i = 0; i < ciphertextLength; i++) { res.ciphertext.push(tokenizer.byte()) } - for (let i = 0; i < 16; i++) { + while (!tokenizer.isEmpty()) { res.tag.push(tokenizer.byte()) } return res diff --git a/src/oracle/proxy/encode.js b/src/oracle/proxy/encode.js index 6499a2d..1178306 100644 --- a/src/oracle/proxy/encode.js +++ b/src/oracle/proxy/encode.js @@ -24,8 +24,9 @@ const keygenEncoders = [ }, // round 3 function * (value) { - yield Buffer.from(value.ciphertext) // 32 bytes - yield Buffer.from(value.tag) // 16 bytes + yield Buffer.from([ value.ciphertext.length ]) + yield Buffer.from(value.ciphertext) // 32 bytes or less + yield Buffer.from(value.tag) // 16 bytes or less }, // round 4 function * (value) { From 3621b4f70ee4a825d1272a7f28afe2fcb8d5cac4 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Thu, 31 Oct 2019 18:46:14 +0300 Subject: [PATCH 046/129] Fetching last block time in bncWatcher. Prefunding eth bridge in tests --- src/oracle/bncWatcher/bncWatcher.js | 58 ++++++++++++++++------------- tests/.env | 1 + tests/test/bncToEth.js | 1 - tests/test/index.js | 5 ++- 4 files changed, 38 insertions(+), 27 deletions(-) diff --git a/src/oracle/bncWatcher/bncWatcher.js b/src/oracle/bncWatcher/bncWatcher.js index 1509acb..58c853d 100644 --- a/src/oracle/bncWatcher/bncWatcher.js +++ b/src/oracle/bncWatcher/bncWatcher.js @@ -20,21 +20,17 @@ async function initialize () { } async function main () { - const newTransactions = await fetchNewTransactions() - if (newTransactions === null || newTransactions.length === 0) { - + const { transactions, endTime } = await fetchNewTransactions() + if (!transactions || transactions.length === 0) { + logger.debug(`Found 0 new transactions`) await new Promise(r => setTimeout(r, 5000)) return } - if (newTransactions.length) { - logger.info(`Found ${newTransactions.length} new transactions`) - logger.trace('%o', newTransactions) - } else { - logger.debug(`Found 0 new transactions`) - } + logger.info(`Found ${transactions.length} new transactions`) + logger.trace('%o', transactions) - for (const tx of newTransactions.reverse()) { + for (const tx of transactions.reverse()) { if (tx.memo !== 'funding') { const publicKeyEncoded = (await getTx(tx.txHash)).signatures[0].pub_key.value await proxyHttpClient @@ -44,8 +40,9 @@ async function main () { hash: `0x${tx.txHash}` }) } - await redis.set('foreignTime', Date.parse(tx.timeStamp)) + //await redis.set('foreignTime', Date.parse(tx.timeStamp)) } + await redis.set('foreignTime', endTime) } function getTx (hash) { @@ -59,26 +56,37 @@ function getTx (hash) { .catch(() => getTx(hash)) } +function getBlockTime () { + return foreignHttpClient + .get(`/api/v1/time`) + .then(res => Date.parse(res.data.block_time) - 10 * 1000) + .catch(() => getBlockTime()) +} + async function fetchNewTransactions () { logger.debug('Fetching new transactions') const startTime = parseInt(await redis.get('foreignTime')) + 1 const address = getLastForeignAddress() + const endTime = await getBlockTime() if (address === null) - return null + return {} logger.debug('Sending api transactions request') - return foreignHttpClient - .get('/api/v1/transactions', { - params: { - address, - side: 'RECEIVE', - txAsset: FOREIGN_ASSET, - txType: 'TRANSFER', - startTime, - endTime: startTime + 3 * 30 * 24 * 60 * 60 * 1000, - } - }) - .then(res => res.data.tx) - .catch(() => fetchNewTransactions()) + const params = { + address, + side: 'RECEIVE', + txAsset: FOREIGN_ASSET, + txType: 'TRANSFER', + startTime, + endTime, + } + try { + logger.trace('%o', params) + const transactions = (await foreignHttpClient + .get('/api/v1/transactions', { params })).data.tx + return { transactions, endTime } + } catch (e) { + return await fetchNewTransactions() + } } function getLastForeignAddress () { diff --git a/tests/.env b/tests/.env index 004c1d0..d6c7a4b 100644 --- a/tests/.env +++ b/tests/.env @@ -1,6 +1,7 @@ HOME_RPC_URL=http://ganache_home:8545 HOME_BRIDGE_ADDRESS=0x44c158FE850821ae69DaF37AADF5c539e9d0025B HOME_TOKEN_ADDRESS=0xd5fE0D28e058D375b0b038fFbB446Da37E85fFdc +HOME_PRIVATE_KEY=e2aeb24eaa63102d0c0821717c3b6384abdabd7af2ad4ec8e650dce300798b27 FOREIGN_URL=https://testnet-dex.binance.org/ FOREIGN_CHAIN_ID=Binance-Chain-Nile diff --git a/tests/test/bncToEth.js b/tests/test/bncToEth.js index 7da42d3..1587a87 100644 --- a/tests/test/bncToEth.js +++ b/tests/test/bncToEth.js @@ -17,7 +17,6 @@ module.exports = usersFunc => { }) it('should make coorect exchange transactions on eth side', async function () { - this.timeout(180000) for (let i = 0; i < 3; i++) { do { const user = users[i] diff --git a/tests/test/index.js b/tests/test/index.js index 60a105c..d304050 100644 --- a/tests/test/index.js +++ b/tests/test/index.js @@ -10,7 +10,7 @@ const testChangeThreshold = require('./changeThreshold') const usersConfig = require('../config').users const validatorsConfig = require('../config').validators -const { FOREIGN_PRIVATE_KEY } = process.env +const { HOME_PRIVATE_KEY, FOREIGN_PRIVATE_KEY, HOME_BRIDGE_ADDRESS } = process.env const { controller1 } = require('./utils/proxyController') @@ -23,9 +23,11 @@ describe('bridge tests', function () { describe('generation of initial epoch keys', function () { let info + let homePrefundedUser let foreignPrefundedUser before(async function () { + homePrefundedUser = await createUser(HOME_PRIVATE_KEY) foreignPrefundedUser = await createUser(FOREIGN_PRIVATE_KEY) }) @@ -36,6 +38,7 @@ describe('bridge tests', function () { after(async function () { await foreignPrefundedUser.transferBnc(info.foreignBridgeAddress, 50, 0.1) + await homePrefundedUser.transferEth(HOME_BRIDGE_ADDRESS, 500) }) }) From bd6de658e14d613cf26c8ad42225c6b780a322e6 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Thu, 31 Oct 2019 22:43:34 +0300 Subject: [PATCH 047/129] Little refactor of bnc watcher --- demo/validator1/.env.development | 3 +++ demo/validator1/.env.staging | 3 +++ demo/validator2/.env.development | 3 +++ demo/validator2/.env.staging | 3 +++ demo/validator3/.env.development | 3 +++ demo/validator3/.env.staging | 3 +++ src/deploy/deploy-home/.env.development | 2 +- src/oracle/bncWatcher/bncWatcher.js | 13 ++++++++----- src/oracle/docker-compose-test.yml | 3 +++ src/oracle/docker-compose.yml | 3 +++ 10 files changed, 33 insertions(+), 6 deletions(-) diff --git a/demo/validator1/.env.development b/demo/validator1/.env.development index 6b8e3c8..bba8faf 100644 --- a/demo/validator1/.env.development +++ b/demo/validator1/.env.development @@ -9,6 +9,9 @@ SIDE_SHARED_DB_ADDRESS=0xd5fE0D28e058D375b0b038fFbB446Da37E85fFdc FOREIGN_URL=https://testnet-dex.binance.org/ FOREIGN_CHAIN_ID=Binance-Chain-Nile FOREIGN_ASSET=KFT-94F +FOREIGN_START_TIME=1572500000000 +FOREIGN_FETCH_INTERVAL=5000 +FOREIGN_FETCH_BLOCK_TIME_OFFSET=10000 VALIDATOR_PRIVATE_KEY=2be3f252e16541bf1bb2d4a517d2bf173e6d09f2d765d32c64dc50515aec63ea diff --git a/demo/validator1/.env.staging b/demo/validator1/.env.staging index 5e5e086..20692c4 100644 --- a/demo/validator1/.env.staging +++ b/demo/validator1/.env.staging @@ -9,6 +9,9 @@ SIDE_SHARED_DB_ADDRESS=0xda9a1cA2Fcb18cAB02934269369627D2b4ea8902 FOREIGN_URL=https://testnet-dex.binance.org/ FOREIGN_CHAIN_ID=Binance-Chain-Nile FOREIGN_ASSET=KFT-94F +FOREIGN_START_TIME=1572500000000 +FOREIGN_FETCH_INTERVAL=5000 +FOREIGN_FETCH_BLOCK_TIME_OFFSET=10000 #VALIDATOR_PRIVATE_KEY is taken from .keys diff --git a/demo/validator2/.env.development b/demo/validator2/.env.development index c15297e..d1cfebd 100644 --- a/demo/validator2/.env.development +++ b/demo/validator2/.env.development @@ -9,6 +9,9 @@ SIDE_SHARED_DB_ADDRESS=0xd5fE0D28e058D375b0b038fFbB446Da37E85fFdc FOREIGN_URL=https://testnet-dex.binance.org/ FOREIGN_CHAIN_ID=Binance-Chain-Nile FOREIGN_ASSET=KFT-94F +FOREIGN_START_TIME=1572500000000 +FOREIGN_FETCH_INTERVAL=5000 +FOREIGN_FETCH_BLOCK_TIME_OFFSET=10000 VALIDATOR_PRIVATE_KEY=e59d58c77b791f98f10187117374ae9c589d48a62720ec6a5e142b0cc134f685 diff --git a/demo/validator2/.env.staging b/demo/validator2/.env.staging index eb851f3..edce271 100644 --- a/demo/validator2/.env.staging +++ b/demo/validator2/.env.staging @@ -9,6 +9,9 @@ SIDE_SHARED_DB_ADDRESS=0xda9a1cA2Fcb18cAB02934269369627D2b4ea8902 FOREIGN_URL=https://testnet-dex.binance.org/ FOREIGN_CHAIN_ID=Binance-Chain-Nile FOREIGN_ASSET=KFT-94F +FOREIGN_START_TIME=1572500000000 +FOREIGN_FETCH_INTERVAL=5000 +FOREIGN_FETCH_BLOCK_TIME_OFFSET=10000 #VALIDATOR_PRIVATE_KEY is taken from .keys diff --git a/demo/validator3/.env.development b/demo/validator3/.env.development index be25774..64f6f65 100644 --- a/demo/validator3/.env.development +++ b/demo/validator3/.env.development @@ -9,6 +9,9 @@ SIDE_SHARED_DB_ADDRESS=0xd5fE0D28e058D375b0b038fFbB446Da37E85fFdc FOREIGN_URL=https://testnet-dex.binance.org/ FOREIGN_CHAIN_ID=Binance-Chain-Nile FOREIGN_ASSET=KFT-94F +FOREIGN_START_TIME=1572500000000 +FOREIGN_FETCH_INTERVAL=5000 +FOREIGN_FETCH_BLOCK_TIME_OFFSET=10000 VALIDATOR_PRIVATE_KEY=afaa4d4d6e54d25b0bf0361e3fd6cef562f6311bf6200de2dd0aa4cab63ae3b5 diff --git a/demo/validator3/.env.staging b/demo/validator3/.env.staging index 73f9f99..da39c37 100644 --- a/demo/validator3/.env.staging +++ b/demo/validator3/.env.staging @@ -9,6 +9,9 @@ SIDE_SHARED_DB_ADDRESS=0xda9a1cA2Fcb18cAB02934269369627D2b4ea8902 FOREIGN_URL=https://testnet-dex.binance.org/ FOREIGN_CHAIN_ID=Binance-Chain-Nile FOREIGN_ASSET=KFT-94F +FOREIGN_START_TIME=1572500000000 +FOREIGN_FETCH_INTERVAL=5000 +FOREIGN_FETCH_BLOCK_TIME_OFFSET=10000 #VALIDATOR_PRIVATE_KEY is taken from .keys diff --git a/src/deploy/deploy-home/.env.development b/src/deploy/deploy-home/.env.development index 000ccbe..26e2481 100644 --- a/src/deploy/deploy-home/.env.development +++ b/src/deploy/deploy-home/.env.development @@ -14,4 +14,4 @@ THRESHOLD=1 MIN_TX_LIMIT=10000000000000000 MAX_TX_LIMIT=100000000000000000000 -BLOCKS_RANGE_SIZE=25 +BLOCKS_RANGE_SIZE=10 diff --git a/src/oracle/bncWatcher/bncWatcher.js b/src/oracle/bncWatcher/bncWatcher.js index 58c853d..b6ac7a8 100644 --- a/src/oracle/bncWatcher/bncWatcher.js +++ b/src/oracle/bncWatcher/bncWatcher.js @@ -9,13 +9,17 @@ const { publicKeyToAddress } = require('./crypto') const { FOREIGN_URL, PROXY_URL, FOREIGN_ASSET } = process.env +const FOREIGN_START_TIME = parseInt(process.env.FOREIGN_START_TIME) +const FOREIGN_FETCH_INTERVAL = parseInt(process.env.FOREIGN_FETCH_INTERVAL) +const FOREIGN_FETCH_BLOCK_TIME_OFFSET = parseInt(process.env.FOREIGN_FETCH_BLOCK_TIME_OFFSET) + const foreignHttpClient = axios.create({ baseURL: FOREIGN_URL }) const proxyHttpClient = axios.create({ baseURL: PROXY_URL }) async function initialize () { if (await redis.get('foreignTime') === null) { logger.info('Set default foreign time') - await redis.set('foreignTime', Date.now() - 2 * 30 * 24 * 60 * 60 * 1000) + await redis.set('foreignTime', FOREIGN_START_TIME) } } @@ -23,7 +27,7 @@ async function main () { const { transactions, endTime } = await fetchNewTransactions() if (!transactions || transactions.length === 0) { logger.debug(`Found 0 new transactions`) - await new Promise(r => setTimeout(r, 5000)) + await new Promise(r => setTimeout(r, FOREIGN_FETCH_INTERVAL)) return } @@ -40,7 +44,6 @@ async function main () { hash: `0x${tx.txHash}` }) } - //await redis.set('foreignTime', Date.parse(tx.timeStamp)) } await redis.set('foreignTime', endTime) } @@ -59,7 +62,7 @@ function getTx (hash) { function getBlockTime () { return foreignHttpClient .get(`/api/v1/time`) - .then(res => Date.parse(res.data.block_time) - 10 * 1000) + .then(res => Date.parse(res.data.block_time) - FOREIGN_FETCH_BLOCK_TIME_OFFSET) .catch(() => getBlockTime()) } @@ -67,7 +70,7 @@ async function fetchNewTransactions () { logger.debug('Fetching new transactions') const startTime = parseInt(await redis.get('foreignTime')) + 1 const address = getLastForeignAddress() - const endTime = await getBlockTime() + const endTime = Math.min(startTime + 3 * 30 * 24 * 60 * 60 * 1000, await getBlockTime()) if (address === null) return {} logger.debug('Sending api transactions request') diff --git a/src/oracle/docker-compose-test.yml b/src/oracle/docker-compose-test.yml index 91845c1..696d830 100644 --- a/src/oracle/docker-compose-test.yml +++ b/src/oracle/docker-compose-test.yml @@ -102,6 +102,9 @@ services: - FOREIGN_ASSET - 'RABBITMQ_URL=amqp://rabbitmq:5672' - 'PROXY_URL=http://proxy:8001' + - FOREIGN_START_TIME + - FOREIGN_FETCH_INTERVAL + - FOREIGN_FETCH_BLOCK_TIME_OFFSET - LOG_LEVEL volumes: - '${PWD}/${TARGET_NETWORK}/keys:/keys' diff --git a/src/oracle/docker-compose.yml b/src/oracle/docker-compose.yml index 499e9f7..0572ed2 100644 --- a/src/oracle/docker-compose.yml +++ b/src/oracle/docker-compose.yml @@ -111,6 +111,9 @@ services: - FOREIGN_ASSET - 'RABBITMQ_URL=amqp://rabbitmq:5672' - 'PROXY_URL=http://proxy:8001' + - FOREIGN_START_TIME + - FOREIGN_FETCH_INTERVAL + - FOREIGN_FETCH_BLOCK_TIME_OFFSET - LOG_LEVEL volumes: - '${PWD}/${TARGET_NETWORK}/keys:/keys' From 11b13d5bfe272f83080705dd9e18d30c531afffd Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Fri, 1 Nov 2019 11:17:33 +0300 Subject: [PATCH 048/129] Added tests readme --- tests/README.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 tests/README.md diff --git a/tests/README.md b/tests/README.md new file mode 100644 index 0000000..85ab76a --- /dev/null +++ b/tests/README.md @@ -0,0 +1,37 @@ +# Ethereum to Binance Chain / E2E tests + +## Prerequisites + +To run the tests you need to have +[Docker](https://www.docker.com/community-edition) and +[Docker Compose](https://docs.docker.com/compose/install/) installed. + +## Correlation with CircleCI tests + +CircleCI uses this tests for testing the code base. + +## Running + +To run the bridge tests, you first need to clean old test environment, and then initialize a new one: +```bash +./demo/clean.sh +./tests/init.sh +``` +This will create a clean development environment, using `./demo/start-environment.sh`. +This will also prefund user accounts from `./tests/config.json` for both networks. +Prefunding process uses `./src/test-services` scripts. +Finally, this command will start 3 validators in daemon mode (using `./demo/validator-demo.sh`), +and wait until they are ready. + +Next, you can run the tests: +```bash +FOREIGN_PRIVATE_KEY=0000000000000000000000000000000000000000000000000000000000000000 ./tests/run.sh +``` +`FOREIGN_PRIVATE_KEY` is the key, that will be used for initial prefunding first +generated binance side of the bridge. + +After tests are done, all active docker containers can be killed. +```bash +docker kill $(docker ps | grep validator[1-3]_ | awk '{print $1}') +docker kill ganache_side ganache_home +``` From 219cc5185aa2166a133416699ada047504b8707a Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Fri, 1 Nov 2019 11:20:26 +0300 Subject: [PATCH 049/129] Added docker ignore files --- src/oracle/scripts/resetToBlock/.dockerignore | 3 +++ src/test-services/binanceBalance/.dockerignore | 4 ++++ src/test-services/binanceSend/.dockerignore | 4 ++++ src/test-services/ethereumBalance/.dockerignore | 4 ++++ src/test-services/ethereumSend/.dockerignore | 4 ++++ src/test-services/getAddresses/.dockerignore | 3 +++ src/test-services/sidePrefund/.dockerignore | 4 ++++ tests/.dockerignore | 5 +++++ 8 files changed, 31 insertions(+) create mode 100644 src/oracle/scripts/resetToBlock/.dockerignore create mode 100644 src/test-services/binanceBalance/.dockerignore create mode 100644 src/test-services/binanceSend/.dockerignore create mode 100644 src/test-services/ethereumBalance/.dockerignore create mode 100644 src/test-services/ethereumSend/.dockerignore create mode 100644 src/test-services/getAddresses/.dockerignore create mode 100644 src/test-services/sidePrefund/.dockerignore create mode 100644 tests/.dockerignore diff --git a/src/oracle/scripts/resetToBlock/.dockerignore b/src/oracle/scripts/resetToBlock/.dockerignore new file mode 100644 index 0000000..4635bd2 --- /dev/null +++ b/src/oracle/scripts/resetToBlock/.dockerignore @@ -0,0 +1,3 @@ +.dockerignore +Dockerfile +run.sh diff --git a/src/test-services/binanceBalance/.dockerignore b/src/test-services/binanceBalance/.dockerignore new file mode 100644 index 0000000..4119e2e --- /dev/null +++ b/src/test-services/binanceBalance/.dockerignore @@ -0,0 +1,4 @@ +.dockerignore +Dockerfile +run.sh +.env.* diff --git a/src/test-services/binanceSend/.dockerignore b/src/test-services/binanceSend/.dockerignore new file mode 100644 index 0000000..4119e2e --- /dev/null +++ b/src/test-services/binanceSend/.dockerignore @@ -0,0 +1,4 @@ +.dockerignore +Dockerfile +run.sh +.env.* diff --git a/src/test-services/ethereumBalance/.dockerignore b/src/test-services/ethereumBalance/.dockerignore new file mode 100644 index 0000000..4119e2e --- /dev/null +++ b/src/test-services/ethereumBalance/.dockerignore @@ -0,0 +1,4 @@ +.dockerignore +Dockerfile +run.sh +.env.* diff --git a/src/test-services/ethereumSend/.dockerignore b/src/test-services/ethereumSend/.dockerignore new file mode 100644 index 0000000..4119e2e --- /dev/null +++ b/src/test-services/ethereumSend/.dockerignore @@ -0,0 +1,4 @@ +.dockerignore +Dockerfile +run.sh +.env.* diff --git a/src/test-services/getAddresses/.dockerignore b/src/test-services/getAddresses/.dockerignore new file mode 100644 index 0000000..4635bd2 --- /dev/null +++ b/src/test-services/getAddresses/.dockerignore @@ -0,0 +1,3 @@ +.dockerignore +Dockerfile +run.sh diff --git a/src/test-services/sidePrefund/.dockerignore b/src/test-services/sidePrefund/.dockerignore new file mode 100644 index 0000000..4119e2e --- /dev/null +++ b/src/test-services/sidePrefund/.dockerignore @@ -0,0 +1,4 @@ +.dockerignore +Dockerfile +run.sh +.env.* diff --git a/tests/.dockerignore b/tests/.dockerignore new file mode 100644 index 0000000..51e9d4a --- /dev/null +++ b/tests/.dockerignore @@ -0,0 +1,5 @@ +.dockerignore +Dockerfile +init.sh +run.sh +results.xml From e27f5c8df27bb73334932508a593b95e3500e5b0 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Fri, 1 Nov 2019 11:21:28 +0300 Subject: [PATCH 050/129] Added retry promise in bncController --- tests/init.sh | 2 ++ tests/test/utils/bncController.js | 23 ++++++++--------------- tests/test/utils/wait.js | 15 ++++++++++++++- 3 files changed, 24 insertions(+), 16 deletions(-) diff --git a/tests/init.sh b/tests/init.sh index e9831b3..08a506c 100755 --- a/tests/init.sh +++ b/tests/init.sh @@ -3,6 +3,8 @@ set -e set -v +docker build -t tss ./src/tss + ./demo/start-environment.sh cat ./tests/config.json | jq .users[].ethAddress | xargs -I {} ./src/test-services/ethereumSend/run.sh {} 100 diff --git a/tests/test/utils/bncController.js b/tests/test/utils/bncController.js index 99845cd..82fe567 100644 --- a/tests/test/utils/bncController.js +++ b/tests/test/utils/bncController.js @@ -1,5 +1,7 @@ const axios = require('axios') +const { retry } = require('./wait') + const { FOREIGN_URL, FOREIGN_ASSET } = process.env const bnc = axios.create({ @@ -9,21 +11,12 @@ const bnc = axios.create({ module.exports = { getBalance: async function (address) { - try { - const response = await bnc.get(`/api/v1/account/${address}`) - - return parseFloat(response.data.balances.find(x => x.symbol === FOREIGN_ASSET).free) - } catch (e) { - return 0 - } + const response = await retry(5, () => bnc.get(`/api/v1/account/${address}`)) + const tokens = response.data.balances.find(x => x.symbol === FOREIGN_ASSET) + return response && tokens ? parseFloat(tokens.free) : 0 }, - getSequence: async function(address) { - try { - const response = await bnc.get(`/api/v1/account/${address}/sequence`) - - return response.data.sequence - } catch (e) { - return 0 - } + getSequence: async function (address) { + const response = await retry(5, () => bnc.get(`/api/v1/account/${address}/sequence`)) + return response ? response.data.sequence : 0 } } diff --git a/tests/test/utils/wait.js b/tests/test/utils/wait.js index 733d9f4..ae0a145 100644 --- a/tests/test/utils/wait.js +++ b/tests/test/utils/wait.js @@ -11,6 +11,18 @@ async function waitPromise (getPromise, checker) { } while (true) } +async function retry (n, getPromise) { + while (n) { + try { + return await getPromise() + } catch (e) { + await delay(3000) + n-- + } + } + return null +} + Array.prototype.seqMap = async function (transition) { const results = [] for (let i = 0; i < this.length; i++) { @@ -21,5 +33,6 @@ Array.prototype.seqMap = async function (transition) { module.exports = { waitPromise, - delay + delay, + retry } From 427694283c06309f97654040bc6d7245b0f215a3 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Fri, 1 Nov 2019 11:22:04 +0300 Subject: [PATCH 051/129] Updated gitignore --- .gitignore | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index 5d2cec0..6806d9b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,21 +1,14 @@ .idea/ node_modules/ .DS_Store -**/keys*.store -**/signature -**/params data/ demo/validator*/development demo/validator*/staging demo/validator*/.keys.staging -demo/ganache_home_db/ -demo/ganache_side_db/ -demo/*.zip -src/deploy/deploy-home/build/ -src/deploy/deploy-side/build/ -src/deploy/deploy-test/build/ +src/deploy/deploy*/build/ src/deploy/.keys.staging src/test-services/.keys.staging src/test-services/.keys.development -test.js +src/test.js tests/results.xml +package-lock.json From 34d6927c0b19e9743efde731decafb7991cc21cc Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Fri, 1 Nov 2019 21:42:44 +0300 Subject: [PATCH 052/129] Added eslint configs --- .eslintignore | 8 ++++++++ .eslintrc | 18 ++++++++++++++++++ package.json | 14 ++++++++++++++ src/deploy/.eslintrc | 11 +++++++++++ src/oracle/scripts/.eslintrc | 8 ++++++++ src/test-services/.eslintrc | 8 ++++++++ tests/.eslintrc | 12 ++++++++++++ 7 files changed, 79 insertions(+) create mode 100644 .eslintignore create mode 100644 .eslintrc create mode 100644 package.json create mode 100644 src/deploy/.eslintrc create mode 100644 src/oracle/scripts/.eslintrc create mode 100644 src/test-services/.eslintrc create mode 100644 tests/.eslintrc diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..4fd97cc --- /dev/null +++ b/.eslintignore @@ -0,0 +1,8 @@ +node_modules/ +data/ +demo/validator*/development +demo/validator*/staging +src/deploy/deploy/*/build +src/deploy/deploy-home/contracts/openzeppelin-solidity +src/deploy/deploy-test/contracts/openzeppelin-solidity +src/tss/multi-party-ecdsa diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 0000000..c0a5fcf --- /dev/null +++ b/.eslintrc @@ -0,0 +1,18 @@ +{ + "extends": [ + "plugin:node/recommended", + "airbnb-base" + ], + "plugins": [ + "node" + ], + "rules": { + "semi": [1, "never"], + "comma-dangle": [1, "never"], + "node/no-missing-require": 0, + "import/no-unresolved": 0, + "no-return-await": 0, + "no-await-in-loop": 0, + "no-constant-condition": 0 + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..e954bd9 --- /dev/null +++ b/package.json @@ -0,0 +1,14 @@ +{ + "name": "bridge", + "version": "0.0.1", + "devDependencies": { + "eslint": "^6.6.0", + "eslint-config-airbnb": "^18.0.1", + "eslint-plugin-import": "^2.18.2", + "eslint-plugin-node": "^10.0.0", + "eslint-plugin-truffle": "0.3.1" + }, + "engines": { + "node": ">=10.6.0" + } +} diff --git a/src/deploy/.eslintrc b/src/deploy/.eslintrc new file mode 100644 index 0000000..8f4829c --- /dev/null +++ b/src/deploy/.eslintrc @@ -0,0 +1,11 @@ +{ + "extends": [ + "../../.eslintrc" + ], + "plugins": [ + "truffle" + ], + "env": { + "truffle/globals": true + } +} diff --git a/src/oracle/scripts/.eslintrc b/src/oracle/scripts/.eslintrc new file mode 100644 index 0000000..252c81a --- /dev/null +++ b/src/oracle/scripts/.eslintrc @@ -0,0 +1,8 @@ +{ + "extends": [ + "../../../.eslintrc" + ], + "rules": { + "no-console": 0 + } +} diff --git a/src/test-services/.eslintrc b/src/test-services/.eslintrc new file mode 100644 index 0000000..3703c0a --- /dev/null +++ b/src/test-services/.eslintrc @@ -0,0 +1,8 @@ +{ + "extends": [ + "../../.eslintrc" + ], + "rules": { + "no-console": 0 + } +} diff --git a/tests/.eslintrc b/tests/.eslintrc new file mode 100644 index 0000000..8fb9bf8 --- /dev/null +++ b/tests/.eslintrc @@ -0,0 +1,12 @@ +{ + "extends": [ + "../.eslintrc" + ], + "env": { + "mocha": true + }, + "rules": { + "prefer-arrow-callback": 0, + "func-names": 0 + } +} From 62c1dd80644a4dbbb1ae9ea73cbde3ea8ca7bc0b Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Fri, 1 Nov 2019 21:43:25 +0300 Subject: [PATCH 053/129] Fixed eslint error/warnings --- .../deploy-home/migrations/1_deployment.js | 8 +- .../deploy-side/migrations/1_deployment.js | 2 +- src/oracle/bncWatcher/bncWatcher.js | 115 +++--- src/oracle/bncWatcher/package.json | 3 + src/oracle/docker-compose-test.yml | 3 - src/oracle/docker-compose.yml | 3 - src/oracle/ethWatcher/ethWatcher.js | 273 +++++++------- src/oracle/ethWatcher/package.json | 3 + src/oracle/proxy/decode.js | 215 +++++------ src/oracle/proxy/encode.js | 65 ++-- src/oracle/proxy/index.js | 341 +++++++++++------- src/oracle/proxy/package.json | 3 + src/oracle/proxy/sendTx.js | 51 +-- src/oracle/scripts/resetToBlock/package.json | 3 + .../scripts/resetToBlock/resetToBlock.js | 2 +- src/oracle/shared/amqp.js | 46 +-- src/oracle/shared/crypto.js | 40 +- src/oracle/shared/db.js | 3 +- src/oracle/tss-keygen/keygen.js | 41 ++- src/oracle/tss-keygen/package.json | 3 + src/oracle/tss-sign/package.json | 3 + src/oracle/tss-sign/signer.js | 306 ++++++++-------- src/oracle/tss-sign/tx.js | 58 ++- .../binanceBalance/testGetBinanceBalance.js | 18 +- .../binanceSend/testBinanceSend.js | 7 +- .../ethereumBalance/testGetEthereumBalance.js | 19 +- .../ethereumSend/testEthereumSend.js | 32 +- .../getAddresses/testGetAddresses.js | 26 +- .../sidePrefund/testEthereumSend.js | 11 +- tests/package.json | 3 + tests/test/addValidator.js | 23 +- tests/test/bncToEth.js | 12 +- tests/test/changeThreshold.js | 21 +- tests/test/ethToBnc.js | 21 +- tests/test/index.js | 6 +- tests/test/removeValidator.js | 23 +- tests/test/utils/bncClient.js | 6 +- tests/test/utils/bncController.js | 6 +- tests/test/utils/proxyController.js | 14 +- tests/test/utils/user.js | 24 +- tests/test/utils/wait.js | 25 +- 41 files changed, 1047 insertions(+), 840 deletions(-) diff --git a/src/deploy/deploy-home/migrations/1_deployment.js b/src/deploy/deploy-home/migrations/1_deployment.js index 5bd4359..fe88868 100644 --- a/src/deploy/deploy-home/migrations/1_deployment.js +++ b/src/deploy/deploy-home/migrations/1_deployment.js @@ -1,20 +1,20 @@ const Bridge = artifacts.require('Bridge') const addresses = Object.entries(process.env) - .filter(([ key ]) => key.startsWith('VALIDATOR_ADDRESS')) - .map(([ , value ]) => value) + .filter(([key]) => key.startsWith('VALIDATOR_ADDRESS')) + .map(([, value]) => value) const { THRESHOLD, HOME_TOKEN_ADDRESS, MIN_TX_LIMIT, MAX_TX_LIMIT, BLOCKS_RANGE_SIZE } = process.env -module.exports = deployer => { +module.exports = (deployer) => { deployer.deploy( Bridge, THRESHOLD, addresses, HOME_TOKEN_ADDRESS, - [ MIN_TX_LIMIT, MAX_TX_LIMIT ], + [MIN_TX_LIMIT, MAX_TX_LIMIT], BLOCKS_RANGE_SIZE ) } diff --git a/src/deploy/deploy-side/migrations/1_deployment.js b/src/deploy/deploy-side/migrations/1_deployment.js index bad14cd..7b2ff31 100644 --- a/src/deploy/deploy-side/migrations/1_deployment.js +++ b/src/deploy/deploy-side/migrations/1_deployment.js @@ -1,5 +1,5 @@ const SharedDB = artifacts.require('SharedDB') -module.exports = deployer => { +module.exports = (deployer) => { deployer.deploy(SharedDB) } diff --git a/src/oracle/bncWatcher/bncWatcher.js b/src/oracle/bncWatcher/bncWatcher.js index b6ac7a8..91df7a1 100644 --- a/src/oracle/bncWatcher/bncWatcher.js +++ b/src/oracle/bncWatcher/bncWatcher.js @@ -9,70 +9,50 @@ const { publicKeyToAddress } = require('./crypto') const { FOREIGN_URL, PROXY_URL, FOREIGN_ASSET } = process.env -const FOREIGN_START_TIME = parseInt(process.env.FOREIGN_START_TIME) -const FOREIGN_FETCH_INTERVAL = parseInt(process.env.FOREIGN_FETCH_INTERVAL) -const FOREIGN_FETCH_BLOCK_TIME_OFFSET = parseInt(process.env.FOREIGN_FETCH_BLOCK_TIME_OFFSET) +const FOREIGN_START_TIME = parseInt(process.env.FOREIGN_START_TIME, 10) +const FOREIGN_FETCH_INTERVAL = parseInt(process.env.FOREIGN_FETCH_INTERVAL, 10) +const FOREIGN_FETCH_BLOCK_TIME_OFFSET = parseInt(process.env.FOREIGN_FETCH_BLOCK_TIME_OFFSET, 10) const foreignHttpClient = axios.create({ baseURL: FOREIGN_URL }) const proxyHttpClient = axios.create({ baseURL: PROXY_URL }) -async function initialize () { - if (await redis.get('foreignTime') === null) { - logger.info('Set default foreign time') - await redis.set('foreignTime', FOREIGN_START_TIME) +function getLastForeignAddress() { + const epoch = Math.max(0, ...fs.readdirSync('/keys') + .map((x) => parseInt(x.split('.')[0].substr(4), 10))) + if (epoch === 0) { + return null } + const keysFile = `/keys/keys${epoch}.store` + const publicKey = JSON.parse(fs.readFileSync(keysFile))[5] + return publicKeyToAddress(publicKey) } -async function main () { - const { transactions, endTime } = await fetchNewTransactions() - if (!transactions || transactions.length === 0) { - logger.debug(`Found 0 new transactions`) - await new Promise(r => setTimeout(r, FOREIGN_FETCH_INTERVAL)) - return - } - - logger.info(`Found ${transactions.length} new transactions`) - logger.trace('%o', transactions) - - for (const tx of transactions.reverse()) { - if (tx.memo !== 'funding') { - const publicKeyEncoded = (await getTx(tx.txHash)).signatures[0].pub_key.value - await proxyHttpClient - .post('/transfer', { - to: computeAddress(Buffer.from(publicKeyEncoded, 'base64')), - value: new BN(tx.value).multipliedBy(10 ** 18).integerValue(), - hash: `0x${tx.txHash}` - }) - } - } - await redis.set('foreignTime', endTime) -} - -function getTx (hash) { +function getTx(hash) { return foreignHttpClient .get(`/api/v1/tx/${hash}`, { params: { format: 'json' } }) - .then(res => res.data.tx.value) + .then((res) => res.data.tx.value) .catch(() => getTx(hash)) } -function getBlockTime () { +function getBlockTime() { return foreignHttpClient - .get(`/api/v1/time`) - .then(res => Date.parse(res.data.block_time) - FOREIGN_FETCH_BLOCK_TIME_OFFSET) + .get('/api/v1/time') + .then((res) => Date.parse(res.data.block_time) - FOREIGN_FETCH_BLOCK_TIME_OFFSET) .catch(() => getBlockTime()) } -async function fetchNewTransactions () { +async function fetchNewTransactions() { logger.debug('Fetching new transactions') - const startTime = parseInt(await redis.get('foreignTime')) + 1 + const startTime = parseInt(await redis.get('foreignTime'), 10) + 1 const address = getLastForeignAddress() const endTime = Math.min(startTime + 3 * 30 * 24 * 60 * 60 * 1000, await getBlockTime()) - if (address === null) + if (address === null) { return {} + } logger.debug('Sending api transactions request') const params = { address, @@ -80,29 +60,58 @@ async function fetchNewTransactions () { txAsset: FOREIGN_ASSET, txType: 'TRANSFER', startTime, - endTime, + endTime } try { logger.trace('%o', params) const transactions = (await foreignHttpClient .get('/api/v1/transactions', { params })).data.tx - return { transactions, endTime } + return { + transactions, + endTime + } } catch (e) { return await fetchNewTransactions() } } -function getLastForeignAddress () { - const epoch = Math.max(0, ...fs.readdirSync('/keys').map(x => parseInt(x.split('.')[0].substr(4)))) - if (epoch === 0) - return null - const keysFile = `/keys/keys${epoch}.store` - const publicKey = JSON.parse(fs.readFileSync(keysFile))[5] - return publicKeyToAddress(publicKey) +async function initialize() { + if (await redis.get('foreignTime') === null) { + logger.info('Set default foreign time') + await redis.set('foreignTime', FOREIGN_START_TIME) + } } -initialize().then(async () => { - while (true) { - await main() +async function main() { + const { transactions, endTime } = await fetchNewTransactions() + if (!transactions || transactions.length === 0) { + logger.debug('Found 0 new transactions') + await new Promise((r) => setTimeout(r, FOREIGN_FETCH_INTERVAL)) + return } -}) + + logger.info(`Found ${transactions.length} new transactions`) + logger.trace('%o', transactions) + + for (let i = transactions.length - 1; i >= 0; i -= 1) { + const tx = transactions[i] + if (tx.memo !== 'funding') { + const publicKeyEncoded = (await getTx(tx.txHash)).signatures[0].pub_key.value + await proxyHttpClient + .post('/transfer', { + to: computeAddress(Buffer.from(publicKeyEncoded, 'base64')), + value: new BN(tx.value).multipliedBy(10 ** 18) + .integerValue(), + hash: `0x${tx.txHash}` + }) + } + } + await redis.set('foreignTime', endTime) +} + +initialize() + .then(async () => { + while (true) { + await main() + } + }) diff --git a/src/oracle/bncWatcher/package.json b/src/oracle/bncWatcher/package.json index 445edda..721ea33 100644 --- a/src/oracle/bncWatcher/package.json +++ b/src/oracle/bncWatcher/package.json @@ -9,6 +9,9 @@ "ethers": "4.0.33", "pino": "5.13.4", "pino-pretty": "3.2.1" + }, + "engines": { + "node": ">=10.6.0" } } diff --git a/src/oracle/docker-compose-test.yml b/src/oracle/docker-compose-test.yml index 696d830..2de2b8b 100644 --- a/src/oracle/docker-compose-test.yml +++ b/src/oracle/docker-compose-test.yml @@ -9,10 +9,8 @@ services: - HOME_RPC_URL - HOME_BRIDGE_ADDRESS - HOME_TOKEN_ADDRESS - - HOME_CHAIN_ID - SIDE_RPC_URL - SIDE_SHARED_DB_ADDRESS - - SIDE_CHAIN_ID - VALIDATOR_PRIVATE_KEY - FOREIGN_URL - FOREIGN_ASSET @@ -83,7 +81,6 @@ services: - HOME_RPC_URL - HOME_BRIDGE_ADDRESS - HOME_TOKEN_ADDRESS - - HOME_CHAIN_ID - HOME_START_BLOCK - BLOCKS_RANGE_SIZE - VALIDATOR_PRIVATE_KEY diff --git a/src/oracle/docker-compose.yml b/src/oracle/docker-compose.yml index 0572ed2..994bfa7 100644 --- a/src/oracle/docker-compose.yml +++ b/src/oracle/docker-compose.yml @@ -9,10 +9,8 @@ services: - HOME_RPC_URL - HOME_BRIDGE_ADDRESS - HOME_TOKEN_ADDRESS - - HOME_CHAIN_ID - SIDE_RPC_URL - SIDE_SHARED_DB_ADDRESS - - SIDE_CHAIN_ID - VALIDATOR_PRIVATE_KEY - FOREIGN_URL - FOREIGN_ASSET @@ -93,7 +91,6 @@ services: - HOME_RPC_URL - HOME_BRIDGE_ADDRESS - HOME_TOKEN_ADDRESS - - HOME_CHAIN_ID - HOME_START_BLOCK - VALIDATOR_PRIVATE_KEY - 'RABBITMQ_URL=amqp://rabbitmq:5672' diff --git a/src/oracle/ethWatcher/ethWatcher.js b/src/oracle/ethWatcher/ethWatcher.js index ca9fea6..b59602e 100644 --- a/src/oracle/ethWatcher/ethWatcher.js +++ b/src/oracle/ethWatcher/ethWatcher.js @@ -1,5 +1,5 @@ const Web3 = require('web3') -const utils = require('ethers').utils +const { utils } = require('ethers') const BN = require('bignumber.js') const axios = require('axios') @@ -10,19 +10,21 @@ const { publicKeyToAddress } = require('./crypto') const abiBridge = require('./contracts_data/Bridge.json').abi -const { HOME_RPC_URL, HOME_BRIDGE_ADDRESS, RABBITMQ_URL, HOME_START_BLOCK, VALIDATOR_PRIVATE_KEY } = process.env +const { + HOME_RPC_URL, HOME_BRIDGE_ADDRESS, RABBITMQ_URL, HOME_START_BLOCK, VALIDATOR_PRIVATE_KEY +} = process.env const homeWeb3 = new Web3(HOME_RPC_URL) const bridge = new homeWeb3.eth.Contract(abiBridge, HOME_BRIDGE_ADDRESS) const validatorAddress = homeWeb3.eth.accounts.privateKeyToAccount(`0x${VALIDATOR_PRIVATE_KEY}`).address +const foreignNonce = [] let channel let exchangeQueue let signQueue let keygenQueue let cancelKeygenQueue let blockNumber -let foreignNonce = [] let epoch let epochStart let redisTx @@ -30,16 +32,17 @@ let rangeSize let lastTransactionBlockNumber let isCurrentValidator -async function resetFutureMessages (queue) { +async function resetFutureMessages(queue) { logger.debug(`Resetting future messages in queue ${queue.name}`) const { messageCount } = await channel.checkQueue(queue.name) if (messageCount) { logger.info(`Filtering ${messageCount} reloaded messages from queue ${queue.name}`) const backup = await assertQueue(channel, `${queue.name}.backup`) - do { + while (true) { const message = await queue.get() - if (message === false) + if (message === false) { break + } const data = JSON.parse(message.content) if (data.blockNumber < blockNumber) { logger.debug('Saving message %o', data) @@ -48,25 +51,134 @@ async function resetFutureMessages (queue) { logger.debug('Dropping message %o', data) } channel.ack(message) - } while (true) + } logger.debug('Dropped messages came from future') - do { + while (true) { const message = await backup.get() - if (message === false) + if (message === false) { break + } const data = JSON.parse(message.content) logger.debug('Requeuing message %o', data) queue.send(data) channel.ack(message) - } while (true) + } logger.debug('Redirected messages back to initial queue') } } -async function initialize () { +async function sendKeygen(event) { + const newEpoch = event.returnValues.newEpoch.toNumber() + keygenQueue.send({ + epoch: newEpoch, + blockNumber, + threshold: (await bridge.methods.getThreshold(newEpoch) + .call()).toNumber(), + parties: (await bridge.methods.getParties(newEpoch) + .call()).toNumber() + }) + logger.debug('Sent keygen start event') +} + +function sendKeygenCancellation(event) { + const eventEpoch = event.returnValues.epoch.toNumber() + cancelKeygenQueue.send({ + epoch: eventEpoch, + blockNumber + }) + logger.debug('Sent keygen cancellation event') +} + +async function sendSignFundsTransfer(event) { + const newEpoch = event.returnValues.newEpoch.toNumber() + const oldEpoch = event.returnValues.oldEpoch.toNumber() + signQueue.send({ + epoch: oldEpoch, + blockNumber, + newEpoch, + nonce: foreignNonce[oldEpoch], + threshold: (await bridge.methods.getThreshold(oldEpoch) + .call()).toNumber(), + parties: (await bridge.methods.getParties(oldEpoch) + .call()).toNumber() + }) + logger.debug('Sent sign funds transfer event') + foreignNonce[oldEpoch] += 1 + redisTx.incr(`foreignNonce${oldEpoch}`) +} + +async function sendSign(event) { + const tx = await homeWeb3.eth.getTransaction(event.transactionHash) + const msg = utils.serializeTransaction({ + nonce: tx.nonce, + gasPrice: `0x${new BN(tx.gasPrice).toString(16)}`, + gasLimit: `0x${new BN(tx.gas).toString(16)}`, + to: tx.to, + value: `0x${new BN(tx.value).toString(16)}`, + data: tx.input, + chainId: await homeWeb3.eth.net.getId() + }) + const hash = homeWeb3.utils.sha3(msg) + const publicKey = utils.recoverPublicKey(hash, { + r: tx.r, + s: tx.s, + v: tx.v + }) + const msgToQueue = { + epoch, + blockNumber, + recipient: publicKeyToAddress({ + x: publicKey.substr(4, 64), + y: publicKey.substr(68, 64) + }), + value: (new BN(event.returnValues.value)).dividedBy(10 ** 18) + .toFixed(8, 3), + nonce: event.returnValues.nonce.toNumber() + } + + exchangeQueue.send(msgToQueue) + logger.debug('Sent new sign event: %o', msgToQueue) + + lastTransactionBlockNumber = blockNumber + redisTx.set('lastTransactionBlockNumber', blockNumber) + logger.debug(`Set lastTransactionBlockNumber to ${blockNumber}`) +} + +async function sendStartSign() { + redisTx.incr(`foreignNonce${epoch}`) + signQueue.send({ + epoch, + blockNumber, + nonce: foreignNonce[epoch], + threshold: (await bridge.methods.getThreshold(epoch) + .call()).toNumber(), + parties: (await bridge.methods.getParties(epoch) + .call()).toNumber() + }) + foreignNonce[epoch] += 1 +} + +async function processEpochStart(event) { + epoch = event.returnValues.epoch.toNumber() + epochStart = blockNumber + logger.info(`Epoch ${epoch} started`) + rangeSize = (await bridge.methods.getRangeSize() + .call()).toNumber() + isCurrentValidator = (await bridge.methods.getValidators() + .call()).includes(validatorAddress) + if (isCurrentValidator) { + logger.info(`${validatorAddress} is a current validator`) + } else { + logger.info(`${validatorAddress} is not a current validator`) + } + logger.info(`Updated range size to ${rangeSize}`) + foreignNonce[epoch] = 0 +} + +async function initialize() { channel = await connectRabbit(RABBITMQ_URL) exchangeQueue = await assertQueue(channel, 'exchangeQueue') signQueue = await assertQueue(channel, 'signQueue') @@ -79,11 +191,12 @@ async function initialize () { epoch = events.length ? events[events.length - 1].returnValues.epoch.toNumber() : 0 logger.info(`Current epoch ${epoch}`) epochStart = events.length ? events[events.length - 1].blockNumber : 1 - const saved = (parseInt(await redis.get('homeBlock')) + 1) || parseInt(HOME_START_BLOCK) + const saved = (parseInt(await redis.get('homeBlock'), 10) + 1) || parseInt(HOME_START_BLOCK, 10) if (epochStart > saved) { logger.info(`Data in db is outdated, starting from epoch ${epoch}, block #${epochStart}`) blockNumber = epochStart - rangeSize = (await bridge.methods.getRangeSize().call()).toNumber() + rangeSize = (await bridge.methods.getRangeSize() + .call()).toNumber() await redis.multi() .set('homeBlock', blockNumber - 1) .set(`foreignNonce${epoch}`, 0) @@ -92,10 +205,11 @@ async function initialize () { } else { logger.info('Restoring epoch and block number from local db') blockNumber = saved - foreignNonce[epoch] = parseInt(await redis.get(`foreignNonce${epoch}`)) || 0 + foreignNonce[epoch] = parseInt(await redis.get(`foreignNonce${epoch}`), 10) || 0 } logger.debug('Checking if current validator') - isCurrentValidator = (await bridge.methods.getValidators().call()).includes(validatorAddress) + isCurrentValidator = (await bridge.methods.getValidators() + .call()).includes(validatorAddress) if (isCurrentValidator) { logger.info(`${validatorAddress} is a current validator`) } else { @@ -106,16 +220,16 @@ async function initialize () { await resetFutureMessages(cancelKeygenQueue) await resetFutureMessages(exchangeQueue) await resetFutureMessages(signQueue) - logger.debug(`Sending start commands`) + logger.debug('Sending start commands') await axios.get('http://keygen:8001/start') await axios.get('http://signer:8001/start') } -async function main () { +async function main() { logger.debug(`Watching events in block #${blockNumber}`) if (await homeWeb3.eth.getBlock(blockNumber) === null) { logger.debug('No block') - await new Promise(r => setTimeout(r, 1000)) + await new Promise((r) => setTimeout(r, 1000)) return } @@ -126,7 +240,8 @@ async function main () { toBlock: blockNumber }) - for (const event of bridgeEvents) { + for (let i = 0; i < bridgeEvents.length; i += 1) { + const event = bridgeEvents[i] switch (event.event) { case 'NewEpoch': await sendKeygen(event) @@ -135,14 +250,20 @@ async function main () { sendKeygenCancellation(event) break case 'NewFundsTransfer': - isCurrentValidator && await sendSignFundsTransfer(event) + if (isCurrentValidator) { + await sendSignFundsTransfer(event) + } break case 'ExchangeRequest': - isCurrentValidator && await sendSign(event) + if (isCurrentValidator) { + await sendSign(event) + } break case 'EpochStart': await processEpochStart(event) break + default: + logger.warn('Unknown event %o', event) } } @@ -155,108 +276,16 @@ async function main () { } } - blockNumber++ + blockNumber += 1 // Exec redis tx - await redisTx.incr('homeBlock').exec() + await redisTx.incr('homeBlock') + .exec() await redis.save() } -initialize().then(async () => { - while (true) { - await main() - } -}, e => logger.warn('Initialization failed %o', e)) - -async function sendKeygen (event) { - const newEpoch = event.returnValues.newEpoch.toNumber() - keygenQueue.send({ - epoch: newEpoch, - blockNumber, - threshold: (await bridge.methods.getThreshold(newEpoch).call()).toNumber(), - parties: (await bridge.methods.getParties(newEpoch).call()).toNumber() - }) - logger.debug('Sent keygen start event') -} - -function sendKeygenCancellation (event) { - const epoch = event.returnValues.epoch.toNumber() - cancelKeygenQueue.send({ - epoch, - blockNumber - }) - logger.debug('Sent keygen cancellation event') -} - -async function sendSignFundsTransfer (event) { - const newEpoch = event.returnValues.newEpoch.toNumber() - const oldEpoch = event.returnValues.oldEpoch.toNumber() - signQueue.send({ - epoch: oldEpoch, - blockNumber, - newEpoch, - nonce: foreignNonce[oldEpoch], - threshold: (await bridge.methods.getThreshold(oldEpoch).call()).toNumber(), - parties: (await bridge.methods.getParties(oldEpoch).call()).toNumber() - }) - logger.debug('Sent sign funds transfer event') - foreignNonce[oldEpoch]++ - redisTx.incr(`foreignNonce${oldEpoch}`) -} - -async function sendSign (event) { - const tx = await homeWeb3.eth.getTransaction(event.transactionHash) - const msg = utils.serializeTransaction({ - nonce: tx.nonce, - gasPrice: `0x${new BN(tx.gasPrice).toString(16)}`, - gasLimit: `0x${new BN(tx.gas).toString(16)}`, - to: tx.to, - value: `0x${new BN(tx.value).toString(16)}`, - data: tx.input, - chainId: await homeWeb3.eth.net.getId() - }) - const hash = homeWeb3.utils.sha3(msg) - const publicKey = utils.recoverPublicKey(hash, { r: tx.r, s: tx.s, v: tx.v }) - const msgToQueue = { - epoch, - blockNumber, - recipient: publicKeyToAddress({ - x: publicKey.substr(4, 64), - y: publicKey.substr(68, 64) - }), - value: (new BN(event.returnValues.value)).dividedBy(10 ** 18).toFixed(8, 3), - nonce: event.returnValues.nonce.toNumber() - } - - exchangeQueue.send(msgToQueue) - logger.debug('Sent new sign event: %o', msgToQueue) - - lastTransactionBlockNumber = blockNumber - redisTx.set('lastTransactionBlockNumber', blockNumber) - logger.debug(`Set lastTransactionBlockNumber to ${blockNumber}`) -} - -async function sendStartSign () { - redisTx.incr(`foreignNonce${epoch}`) - signQueue.send({ - epoch, - blockNumber, - nonce: foreignNonce[epoch]++, - threshold: (await bridge.methods.getThreshold(epoch).call()).toNumber(), - parties: (await bridge.methods.getParties(epoch).call()).toNumber() - }) -} - -async function processEpochStart (event) { - epoch = event.returnValues.epoch.toNumber() - epochStart = blockNumber - logger.info(`Epoch ${epoch} started`) - rangeSize = (await bridge.methods.getRangeSize().call()).toNumber() - isCurrentValidator = (await bridge.methods.getValidators().call()).includes(validatorAddress) - if (isCurrentValidator) { - logger.info(`${validatorAddress} is a current validator`) - } else { - logger.info(`${validatorAddress} is not a current validator`) - } - logger.info(`Updated range size to ${rangeSize}`) - foreignNonce[epoch] = 0 -} +initialize() + .then(async () => { + while (true) { + await main() + } + }, (e) => logger.warn('Initialization failed %o', e)) diff --git a/src/oracle/ethWatcher/package.json b/src/oracle/ethWatcher/package.json index 027e9de..26ec5a6 100644 --- a/src/oracle/ethWatcher/package.json +++ b/src/oracle/ethWatcher/package.json @@ -11,5 +11,8 @@ "pino": "5.13.4", "pino-pretty": "3.2.1", "axios": "0.19.0" + }, + "engines": { + "node": ">=10.6.0" } } diff --git a/src/oracle/proxy/decode.js b/src/oracle/proxy/decode.js index b736749..f1d2e2e 100644 --- a/src/oracle/proxy/decode.js +++ b/src/oracle/proxy/decode.js @@ -1,18 +1,19 @@ const BN = require('bn.js') -function Tokenizer (_buffer) { +function Tokenizer(_buffer) { const buffer = _buffer let position = 0 return { - isEmpty: function () { + isEmpty() { return position === buffer.length }, - parse: function (length = 32, base = 16) { + parse(length = 32, base = 16) { const res = new BN(buffer.slice(position, position + length)).toString(base) position += length return res }, - byte: function () { + byte() { + // eslint-disable-next-line no-plusplus return buffer[position++] } } @@ -21,7 +22,7 @@ function Tokenizer (_buffer) { const keygenDecoders = [ null, // round 1 - function (tokenizer) { + (tokenizer) => { const res = { e: { n: tokenizer.parse(256, 10) @@ -37,23 +38,21 @@ const keygenDecoders = [ return res }, // round 2 - function (tokenizer) { - return { - blind_factor: tokenizer.parse(), - y_i: { - x: tokenizer.parse(), - y: tokenizer.parse() - } + (tokenizer) => ({ + blind_factor: tokenizer.parse(), + y_i: { + x: tokenizer.parse(), + y: tokenizer.parse() } - }, + }), // round 3 - function (tokenizer) { + (tokenizer) => { const res = { ciphertext: [], tag: [] } const ciphertextLength = tokenizer.byte() // probably 32 - for (let i = 0; i < ciphertextLength; i++) { + for (let i = 0; i < ciphertextLength; i += 1) { res.ciphertext.push(tokenizer.byte()) } while (!tokenizer.isEmpty()) { @@ -62,7 +61,7 @@ const keygenDecoders = [ return res }, // round 4 - function (tokenizer) { + (tokenizer) => { const res = { parameters: { threshold: tokenizer.byte(), @@ -73,157 +72,139 @@ const keygenDecoders = [ while (!tokenizer.isEmpty()) { res.commitments.push({ x: tokenizer.parse(), - y: tokenizer.parse(), + y: tokenizer.parse() }) } return res }, // round 5 - function (tokenizer) { - return { - pk: { - x: tokenizer.parse(), - y: tokenizer.parse() - }, - pk_t_rand_commitment: { - x: tokenizer.parse(), - y: tokenizer.parse() - }, - challenge_response: tokenizer.parse() - } - } + (tokenizer) => ({ + pk: { + x: tokenizer.parse(), + y: tokenizer.parse() + }, + pk_t_rand_commitment: { + x: tokenizer.parse(), + y: tokenizer.parse() + }, + challenge_response: tokenizer.parse() + }) ] const signDecoders = [ // round 0 - function (tokenizer) { - return tokenizer.byte() - }, + (tokenizer) => tokenizer.byte(), // round 1 - function (tokenizer) { - return [ - { - com: tokenizer.parse() - }, - { - c: tokenizer.parse(512) - } - ] - }, + (tokenizer) => [ + { + com: tokenizer.parse() + }, + { + c: tokenizer.parse(512) + } + ], // round 2 - function (tokenizer) { + (tokenizer) => { const res = [] - for (let i = 0; i < 2; i++) { + for (let i = 0; i < 2; i += 1) { res[i] = { c: tokenizer.parse(512), b_proof: { pk: { x: tokenizer.parse(), - y: tokenizer.parse(), + y: tokenizer.parse() }, pk_t_rand_commitment: { x: tokenizer.parse(), - y: tokenizer.parse(), + y: tokenizer.parse() }, - challenge_response: tokenizer.parse(), + challenge_response: tokenizer.parse() }, beta_tag_proof: { pk: { x: tokenizer.parse(), - y: tokenizer.parse(), + y: tokenizer.parse() }, pk_t_rand_commitment: { x: tokenizer.parse(), - y: tokenizer.parse(), + y: tokenizer.parse() }, - challenge_response: tokenizer.parse(), + challenge_response: tokenizer.parse() } } } return res }, // round 3 - function (tokenizer) { - return tokenizer.parse() - }, + (tokenizer) => tokenizer.parse(), // round 4 - function (tokenizer) { - return { - blind_factor: tokenizer.parse(), - g_gamma_i: { - x: tokenizer.parse(), - y: tokenizer.parse() - } + (tokenizer) => ({ + blind_factor: tokenizer.parse(), + g_gamma_i: { + x: tokenizer.parse(), + y: tokenizer.parse() } - }, + }), // round 5 - function (tokenizer) { - return { - com: tokenizer.parse() - } - }, + (tokenizer) => ({ + com: tokenizer.parse() + }), // round 6 - function (tokenizer) { - return [ - { - V_i: { - x: tokenizer.parse(), - y: tokenizer.parse() - }, - A_i: { - x: tokenizer.parse(), - y: tokenizer.parse() - }, - B_i: { - x: tokenizer.parse(), - y: tokenizer.parse() - }, - blind_factor: tokenizer.parse() - }, - { - T: { - x: tokenizer.parse(), - y: tokenizer.parse() - }, - A3: { - x: tokenizer.parse(), - y: tokenizer.parse() - }, - z1: tokenizer.parse(), - z2: tokenizer.parse() - } - ] - }, - // round 7 - function (tokenizer) { - return { - com: tokenizer.parse() - } - }, - // round 8 - function (tokenizer) { - return { - u_i: { + (tokenizer) => [ + { + V_i: { x: tokenizer.parse(), y: tokenizer.parse() }, - t_i: { + A_i: { + x: tokenizer.parse(), + y: tokenizer.parse() + }, + B_i: { x: tokenizer.parse(), y: tokenizer.parse() }, blind_factor: tokenizer.parse() + }, + { + T: { + x: tokenizer.parse(), + y: tokenizer.parse() + }, + A3: { + x: tokenizer.parse(), + y: tokenizer.parse() + }, + z1: tokenizer.parse(), + z2: tokenizer.parse() } - }, + ], + // round 7 + (tokenizer) => ({ + com: tokenizer.parse() + }), + // round 8 + (tokenizer) => ({ + u_i: { + x: tokenizer.parse(), + y: tokenizer.parse() + }, + t_i: { + x: tokenizer.parse(), + y: tokenizer.parse() + }, + blind_factor: tokenizer.parse() + }), // round 9 - function (tokenizer) { - return tokenizer.parse() - }, + (tokenizer) => tokenizer.parse() ] -module.exports = function (isKeygen, round, value) { - value = Buffer.from(value.substr(2), 'hex') - const tokenizer = Tokenizer(value) - const roundNumber = parseInt(round[round.length - 1]) +function decode(isKeygen, round, value) { + const newValue = Buffer.from(value.substr(2), 'hex') + const tokenizer = Tokenizer(newValue) + const roundNumber = parseInt(round[round.length - 1], 10) const decoder = (isKeygen ? keygenDecoders : signDecoders)[roundNumber] return JSON.stringify(decoder(tokenizer)) } + +module.exports = decode diff --git a/src/oracle/proxy/encode.js b/src/oracle/proxy/encode.js index 1178306..4a18410 100644 --- a/src/oracle/proxy/encode.js +++ b/src/oracle/proxy/encode.js @@ -2,43 +2,44 @@ const BN = require('bignumber.js') const { padZeros } = require('./crypto') -function makeBuffer (value, length = 32, base = 16) { +function makeBuffer(value, length = 32, base = 16) { return Buffer.from(padZeros(new BN(value, base).toString(16), length * 2), 'hex') } const keygenEncoders = [ null, // round 1 - function * (value) { + function* g(value) { yield makeBuffer(value.e.n, 256, 10) yield makeBuffer(value.com) - for (let x of value.correct_key_proof.sigma_vec) { - yield makeBuffer(x, 256, 10) + for (let i = 0; i < value.correct_key_proof.sigma_vec.length; i += 1) { + yield makeBuffer(value.correct_key_proof.sigma_vecp[i], 256, 10) } }, // round 2 - function * (value) { + function* g(value) { yield makeBuffer(value.blind_factor) yield makeBuffer(value.y_i.x) yield makeBuffer(value.y_i.y) }, // round 3 - function * (value) { - yield Buffer.from([ value.ciphertext.length ]) + function* g(value) { + yield Buffer.from([value.ciphertext.length]) yield Buffer.from(value.ciphertext) // 32 bytes or less yield Buffer.from(value.tag) // 16 bytes or less }, // round 4 - function * (value) { - yield Buffer.from([ value.parameters.threshold ]) // 1 byte - yield Buffer.from([ value.parameters.share_count ]) // 1 byte - for (let x of value.commitments) { + function* g(value) { + yield Buffer.from([value.parameters.threshold]) // 1 byte + yield Buffer.from([value.parameters.share_count]) // 1 byte + for (let i = 0; i < value.commitments.length; i += 1) { + const x = value.correct_key_proof.sigma_vec[i] yield makeBuffer(x.x) yield makeBuffer(x.y) } }, // round 5 - function * (value) { + function* g(value) { yield makeBuffer(value.pk.x) yield makeBuffer(value.pk.y) yield makeBuffer(value.pk_t_rand_commitment.x) @@ -49,17 +50,17 @@ const keygenEncoders = [ const signEncoders = [ // round 0 - function * (value) { - yield Buffer.from([ value ]) + function* g(value) { + yield Buffer.from([value]) }, // round 1 - function * (value) { + function* g(value) { yield makeBuffer(value[0].com) yield makeBuffer(value[1].c, 512) }, // round 2 - function * (value) { - for (let i = 0; i < 2; i++) { + function* g(value) { + for (let i = 0; i < 2; i += 1) { yield makeBuffer(value[i].c, 512) yield makeBuffer(value[i].b_proof.pk.x) yield makeBuffer(value[i].b_proof.pk.y) @@ -74,21 +75,21 @@ const signEncoders = [ } }, // round 3 - function * (value) { + function* g(value) { yield makeBuffer(value) }, // round 4 - function * (value) { + function* g(value) { yield makeBuffer(value.blind_factor) yield makeBuffer(value.g_gamma_i.x) yield makeBuffer(value.g_gamma_i.y) }, // round 5 - function * (value) { + function* g(value) { yield makeBuffer(value.com) }, // round 6 - function * (value) { + function* g(value) { yield makeBuffer(value[0].V_i.x) yield makeBuffer(value[0].V_i.y) yield makeBuffer(value[0].A_i.x) @@ -104,11 +105,11 @@ const signEncoders = [ yield makeBuffer(value[1].z2) }, // round 7 - function * (value) { + function* g(value) { yield makeBuffer(value.com) }, // round 8 - function * (value) { + function* g(value) { yield makeBuffer(value.u_i.x) yield makeBuffer(value.u_i.y) yield makeBuffer(value.t_i.x) @@ -116,23 +117,23 @@ const signEncoders = [ yield makeBuffer(value.blind_factor) }, // round 9 - function * (value) { + function* g(value) { yield makeBuffer(value) - }, + } ] -module.exports = function (isKeygen, round, value) { +function encode(isKeygen, round, value) { const parsedValue = JSON.parse(value) - const roundNumber = parseInt(round[round.length - 1]) + const roundNumber = parseInt(round[round.length - 1], 10) const encoder = (isKeygen ? keygenEncoders : signEncoders)[roundNumber] const generator = encoder(parsedValue) const buffers = [] - let next - while (true) { - next = generator.next() - if (next.done) - break + let next = generator.next() + while (!next.done) { buffers.push(next.value) + next = generator.next() } return Buffer.concat(buffers) } + +module.exports = encode diff --git a/src/oracle/proxy/index.js b/src/oracle/proxy/index.js index 99122a7..ef7e76f 100644 --- a/src/oracle/proxy/index.js +++ b/src/oracle/proxy/index.js @@ -12,8 +12,8 @@ const logger = require('./logger') const { publicKeyToAddress } = require('./crypto') const { - HOME_RPC_URL, HOME_BRIDGE_ADDRESS, SIDE_RPC_URL, SIDE_SHARED_DB_ADDRESS, VALIDATOR_PRIVATE_KEY, HOME_CHAIN_ID, - SIDE_CHAIN_ID, HOME_TOKEN_ADDRESS, FOREIGN_URL, FOREIGN_ASSET + HOME_RPC_URL, HOME_BRIDGE_ADDRESS, SIDE_RPC_URL, SIDE_SHARED_DB_ADDRESS, VALIDATOR_PRIVATE_KEY, + HOME_TOKEN_ADDRESS, FOREIGN_URL, FOREIGN_ASSET } = process.env const abiSharedDb = require('./contracts_data/SharedDB.json').abi const abiBridge = require('./contracts_data/Bridge.json').abi @@ -39,28 +39,9 @@ const app = express() app.use(express.json()) app.use(express.urlencoded({ extended: true })) -app.post('/get', get) -app.post('/set', set) -app.post('/signupkeygen', signupKeygen) -app.post('/signupsign', signupSign) - -app.post('/confirmKeygen', confirmKeygen) -app.post('/confirmFundsTransfer', confirmFundsTransfer) -app.post('/transfer', transfer) - const votesProxyApp = express() -votesProxyApp.use(express.json()) -votesProxyApp.use(express.urlencoded({ extended: true })) -votesProxyApp.get('/vote/startVoting', voteStartVoting) -votesProxyApp.get('/vote/startKeygen', voteStartKeygen) -votesProxyApp.get('/vote/cancelKeygen', voteCancelKeygen) -votesProxyApp.get('/vote/addValidator/:validator', voteAddValidator) -votesProxyApp.get('/vote/removeValidator/:validator', voteRemoveValidator) -votesProxyApp.get('/vote/changeThreshold/:threshold', voteChangeThreshold) -votesProxyApp.get('/info', info) - -async function main () { +async function main() { homeValidatorNonce = await homeWeb3.eth.getTransactionCount(validatorAddress) sideValidatorNonce = await sideWeb3.eth.getTransactionCount(validatorAddress) @@ -80,35 +61,77 @@ async function main () { main() -function Ok (data) { +function Ok(data) { return { Ok: data } } -function Err (data) { +function Err(data) { return { Err: data } } -async function get (req, res) { +function sideSendQuery(query) { + return lock.acquire('home', async () => { + logger.debug('Sending side query') + const encodedABI = query.encodeABI() + const senderResponse = await sideSender({ + data: encodedABI, + to: SIDE_SHARED_DB_ADDRESS, + nonce: sideValidatorNonce + }) + if (senderResponse !== true) { + sideValidatorNonce += 1 + } + return senderResponse + }) +} + +function homeSendQuery(query) { + return lock.acquire('home', async () => { + logger.debug('Sending home query') + const encodedABI = query.encodeABI() + const senderResponse = await homeSender({ + data: encodedABI, + to: HOME_BRIDGE_ADDRESS, + nonce: homeValidatorNonce + }) + if (senderResponse !== true) { + homeValidatorNonce += 1 + } + return senderResponse + }) +} + +async function get(req, res) { logger.debug('Get call, %o', req.body.key) const round = req.body.key.second const uuid = req.body.key.third let from - if (uuid.startsWith('k')) - from = (await bridge.methods.getNextValidators().call())[parseInt(req.body.key.first) - 1] - else { - const validators = await bridge.methods.getValidators().call() - from = await sharedDb.methods.getSignupAddress(uuid, validators, parseInt(req.body.key.first)).call() + if (uuid.startsWith('k')) { + from = (await bridge.methods.getNextValidators() + .call())[parseInt(req.body.key.first, 10) - 1] + } else { + const validators = await bridge.methods.getValidators() + .call() + from = await sharedDb.methods.getSignupAddress( + uuid, + validators, parseInt(req.body.key.first, 10) + ) + .call() } const to = Number(req.body.key.fourth) // 0 if empty const key = homeWeb3.utils.sha3(`${round}_${to}`) - const data = await sharedDb.methods.getData(from, sideWeb3.utils.sha3(uuid), key).call() + const data = await sharedDb.methods.getData(from, sideWeb3.utils.sha3(uuid), key) + .call() if (data.length > 2) { logger.trace(`Received encoded data: ${data}`) const decoded = decode(uuid[0] === 'k', round, data) logger.trace('Decoded data: %o', decoded) - res.send(Ok({ key: req.body.key, value: decoded })) + res.send(Ok({ + key: req.body.key, + value: decoded + })) } else { setTimeout(() => res.send(Err(null)), 1000) } @@ -116,7 +139,7 @@ async function get (req, res) { logger.debug('Get end') } -async function set (req, res) { +async function set(req, res) { logger.debug('Set call') const round = req.body.key.second const uuid = req.body.key.third @@ -134,21 +157,26 @@ async function set (req, res) { logger.debug('Set end') } -async function signupKeygen (req, res) { +async function signupKeygen(req, res) { logger.debug('SignupKeygen call') - const epoch = (await bridge.methods.nextEpoch().call()).toNumber() - const partyId = (await bridge.methods.getNextPartyId(validatorAddress).call()).toNumber() + const epoch = (await bridge.methods.nextEpoch() + .call()).toNumber() + const partyId = (await bridge.methods.getNextPartyId(validatorAddress) + .call()).toNumber() if (partyId === 0) { res.send(Err({ message: 'Not a validator' })) logger.debug('Not a validator') } else { - res.send(Ok({ uuid: `k${epoch}`, number: partyId })) + res.send(Ok({ + uuid: `k${epoch}`, + number: partyId + })) logger.debug('SignupKeygen end') } } -async function signupSign (req, res) { +async function signupSign(req, res) { logger.debug('SignupSign call') const hash = sideWeb3.utils.sha3(`0x${req.body.third}`) const query = sharedDb.methods.signupSign(hash) @@ -157,19 +185,27 @@ async function signupSign (req, res) { // Already have signup if (receipt.status === false) { - res.send(Ok({ uuid: hash, number: 0 })) + res.send(Ok({ + uuid: hash, + number: 0 + })) logger.debug('Already have signup') return } - const validators = await bridge.methods.getValidators().call() - const id = (await sharedDb.methods.getSignupNumber(hash, validators, validatorAddress).call()).toNumber() + const validators = await bridge.methods.getValidators() + .call() + const id = (await sharedDb.methods.getSignupNumber(hash, validators, validatorAddress) + .call()).toNumber() - res.send(Ok({ uuid: hash, number: id })) + res.send(Ok({ + uuid: hash, + number: id + })) logger.debug('SignupSign end') } -async function confirmKeygen (req, res) { +async function confirmKeygen(req, res) { logger.debug('Confirm keygen call') const { x, y } = req.body[5] const query = bridge.methods.confirmKeygen(`0x${x}`, `0x${y}`) @@ -178,7 +214,7 @@ async function confirmKeygen (req, res) { logger.debug('Confirm keygen end') } -async function confirmFundsTransfer (req, res) { +async function confirmFundsTransfer(req, res) { logger.debug('Confirm funds transfer call') const query = bridge.methods.confirmFundsTransfer() await homeSendQuery(query) @@ -186,49 +222,7 @@ async function confirmFundsTransfer (req, res) { logger.debug('Confirm funds transfer end') } -function sideSendQuery (query) { - return lock.acquire('home', async () => { - logger.debug('Sending side query') - const encodedABI = query.encodeABI() - const senderResponse = await sideSender({ - data: encodedABI, - to: SIDE_SHARED_DB_ADDRESS, - nonce: sideValidatorNonce - }) - if (senderResponse !== true) { - sideValidatorNonce++ - } - return senderResponse - }) -} - -function homeSendQuery (query) { - return lock.acquire('home', async () => { - logger.debug('Sending home query') - const encodedABI = query.encodeABI() - const senderResponse = await homeSender({ - data: encodedABI, - to: HOME_BRIDGE_ADDRESS, - nonce: homeValidatorNonce - }) - if (senderResponse !== true) { - homeValidatorNonce++ - } - return senderResponse - }) -} - -function parseReason (message) { - const result = /(?<="reason":").*?(?=")/.exec(message) - return result ? result[0] : '' -} - -function parseError (message) { - const result = /(?<="error":").*?(?=")/.exec(message) - return result ? result[0] : '' -} - -async function sendVote (query, req, res, waitFlag = false) { +async function sendVote(query, req, res, waitFlag = false) { try { const sentQuery = await homeSendQuery(query) let { txHash, gasLimit } = sentQuery @@ -262,43 +256,43 @@ async function sendVote (query, req, res, waitFlag = false) { } } -async function voteStartVoting (req, res) { +async function voteStartVoting(req, res) { logger.info('Voting for starting new epoch voting process') const query = bridge.methods.startVoting() sendVote(query, req, res, true) } -async function voteStartKeygen (req, res) { +async function voteStartKeygen(req, res) { logger.info('Voting for starting new epoch keygen') const query = bridge.methods.voteStartKeygen() sendVote(query, req, res) } -async function voteCancelKeygen (req, res) { +async function voteCancelKeygen(req, res) { logger.info('Voting for cancelling new epoch keygen') const query = bridge.methods.voteCancelKeygen() sendVote(query, req, res) } -async function voteAddValidator (req, res) { +async function voteAddValidator(req, res) { logger.info('Voting for adding new validator') const query = bridge.methods.voteAddValidator(req.params.validator) sendVote(query, req, res) } -async function voteChangeThreshold (req, res) { +async function voteChangeThreshold(req, res) { logger.info('Voting for changing threshold') const query = bridge.methods.voteChangeThreshold(req.params.threshold) sendVote(query, req, res) } -async function voteRemoveValidator (req, res) { +async function voteRemoveValidator(req, res) { logger.info('Voting for removing validator') const query = bridge.methods.voteRemoveValidator(req.params.validator) sendVote(query, req, res, true) } -function decodeStatus (status) { +function decodeStatus(status) { switch (status) { case 0: return 'ready' @@ -308,10 +302,12 @@ function decodeStatus (status) { return 'keygen' case 3: return 'funds_transfer' + default: + return 'unknown_state' } } -function boundX (x) { +function boundX(x) { try { return x.toNumber() } catch (e) { @@ -319,32 +315,101 @@ function boundX (x) { } } -async function info (req, res) { +function toNumber(x) { + return x.toNumber() +} + +async function transfer(req, res) { + logger.info('Transfer start') + const { hash, to, value } = req.body + if (homeWeb3.utils.isAddress(to)) { + logger.info(`Calling transfer to ${to}, ${value} tokens`) + const query = bridge.methods.transfer(hash, to, `0x${new BN(value).toString(16)}`) + await homeSendQuery(query) + } + res.send() + logger.info('Transfer end') +} + +function getForeignBalances(address) { + return httpClient + .get(`/api/v1/account/${address}`) + .then((res) => res.data.balances.reduce((prev, cur) => { + // eslint-disable-next-line no-param-reassign + prev[cur.symbol] = cur.free + return prev + }, {})) + .catch(() => ({})) +} + +async function info(req, res) { logger.debug('Info start') try { - const [ x, y, epoch, rangeSize, nextRangeSize, epochStartBlock, foreignNonce, nextEpoch, threshold, nextThreshold, validators, nextValidators, status, homeBalance ] = await Promise.all([ - bridge.methods.getX().call().then(x => new BN(x).toString(16)), - bridge.methods.getY().call().then(x => new BN(x).toString(16)), - bridge.methods.epoch().call().then(x => x.toNumber()), - bridge.methods.getRangeSize().call().then(x => x.toNumber()), - bridge.methods.getNextRangeSize().call().then(x => x.toNumber()), - bridge.methods.getStartBlock().call().then(x => x.toNumber()), - bridge.methods.getNonce().call().then(boundX), - bridge.methods.nextEpoch().call().then(x => x.toNumber()), - bridge.methods.getThreshold().call().then(x => x.toNumber()), - bridge.methods.getNextThreshold().call().then(x => x.toNumber()), - bridge.methods.getValidators().call(), - bridge.methods.getNextValidators().call(), - bridge.methods.status().call(), - token.methods.balanceOf(HOME_BRIDGE_ADDRESS).call().then(x => parseFloat(new BN(x).dividedBy(10 ** 18).toFixed(8, 3))) + const [ + x, y, epoch, rangeSize, nextRangeSize, epochStartBlock, foreignNonce, nextEpoch, + threshold, nextThreshold, validators, nextValidators, status, homeBalance + ] = await Promise.all([ + bridge.methods.getX() + .call() + .then((value) => new BN(value).toString(16)), + bridge.methods.getY() + .call() + .then((value) => new BN(value).toString(16)), + bridge.methods.epoch() + .call() + .then(toNumber), + bridge.methods.getRangeSize() + .call() + .then(toNumber), + bridge.methods.getNextRangeSize() + .call() + .then(toNumber), + bridge.methods.getStartBlock() + .call() + .then(toNumber), + bridge.methods.getNonce() + .call() + .then(boundX), + bridge.methods.nextEpoch() + .call() + .then(toNumber), + bridge.methods.getThreshold() + .call() + .then(toNumber), + bridge.methods.getNextThreshold() + .call() + .then(toNumber), + bridge.methods.getValidators() + .call(), + bridge.methods.getNextValidators() + .call(), + bridge.methods.status() + .call(), + token.methods.balanceOf(HOME_BRIDGE_ADDRESS) + .call() + .then((value) => parseFloat(new BN(value).dividedBy(10 ** 18) + .toFixed(8, 3))) ]) - const [ confirmationsForFundsTransfer, votesForVoting, votesForKeygen, votesForCancelKeygen ] = await Promise.all([ - bridge.methods.votesCount(homeWeb3.utils.sha3(utils.solidityPack([ 'uint8', 'uint256' ], [ 1, nextEpoch ]))).call().then(boundX), - bridge.methods.votesCount(homeWeb3.utils.sha3(utils.solidityPack([ 'uint8', 'uint256' ], [ 2, nextEpoch ]))).call().then(boundX), - bridge.methods.votesCount(homeWeb3.utils.sha3(utils.solidityPack([ 'uint8', 'uint256' ], [ 7, nextEpoch ]))).call().then(boundX), - bridge.methods.votesCount(homeWeb3.utils.sha3(utils.solidityPack([ 'uint8', 'uint256' ], [ 8, nextEpoch ]))).call().then(boundX) + const [ + confirmationsForFundsTransfer, votesForVoting, votesForKeygen, votesForCancelKeygen + ] = await Promise.all([ + bridge.methods.votesCount(homeWeb3.utils.sha3(utils.solidityPack(['uint8', 'uint256'], [1, nextEpoch]))) + .call() + .then(boundX), + bridge.methods.votesCount(homeWeb3.utils.sha3(utils.solidityPack(['uint8', 'uint256'], [2, nextEpoch]))) + .call() + .then(boundX), + bridge.methods.votesCount(homeWeb3.utils.sha3(utils.solidityPack(['uint8', 'uint256'], [7, nextEpoch]))) + .call() + .then(boundX), + bridge.methods.votesCount(homeWeb3.utils.sha3(utils.solidityPack(['uint8', 'uint256'], [8, nextEpoch]))) + .call() + .then(boundX) ]) - const foreignAddress = publicKeyToAddress({ x, y }) + const foreignAddress = publicKeyToAddress({ + x, + y + }) const balances = await getForeignBalances(foreignAddress) const msg = { epoch, @@ -361,7 +426,7 @@ async function info (req, res) { nextValidators, homeBalance, foreignBalanceTokens: parseFloat(balances[FOREIGN_ASSET]) || 0, - foreignBalanceNative: parseFloat(balances['BNB']) || 0, + foreignBalanceNative: parseFloat(balances.BNB) || 0, bridgeStatus: decodeStatus(status), votesForVoting, votesForKeygen, @@ -372,29 +437,27 @@ async function info (req, res) { res.send(msg) } catch (e) { logger.debug('%o', e) - res.send({ message: 'Something went wrong, resend request', error: e }) + res.send({ + message: 'Something went wrong, resend request', + error: e + }) } logger.debug('Info end') } -async function transfer (req, res) { - logger.info('Transfer start') - const { hash, to, value } = req.body - if (homeWeb3.utils.isAddress(to)) { - logger.info(`Calling transfer to ${to}, ${value} tokens`) - const query = bridge.methods.transfer(hash, to, '0x' + (new BN(value).toString(16))) - await homeSendQuery(query) - } - res.send() - logger.info('Transfer end') -} +app.post('/get', get) +app.post('/set', set) +app.post('/signupkeygen', signupKeygen) +app.post('/signupsign', signupSign) -function getForeignBalances (address) { - return httpClient - .get(`/api/v1/account/${address}`) - .then(res => res.data.balances.reduce((prev, cur) => { - prev[cur.symbol] = cur.free - return prev - }, {})) - .catch(err => ({})) -} +app.post('/confirmKeygen', confirmKeygen) +app.post('/confirmFundsTransfer', confirmFundsTransfer) +app.post('/transfer', transfer) + +votesProxyApp.get('/vote/startVoting', voteStartVoting) +votesProxyApp.get('/vote/startKeygen', voteStartKeygen) +votesProxyApp.get('/vote/cancelKeygen', voteCancelKeygen) +votesProxyApp.get('/vote/addValidator/:validator', voteAddValidator) +votesProxyApp.get('/vote/removeValidator/:validator', voteRemoveValidator) +votesProxyApp.get('/vote/changeThreshold/:threshold', voteChangeThreshold) +votesProxyApp.get('/info', info) diff --git a/src/oracle/proxy/package.json b/src/oracle/proxy/package.json index d941190..6624098 100644 --- a/src/oracle/proxy/package.json +++ b/src/oracle/proxy/package.json @@ -12,5 +12,8 @@ "ethers": "4.0.37", "pino": "5.13.4", "pino-pretty": "3.2.1" + }, + "engines": { + "node": ">=10.6.0" } } diff --git a/src/oracle/proxy/sendTx.js b/src/oracle/proxy/sendTx.js index bba562a..c18ed41 100644 --- a/src/oracle/proxy/sendTx.js +++ b/src/oracle/proxy/sendTx.js @@ -7,28 +7,28 @@ const logger = require('./logger') const { GAS_LIMIT_FACTOR, MAX_GAS_LIMIT } = process.env -function sendRpcRequest (url, method, params) { +function sendRpcRequest(url, method, params) { return axios.post(url, { jsonrpc: '2.0', method, params, id: 1 }) - .then(res => res.data) - .catch(async e => { + .then((res) => res.data) + .catch(async () => { logger.warn(`Request to ${url}, method ${method} failed, retrying`) - await new Promise(res => setTimeout(res, 1000)) + await new Promise((res) => setTimeout(res, 1000)) return sendRpcRequest(url, method, params) }) } -async function createSender (url, privateKey) { +async function createSender(url, privateKey) { const web3 = new Web3(url, null, { transactionConfirmationBlocks: 1 }) const signer = new ethers.utils.SigningKey(privateKey) const chainId = await web3.eth.net.getId() - return async function (tx) { - tx = { + return async function send(tx) { + const newTx = { data: tx.data, to: tx.to, nonce: tx.nonce, @@ -38,29 +38,30 @@ async function createSender (url, privateKey) { } try { - logger.trace(`Preparing and sending transaction %o on ${url}`, tx) - const estimate = await sendRpcRequest(url, 'eth_estimateGas', [ { + logger.trace(`Preparing and sending transaction %o on ${url}`, newTx) + const estimate = await sendRpcRequest(url, 'eth_estimateGas', [{ from: signer.address, - to: tx.to, - data: tx.data, - gasPrice: tx.gasPrice, - value: tx.value, + to: newTx.to, + data: newTx.data, + gasPrice: newTx.gasPrice, + value: newTx.value, gas: `0x${new BN(MAX_GAS_LIMIT).toString(16)}` - } ]) + }]) if (estimate.error) { logger.debug('Gas estimate failed %o, skipping tx, reverting nonce', estimate.error) return true } - const gasLimit = BN.min(new BN(estimate.result, 16).multipliedBy(GAS_LIMIT_FACTOR), MAX_GAS_LIMIT) - tx.gasLimit = `0x${new BN(gasLimit).toString(16)}` + const gasLimit = BN.min(new BN(estimate.result, 16) + .multipliedBy(GAS_LIMIT_FACTOR), MAX_GAS_LIMIT) + newTx.gasLimit = `0x${new BN(gasLimit).toString(16)}` logger.trace(`Estimated gas to ${gasLimit}`) const hash = web3.utils.sha3(ethers.utils.serializeTransaction(tx)) const signature = signer.signDigest(hash) const signedTx = ethers.utils.serializeTransaction(tx, signature) - const { result, error } = await sendRpcRequest(url, 'eth_sendRawTransaction', [ signedTx ]) + const { result, error } = await sendRpcRequest(url, 'eth_sendRawTransaction', [signedTx]) // handle nonce error // handle insufficient funds error if (error) { @@ -68,7 +69,10 @@ async function createSender (url, privateKey) { return false } - return { txHash: result, gasLimit: tx.gasLimit } + return { + txHash: result, + gasLimit: tx.gasLimit + } } catch (e) { logger.warn('Something failed, %o', e) return false @@ -76,16 +80,19 @@ async function createSender (url, privateKey) { } } -async function waitForReceipt (url, txHash) { +async function waitForReceipt(url, txHash) { while (true) { - const { result, error } = await sendRpcRequest(url, 'eth_getTransactionReceipt', [ txHash ]) + const { result, error } = await sendRpcRequest(url, 'eth_getTransactionReceipt', [txHash]) if (result === null || error) { - await new Promise(res => setTimeout(res, 1000)) + await new Promise((res) => setTimeout(res, 1000)) } else { return result } } } -module.exports = { createSender, waitForReceipt } +module.exports = { + createSender, + waitForReceipt +} diff --git a/src/oracle/scripts/resetToBlock/package.json b/src/oracle/scripts/resetToBlock/package.json index f4546c1..3a3d820 100644 --- a/src/oracle/scripts/resetToBlock/package.json +++ b/src/oracle/scripts/resetToBlock/package.json @@ -3,5 +3,8 @@ "version": "0.0.1", "dependencies": { "ioredis": "4.14.1" + }, + "engines": { + "node": ">=10.6.0" } } diff --git a/src/oracle/scripts/resetToBlock/resetToBlock.js b/src/oracle/scripts/resetToBlock/resetToBlock.js index bcbaddf..a7d540d 100644 --- a/src/oracle/scripts/resetToBlock/resetToBlock.js +++ b/src/oracle/scripts/resetToBlock/resetToBlock.js @@ -12,7 +12,7 @@ redis.on('error', () => { }) redis.on('connect', async () => { - await redis.set('homeBlock', parseInt(process.argv[2])) + await redis.set('homeBlock', parseInt(process.argv[2], 10)) await redis.save() redis.disconnect() }) diff --git a/src/oracle/shared/amqp.js b/src/oracle/shared/amqp.js index 8bc751e..e6a88d9 100644 --- a/src/oracle/shared/amqp.js +++ b/src/oracle/shared/amqp.js @@ -2,30 +2,30 @@ const amqp = require('amqplib') const logger = require('./logger') -function _connectRabbit (url) { - return amqp.connect(url).catch(() => { - logger.debug('Failed to connect to rabbitmqServer, reconnecting') - return new Promise(resolve => - setTimeout(() => resolve(_connectRabbit(url)), 2000) - ) - }) -} - async function connectRabbit(url) { - const connection = await _connectRabbit(url) - return await connection.createChannel() -} - -async function assertQueue (channel, name) { - const queue = await channel.assertQueue(name) - return { - name: queue.queue, - send: msg => channel.sendToQueue(queue.queue, Buffer.from(JSON.stringify(msg)), { - persistent: true - }), - get: consumer => channel.get(queue.queue, consumer), - consume: consumer => channel.consume(queue.queue, consumer) + while (true) { + try { + return (await amqp.connect(url)).createChannel() + } catch (e) { + logger.debug('Failed to connect to rabbitmqServer, reconnecting') + await new Promise((resolve) => setTimeout(resolve, 2000)) + } } } -module.exports = { connectRabbit, assertQueue } +async function assertQueue(channel, name) { + const queue = await channel.assertQueue(name) + return { + name: queue.queue, + send: (msg) => channel.sendToQueue(queue.queue, Buffer.from(JSON.stringify(msg)), { + persistent: true + }), + get: (consumer) => channel.get(queue.queue, consumer), + consume: (consumer) => channel.consume(queue.queue, consumer) + } +} + +module.exports = { + connectRabbit, + assertQueue +} diff --git a/src/oracle/shared/crypto.js b/src/oracle/shared/crypto.js index 16c0fd8..358e61c 100644 --- a/src/oracle/shared/crypto.js +++ b/src/oracle/shared/crypto.js @@ -1,7 +1,27 @@ const crypto = require('crypto') const bech32 = require('bech32') -function publicKeyToAddress ({ x, y }) { +function padZeros(s, len) { + while (s.length < len) { + // eslint-disable-next-line no-param-reassign + s = `0${s}` + } + return s +} + +function sha256(bytes) { + return crypto.createHash('sha256') + .update(bytes) + .digest('hex') +} + +function ripemd160(bytes) { + return crypto.createHash('ripemd160') + .update(bytes) + .digest('hex') +} + +function publicKeyToAddress({ x, y }) { const compact = (parseInt(y[y.length - 1], 16) % 2 ? '03' : '02') + padZeros(x, 64) const sha256Hash = sha256(Buffer.from(compact, 'hex')) const hash = ripemd160(Buffer.from(sha256Hash, 'hex')) @@ -9,18 +29,8 @@ function publicKeyToAddress ({ x, y }) { return bech32.encode('tbnb', words) } -function padZeros (s, len) { - while (s.length < len) - s = '0' + s - return s +module.exports = { + publicKeyToAddress, + padZeros, + sha256 } - -function sha256 (bytes) { - return crypto.createHash('sha256').update(bytes).digest('hex') -} - -function ripemd160 (bytes) { - return crypto.createHash('ripemd160').update(bytes).digest('hex') -} - -module.exports = { publicKeyToAddress, padZeros, sha256 } diff --git a/src/oracle/shared/db.js b/src/oracle/shared/db.js index a6732f7..1faf6fc 100644 --- a/src/oracle/shared/db.js +++ b/src/oracle/shared/db.js @@ -1,6 +1,7 @@ const Redis = require('ioredis') const logger = require('./logger') + logger.info('Connecting to redis') const redis = new Redis({ @@ -14,7 +15,7 @@ redis.on('connect', () => { logger.info('Connected to redis') }) -redis.on('error', e => { +redis.on('error', (e) => { logger.warn('Redis error %o', e) }) diff --git a/src/oracle/tss-keygen/keygen.js b/src/oracle/tss-keygen/keygen.js index 77dfc80..77f9a7e 100644 --- a/src/oracle/tss-keygen/keygen.js +++ b/src/oracle/tss-keygen/keygen.js @@ -9,17 +9,15 @@ const { publicKeyToAddress } = require('./crypto') const { RABBITMQ_URL, PROXY_URL } = process.env const app = express() -app.get('/start', (req, res) => { - logger.info('Ready to start') - ready = true - res.send() -}) -app.listen(8001, () => logger.debug('Listening on 8001')) let currentKeygenEpoch = null let ready = false -async function main () { +async function confirmKeygen(keysFile) { + exec.execSync(`curl -X POST -H "Content-Type: application/json" -d @"${keysFile}" "${PROXY_URL}/confirmKeygen"`, { stdio: 'pipe' }) +} + +async function main() { logger.info('Connecting to RabbitMQ server') const channel = await connectRabbit(RABBITMQ_URL) logger.info('Connecting to epoch events queue') @@ -27,11 +25,11 @@ async function main () { const cancelKeygenQueue = await assertQueue(channel, 'cancelKeygenQueue') while (!ready) { - await new Promise(res => setTimeout(res, 1000)) + await new Promise((res) => setTimeout(res, 1000)) } channel.prefetch(1) - keygenQueue.consume(msg => { + keygenQueue.consume((msg) => { const { epoch, parties, threshold } = JSON.parse(msg.content) logger.info(`Consumed new epoch event, starting keygen for epoch ${epoch}`) @@ -41,8 +39,11 @@ async function main () { currentKeygenEpoch = epoch logger.debug('Writing params') - fs.writeFileSync('./params', JSON.stringify({ parties: parties.toString(), threshold: threshold.toString() })) - const cmd = exec.execFile('./keygen-entrypoint.sh', [ PROXY_URL, keysFile ], async () => { + fs.writeFileSync('./params', JSON.stringify({ + parties: parties.toString(), + threshold: threshold.toString() + })) + const cmd = exec.execFile('./keygen-entrypoint.sh', [PROXY_URL, keysFile], async () => { currentKeygenEpoch = null if (fs.existsSync(keysFile)) { logger.info(`Finished keygen for epoch ${epoch}`) @@ -57,11 +58,11 @@ async function main () { logger.debug('Ack for keygen message') channel.ack(msg) }) - cmd.stdout.on('data', data => logger.debug(data.toString())) - cmd.stderr.on('data', data => logger.debug(data.toString())) + cmd.stdout.on('data', (data) => logger.debug(data.toString())) + cmd.stderr.on('data', (data) => logger.debug(data.toString())) }) - cancelKeygenQueue.consume(async msg => { + cancelKeygenQueue.consume(async (msg) => { const { epoch } = JSON.parse(msg.content) logger.info(`Consumed new cancel event for epoch ${epoch} keygen`) if (currentKeygenEpoch === epoch) { @@ -72,8 +73,12 @@ async function main () { }) } -main() -async function confirmKeygen (keysFile) { - exec.execSync(`curl -X POST -H "Content-Type: application/json" -d @"${keysFile}" "${PROXY_URL}/confirmKeygen"`, { stdio: 'pipe' }) -} +app.get('/start', (req, res) => { + logger.info('Ready to start') + ready = true + res.send() +}) +app.listen(8001, () => logger.debug('Listening on 8001')) + +main() diff --git a/src/oracle/tss-keygen/package.json b/src/oracle/tss-keygen/package.json index 64c6c24..ba4680e 100644 --- a/src/oracle/tss-keygen/package.json +++ b/src/oracle/tss-keygen/package.json @@ -7,5 +7,8 @@ "pino": "5.13.4", "pino-pretty": "3.2.1", "express": "4.17.1" + }, + "engines": { + "node": ">=10.6.0" } } diff --git a/src/oracle/tss-sign/package.json b/src/oracle/tss-sign/package.json index 141a555..7d0c822 100644 --- a/src/oracle/tss-sign/package.json +++ b/src/oracle/tss-sign/package.json @@ -9,5 +9,8 @@ "express": "4.17.1", "pino": "5.13.4", "pino-pretty": "3.2.1" + }, + "engines": { + "node": ">=10.6.0" } } diff --git a/src/oracle/tss-sign/signer.js b/src/oracle/tss-sign/signer.js index 5077e6a..2ffe5cb 100644 --- a/src/oracle/tss-sign/signer.js +++ b/src/oracle/tss-sign/signer.js @@ -1,24 +1,20 @@ const exec = require('child_process') const fs = require('fs') const BN = require('bignumber.js') +const axios = require('axios') const express = require('express') const logger = require('./logger') const { connectRabbit, assertQueue } = require('./amqp') const { publicKeyToAddress, sha256 } = require('./crypto') -const app = express() -app.get('/restart/:attempt', restart) -app.get('/start', (req, res) => { - logger.info('Ready to start') - ready = true - res.send() -}) -app.listen(8001, () => logger.debug('Listening on 8001')) - -const { RABBITMQ_URL, FOREIGN_URL, PROXY_URL, FOREIGN_ASSET } = process.env const Transaction = require('./tx') -const axios = require('axios') + +const app = express() + +const { + RABBITMQ_URL, FOREIGN_URL, PROXY_URL, FOREIGN_ASSET +} = process.env const httpClient = axios.create({ baseURL: FOREIGN_URL }) @@ -29,7 +25,126 @@ let ready = false let exchangeQueue let channel -async function main () { +async function getExchangeMessages(nonce) { + logger.debug('Getting exchange messages') + const messages = [] + while (true) { + const msg = await exchangeQueue.get() + if (msg === false) { + break + } + const data = JSON.parse(msg.content) + logger.debug('Got message %o', data) + if (data.nonce !== nonce) { + channel.nack(msg, false, true) + break + } + messages.push(msg) + } + logger.debug(`Found ${messages.length} messages`) + return messages +} + +function restart(req, res) { + logger.info('Cancelling current sign') + nextAttempt = req.params.attempt + exec.execSync('pkill gg18_sign || true') + cancelled = true + res.send('Cancelled') +} + +function confirmFundsTransfer() { + exec.execSync(`curl -X POST -H "Content-Type: application/json" "${PROXY_URL}/confirmFundsTransfer"`, { stdio: 'pipe' }) +} + +function getAccountFromFile(file) { + logger.debug(`Reading ${file}`) + if (!fs.existsSync(file)) { + logger.debug('No keys found, skipping') + return { address: '' } + } + const publicKey = JSON.parse(fs.readFileSync(file))[5] + return { + address: publicKeyToAddress(publicKey), + publicKey + } +} + +function getAccount(address) { + logger.info(`Getting account ${address} data`) + return httpClient + .get(`/api/v1/account/${address}`) + .then((res) => res.data) + .catch(() => { + logger.debug('Retrying') + return getAccount(address) + }) +} + +async function waitForAccountNonce(address, nonce) { + cancelled = false + logger.info(`Waiting for account ${address} to have nonce ${nonce}`) + while (!cancelled) { + const { sequence } = await getAccount(address) + if (sequence >= nonce) { + break + } + await new Promise((resolve) => setTimeout(resolve, 1000)) + logger.debug('Waiting for needed account nonce') + } + logger.info('Account nonce is OK') + return !cancelled +} + + +function sendTx(tx) { + return httpClient + .post('/api/v1/broadcast?sync=true', tx, { + headers: { + 'Content-Type': 'text/plain' + } + }) + .catch((err) => { + if (err.response.data.message.includes('Tx already exists in cache')) { + logger.debug('Tx already exists in cache') + return true + } + logger.info('Something failed, restarting: %o', err.response) + return new Promise((resolve) => setTimeout(() => resolve(sendTx(tx)), 1000)) + }) +} + +function sign(keysFile, hash, tx, publicKey) { + return new Promise((resolve) => { + const cmd = exec.execFile('./sign-entrypoint.sh', [PROXY_URL, keysFile, hash], async (error) => { + if (fs.existsSync('signature')) { + logger.info('Finished signature generation') + const signature = JSON.parse(fs.readFileSync('signature')) + logger.debug('%o', signature) + + logger.info('Building signed transaction') + const signedTx = tx.addSignature(publicKey, { + r: signature[1], + s: signature[3] + }) + + logger.info('Sending transaction') + logger.debug(signedTx) + await sendTx(signedTx) + resolve(true) + } else if (error === null || error.code === 0) { + resolve(true) + } else { + logger.warn('Sign failed') + resolve(false) + } + }) + cmd.stdout.on('data', (data) => logger.debug(data.toString())) + cmd.stderr.on('data', (data) => logger.debug(data.toString())) + }) +} + +async function main() { logger.info('Connecting to RabbitMQ server') channel = await connectRabbit(RABBITMQ_URL) logger.info('Connecting to signature events queue') @@ -37,15 +152,17 @@ async function main () { const signQueue = await assertQueue(channel, 'signQueue') while (!ready) { - await new Promise(res => setTimeout(res, 1000)) + await new Promise((res) => setTimeout(res, 1000)) } channel.prefetch(1) - signQueue.consume(async msg => { + signQueue.consume(async (msg) => { const data = JSON.parse(msg.content) logger.info('Consumed sign event: %o', data) - const { nonce, epoch, newEpoch, parties, threshold } = data + const { + nonce, epoch, newEpoch, parties, threshold + } = data const keysFile = `/keys/keys${epoch}.store` const { address: from, publicKey } = getAccountFromFile(keysFile) @@ -57,16 +174,22 @@ async function main () { const account = await getAccount(from) logger.debug('Writing params') - fs.writeFileSync('./params', JSON.stringify({ parties: parties.toString(), threshold: threshold.toString() })) + fs.writeFileSync('./params', JSON.stringify({ + parties: parties.toString(), + threshold: threshold.toString() + })) attempt = 1 if (!newEpoch) { const exchanges = await getExchangeMessages(nonce) - const exchangesData = exchanges.map(msg => JSON.parse(msg.content)) + const exchangesData = exchanges.map((exchangeMsg) => JSON.parse(exchangeMsg.content)) if (exchanges.length > 0 && account.sequence <= nonce) { - const recipients = exchangesData.map(({ value, recipient }) => ({ to: recipient, tokens: value })) + const recipients = exchangesData.map(({ value, recipient }) => ({ + to: recipient, + tokens: value + })) while (true) { logger.info(`Building corresponding transfer transaction, nonce ${nonce}`) @@ -82,16 +205,18 @@ async function main () { const hash = sha256(tx.getSignBytes()) logger.info(`Starting signature generation for transaction hash ${hash}`) - const done = await sign(keysFile, hash, tx, publicKey) && await waitForAccountNonce(from, nonce + 1) + const done = await sign(keysFile, hash, tx, publicKey) + && await waitForAccountNonce(from, nonce + 1) if (done) { - exchanges.forEach(msg => channel.ack(msg)) + // eslint-disable-next-line no-loop-func + exchanges.forEach((exchangeMsg) => channel.ack(exchangeMsg)) break } - attempt = nextAttempt ? nextAttempt : attempt + 1 + attempt = nextAttempt || attempt + 1 logger.warn(`Sign failed, starting next attempt ${attempt}`) nextAttempt = null - await new Promise(resolve => setTimeout(resolve, 1000)) + await new Promise((resolve) => setTimeout(resolve, 1000)) } } } else if (account.sequence <= nonce) { @@ -104,27 +229,28 @@ async function main () { from, accountNumber: account.account_number, sequence: nonce, - recipients: [ { + recipients: [{ to, - tokens: account.balances.find(x => x.symbol === FOREIGN_ASSET).free, - bnbs: new BN(account.balances.find(x => x.symbol === 'BNB').free).minus(new BN(60000).div(10 ** 8)), - } ], + tokens: account.balances.find((token) => token.symbol === FOREIGN_ASSET).free, + bnbs: new BN(account.balances.find((token) => token.symbol === 'BNB').free).minus(new BN(60000).div(10 ** 8)) + }], asset: FOREIGN_ASSET, memo: `Attempt ${attempt}` }) const hash = sha256(tx.getSignBytes()) logger.info(`Starting signature generation for transaction hash ${hash}`) - const done = await sign(keysFile, hash, tx, publicKey) && await waitForAccountNonce(from, nonce + 1) + const done = await sign(keysFile, hash, tx, publicKey) + && await waitForAccountNonce(from, nonce + 1) if (done) { await confirmFundsTransfer() break } - attempt = nextAttempt ? nextAttempt : attempt + 1 + attempt = nextAttempt || attempt + 1 logger.warn(`Sign failed, starting next attempt ${attempt}`) nextAttempt = null - await new Promise(resolve => setTimeout(resolve, 1000)) + await new Promise((resolve) => setTimeout(resolve, 1000)) } } else { logger.debug('Tx has been already sent') @@ -134,118 +260,12 @@ async function main () { }) } +app.get('/restart/:attempt', restart) +app.get('/start', (req, res) => { + logger.info('Ready to start') + ready = true + res.send() +}) +app.listen(8001, () => logger.debug('Listening on 8001')) + main() - -async function getExchangeMessages (nonce) { - logger.debug('Getting exchange messages') - const messages = [] - do { - const msg = await exchangeQueue.get() - if (msg === false) { - break - } - const data = JSON.parse(msg.content) - logger.debug('Got message %o', data) - if (data.nonce !== nonce) { - channel.nack(msg, false, true) - break - } - messages.push(msg) - } while (true) - logger.debug(`Found ${messages.length} messages`) - return messages -} - -function sign (keysFile, hash, tx, publicKey) { - return new Promise(resolve => { - const cmd = exec.execFile('./sign-entrypoint.sh', [ PROXY_URL, keysFile, hash ], async (error) => { - if (fs.existsSync('signature')) { - logger.info('Finished signature generation') - const signature = JSON.parse(fs.readFileSync('signature')) - logger.debug('%o', signature) - - logger.info('Building signed transaction') - const signedTx = tx.addSignature(publicKey, { r: signature[1], s: signature[3] }) - - logger.info('Sending transaction') - logger.debug(signedTx) - await sendTx(signedTx) - resolve(true) - } else if (error === null || error.code === 0) { - resolve(true) - } else { - logger.warn('Sign failed') - resolve(false) - } - }) - cmd.stdout.on('data', data => logger.debug(data.toString())) - cmd.stderr.on('data', data => logger.debug(data.toString())) - }) -} - -function restart (req, res) { - logger.info('Cancelling current sign') - nextAttempt = req.params.attempt - exec.execSync('pkill gg18_sign || true') - cancelled = true - res.send('Cancelled') -} - -function confirmFundsTransfer () { - exec.execSync(`curl -X POST -H "Content-Type: application/json" "${PROXY_URL}/confirmFundsTransfer"`, { stdio: 'pipe' }) -} - -function getAccountFromFile (file) { - logger.debug(`Reading ${file}`) - if (!fs.existsSync(file)) { - logger.debug('No keys found, skipping') - return { address: '' } - } - const publicKey = JSON.parse(fs.readFileSync(file))[5] - return { - address: publicKeyToAddress(publicKey), - publicKey: publicKey - } -} - -async function waitForAccountNonce (address, nonce) { - cancelled = false - logger.info(`Waiting for account ${address} to have nonce ${nonce}`) - while (!cancelled) { - const sequence = (await getAccount(address)).sequence - if (sequence >= nonce) - break - await new Promise(resolve => setTimeout(resolve, 1000)) - logger.debug('Waiting for needed account nonce') - } - logger.info('Account nonce is OK') - return !cancelled -} - -function getAccount (address) { - logger.info(`Getting account ${address} data`) - return httpClient - .get(`/api/v1/account/${address}`) - .then(res => res.data) - .catch(() => { - logger.debug('Retrying') - return getAccount(address) - }) -} - -function sendTx (tx) { - return httpClient - .post(`/api/v1/broadcast?sync=true`, tx, { - headers: { - 'Content-Type': 'text/plain' - } - }) - .catch(err => { - if (err.response.data.message.includes('Tx already exists in cache')) - logger.debug('Tx already exists in cache') - else { - logger.info('Something failed, restarting: %o', err.response) - return new Promise(resolve => setTimeout(() => resolve(sendTx(tx)), 1000)) - } - }) -} diff --git a/src/oracle/tss-sign/tx.js b/src/oracle/tss-sign/tx.js index 351e3a6..fa3ec96 100644 --- a/src/oracle/tss-sign/tx.js +++ b/src/oracle/tss-sign/tx.js @@ -10,42 +10,52 @@ const { FOREIGN_CHAIN_ID } = process.env const BNB_ASSET = 'BNB' class Transaction { - constructor (options) { - const { from, accountNumber, sequence, recipients, asset, memo = '' } = options + constructor(options) { + const { + from, accountNumber, sequence, recipients, asset, memo = '' + } = options - const totalTokens = recipients.reduce((sum, { tokens }) => sum.plus(new BN(tokens || 0)), new BN(0)) - const totalBnbs = recipients.reduce((sum, { bnbs }) => sum.plus(new BN(bnbs || 0)), new BN(0)) + const totalTokens = recipients.reduce( + (sum, { tokens }) => sum.plus(new BN(tokens || 0)), new BN(0) + ) + const totalBnbs = recipients.reduce( + (sum, { bnbs }) => sum.plus(new BN(bnbs || 0)), new BN(0) + ) const senderCoins = [] if (asset && totalTokens.isGreaterThan(0)) { senderCoins.push({ denom: asset, - amount: totalTokens.multipliedBy(10 ** 8).toNumber(), + amount: totalTokens.multipliedBy(10 ** 8) + .toNumber() }) } if (totalBnbs.isGreaterThan(0)) { senderCoins.push({ denom: BNB_ASSET, - amount: totalBnbs.multipliedBy(10 ** 8).toNumber(), + amount: totalBnbs.multipliedBy(10 ** 8) + .toNumber() }) } senderCoins.sort((a, b) => a.denom > b.denom) - const inputs = [ { + const inputs = [{ address: from, coins: senderCoins - } ] + }] const outputs = recipients.map(({ to, tokens, bnbs }) => { const receiverCoins = [] if (asset && tokens) { receiverCoins.push({ denom: asset, - amount: new BN(tokens).multipliedBy(10 ** 8).toNumber(), + amount: new BN(tokens).multipliedBy(10 ** 8) + .toNumber() }) } if (bnbs) { receiverCoins.push({ denom: BNB_ASSET, - amount: new BN(bnbs).multipliedBy(10 ** 8).toNumber(), + amount: new BN(bnbs).multipliedBy(10 ** 8) + .toNumber() }) } receiverCoins.sort((a, b) => a.denom > b.denom) @@ -56,8 +66,14 @@ class Transaction { }) const msg = { - inputs: inputs.map((x) => ({...x, address: crypto.decodeAddress(x.address)})), - outputs: outputs.map((x) => ({...x, address: crypto.decodeAddress(x.address)})), + inputs: inputs.map((x) => ({ + ...x, + address: crypto.decodeAddress(x.address) + })), + outputs: outputs.map((x) => ({ + ...x, + address: crypto.decodeAddress(x.address) + })), msgType: 'MsgSend' } @@ -72,29 +88,31 @@ class Transaction { memo, msg, sequence, - type: msg.msgType, + type: msg.msgType }) } - getSignBytes () { + getSignBytes() { return this.tx.getSignBytes(this.signMsg) } - addSignature (publicKey, signature) { + addSignature(publicKey, signature) { const yLast = parseInt(publicKey.y[publicKey.y.length - 1], 16) const n = new BN('FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141', 16) const s = new BN(signature.s, 16) if (s.gt(n.div(2))) { logger.debug('Normalizing s') - signature.s = n.minus(s).toString(16) + // eslint-disable-next-line no-param-reassign + signature.s = n.minus(s) + .toString(16) } - const publicKeyEncoded = Buffer.from('eb5ae98721' + (yLast % 2 ? '03' : '02') + padZeros(publicKey.x, 64), 'hex') - this.tx.signatures = [ { + const publicKeyEncoded = Buffer.from(`eb5ae98721${yLast % 2 ? '03' : '02'}${padZeros(publicKey.x, 64)}`, 'hex') + this.tx.signatures = [{ pub_key: publicKeyEncoded, signature: Buffer.from(padZeros(signature.r, 64) + padZeros(signature.s, 64), 'hex'), account_number: this.tx.account_number, - sequence: this.tx.sequence, - } ] + sequence: this.tx.sequence + }] return this.tx.serialize() } } diff --git a/src/test-services/binanceBalance/testGetBinanceBalance.js b/src/test-services/binanceBalance/testGetBinanceBalance.js index 21d6e8d..6d356b0 100644 --- a/src/test-services/binanceBalance/testGetBinanceBalance.js +++ b/src/test-services/binanceBalance/testGetBinanceBalance.js @@ -5,10 +5,14 @@ const { FOREIGN_URL, FOREIGN_ASSET } = process.env const address = process.argv[2] const httpClient = axios.create({ baseURL: FOREIGN_URL }) -httpClient - .get(`/api/v1/account/${address}`) - .then(res => { - console.log(`BNB: ${parseFloat(res.data.balances.find(x => x.symbol === 'BNB').free)}`) - console.log(`${FOREIGN_ASSET}: ${parseFloat(res.data.balances.find(x => x.symbol === FOREIGN_ASSET).free)}`) - }) - .catch(console.log) +function main() { + httpClient + .get(`/api/v1/account/${address}`) + .then((res) => { + console.log(`BNB: ${parseFloat(res.data.balances.find((token) => token.symbol === 'BNB').free)}`) + console.log(`${FOREIGN_ASSET}: ${parseFloat(res.data.balances.find((token) => token.symbol === FOREIGN_ASSET).free)}`) + }) + .catch(console.log) +} + +main() diff --git a/src/test-services/binanceSend/testBinanceSend.js b/src/test-services/binanceSend/testBinanceSend.js index 46678d7..f0aede3 100644 --- a/src/test-services/binanceSend/testBinanceSend.js +++ b/src/test-services/binanceSend/testBinanceSend.js @@ -6,7 +6,7 @@ const PRIVATE_KEY = process.env.PRIVATE_KEY || FOREIGN_PRIVATE_KEY const client = new Bnc(FOREIGN_URL) -async function main () { +async function main() { client.chooseNetwork('testnet') await client.setPrivateKey(PRIVATE_KEY) @@ -43,10 +43,11 @@ async function main () { receipt = await client.transfer(from, to, tokens, FOREIGN_ASSET, 'exchange') } - if (receipt.status === 200) + if (receipt.status === 200) { console.log(receipt.result[0].hash) - else + } else { console.log(receipt) + } } main() diff --git a/src/test-services/ethereumBalance/testGetEthereumBalance.js b/src/test-services/ethereumBalance/testGetEthereumBalance.js index 3d0e9ea..8b9ac8a 100644 --- a/src/test-services/ethereumBalance/testGetEthereumBalance.js +++ b/src/test-services/ethereumBalance/testGetEthereumBalance.js @@ -8,11 +8,18 @@ const abiToken = require('./IERC20').abi const web3 = new Web3(HOME_RPC_URL, null, { transactionConfirmationBlocks: 1 }) const token = new web3.eth.Contract(abiToken, HOME_TOKEN_ADDRESS) -const address = process.argv[2] +function main() { + const address = process.argv[2] -web3.eth.getBalance(address).then(x => console.log(`${x.toString()} wei`)) + web3.eth.getBalance(address) + .then((balance) => console.log(`${balance.toString()} wei`)) -token.methods.balanceOf(address).call() - .then(x => parseFloat(new BN(x).dividedBy(10 ** 18).toFixed(8, 3))) - .then(x => console.log(`${x.toString()} tokens`)) - .catch(() => console.log('0 tokens')) + token.methods.balanceOf(address) + .call() + .then((balance) => parseFloat(new BN(balance).dividedBy(10 ** 18) + .toFixed(8, 3))) + .then((balance) => console.log(`${balance.toString()} tokens`)) + .catch(() => console.log('0 tokens')) +} + +main() diff --git a/src/test-services/ethereumSend/testEthereumSend.js b/src/test-services/ethereumSend/testEthereumSend.js index 345658e..03ee123 100644 --- a/src/test-services/ethereumSend/testEthereumSend.js +++ b/src/test-services/ethereumSend/testEthereumSend.js @@ -1,7 +1,9 @@ const Web3 = require('web3') const BN = require('bignumber.js') -const { HOME_RPC_URL, HOME_BRIDGE_ADDRESS, HOME_PRIVATE_KEY, HOME_TOKEN_ADDRESS } = process.env +const { + HOME_RPC_URL, HOME_BRIDGE_ADDRESS, HOME_PRIVATE_KEY, HOME_TOKEN_ADDRESS +} = process.env const abiToken = require('./IERC20').abi const abiBridge = require('./Bridge').abi @@ -14,21 +16,22 @@ const bridge = new web3.eth.Contract(abiBridge, HOME_BRIDGE_ADDRESS) const sender = web3.eth.accounts.privateKeyToAccount(`0x${PRIVATE_KEY}`).address -async function main () { +async function main() { const HOME_CHAIN_ID = await web3.eth.net.getId() - const blockGasLimit = (await web3.eth.getBlock("latest", false)).gasLimit + const blockGasLimit = (await web3.eth.getBlock('latest', false)).gasLimit const to = process.argv[2] - const amount = parseInt(process.argv[3]) + const amount = parseInt(process.argv[3], 10) let coins = process.argv[4] const txCount = await web3.eth.getTransactionCount(sender) - if (to === "bridge" && amount !== 0) { + if (to === 'bridge' && amount !== 0) { console.log(`Transfer from ${sender} to ${HOME_BRIDGE_ADDRESS}, ${amount} tokens`) - const queryApprove = token.methods.approve(HOME_BRIDGE_ADDRESS, '0x'+(new BN(amount).multipliedBy(10 ** 18).toString(16))) + const queryApprove = token.methods.approve(HOME_BRIDGE_ADDRESS, `0x${new BN(amount).multipliedBy(10 ** 18) + .toString(16)}`) const txApprove = { data: queryApprove.encodeABI(), from: sender, @@ -42,9 +45,10 @@ async function main () { const signedTxApprove = await web3.eth.accounts.signTransaction(txApprove, PRIVATE_KEY) const receiptApprove = await web3.eth.sendSignedTransaction(signedTxApprove.rawTransaction) - console.log('txHash approve: ' + receiptApprove.transactionHash) + console.log(`txHash approve: ${receiptApprove.transactionHash}`) - const queryExchange = bridge.methods.exchange('0x'+(new BN(amount).multipliedBy(10 ** 18).toString(16))) + const queryExchange = bridge.methods.exchange(`0x${new BN(amount).multipliedBy(10 ** 18) + .toString(16)}`) const txExchange = { data: queryExchange.encodeABI(), from: sender, @@ -58,11 +62,12 @@ async function main () { const signedTxExchange = await web3.eth.accounts.signTransaction(txExchange, PRIVATE_KEY) const receiptExchange = await web3.eth.sendSignedTransaction(signedTxExchange.rawTransaction) - console.log('txHash exchange: ' + receiptExchange.transactionHash) + console.log(`txHash exchange: ${receiptExchange.transactionHash}`) } else if (amount !== 0) { console.log(`Transfer from ${sender} to ${to}, ${amount} tokens`) - const query = token.methods.transfer(to, '0x'+(new BN(amount).multipliedBy(10 ** 18).toString(16))) + const query = token.methods.transfer(to, `0x${new BN(amount).multipliedBy(10 ** 18) + .toString(16)}`) const tx = { data: query.encodeABI(), from: sender, @@ -75,7 +80,7 @@ async function main () { }) * 1.5), blockGasLimit) const signedTx = await web3.eth.accounts.signTransaction(tx, PRIVATE_KEY) const receipt = await web3.eth.sendSignedTransaction(signedTx.rawTransaction) - console.log('txHash transfer: ' + receipt.transactionHash) + console.log(`txHash transfer: ${receipt.transactionHash}`) } if (coins) { @@ -85,7 +90,7 @@ async function main () { const tx = { data: '0x', from: sender, - to: to, + to, nonce: await web3.eth.getTransactionCount(sender), chainId: HOME_CHAIN_ID, value: web3.utils.toWei(new BN(coins).toString(), 'ether'), @@ -94,9 +99,8 @@ async function main () { const signedTx = await web3.eth.accounts.signTransaction(tx, PRIVATE_KEY) const receipt = await web3.eth.sendSignedTransaction(signedTx.rawTransaction) - console.log('txHash: ' + receipt.transactionHash) + console.log(`txHash: ${receipt.transactionHash}`) } - } main() diff --git a/src/test-services/getAddresses/testGetAddresses.js b/src/test-services/getAddresses/testGetAddresses.js index e51c3c6..0c7c01a 100644 --- a/src/test-services/getAddresses/testGetAddresses.js +++ b/src/test-services/getAddresses/testGetAddresses.js @@ -2,24 +2,28 @@ const { utils } = require('ethers') const bech32 = require('bech32') const crypto = require('crypto') -const privateKey = process.argv[2].startsWith('0x') ? process.argv[2] : '0x' + process.argv[2] +function sha256(bytes) { + return crypto.createHash('sha256').update(bytes).digest('hex') +} -const ethAddress = utils.computeAddress(privateKey) -const publicKey = utils.computePublicKey(privateKey, true) +function ripemd160(bytes) { + return crypto.createHash('ripemd160').update(bytes).digest('hex') +} -console.log(`Eth address: ${ethAddress}\nBnc address: ${publicKeyToAddress(publicKey)}`) - -function publicKeyToAddress (publicKey) { +function publicKeyToAddress(publicKey) { const sha256Hash = sha256(Buffer.from(publicKey.substr(2), 'hex')) const hash = ripemd160(Buffer.from(sha256Hash, 'hex')) const words = bech32.toWords(Buffer.from(hash, 'hex')) return bech32.encode('tbnb', words) } -function sha256 (bytes) { - return crypto.createHash('sha256').update(bytes).digest('hex') +function main() { + const privateKey = process.argv[2].startsWith('0x') ? process.argv[2] : `0x${process.argv[2]}` + + const ethAddress = utils.computeAddress(privateKey) + const publicKey = utils.computePublicKey(privateKey, true) + + console.log(`Eth address: ${ethAddress}\nBnc address: ${publicKeyToAddress(publicKey)}`) } -function ripemd160 (bytes) { - return crypto.createHash('ripemd160').update(bytes).digest('hex') -} +main() diff --git a/src/test-services/sidePrefund/testEthereumSend.js b/src/test-services/sidePrefund/testEthereumSend.js index 731af3e..9289e30 100644 --- a/src/test-services/sidePrefund/testEthereumSend.js +++ b/src/test-services/sidePrefund/testEthereumSend.js @@ -7,7 +7,7 @@ const web3 = new Web3(SIDE_RPC_URL, null, { transactionConfirmationBlocks: 1 }) const sender = web3.eth.accounts.privateKeyToAccount(`0x${SIDE_PRIVATE_KEY}`).address -async function main () { +async function main() { const SIDE_CHAIN_ID = await web3.eth.net.getId() const to = process.argv[2] @@ -15,20 +15,19 @@ async function main () { console.log(`Transfer from ${sender} to ${to}, ${amount} eth`) - const tx_coins = { + const txCoins = { data: '0x', from: sender, - to: to, + to, nonce: await web3.eth.getTransactionCount(sender), chainId: SIDE_CHAIN_ID, value: web3.utils.toWei(new BN(amount).toString(), 'ether'), gas: 21000 } - const signedTx = await web3.eth.accounts.signTransaction(tx_coins, SIDE_PRIVATE_KEY) + const signedTx = await web3.eth.accounts.signTransaction(txCoins, SIDE_PRIVATE_KEY) const receipt = await web3.eth.sendSignedTransaction(signedTx.rawTransaction) - console.log('txHash: ' + receipt.transactionHash) - + console.log(`txHash: ${receipt.transactionHash}`) } main() diff --git a/tests/package.json b/tests/package.json index de759d4..ffc0554 100644 --- a/tests/package.json +++ b/tests/package.json @@ -6,5 +6,8 @@ "axios": "0.19.0", "@binance-chain/javascript-sdk": "2.16.1", "bignumber.js": "9.0.0" + }, + "engines": { + "node": ">=10.6.0" } } diff --git a/tests/test/addValidator.js b/tests/test/addValidator.js index 8bfa320..6c1068c 100644 --- a/tests/test/addValidator.js +++ b/tests/test/addValidator.js @@ -5,15 +5,16 @@ const { getBalance } = require('./utils/bncController') const { controller1, controller3 } = require('./utils/proxyController') -module.exports = newValidator => { +module.exports = (newValidator) => { describe('add validator', function () { let info let initialInfo let nextValidators before(async function () { - initialInfo = info = await controller1.getInfo() - nextValidators = [ ...initialInfo.validators, newValidator ] + initialInfo = await controller1.getInfo() + info = initialInfo + nextValidators = [...initialInfo.validators, newValidator] }) it('should start voting process', async function () { @@ -23,7 +24,7 @@ module.exports = newValidator => { assert.strictEqual(info.bridgeStatus, 'ready', 'Should not change state after one vote') await controller3.voteStartVoting() - info = await waitPromise(controller1.getInfo, info => info.bridgeStatus === 'voting') + info = await waitPromise(controller1.getInfo, (newInfo) => newInfo.bridgeStatus === 'voting') assert.deepStrictEqual(info.epoch, initialInfo.epoch, 'Current epoch is not set correctly') assert.deepStrictEqual(info.nextEpoch, initialInfo.epoch + 1, 'Next epoch is not set correctly') assert.deepStrictEqual(info.nextValidators, initialInfo.validators, 'Next validators are not set correctly') @@ -46,7 +47,10 @@ module.exports = newValidator => { assert.deepStrictEqual(info.nextValidators, initialInfo.validators, 'Next validators are not set correctly') await controller3.voteAddValidator(newValidator) - info = await waitPromise(controller1.getInfo, info => info.nextValidators.length === nextValidators.length) + info = await waitPromise( + controller1.getInfo, + (newInfo) => newInfo.nextValidators.length === nextValidators.length + ) assert.deepStrictEqual(info.validators, initialInfo.validators, 'Validators are not set correctly') assert.deepStrictEqual(info.nextValidators, nextValidators, 'Next validators are not set correctly') @@ -67,7 +71,7 @@ module.exports = newValidator => { assert.strictEqual(info.bridgeStatus, 'voting', 'Should not change state after one vote') await controller3.voteStartKeygen() - info = await waitPromise(controller1.getInfo, info => info.bridgeStatus === 'keygen') + info = await waitPromise(controller1.getInfo, (newInfo) => newInfo.bridgeStatus === 'keygen') await controller3.voteStartKeygen() await delay(5000) @@ -81,12 +85,15 @@ module.exports = newValidator => { it('should finish keygen process and start funds transfer', async function () { this.timeout(120000) - info = await waitPromise(controller1.getInfo, info => info.bridgeStatus === 'funds_transfer') + info = await waitPromise(controller1.getInfo, (newInfo) => newInfo.bridgeStatus === 'funds_transfer') }) it('should transfer all funds to new account and start new epoch', async function () { this.timeout(300000) - info = await waitPromise(controller1.getInfo, info => info.epoch === initialInfo.epoch + 1) + info = await waitPromise( + controller1.getInfo, + (newInfo) => newInfo.epoch === initialInfo.epoch + 1 + ) assert.deepStrictEqual(info.validators, nextValidators, 'Incorrect set of validators in new epoch') assert.strictEqual(info.nextEpoch, initialInfo.epoch + 1, 'Incorrect next epoch') assert.strictEqual(info.bridgeStatus, 'ready', 'Incorrect bridge state in new epoch') diff --git a/tests/test/bncToEth.js b/tests/test/bncToEth.js index 1587a87..3559435 100644 --- a/tests/test/bncToEth.js +++ b/tests/test/bncToEth.js @@ -2,7 +2,7 @@ const { delay } = require('./utils/wait') const { controller1 } = require('./utils/proxyController') -module.exports = usersFunc => { +module.exports = (usersFunc) => { describe('exchange of tokens in bnc => eth direction', function () { let users let info @@ -11,21 +11,21 @@ module.exports = usersFunc => { before(async function () { users = usersFunc() info = await controller1.getInfo() - ethBalances = await Promise.all(users.map(user => user.getEthBalance())) + ethBalances = await Promise.all(users.map((user) => user.getEthBalance())) await Promise.all(users.map((user, i) => user.exchangeBnc(info.foreignBridgeAddress, 3 + i))) }) - it('should make coorect exchange transactions on eth side', async function () { - for (let i = 0; i < 3; i++) { - do { + it('should make correct exchange transactions on eth side', async function () { + for (let i = 0; i < 3; i += 1) { + while (true) { const user = users[i] const newEthBalance = await user.getEthBalance() if (newEthBalance === ethBalances[i] + 3 + i) { break } await delay(500) - } while (true) + } } }) }) diff --git a/tests/test/changeThreshold.js b/tests/test/changeThreshold.js index eb65ec7..74a6e68 100644 --- a/tests/test/changeThreshold.js +++ b/tests/test/changeThreshold.js @@ -5,13 +5,14 @@ const { getBalance } = require('./utils/bncController') const { controller1, controller2, controller3 } = require('./utils/proxyController') -module.exports = newThreshold => { +module.exports = (newThreshold) => { describe('change threshold', function () { let info let initialInfo before(async function () { - initialInfo = info = await controller1.getInfo() + initialInfo = await controller1.getInfo() + info = initialInfo }) it('should start voting process', async function () { @@ -21,7 +22,7 @@ module.exports = newThreshold => { assert.strictEqual(info.bridgeStatus, 'ready', 'Should not change state after one vote') await controller2.voteStartVoting() - info = await waitPromise(controller1.getInfo, info => info.bridgeStatus === 'voting') + info = await waitPromise(controller1.getInfo, (newInfo) => newInfo.bridgeStatus === 'voting') assert.deepStrictEqual(info.epoch, initialInfo.epoch, 'Current epoch is not set correctly') assert.deepStrictEqual(info.nextEpoch, initialInfo.epoch + 1, 'Next epoch is not set correctly') assert.deepStrictEqual(info.nextValidators, initialInfo.validators, 'Next validators are not set correctly') @@ -46,7 +47,10 @@ module.exports = newThreshold => { assert.deepStrictEqual(info.nextThreshold, initialInfo.threshold, 'Next threshold is not set correctly') await controller2.voteChangeThreshold(newThreshold) - info = await waitPromise(controller1.getInfo, info => info.nextThreshold === newThreshold) + info = await waitPromise( + controller1.getInfo, + (newInfo) => newInfo.nextThreshold === newThreshold + ) assert.deepStrictEqual(info.validators, initialInfo.validators, 'Validators are not set correctly') assert.deepStrictEqual(info.nextValidators, initialInfo.validators, 'Next validators are not set correctly') assert.deepStrictEqual(info.threshold, initialInfo.threshold, 'Threshold not set correctly') @@ -70,7 +74,7 @@ module.exports = newThreshold => { assert.strictEqual(info.bridgeStatus, 'voting', 'Should not change state after one vote') await controller2.voteStartKeygen() - info = await waitPromise(controller1.getInfo, info => info.bridgeStatus === 'keygen') + info = await waitPromise(controller1.getInfo, (newInfo) => newInfo.bridgeStatus === 'keygen') await controller3.voteStartKeygen() await delay(5000) @@ -86,12 +90,15 @@ module.exports = newThreshold => { it('should finish keygen process and start funds transfer', async function () { this.timeout(120000) - info = await waitPromise(controller1.getInfo, info => info.bridgeStatus === 'funds_transfer') + info = await waitPromise(controller1.getInfo, (newInfo) => newInfo.bridgeStatus === 'funds_transfer') }) it('should transfer all funds to new account and start new epoch', async function () { this.timeout(300000) - info = await waitPromise(controller1.getInfo, info => info.epoch === initialInfo.epoch + 1) + info = await waitPromise( + controller1.getInfo, + (newInfo) => newInfo.epoch === initialInfo.epoch + 1 + ) assert.deepStrictEqual(info.validators, initialInfo.validators, 'Incorrect set of validators in new epoch') assert.strictEqual(info.nextEpoch, initialInfo.epoch + 1, 'Incorrect next epoch') assert.strictEqual(info.bridgeStatus, 'ready', 'Incorrect bridge state in new epoch') diff --git a/tests/test/ethToBnc.js b/tests/test/ethToBnc.js index 461b92f..4e8afd0 100644 --- a/tests/test/ethToBnc.js +++ b/tests/test/ethToBnc.js @@ -1,12 +1,12 @@ const assert = require('assert') const { getSequence } = require('./utils/bncController') -const { waitPromise, delay } = require('./utils/wait') +const { waitPromise, delay, seqMap } = require('./utils/wait') const { HOME_BRIDGE_ADDRESS } = process.env const { controller1 } = require('./utils/proxyController') -module.exports = usersFunc => { +module.exports = (usersFunc) => { describe('exchange of tokens in eth => bnc direction', function () { let info let users @@ -17,8 +17,8 @@ module.exports = usersFunc => { before(async function () { users = usersFunc() info = await controller1.getInfo() - ethBalances = await Promise.all(users.map(user => user.getEthBalance())) - bncBalances = await users.seqMap(user => user.getBncBalance()) + ethBalances = await Promise.all(users.map((user) => user.getEthBalance())) + bncBalances = await seqMap(users, (user) => user.getBncBalance()) bncBridgeSequence = await getSequence(info.foreignBridgeAddress) await Promise.all(users.map((user, i) => user.approveEth(HOME_BRIDGE_ADDRESS, 5 + i))) @@ -26,21 +26,24 @@ module.exports = usersFunc => { it('should accept exchange requests', async function () { await Promise.all(users.map((user, i) => user.exchangeEth(5 + i))) - const newEthBalances = await Promise.all(users.map(user => user.getEthBalance())) - for (let i = 0; i < 3; i++) { + const newEthBalances = await Promise.all(users.map((user) => user.getEthBalance())) + for (let i = 0; i < 3; i += 1) { assert.strictEqual(newEthBalances[i], ethBalances[i] - 5 - i, `Balance of ${users[i].ethAddress} did not updated as expected`) } }) it('should make exchange transaction on bnc side', async function () { this.timeout(300000) - await waitPromise(() => getSequence(info.foreignBridgeAddress), sequence => sequence === bncBridgeSequence + 1) + await waitPromise( + () => getSequence(info.foreignBridgeAddress), + (sequence) => sequence === bncBridgeSequence + 1 + ) }) it('should make correct exchange transaction', async function () { await delay(10000) - const newBncBalances = await Promise.all(users.map(user => user.getBncBalance())) - for (let i = 0; i < 3; i++) { + const newBncBalances = await Promise.all(users.map((user) => user.getBncBalance())) + for (let i = 0; i < 3; i += 1) { assert.strictEqual(newBncBalances[i], bncBalances[i] + 5 + i, `Balance of ${users[i].bncAddress} did not updated as expected`) } }) diff --git a/tests/test/index.js b/tests/test/index.js index d304050..1293eb8 100644 --- a/tests/test/index.js +++ b/tests/test/index.js @@ -1,5 +1,5 @@ const createUser = require('./utils/user') -const { waitPromise } = require('./utils/wait') +const { waitPromise, seqMap } = require('./utils/wait') const testEthToBnc = require('./ethToBnc') const testBncToEth = require('./bncToEth') @@ -18,7 +18,7 @@ describe('bridge tests', function () { let users before(async function () { - users = await usersConfig.seqMap(user => createUser(user.privateKey)) + users = await seqMap(usersConfig, (user) => createUser(user.privateKey)) }) describe('generation of initial epoch keys', function () { @@ -33,7 +33,7 @@ describe('bridge tests', function () { it('should generate keys', async function () { this.timeout(120000) - info = await waitPromise(controller1.getInfo, info => info.epoch === 1) + info = await waitPromise(controller1.getInfo, (newInfo) => newInfo.epoch === 1) }) after(async function () { diff --git a/tests/test/removeValidator.js b/tests/test/removeValidator.js index c5377bb..b33b7e3 100644 --- a/tests/test/removeValidator.js +++ b/tests/test/removeValidator.js @@ -5,15 +5,16 @@ const { getBalance } = require('./utils/bncController') const { controller1, controller2, controller3 } = require('./utils/proxyController') -module.exports = oldValidator => { +module.exports = (oldValidator) => { describe('remove validator', function () { let info let initialInfo let nextValidators before(async function () { - initialInfo = info = await controller1.getInfo() - nextValidators = initialInfo.validators.filter(validator => validator !== oldValidator) + initialInfo = await controller1.getInfo() + info = initialInfo + nextValidators = initialInfo.validators.filter((validator) => validator !== oldValidator) }) it('should start voting process', async function () { @@ -23,7 +24,7 @@ module.exports = oldValidator => { assert.strictEqual(info.bridgeStatus, 'ready', 'Should not change state after one vote') await controller2.voteStartVoting() - info = await waitPromise(controller1.getInfo, info => info.bridgeStatus === 'voting') + info = await waitPromise(controller1.getInfo, (newInfo) => newInfo.bridgeStatus === 'voting') assert.deepStrictEqual(info.epoch, initialInfo.epoch, 'Current epoch is not set correctly') assert.deepStrictEqual(info.nextEpoch, initialInfo.epoch + 1, 'Next epoch is not set correctly') assert.deepStrictEqual(info.nextValidators, initialInfo.validators, 'Next validators are not set correctly') @@ -46,7 +47,10 @@ module.exports = oldValidator => { assert.deepStrictEqual(info.nextValidators, initialInfo.validators, 'Next validators are not set correctly') await controller2.voteRemoveValidator(oldValidator) - info = await waitPromise(controller1.getInfo, info => info.nextValidators.length === nextValidators.length) + info = await waitPromise( + controller1.getInfo, + (newInfo) => newInfo.nextValidators.length === nextValidators.length + ) assert.deepStrictEqual(info.validators, initialInfo.validators, 'Validators are not set correctly') assert.deepStrictEqual(info.nextValidators, nextValidators, 'Next validators are not set correctly') @@ -67,7 +71,7 @@ module.exports = oldValidator => { assert.strictEqual(info.bridgeStatus, 'voting', 'Should not change state after one vote') await controller2.voteStartKeygen() - info = await waitPromise(controller1.getInfo, info => info.bridgeStatus === 'keygen') + info = await waitPromise(controller1.getInfo, (newInfo) => newInfo.bridgeStatus === 'keygen') await controller3.voteStartKeygen() await delay(5000) @@ -81,12 +85,15 @@ module.exports = oldValidator => { it('should finish keygen process and start funds transfer', async function () { this.timeout(120000) - info = await waitPromise(controller1.getInfo, info => info.bridgeStatus === 'funds_transfer') + info = await waitPromise(controller1.getInfo, (newInfo) => newInfo.bridgeStatus === 'funds_transfer') }) it('should transfer all funds to new account and start new epoch', async function () { this.timeout(300000) - info = await waitPromise(controller1.getInfo, info => info.epoch === initialInfo.epoch + 1) + info = await waitPromise( + controller1.getInfo, + (newInfo) => newInfo.epoch === initialInfo.epoch + 1 + ) assert.deepStrictEqual(info.validators, nextValidators, 'Incorrect set of validators in new epoch') assert.strictEqual(info.nextEpoch, initialInfo.epoch + 1, 'Incorrect next epoch') assert.strictEqual(info.bridgeStatus, 'ready', 'Incorrect bridge state in new epoch') diff --git a/tests/test/utils/bncClient.js b/tests/test/utils/bncClient.js index 4396b53..cd461fb 100644 --- a/tests/test/utils/bncClient.js +++ b/tests/test/utils/bncClient.js @@ -4,7 +4,7 @@ const { delay } = require('./wait') const { FOREIGN_URL, FOREIGN_ASSET } = process.env -module.exports = async function main (privateKey) { +module.exports = async function main(privateKey) { const client = new Bnc(FOREIGN_URL) client.chooseNetwork('testnet') @@ -16,7 +16,7 @@ module.exports = async function main (privateKey) { await delay(1000) return { - transfer: async function (to, tokens, bnbs) { + async transfer(to, tokens, bnbs) { const outputs = [{ to, coins: [] @@ -35,7 +35,7 @@ module.exports = async function main (privateKey) { } await client.multiSend(from, outputs, 'funding') }, - exchange: async function (to, value) { + async exchange(to, value) { await client.transfer(from, to, value.toString(), FOREIGN_ASSET, 'exchange') } } diff --git a/tests/test/utils/bncController.js b/tests/test/utils/bncController.js index 82fe567..cd4a145 100644 --- a/tests/test/utils/bncController.js +++ b/tests/test/utils/bncController.js @@ -10,12 +10,12 @@ const bnc = axios.create({ }) module.exports = { - getBalance: async function (address) { + async getBalance(address) { const response = await retry(5, () => bnc.get(`/api/v1/account/${address}`)) - const tokens = response.data.balances.find(x => x.symbol === FOREIGN_ASSET) + const tokens = response.data.balances.find((x) => x.symbol === FOREIGN_ASSET) return response && tokens ? parseFloat(tokens.free) : 0 }, - getSequence: async function (address) { + async getSequence(address) { const response = await retry(5, () => bnc.get(`/api/v1/account/${address}/sequence`)) return response ? response.data.sequence : 0 } diff --git a/tests/test/utils/proxyController.js b/tests/test/utils/proxyController.js index b9492c4..6e3fc5c 100644 --- a/tests/test/utils/proxyController.js +++ b/tests/test/utils/proxyController.js @@ -1,6 +1,6 @@ const axios = require('axios') -function createController (validatorId) { +function createController(validatorId) { const url = `http://validator${validatorId}_proxy_1:8002/` const proxy = axios.create({ @@ -9,22 +9,22 @@ function createController (validatorId) { }) return { - getInfo: async function () { + async getInfo() { return (await proxy.get('/info')).data }, - voteStartVoting: async function () { + async voteStartVoting() { return (await proxy.get('/vote/startVoting')).data }, - voteStartKeygen: async function () { + async voteStartKeygen() { return (await proxy.get('/vote/startKeygen')).data }, - voteAddValidator: async function (validatorAddress) { + async voteAddValidator(validatorAddress) { return (await proxy.get(`/vote/addValidator/${validatorAddress}`)).data }, - voteRemoveValidator: async function (validatorAddress) { + async voteRemoveValidator(validatorAddress) { return (await proxy.get(`/vote/removeValidator/${validatorAddress}`)).data }, - voteChangeThreshold: async function (threshold) { + async voteChangeThreshold(threshold) { return (await proxy.get(`/vote/changeThreshold/${threshold}`)).data } } diff --git a/tests/test/utils/user.js b/tests/test/utils/user.js index 8294581..3562bbe 100644 --- a/tests/test/utils/user.js +++ b/tests/test/utils/user.js @@ -11,7 +11,7 @@ const txOptions = { gasLimit: 200000 } -module.exports = async function (privateKey) { +async function createUser(privateKey) { const wallet = new ethers.Wallet(privateKey, provider) const ethAddress = wallet.address const bncAddress = getAddressFromPrivateKey(privateKey) @@ -23,32 +23,34 @@ module.exports = async function (privateKey) { return { ethAddress, bncAddress, - getEthBalance: async function () { + async getEthBalance() { const balance = await token.balanceOf(ethAddress) return parseFloat(new BN(balance).dividedBy(10 ** 18).toFixed(8, 3)) }, - transferEth: async function (to, value) { - const tx = await token.transfer(to, '0x' + (new BN(value).multipliedBy(10 ** 18).toString(16)), txOptions) + async transferEth(to, value) { + const tx = await token.transfer(to, `0x${new BN(value).multipliedBy(10 ** 18).toString(16)}`, txOptions) await tx.wait() }, - approveEth: async function (to, value) { - const tx = await token.approve(to, '0x' + (new BN(value).multipliedBy(10 ** 18).toString(16)), txOptions) + async approveEth(to, value) { + const tx = await token.approve(to, `0x${new BN(value).multipliedBy(10 ** 18).toString(16)}`, txOptions) await tx.wait() }, - exchangeEth: async function (value) { - const tx = await bridge.exchange('0x' + (new BN(value).multipliedBy(10 ** 18).toString(16)), txOptions) + async exchangeEth(value) { + const tx = await bridge.exchange(`0x${new BN(value).multipliedBy(10 ** 18).toString(16)}`, txOptions) await tx.wait() }, - getBncBalance: async function () { + async getBncBalance() { const balance = await getBalance(bncAddress) await delay(1000) return balance }, - transferBnc: async function (bridgeAddress, tokens, bnbs) { + async transferBnc(bridgeAddress, tokens, bnbs) { return await bncClient.transfer(bridgeAddress, tokens, bnbs) }, - exchangeBnc: async function (bridgeAddress, value) { + async exchangeBnc(bridgeAddress, value) { return await bncClient.exchange(bridgeAddress, value) } } } + +module.exports = createUser diff --git a/tests/test/utils/wait.js b/tests/test/utils/wait.js index ae0a145..7002df4 100644 --- a/tests/test/utils/wait.js +++ b/tests/test/utils/wait.js @@ -1,32 +1,34 @@ async function delay(ms) { - await new Promise(res => setTimeout(res, ms)) + await new Promise((res) => setTimeout(res, ms)) } -async function waitPromise (getPromise, checker) { - do { +async function waitPromise(getPromise, checker) { + while (true) { const result = await getPromise() - if (checker(result)) + if (checker(result)) { return result + } await delay(1000) - } while (true) + } } -async function retry (n, getPromise) { +async function retry(n, getPromise) { while (n) { try { return await getPromise() } catch (e) { await delay(3000) - n-- + // eslint-disable-next-line no-param-reassign + n -= 1 } } return null } -Array.prototype.seqMap = async function (transition) { +async function seqMap(arr, transition) { const results = [] - for (let i = 0; i < this.length; i++) { - results[i] = await transition(this[i]) + for (let i = 0; i < arr.length; i += 1) { + results[i] = await transition(arr[i]) } return results } @@ -34,5 +36,6 @@ Array.prototype.seqMap = async function (transition) { module.exports = { waitPromise, delay, - retry + retry, + seqMap } From 5489ebaaf2662d1d568b511b5a4fd299fd96c952 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Sun, 3 Nov 2019 13:53:49 +0300 Subject: [PATCH 054/129] Handle no cache found situation --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e14745e..0160b08 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -80,7 +80,7 @@ orbs: steps: - run: name: "Load tss image from archive" - command: docker load -i ./workspace/tss.tar.gz + command: docker load -i ./workspace/tss.tar.gz || true save_docker_logs: description: "Save docker logs" parameters: From 6e65bbcb04ef9dd8958b1859c51f8854f949d362 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Sun, 3 Nov 2019 13:54:34 +0300 Subject: [PATCH 055/129] Refactored and linted components --- src/oracle/bncWatcher/Dockerfile | 2 +- src/oracle/bncWatcher/bncWatcher.js | 62 +++++++++++++++-------------- src/oracle/ethWatcher/Dockerfile | 2 +- src/oracle/ethWatcher/ethWatcher.js | 20 ++++++---- src/oracle/proxy/Dockerfile | 2 +- src/oracle/proxy/index.js | 30 ++++++-------- src/oracle/proxy/sendTx.js | 16 +++----- src/oracle/shared/wait.js | 24 +++++++++++ src/oracle/tss-keygen/Dockerfile | 2 +- src/oracle/tss-keygen/keygen.js | 3 +- src/oracle/tss-sign/Dockerfile | 2 +- src/oracle/tss-sign/signer.js | 18 ++++----- tests/test/utils/wait.js | 4 +- 13 files changed, 103 insertions(+), 84 deletions(-) create mode 100644 src/oracle/shared/wait.js diff --git a/src/oracle/bncWatcher/Dockerfile b/src/oracle/bncWatcher/Dockerfile index be3f7c2..104556b 100644 --- a/src/oracle/bncWatcher/Dockerfile +++ b/src/oracle/bncWatcher/Dockerfile @@ -9,6 +9,6 @@ COPY ./bncWatcher/package.json /watcher/ RUN npm install -COPY ./bncWatcher/bncWatcher.js ./shared/db.js ./shared/logger.js ./shared/crypto.js /watcher/ +COPY ./bncWatcher/bncWatcher.js ./shared/db.js ./shared/logger.js ./shared/crypto.js ./shared/wait.js /watcher/ ENTRYPOINT ["node", "bncWatcher.js"] diff --git a/src/oracle/bncWatcher/bncWatcher.js b/src/oracle/bncWatcher/bncWatcher.js index 91df7a1..966d159 100644 --- a/src/oracle/bncWatcher/bncWatcher.js +++ b/src/oracle/bncWatcher/bncWatcher.js @@ -6,6 +6,7 @@ const { computeAddress } = require('ethers').utils const logger = require('./logger') const redis = require('./db') const { publicKeyToAddress } = require('./crypto') +const { delay, retry } = require('./wait') const { FOREIGN_URL, PROXY_URL, FOREIGN_ASSET } = process.env @@ -27,22 +28,21 @@ function getLastForeignAddress() { return publicKeyToAddress(publicKey) } -function getTx(hash) { - return foreignHttpClient - .get(`/api/v1/tx/${hash}`, { +async function getTx(hash) { + const response = await retry(() => foreignHttpClient.get( + `/api/v1/tx/${hash}`, + { params: { format: 'json' } - }) - .then((res) => res.data.tx.value) - .catch(() => getTx(hash)) + } + )) + return response.data.tx.value } -function getBlockTime() { - return foreignHttpClient - .get('/api/v1/time') - .then((res) => Date.parse(res.data.block_time) - FOREIGN_FETCH_BLOCK_TIME_OFFSET) - .catch(() => getBlockTime()) +async function getBlockTime() { + const response = await retry(() => foreignHttpClient.get('/api/v1/time')) + return Date.parse(response.data.block_time) - FOREIGN_FETCH_BLOCK_TIME_OFFSET } async function fetchNewTransactions() { @@ -62,16 +62,14 @@ async function fetchNewTransactions() { startTime, endTime } - try { - logger.trace('%o', params) - const transactions = (await foreignHttpClient - .get('/api/v1/transactions', { params })).data.tx - return { - transactions, - endTime - } - } catch (e) { - return await fetchNewTransactions() + + logger.trace('%o', params) + const transactions = (await retry(() => foreignHttpClient + .get('/api/v1/transactions', { params }))).data.tx + + return { + transactions, + endTime } } @@ -82,11 +80,11 @@ async function initialize() { } } -async function main() { +async function loop() { const { transactions, endTime } = await fetchNewTransactions() if (!transactions || transactions.length === 0) { logger.debug('Found 0 new transactions') - await new Promise((r) => setTimeout(r, FOREIGN_FETCH_INTERVAL)) + await delay(FOREIGN_FETCH_INTERVAL) return } @@ -100,7 +98,8 @@ async function main() { await proxyHttpClient .post('/transfer', { to: computeAddress(Buffer.from(publicKeyEncoded, 'base64')), - value: new BN(tx.value).multipliedBy(10 ** 18) + value: new BN(tx.value) + .multipliedBy(10 ** 18) .integerValue(), hash: `0x${tx.txHash}` }) @@ -109,9 +108,12 @@ async function main() { await redis.set('foreignTime', endTime) } -initialize() - .then(async () => { - while (true) { - await main() - } - }) +async function main() { + await initialize() + + while (true) { + await loop() + } +} + +main() diff --git a/src/oracle/ethWatcher/Dockerfile b/src/oracle/ethWatcher/Dockerfile index 2eb0bfa..5b67a29 100644 --- a/src/oracle/ethWatcher/Dockerfile +++ b/src/oracle/ethWatcher/Dockerfile @@ -9,7 +9,7 @@ COPY ./ethWatcher/package.json /watcher/ RUN npm install -COPY ./ethWatcher/ethWatcher.js ./shared/db.js ./shared/logger.js ./shared/amqp.js ./shared/crypto.js /watcher/ +COPY ./ethWatcher/ethWatcher.js ./shared/db.js ./shared/logger.js ./shared/amqp.js ./shared/crypto.js ./shared/wait.js /watcher/ COPY ./ethWatcher/Bridge.json /watcher/contracts_data/ ENTRYPOINT ["node", "ethWatcher.js"] diff --git a/src/oracle/ethWatcher/ethWatcher.js b/src/oracle/ethWatcher/ethWatcher.js index b59602e..9d23626 100644 --- a/src/oracle/ethWatcher/ethWatcher.js +++ b/src/oracle/ethWatcher/ethWatcher.js @@ -7,6 +7,7 @@ const logger = require('./logger') const redis = require('./db') const { connectRabbit, assertQueue } = require('./amqp') const { publicKeyToAddress } = require('./crypto') +const { delay } = require('./wait') const abiBridge = require('./contracts_data/Bridge.json').abi @@ -225,11 +226,11 @@ async function initialize() { await axios.get('http://signer:8001/start') } -async function main() { +async function loop() { logger.debug(`Watching events in block #${blockNumber}`) if (await homeWeb3.eth.getBlock(blockNumber) === null) { logger.debug('No block') - await new Promise((r) => setTimeout(r, 1000)) + await delay(1000) return } @@ -283,9 +284,12 @@ async function main() { await redis.save() } -initialize() - .then(async () => { - while (true) { - await main() - } - }, (e) => logger.warn('Initialization failed %o', e)) +async function main() { + await initialize() + + while (true) { + await loop() + } +} + +main() diff --git a/src/oracle/proxy/Dockerfile b/src/oracle/proxy/Dockerfile index 0e226c0..431811d 100644 --- a/src/oracle/proxy/Dockerfile +++ b/src/oracle/proxy/Dockerfile @@ -6,7 +6,7 @@ COPY ./proxy/package.json /proxy/ RUN npm install -COPY ./proxy/index.js ./proxy/encode.js ./proxy/decode.js ./proxy/sendTx.js ./shared/logger.js ./shared/crypto.js /proxy/ +COPY ./proxy/index.js ./proxy/encode.js ./proxy/decode.js ./proxy/sendTx.js ./shared/logger.js ./shared/crypto.js ./shared/wait.js /proxy/ COPY ./proxy/Bridge.json ./proxy/IERC20.json ./proxy/SharedDB.json /proxy/contracts_data/ ENTRYPOINT ["node", "index.js"] diff --git a/src/oracle/proxy/index.js b/src/oracle/proxy/index.js index ef7e76f..f1e6e29 100644 --- a/src/oracle/proxy/index.js +++ b/src/oracle/proxy/index.js @@ -259,37 +259,37 @@ async function sendVote(query, req, res, waitFlag = false) { async function voteStartVoting(req, res) { logger.info('Voting for starting new epoch voting process') const query = bridge.methods.startVoting() - sendVote(query, req, res, true) + await sendVote(query, req, res, true) } async function voteStartKeygen(req, res) { logger.info('Voting for starting new epoch keygen') const query = bridge.methods.voteStartKeygen() - sendVote(query, req, res) + await sendVote(query, req, res) } async function voteCancelKeygen(req, res) { logger.info('Voting for cancelling new epoch keygen') const query = bridge.methods.voteCancelKeygen() - sendVote(query, req, res) + await sendVote(query, req, res) } async function voteAddValidator(req, res) { logger.info('Voting for adding new validator') const query = bridge.methods.voteAddValidator(req.params.validator) - sendVote(query, req, res) + await sendVote(query, req, res) } async function voteChangeThreshold(req, res) { logger.info('Voting for changing threshold') const query = bridge.methods.voteChangeThreshold(req.params.threshold) - sendVote(query, req, res) + await sendVote(query, req, res) } async function voteRemoveValidator(req, res) { logger.info('Voting for removing validator') const query = bridge.methods.voteRemoveValidator(req.params.validator) - sendVote(query, req, res, true) + await sendVote(query, req, res, true) } function decodeStatus(status) { @@ -315,10 +315,6 @@ function boundX(x) { } } -function toNumber(x) { - return x.toNumber() -} - async function transfer(req, res) { logger.info('Transfer start') const { hash, to, value } = req.body @@ -357,28 +353,28 @@ async function info(req, res) { .then((value) => new BN(value).toString(16)), bridge.methods.epoch() .call() - .then(toNumber), + .then(boundX), bridge.methods.getRangeSize() .call() - .then(toNumber), + .then(boundX), bridge.methods.getNextRangeSize() .call() - .then(toNumber), + .then(boundX), bridge.methods.getStartBlock() .call() - .then(toNumber), + .then(boundX), bridge.methods.getNonce() .call() .then(boundX), bridge.methods.nextEpoch() .call() - .then(toNumber), + .then(boundX), bridge.methods.getThreshold() .call() - .then(toNumber), + .then(boundX), bridge.methods.getNextThreshold() .call() - .then(toNumber), + .then(boundX), bridge.methods.getValidators() .call(), bridge.methods.getNextValidators() diff --git a/src/oracle/proxy/sendTx.js b/src/oracle/proxy/sendTx.js index c18ed41..1add20a 100644 --- a/src/oracle/proxy/sendTx.js +++ b/src/oracle/proxy/sendTx.js @@ -4,22 +4,18 @@ const ethers = require('ethers') const BN = require('bignumber.js') const logger = require('./logger') +const { delay, retry } = require('./wait') const { GAS_LIMIT_FACTOR, MAX_GAS_LIMIT } = process.env -function sendRpcRequest(url, method, params) { - return axios.post(url, { +async function sendRpcRequest(url, method, params) { + const response = await retry(() => axios.post(url, { jsonrpc: '2.0', method, params, id: 1 - }) - .then((res) => res.data) - .catch(async () => { - logger.warn(`Request to ${url}, method ${method} failed, retrying`) - await new Promise((res) => setTimeout(res, 1000)) - return sendRpcRequest(url, method, params) - }) + })) + return response.data } async function createSender(url, privateKey) { @@ -85,7 +81,7 @@ async function waitForReceipt(url, txHash) { const { result, error } = await sendRpcRequest(url, 'eth_getTransactionReceipt', [txHash]) if (result === null || error) { - await new Promise((res) => setTimeout(res, 1000)) + await delay(1000) } else { return result } diff --git a/src/oracle/shared/wait.js b/src/oracle/shared/wait.js new file mode 100644 index 0000000..3e93e91 --- /dev/null +++ b/src/oracle/shared/wait.js @@ -0,0 +1,24 @@ +const logger = require('./logger') + +async function delay(ms) { + await new Promise((res) => setTimeout(res, ms)) +} + +async function retry(n, getPromise = -1, sleep = 3000) { + while (n) { + try { + return await getPromise() + } catch (e) { + logger.debug(`Promise failed, retrying, ${n - 1} attempts left`) + await delay(sleep) + // eslint-disable-next-line no-param-reassign + n -= 1 + } + } + return null +} + +module.exports = { + delay, + retry +} diff --git a/src/oracle/tss-keygen/Dockerfile b/src/oracle/tss-keygen/Dockerfile index 72ed8ca..fd34ce2 100644 --- a/src/oracle/tss-keygen/Dockerfile +++ b/src/oracle/tss-keygen/Dockerfile @@ -9,7 +9,7 @@ COPY ./tss-keygen/package.json /tss/ RUN npm install -COPY ./tss-keygen/keygen-entrypoint.sh ./tss-keygen/keygen.js ./shared/logger.js ./shared/amqp.js ./shared/crypto.js /tss/ +COPY ./tss-keygen/keygen-entrypoint.sh ./tss-keygen/keygen.js ./shared/logger.js ./shared/amqp.js ./shared/crypto.js ./shared/wait.js /tss/ COPY --from=tss /tss/target/release/gg18_keygen_client /tss/ diff --git a/src/oracle/tss-keygen/keygen.js b/src/oracle/tss-keygen/keygen.js index 77f9a7e..0f3a067 100644 --- a/src/oracle/tss-keygen/keygen.js +++ b/src/oracle/tss-keygen/keygen.js @@ -5,6 +5,7 @@ const express = require('express') const logger = require('./logger') const { connectRabbit, assertQueue } = require('./amqp') const { publicKeyToAddress } = require('./crypto') +const { delay } = require('./wait') const { RABBITMQ_URL, PROXY_URL } = process.env @@ -25,7 +26,7 @@ async function main() { const cancelKeygenQueue = await assertQueue(channel, 'cancelKeygenQueue') while (!ready) { - await new Promise((res) => setTimeout(res, 1000)) + await delay(1000) } channel.prefetch(1) diff --git a/src/oracle/tss-sign/Dockerfile b/src/oracle/tss-sign/Dockerfile index 4d53236..0b14ac5 100644 --- a/src/oracle/tss-sign/Dockerfile +++ b/src/oracle/tss-sign/Dockerfile @@ -10,7 +10,7 @@ COPY ./tss-sign/package.json /tss/ RUN npm install --no-optional -COPY ./tss-sign/sign-entrypoint.sh ./tss-sign/signer.js ./tss-sign/tx.js ./shared/logger.js ./shared/amqp.js ./shared/crypto.js /tss/ +COPY ./tss-sign/sign-entrypoint.sh ./tss-sign/signer.js ./tss-sign/tx.js ./shared/logger.js ./shared/amqp.js ./shared/crypto.js ./shared/wait.js /tss/ COPY --from=tss /tss/target/release/gg18_sign_client /tss/ diff --git a/src/oracle/tss-sign/signer.js b/src/oracle/tss-sign/signer.js index 2ffe5cb..1e49e05 100644 --- a/src/oracle/tss-sign/signer.js +++ b/src/oracle/tss-sign/signer.js @@ -7,6 +7,7 @@ const express = require('express') const logger = require('./logger') const { connectRabbit, assertQueue } = require('./amqp') const { publicKeyToAddress, sha256 } = require('./crypto') +const { delay, retry } = require('./wait') const Transaction = require('./tx') @@ -70,15 +71,10 @@ function getAccountFromFile(file) { } } -function getAccount(address) { +async function getAccount(address) { logger.info(`Getting account ${address} data`) - return httpClient - .get(`/api/v1/account/${address}`) - .then((res) => res.data) - .catch(() => { - logger.debug('Retrying') - return getAccount(address) - }) + const response = await retry(() => httpClient.get(`/api/v1/account/${address}`)) + return response.data } async function waitForAccountNonce(address, nonce) { @@ -152,7 +148,7 @@ async function main() { const signQueue = await assertQueue(channel, 'signQueue') while (!ready) { - await new Promise((res) => setTimeout(res, 1000)) + await delay(1000) } channel.prefetch(1) @@ -216,7 +212,7 @@ async function main() { attempt = nextAttempt || attempt + 1 logger.warn(`Sign failed, starting next attempt ${attempt}`) nextAttempt = null - await new Promise((resolve) => setTimeout(resolve, 1000)) + await delay(1000) } } } else if (account.sequence <= nonce) { @@ -250,7 +246,7 @@ async function main() { attempt = nextAttempt || attempt + 1 logger.warn(`Sign failed, starting next attempt ${attempt}`) nextAttempt = null - await new Promise((resolve) => setTimeout(resolve, 1000)) + await delay(1000) } } else { logger.debug('Tx has been already sent') diff --git a/tests/test/utils/wait.js b/tests/test/utils/wait.js index 7002df4..0a5d60d 100644 --- a/tests/test/utils/wait.js +++ b/tests/test/utils/wait.js @@ -12,12 +12,12 @@ async function waitPromise(getPromise, checker) { } } -async function retry(n, getPromise) { +async function retry(n, getPromise, sleep = 3000) { while (n) { try { return await getPromise() } catch (e) { - await delay(3000) + await delay(sleep) // eslint-disable-next-line no-param-reassign n -= 1 } From e21d06ce3b806bd931c9dcad5601327f51b269d9 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Sun, 3 Nov 2019 16:10:06 +0300 Subject: [PATCH 056/129] Fixed typos --- src/oracle/proxy/encode.js | 4 ++-- src/oracle/proxy/sendTx.js | 6 ++++-- src/oracle/shared/wait.js | 2 +- tests/test/utils/bncController.js | 4 ++-- tests/test/utils/wait.js | 2 +- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/oracle/proxy/encode.js b/src/oracle/proxy/encode.js index 4a18410..13361f3 100644 --- a/src/oracle/proxy/encode.js +++ b/src/oracle/proxy/encode.js @@ -13,7 +13,7 @@ const keygenEncoders = [ yield makeBuffer(value.e.n, 256, 10) yield makeBuffer(value.com) for (let i = 0; i < value.correct_key_proof.sigma_vec.length; i += 1) { - yield makeBuffer(value.correct_key_proof.sigma_vecp[i], 256, 10) + yield makeBuffer(value.correct_key_proof.sigma_vec[i], 256, 10) } }, // round 2 @@ -33,7 +33,7 @@ const keygenEncoders = [ yield Buffer.from([value.parameters.threshold]) // 1 byte yield Buffer.from([value.parameters.share_count]) // 1 byte for (let i = 0; i < value.commitments.length; i += 1) { - const x = value.correct_key_proof.sigma_vec[i] + const x = value.commitments[i] yield makeBuffer(x.x) yield makeBuffer(x.y) } diff --git a/src/oracle/proxy/sendTx.js b/src/oracle/proxy/sendTx.js index 1add20a..9e9b0cd 100644 --- a/src/oracle/proxy/sendTx.js +++ b/src/oracle/proxy/sendTx.js @@ -9,12 +9,14 @@ const { delay, retry } = require('./wait') const { GAS_LIMIT_FACTOR, MAX_GAS_LIMIT } = process.env async function sendRpcRequest(url, method, params) { + logger.trace(`Request to ${url}, method ${method}, params %o`, params) const response = await retry(() => axios.post(url, { jsonrpc: '2.0', method, params, id: 1 })) + logger.trace('Response %o', response.data) return response.data } @@ -53,9 +55,9 @@ async function createSender(url, privateKey) { newTx.gasLimit = `0x${new BN(gasLimit).toString(16)}` logger.trace(`Estimated gas to ${gasLimit}`) - const hash = web3.utils.sha3(ethers.utils.serializeTransaction(tx)) + const hash = web3.utils.sha3(ethers.utils.serializeTransaction(newTx)) const signature = signer.signDigest(hash) - const signedTx = ethers.utils.serializeTransaction(tx, signature) + const signedTx = ethers.utils.serializeTransaction(newTx, signature) const { result, error } = await sendRpcRequest(url, 'eth_sendRawTransaction', [signedTx]) // handle nonce error diff --git a/src/oracle/shared/wait.js b/src/oracle/shared/wait.js index 3e93e91..f5c02c0 100644 --- a/src/oracle/shared/wait.js +++ b/src/oracle/shared/wait.js @@ -4,7 +4,7 @@ async function delay(ms) { await new Promise((res) => setTimeout(res, ms)) } -async function retry(n, getPromise = -1, sleep = 3000) { +async function retry(getPromise, n = -1, sleep = 3000) { while (n) { try { return await getPromise() diff --git a/tests/test/utils/bncController.js b/tests/test/utils/bncController.js index cd4a145..5638620 100644 --- a/tests/test/utils/bncController.js +++ b/tests/test/utils/bncController.js @@ -11,12 +11,12 @@ const bnc = axios.create({ module.exports = { async getBalance(address) { - const response = await retry(5, () => bnc.get(`/api/v1/account/${address}`)) + const response = await retry(() => bnc.get(`/api/v1/account/${address}`), 5) const tokens = response.data.balances.find((x) => x.symbol === FOREIGN_ASSET) return response && tokens ? parseFloat(tokens.free) : 0 }, async getSequence(address) { - const response = await retry(5, () => bnc.get(`/api/v1/account/${address}/sequence`)) + const response = await retry(() => bnc.get(`/api/v1/account/${address}/sequence`), 5) return response ? response.data.sequence : 0 } } diff --git a/tests/test/utils/wait.js b/tests/test/utils/wait.js index 0a5d60d..aef08fa 100644 --- a/tests/test/utils/wait.js +++ b/tests/test/utils/wait.js @@ -12,7 +12,7 @@ async function waitPromise(getPromise, checker) { } } -async function retry(n, getPromise, sleep = 3000) { +async function retry(getPromise, n = -1, sleep = 3000) { while (n) { try { return await getPromise() From 25941a61e700360d9288e367a1cec73a6e861c53 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Sun, 3 Nov 2019 21:00:15 +0300 Subject: [PATCH 057/129] Refactored tests and oracle --- src/oracle/ethWatcher/ethWatcher.js | 7 +-- src/oracle/proxy/index.js | 92 ++++++++++------------------- tests/test/addValidator.js | 6 +- tests/test/bncToEth.js | 24 ++++---- tests/test/changeThreshold.js | 6 +- tests/test/ethToBnc.js | 23 ++++---- tests/test/index.js | 40 ++++++++++--- tests/test/removeValidator.js | 6 +- tests/test/utils/bncController.js | 9 ++- tests/test/utils/user.js | 70 ++++++++++++++++++---- 10 files changed, 166 insertions(+), 117 deletions(-) diff --git a/src/oracle/ethWatcher/ethWatcher.js b/src/oracle/ethWatcher/ethWatcher.js index 9d23626..23a83d6 100644 --- a/src/oracle/ethWatcher/ethWatcher.js +++ b/src/oracle/ethWatcher/ethWatcher.js @@ -196,8 +196,6 @@ async function initialize() { if (epochStart > saved) { logger.info(`Data in db is outdated, starting from epoch ${epoch}, block #${epochStart}`) blockNumber = epochStart - rangeSize = (await bridge.methods.getRangeSize() - .call()).toNumber() await redis.multi() .set('homeBlock', blockNumber - 1) .set(`foreignNonce${epoch}`, 0) @@ -208,9 +206,10 @@ async function initialize() { blockNumber = saved foreignNonce[epoch] = parseInt(await redis.get(`foreignNonce${epoch}`), 10) || 0 } + rangeSize = (await bridge.methods.getRangeSize().call()).toNumber() + logger.debug(`Range size ${rangeSize}`) logger.debug('Checking if current validator') - isCurrentValidator = (await bridge.methods.getValidators() - .call()).includes(validatorAddress) + isCurrentValidator = (await bridge.methods.getValidators().call()).includes(validatorAddress) if (isCurrentValidator) { logger.info(`${validatorAddress} is a current validator`) } else { diff --git a/src/oracle/proxy/index.js b/src/oracle/proxy/index.js index f1e6e29..d520245 100644 --- a/src/oracle/proxy/index.js +++ b/src/oracle/proxy/index.js @@ -159,10 +159,8 @@ async function set(req, res) { async function signupKeygen(req, res) { logger.debug('SignupKeygen call') - const epoch = (await bridge.methods.nextEpoch() - .call()).toNumber() - const partyId = (await bridge.methods.getNextPartyId(validatorAddress) - .call()).toNumber() + const epoch = (await bridge.methods.nextEpoch().call()).toNumber() + const partyId = (await bridge.methods.getNextPartyId(validatorAddress).call()).toNumber() if (partyId === 0) { res.send(Err({ message: 'Not a validator' })) @@ -193,10 +191,9 @@ async function signupSign(req, res) { return } - const validators = await bridge.methods.getValidators() - .call() - const id = (await sharedDb.methods.getSignupNumber(hash, validators, validatorAddress) - .call()).toNumber() + const validators = await bridge.methods.getValidators().call() + const id = (await sharedDb.methods.getSignupNumber(hash, validators, validatorAddress).call()) + .toNumber() res.send(Ok({ uuid: hash, @@ -345,62 +342,37 @@ async function info(req, res) { x, y, epoch, rangeSize, nextRangeSize, epochStartBlock, foreignNonce, nextEpoch, threshold, nextThreshold, validators, nextValidators, status, homeBalance ] = await Promise.all([ - bridge.methods.getX() - .call() - .then((value) => new BN(value).toString(16)), - bridge.methods.getY() - .call() - .then((value) => new BN(value).toString(16)), - bridge.methods.epoch() - .call() - .then(boundX), - bridge.methods.getRangeSize() - .call() - .then(boundX), - bridge.methods.getNextRangeSize() - .call() - .then(boundX), - bridge.methods.getStartBlock() - .call() - .then(boundX), - bridge.methods.getNonce() - .call() - .then(boundX), - bridge.methods.nextEpoch() - .call() - .then(boundX), - bridge.methods.getThreshold() - .call() - .then(boundX), - bridge.methods.getNextThreshold() - .call() - .then(boundX), - bridge.methods.getValidators() - .call(), - bridge.methods.getNextValidators() - .call(), - bridge.methods.status() - .call(), - token.methods.balanceOf(HOME_BRIDGE_ADDRESS) - .call() - .then((value) => parseFloat(new BN(value).dividedBy(10 ** 18) - .toFixed(8, 3))) + bridge.methods.getX().call().then((value) => new BN(value).toString(16)), + bridge.methods.getY().call().then((value) => new BN(value).toString(16)), + bridge.methods.epoch().call().then(boundX), + bridge.methods.getRangeSize().call().then(boundX), + bridge.methods.getNextRangeSize().call().then(boundX), + bridge.methods.getStartBlock().call().then(boundX), + bridge.methods.getNonce().call().then(boundX), + bridge.methods.nextEpoch().call().then(boundX), + bridge.methods.getThreshold().call().then(boundX), + bridge.methods.getNextThreshold().call().then(boundX), + bridge.methods.getValidators().call(), + bridge.methods.getNextValidators().call(), + bridge.methods.status().call(), + token.methods.balanceOf(HOME_BRIDGE_ADDRESS).call() + .then((value) => parseFloat(new BN(value).dividedBy(10 ** 18).toFixed(8, 3))) ]) const [ confirmationsForFundsTransfer, votesForVoting, votesForKeygen, votesForCancelKeygen ] = await Promise.all([ - bridge.methods.votesCount(homeWeb3.utils.sha3(utils.solidityPack(['uint8', 'uint256'], [1, nextEpoch]))) - .call() - .then(boundX), - bridge.methods.votesCount(homeWeb3.utils.sha3(utils.solidityPack(['uint8', 'uint256'], [2, nextEpoch]))) - .call() - .then(boundX), - bridge.methods.votesCount(homeWeb3.utils.sha3(utils.solidityPack(['uint8', 'uint256'], [7, nextEpoch]))) - .call() - .then(boundX), - bridge.methods.votesCount(homeWeb3.utils.sha3(utils.solidityPack(['uint8', 'uint256'], [8, nextEpoch]))) - .call() - .then(boundX) + bridge.methods.votesCount( + homeWeb3.utils.sha3(utils.solidityPack(['uint8', 'uint256'], [1, nextEpoch])) + ).call().then(boundX), + bridge.methods.votesCount( + homeWeb3.utils.sha3(utils.solidityPack(['uint8', 'uint256'], [2, nextEpoch])) + ).call().then(boundX), + bridge.methods.votesCount( + homeWeb3.utils.sha3(utils.solidityPack(['uint8', 'uint256'], [7, nextEpoch])) + ).call().then(boundX), + bridge.methods.votesCount( + homeWeb3.utils.sha3(utils.solidityPack(['uint8', 'uint256'], [8, nextEpoch])) + ).call().then(boundX) ]) const foreignAddress = publicKeyToAddress({ x, diff --git a/tests/test/addValidator.js b/tests/test/addValidator.js index 6c1068c..cad94c5 100644 --- a/tests/test/addValidator.js +++ b/tests/test/addValidator.js @@ -1,7 +1,7 @@ const assert = require('assert') const { waitPromise, delay } = require('./utils/wait') -const { getBalance } = require('./utils/bncController') +const { getBepBalance } = require('./utils/bncController') const { controller1, controller3 } = require('./utils/proxyController') @@ -98,8 +98,8 @@ module.exports = (newValidator) => { assert.strictEqual(info.nextEpoch, initialInfo.epoch + 1, 'Incorrect next epoch') assert.strictEqual(info.bridgeStatus, 'ready', 'Incorrect bridge state in new epoch') await delay(5000) - const prevBalance = await getBalance(initialInfo.foreignBridgeAddress) - const newBalance = await getBalance(info.foreignBridgeAddress) + const prevBalance = await getBepBalance(initialInfo.foreignBridgeAddress) + const newBalance = await getBepBalance(info.foreignBridgeAddress) assert.strictEqual(prevBalance, 0, 'Did not transfer all funds') assert.strictEqual(newBalance, initialInfo.foreignBalanceTokens, 'Funds are lost somewhere') }) diff --git a/tests/test/bncToEth.js b/tests/test/bncToEth.js index 3559435..143b3d0 100644 --- a/tests/test/bncToEth.js +++ b/tests/test/bncToEth.js @@ -1,31 +1,29 @@ -const { delay } = require('./utils/wait') +const { waitPromise } = require('./utils/wait') const { controller1 } = require('./utils/proxyController') -module.exports = (usersFunc) => { +module.exports = (getUsers) => { describe('exchange of tokens in bnc => eth direction', function () { let users let info let ethBalances before(async function () { - users = usersFunc() + users = getUsers() info = await controller1.getInfo() - ethBalances = await Promise.all(users.map((user) => user.getEthBalance())) + ethBalances = await Promise.all(users.map((user) => user.getErcBalance())) - await Promise.all(users.map((user, i) => user.exchangeBnc(info.foreignBridgeAddress, 3 + i))) + await Promise.all(users.map((user, i) => user.exchangeBep(info.foreignBridgeAddress, 3 + i))) }) it('should make correct exchange transactions on eth side', async function () { for (let i = 0; i < 3; i += 1) { - while (true) { - const user = users[i] - const newEthBalance = await user.getEthBalance() - if (newEthBalance === ethBalances[i] + 3 + i) { - break - } - await delay(500) - } + const user = users[i] + await waitPromise( + user.getErcBalance, + // eslint-disable-next-line no-loop-func + (newEthBalance) => newEthBalance === ethBalances[i] + 3 + i + ) } }) }) diff --git a/tests/test/changeThreshold.js b/tests/test/changeThreshold.js index 74a6e68..754e7d5 100644 --- a/tests/test/changeThreshold.js +++ b/tests/test/changeThreshold.js @@ -1,7 +1,7 @@ const assert = require('assert') const { waitPromise, delay } = require('./utils/wait') -const { getBalance } = require('./utils/bncController') +const { getBepBalance } = require('./utils/bncController') const { controller1, controller2, controller3 } = require('./utils/proxyController') @@ -105,8 +105,8 @@ module.exports = (newThreshold) => { assert.deepStrictEqual(info.threshold, newThreshold, 'Threshold not set correctly') assert.deepStrictEqual(info.nextThreshold, newThreshold, 'Next threshold is not set correctly') await delay(5000) - const prevBalance = await getBalance(initialInfo.foreignBridgeAddress) - const newBalance = await getBalance(info.foreignBridgeAddress) + const prevBalance = await getBepBalance(initialInfo.foreignBridgeAddress) + const newBalance = await getBepBalance(info.foreignBridgeAddress) assert.strictEqual(prevBalance, 0, 'Did not transfer all funds') assert.strictEqual(newBalance, initialInfo.foreignBalanceTokens, 'Funds are lost somewhere') }) diff --git a/tests/test/ethToBnc.js b/tests/test/ethToBnc.js index 4e8afd0..4bd5e08 100644 --- a/tests/test/ethToBnc.js +++ b/tests/test/ethToBnc.js @@ -1,12 +1,13 @@ const assert = require('assert') -const { getSequence } = require('./utils/bncController') + +const { getBncSequence } = require('./utils/bncController') const { waitPromise, delay, seqMap } = require('./utils/wait') const { HOME_BRIDGE_ADDRESS } = process.env const { controller1 } = require('./utils/proxyController') -module.exports = (usersFunc) => { +module.exports = (getUsers) => { describe('exchange of tokens in eth => bnc direction', function () { let info let users @@ -15,18 +16,18 @@ module.exports = (usersFunc) => { let bncBridgeSequence before(async function () { - users = usersFunc() + users = getUsers() info = await controller1.getInfo() - ethBalances = await Promise.all(users.map((user) => user.getEthBalance())) - bncBalances = await seqMap(users, (user) => user.getBncBalance()) + ethBalances = await Promise.all(users.map((user) => user.getErcBalance())) + bncBalances = await seqMap(users, (user) => user.getBepBalance()) - bncBridgeSequence = await getSequence(info.foreignBridgeAddress) - await Promise.all(users.map((user, i) => user.approveEth(HOME_BRIDGE_ADDRESS, 5 + i))) + bncBridgeSequence = await getBncSequence(info.foreignBridgeAddress) + await Promise.all(users.map((user, i) => user.approveErc(HOME_BRIDGE_ADDRESS, 5 + i))) }) it('should accept exchange requests', async function () { - await Promise.all(users.map((user, i) => user.exchangeEth(5 + i))) - const newEthBalances = await Promise.all(users.map((user) => user.getEthBalance())) + await Promise.all(users.map((user, i) => user.exchangeErc(5 + i))) + const newEthBalances = await Promise.all(users.map((user) => user.getErcBalance())) for (let i = 0; i < 3; i += 1) { assert.strictEqual(newEthBalances[i], ethBalances[i] - 5 - i, `Balance of ${users[i].ethAddress} did not updated as expected`) } @@ -35,14 +36,14 @@ module.exports = (usersFunc) => { it('should make exchange transaction on bnc side', async function () { this.timeout(300000) await waitPromise( - () => getSequence(info.foreignBridgeAddress), + () => getBncSequence(info.foreignBridgeAddress), (sequence) => sequence === bncBridgeSequence + 1 ) }) it('should make correct exchange transaction', async function () { await delay(10000) - const newBncBalances = await Promise.all(users.map((user) => user.getBncBalance())) + const newBncBalances = await Promise.all(users.map((user) => user.getBepBalance())) for (let i = 0; i < 3; i += 1) { assert.strictEqual(newBncBalances[i], bncBalances[i] + 5 + i, `Balance of ${users[i].bncAddress} did not updated as expected`) } diff --git a/tests/test/index.js b/tests/test/index.js index 1293eb8..8d661c8 100644 --- a/tests/test/index.js +++ b/tests/test/index.js @@ -1,3 +1,5 @@ +const assert = require('assert') + const createUser = require('./utils/user') const { waitPromise, seqMap } = require('./utils/wait') @@ -10,7 +12,9 @@ const testChangeThreshold = require('./changeThreshold') const usersConfig = require('../config').users const validatorsConfig = require('../config').validators -const { HOME_PRIVATE_KEY, FOREIGN_PRIVATE_KEY, HOME_BRIDGE_ADDRESS } = process.env +const { + HOME_PRIVATE_KEY, FOREIGN_PRIVATE_KEY, HOME_BRIDGE_ADDRESS, FOREIGN_ASSET +} = process.env const { controller1 } = require('./utils/proxyController') @@ -23,12 +27,34 @@ describe('bridge tests', function () { describe('generation of initial epoch keys', function () { let info - let homePrefundedUser - let foreignPrefundedUser + let ethPrefundedUser + let bncPrefundedUser before(async function () { - homePrefundedUser = await createUser(HOME_PRIVATE_KEY) - foreignPrefundedUser = await createUser(FOREIGN_PRIVATE_KEY) + ethPrefundedUser = await createUser(HOME_PRIVATE_KEY) + bncPrefundedUser = await createUser(FOREIGN_PRIVATE_KEY) + + const bnbBalance = await bncPrefundedUser.getBnbBalance() + assert.ok(bnbBalance >= 0.5, `Insufficient BNB balance on ${bncPrefundedUser.ethAddress} in Binance network, expected 0.5 BNB, got ${bnbBalance}`) + const bepBalance = await bncPrefundedUser.getBepBalance() + assert.ok(bepBalance >= 500, `Insufficient BEP2 balance on ${bncPrefundedUser.ethAddress} in Binance network, expected 500 ${FOREIGN_ASSET}, got ${bepBalance}`) + + const ethBalance = await ethPrefundedUser.getEthBalance() + assert.ok(ethBalance >= 0.5, `Insufficient ETH balance on ${ethPrefundedUser.ethAddress} in Ethereum network, expected 0.5 ETH, got ${ethBalance}`) + const ercBalance = await ethPrefundedUser.getErcBalance() + assert.ok(ercBalance >= 500, `Insufficient ERC20 balance on ${ethPrefundedUser.ethAddress} in Ethereum network, expected 500 ERC20, got ${ercBalance}`) + + + for (let i = 0; i < 3; i += 1) { + const userEthBalance = await users[i].getEthBalance() + assert.ok(userEthBalance >= 0.2, `Insufficient ETH balance on ${users[i].ethAddress} in Ethereum network, expected 0.2 ETH, got ${userEthBalance}`) + const userErcBalance = await users[i].getErcBalance() + assert.ok(userErcBalance >= 50, `Insufficient ERC20 balance on ${users[i].ethAddress} in Ethereum network, expected 50 ERC20, got ${userErcBalance}`) + const userBnbBalance = await users[i].getBepBalance() + assert.ok(userBnbBalance >= 0.1, `Insufficient BNB balance on ${users[i].bncAddress} in Binance network, expected 0.1 BNB, got ${userBnbBalance}`) + const userBepBalance = await users[i].getBepBalance() + assert.ok(userErcBalance >= 50, `Insufficient BEP2 balance on ${users[i].bncAddress} in Binance network, expected 50 ${FOREIGN_ASSET}, got ${userBepBalance}`) + } }) it('should generate keys', async function () { @@ -37,8 +63,8 @@ describe('bridge tests', function () { }) after(async function () { - await foreignPrefundedUser.transferBnc(info.foreignBridgeAddress, 50, 0.1) - await homePrefundedUser.transferEth(HOME_BRIDGE_ADDRESS, 500) + await bncPrefundedUser.transferBepBnb(info.foreignBridgeAddress, 100, 0.1) + await ethPrefundedUser.transferErc(HOME_BRIDGE_ADDRESS, 100) }) }) diff --git a/tests/test/removeValidator.js b/tests/test/removeValidator.js index b33b7e3..b50fe83 100644 --- a/tests/test/removeValidator.js +++ b/tests/test/removeValidator.js @@ -1,7 +1,7 @@ const assert = require('assert') const { waitPromise, delay } = require('./utils/wait') -const { getBalance } = require('./utils/bncController') +const { getBepBalance } = require('./utils/bncController') const { controller1, controller2, controller3 } = require('./utils/proxyController') @@ -98,8 +98,8 @@ module.exports = (oldValidator) => { assert.strictEqual(info.nextEpoch, initialInfo.epoch + 1, 'Incorrect next epoch') assert.strictEqual(info.bridgeStatus, 'ready', 'Incorrect bridge state in new epoch') await delay(5000) - const prevBalance = await getBalance(initialInfo.foreignBridgeAddress) - const newBalance = await getBalance(info.foreignBridgeAddress) + const prevBalance = await getBepBalance(initialInfo.foreignBridgeAddress) + const newBalance = await getBepBalance(info.foreignBridgeAddress) assert.strictEqual(prevBalance, 0, 'Did not transfer all funds') assert.strictEqual(newBalance, initialInfo.foreignBalanceTokens, 'Funds are lost somewhere') }) diff --git a/tests/test/utils/bncController.js b/tests/test/utils/bncController.js index 5638620..d1c9122 100644 --- a/tests/test/utils/bncController.js +++ b/tests/test/utils/bncController.js @@ -10,12 +10,17 @@ const bnc = axios.create({ }) module.exports = { - async getBalance(address) { + async getBnbBalance(address) { const response = await retry(() => bnc.get(`/api/v1/account/${address}`), 5) const tokens = response.data.balances.find((x) => x.symbol === FOREIGN_ASSET) return response && tokens ? parseFloat(tokens.free) : 0 }, - async getSequence(address) { + async getBepBalance(address) { + const response = await retry(() => bnc.get(`/api/v1/account/${address}`), 5) + const tokens = response.data.balances.find((x) => x.symbol === FOREIGN_ASSET) + return response && tokens ? parseFloat(tokens.free) : 0 + }, + async getBncSequence(address) { const response = await retry(() => bnc.get(`/api/v1/account/${address}/sequence`), 5) return response ? response.data.sequence : 0 } diff --git a/tests/test/utils/user.js b/tests/test/utils/user.js index 3562bbe..72b6954 100644 --- a/tests/test/utils/user.js +++ b/tests/test/utils/user.js @@ -3,7 +3,7 @@ const BN = require('bignumber.js') const { getAddressFromPrivateKey } = require('@binance-chain/javascript-sdk/lib/crypto') const createBncClient = require('./bncClient') -const { getBalance } = require('./bncController') +const { getBnbBalance, getBepBalance } = require('./bncController') const { tokenContract, bridgeContract, provider } = require('./homeContracts') const { delay } = require('./wait') @@ -11,7 +11,11 @@ const txOptions = { gasLimit: 200000 } +const { SIDE_RPC_URL } = process.env + async function createUser(privateKey) { + const providerSide = new ethers.providers.JsonRpcProvider(SIDE_RPC_URL) + const walletSide = new ethers.Wallet(privateKey, providerSide) const wallet = new ethers.Wallet(privateKey, provider) const ethAddress = wallet.address const bncAddress = getAddressFromPrivateKey(privateKey) @@ -24,30 +28,74 @@ async function createUser(privateKey) { ethAddress, bncAddress, async getEthBalance() { + const balance = await wallet.getBalance() + return parseFloat(new BN(balance).dividedBy(10 ** 18).toFixed(8, 3)) + }, + async getSideEthBalance() { + const balance = await walletSide.getBalance() + return parseFloat(new BN(balance).dividedBy(10 ** 18).toFixed(8, 3)) + }, + async getErcBalance() { const balance = await token.balanceOf(ethAddress) return parseFloat(new BN(balance).dividedBy(10 ** 18).toFixed(8, 3)) }, async transferEth(to, value) { - const tx = await token.transfer(to, `0x${new BN(value).multipliedBy(10 ** 18).toString(16)}`, txOptions) + const tx = await wallet.sendTransaction( + { + to, + value: `0x${new BN(value).multipliedBy(10 ** 18).toString(16)}` + }, + txOptions + ) await tx.wait() }, - async approveEth(to, value) { - const tx = await token.approve(to, `0x${new BN(value).multipliedBy(10 ** 18).toString(16)}`, txOptions) + async transferEthSide(to, value) { + const tx = await walletSide.sendTransaction( + { + to, + value: `0x${new BN(value).multipliedBy(10 ** 18).toString(16)}` + }, + txOptions + ) await tx.wait() }, - async exchangeEth(value) { - const tx = await bridge.exchange(`0x${new BN(value).multipliedBy(10 ** 18).toString(16)}`, txOptions) + async transferErc(to, value) { + const tx = await token.transfer( + to, + `0x${new BN(value).multipliedBy(10 ** 18).toString(16)}`, + txOptions + ) await tx.wait() }, - async getBncBalance() { - const balance = await getBalance(bncAddress) + async approveErc(to, value) { + const tx = await token.approve( + to, + `0x${new BN(value).multipliedBy(10 ** 18).toString(16)}`, + txOptions + ) + await tx.wait() + }, + async exchangeErc(value) { + const tx = await bridge.exchange( + `0x${new BN(value).multipliedBy(10 ** 18).toString(16)}`, + txOptions + ) + await tx.wait() + }, + async getBnbBalance() { + const balance = await getBnbBalance(bncAddress) await delay(1000) return balance }, - async transferBnc(bridgeAddress, tokens, bnbs) { - return await bncClient.transfer(bridgeAddress, tokens, bnbs) + async getBepBalance() { + const balance = await getBepBalance(bncAddress) + await delay(1000) + return balance }, - async exchangeBnc(bridgeAddress, value) { + async transferBepBnb(to, tokens, bnbs) { + return await bncClient.transfer(to, tokens, bnbs) + }, + async exchangeBep(bridgeAddress, value) { return await bncClient.exchange(bridgeAddress, value) } } From 8c8dad07caac6141cadc9b61b2c3bede4d02704d Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Mon, 4 Nov 2019 12:53:58 +0300 Subject: [PATCH 058/129] Closes #13 --- DEMO.md | 14 +++++++------- src/deploy/deploy-home/.env.development | 2 +- src/deploy/deploy-home/.env.staging | 2 +- src/deploy/deploy-home/contracts/Bridge.sol | 10 +++++++--- src/oracle/tss-keygen/keygen.js | 2 +- src/oracle/tss-sign/signer.js | 2 +- tests/test/index.js | 2 +- 7 files changed, 19 insertions(+), 15 deletions(-) diff --git a/DEMO.md b/DEMO.md index 6294efe..a408598 100644 --- a/DEMO.md +++ b/DEMO.md @@ -197,11 +197,11 @@ The public Binance Chain testnet will keep a BEP2 token. "nextEpoch": 3, // threshold number for current epoch, - // threshold + 1 votes are required for any changes in next epoch - "threshold": 1, + // at least threshold votes are required for any changes in next epoch + "threshold": 2, // threshold number for next epoch - "nextThreshold": 1, + "nextThreshold": 2, // current bridge addresses in home and foreign networks "homeBridgeAddress": "0x44c158FE850821ae69DaF37AADF5c539e9d0025B", @@ -239,13 +239,13 @@ The public Binance Chain testnet will keep a BEP2 token. "confirmationsForFundsTransfer": 0 } ``` - * (7.1) Start voting process for next epoch, via sending `$THRESHOLD + 1` requests to `/vote/startVoting` url. Bridge + * (7.1) Start voting process for next epoch, via sending `$THRESHOLD` requests to `/vote/startVoting` url. Bridge state should be successfully changed to `voting`. * 7.2 Changing next epoch bridge validators / threshold - * (7.2.1) Add / remove validator in next validators list, via sending `$THRESHOLD + 1` requests to + * (7.2.1) Add / remove validator in next validators list, via sending `$THRESHOLD` requests to `/vote/addValidator/$ADDRESS` / `/vote/removeValidator/$ADDRESS`. - * (7.2.2) Change threshold for the next epoch, via sending `$THRESHOLD + 1` requests to `/vote/changeThreshold/$THRESHOLD`. - * (7.3) Start keygen process for next epoch, via sending `$THRESHOLD + 1` requests to `/vote/startKeygen` url. Bridge + * (7.2.2) Change threshold for the next epoch, via sending `$THRESHOLD` requests to `/vote/changeThreshold/$THRESHOLD`. + * (7.3) Start keygen process for next epoch, via sending `$THRESHOLD` requests to `/vote/startKeygen` url. Bridge state should be successfully changed to `keygen`, and in some time to `funds_transfer`, and then to `ready`. * (7.4) If keygen process at some state was stopped(i. e. one validator turned of his oracle), it can be cancelled via via sending `$THRESHOLD + 1` requests to `/vote/cancelKeygen` url. After diff --git a/src/deploy/deploy-home/.env.development b/src/deploy/deploy-home/.env.development index 26e2481..38ec3e0 100644 --- a/src/deploy/deploy-home/.env.development +++ b/src/deploy/deploy-home/.env.development @@ -9,7 +9,7 @@ VALIDATOR_ADDRESS_2=0xaa006899b0ec407de930ba8a166defe59bbfd3dc VALIDATOR_ADDRESS_3=0x6352e3e6038e05b9da00c84ae851308f9774f883 #VALIDATOR_ADDRESS_4=0x4db6b4bd0a3fdc03b027a60f1c48f05c572312aa -THRESHOLD=1 +THRESHOLD=2 MIN_TX_LIMIT=10000000000000000 MAX_TX_LIMIT=100000000000000000000 diff --git a/src/deploy/deploy-home/.env.staging b/src/deploy/deploy-home/.env.staging index 5d80c82..550b4bc 100644 --- a/src/deploy/deploy-home/.env.staging +++ b/src/deploy/deploy-home/.env.staging @@ -10,7 +10,7 @@ VALIDATOR_ADDRESS_2=0xbbbb63D6Fc58bD14dAF9eeF653650c4D10f3dBC8 VALIDATOR_ADDRESS_3=0xcccc27ae510b63E30eC3C68AAD7DdD2578bD62ed #VALIDATOR_ADDRESS_4=0xdddd9300e32fe162bA420f7313651Fd901C2ed71 -THRESHOLD=1 +THRESHOLD=2 MIN_TX_LIMIT=10000000000000000 MAX_TX_LIMIT=100000000000000000000 diff --git a/src/deploy/deploy-home/contracts/Bridge.sol b/src/deploy/deploy-home/contracts/Bridge.sol index a964c28..c424563 100644 --- a/src/deploy/deploy-home/contracts/Bridge.sol +++ b/src/deploy/deploy-home/contracts/Bridge.sol @@ -57,7 +57,7 @@ contract Bridge { constructor(uint threshold, address[] memory validators, address _tokenContract, uint[2] memory limits, uint rangeSize) public { require(validators.length > 0); - require(threshold < validators.length); + require(threshold <= validators.length); tokenContract = IERC20(_tokenContract); @@ -280,6 +280,8 @@ contract Bridge { } function voteChangeThreshold(uint threshold) public voting currentValidator { + require(threshold > 0 && threshold <= getParties(), "Invalid threshold value"); + if (tryVote(Vote.CHANGE_THRESHOLD, threshold)) { states[nextEpoch].threshold = threshold; } @@ -292,6 +294,8 @@ contract Bridge { } function voteStartKeygen() public voting currentValidator { + require(getNextThreshold() <= getNextParties(), "Invalid threshold number"); + if (tryVote(Vote.START_KEYGEN)) { status = Status.KEYGEN; @@ -342,7 +346,7 @@ contract Bridge { require(!votes[personalVote], "Voted already"); votes[personalVote] = true; - if (votesCount[vote] == getThreshold()) { + if (votesCount[vote] + 1 == getThreshold()) { votesCount[vote] = 2 ** 255; return true; } else { @@ -356,7 +360,7 @@ contract Bridge { require(!votes[personalVote], "Confirmed already"); votes[personalVote] = true; - if (votesCount[vote] == getNextThreshold()) { + if (votesCount[vote] + 1 == getNextThreshold()) { votesCount[vote] = 2 ** 255; return true; } else { diff --git a/src/oracle/tss-keygen/keygen.js b/src/oracle/tss-keygen/keygen.js index 0f3a067..2315936 100644 --- a/src/oracle/tss-keygen/keygen.js +++ b/src/oracle/tss-keygen/keygen.js @@ -42,7 +42,7 @@ async function main() { logger.debug('Writing params') fs.writeFileSync('./params', JSON.stringify({ parties: parties.toString(), - threshold: threshold.toString() + threshold: (threshold - 1).toString() })) const cmd = exec.execFile('./keygen-entrypoint.sh', [PROXY_URL, keysFile], async () => { currentKeygenEpoch = null diff --git a/src/oracle/tss-sign/signer.js b/src/oracle/tss-sign/signer.js index 1e49e05..c79e5f0 100644 --- a/src/oracle/tss-sign/signer.js +++ b/src/oracle/tss-sign/signer.js @@ -172,7 +172,7 @@ async function main() { logger.debug('Writing params') fs.writeFileSync('./params', JSON.stringify({ parties: parties.toString(), - threshold: threshold.toString() + threshold: (threshold - 1).toString() })) attempt = 1 diff --git a/tests/test/index.js b/tests/test/index.js index 8d661c8..379689c 100644 --- a/tests/test/index.js +++ b/tests/test/index.js @@ -81,7 +81,7 @@ describe('bridge tests', function () { testEthToBnc(() => users) testBncToEth(() => users) - testChangeThreshold(2) + testChangeThreshold(3) testEthToBnc(() => users) testBncToEth(() => users) From 7f4bc98318b2453354c42d4d7d9c0baef243beb9 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Mon, 4 Nov 2019 17:06:37 +0300 Subject: [PATCH 059/129] Removed web3 dependency from eth watcher --- demo/validator1/.env.development | 1 + demo/validator1/.env.staging | 1 + demo/validator2/.env.development | 1 + demo/validator2/.env.staging | 1 + demo/validator3/.env.development | 1 + demo/validator3/.env.staging | 1 + package.json | 3 + src/oracle/docker-compose-test.yml | 1 + src/oracle/docker-compose.yml | 1 + src/oracle/ethWatcher/Bridge.json | 35243 -------------------------- src/oracle/ethWatcher/Dockerfile | 1 - src/oracle/ethWatcher/ethWatcher.js | 196 +- src/oracle/ethWatcher/package.json | 1 - 13 files changed, 117 insertions(+), 35335 deletions(-) delete mode 100644 src/oracle/ethWatcher/Bridge.json diff --git a/demo/validator1/.env.development b/demo/validator1/.env.development index bba8faf..3166e7b 100644 --- a/demo/validator1/.env.development +++ b/demo/validator1/.env.development @@ -2,6 +2,7 @@ HOME_RPC_URL=http://ganache_home:8545 HOME_BRIDGE_ADDRESS=0x44c158FE850821ae69DaF37AADF5c539e9d0025B HOME_TOKEN_ADDRESS=0xd5fE0D28e058D375b0b038fFbB446Da37E85fFdc HOME_START_BLOCK=1 +HOME_MAX_FETCH_RANGE_SIZE=10 SIDE_RPC_URL=http://ganache_side:8545 SIDE_SHARED_DB_ADDRESS=0xd5fE0D28e058D375b0b038fFbB446Da37E85fFdc diff --git a/demo/validator1/.env.staging b/demo/validator1/.env.staging index 20692c4..5513f42 100644 --- a/demo/validator1/.env.staging +++ b/demo/validator1/.env.staging @@ -2,6 +2,7 @@ HOME_RPC_URL=https://kovan.infura.io/v3/5d7bd94c50ed43fab1cb8e74f58678b0 HOME_BRIDGE_ADDRESS=0x6ADCa5e691341fb9de8927d15c0a89B83A4E665e HOME_TOKEN_ADDRESS=0x57d2533B640cfb58f8f1F69C14c089968Da9fdFc HOME_START_BLOCK=13276224 +HOME_MAX_FETCH_RANGE_SIZE=10 SIDE_RPC_URL=https://sokol.poa.network SIDE_SHARED_DB_ADDRESS=0xda9a1cA2Fcb18cAB02934269369627D2b4ea8902 diff --git a/demo/validator2/.env.development b/demo/validator2/.env.development index d1cfebd..433ee15 100644 --- a/demo/validator2/.env.development +++ b/demo/validator2/.env.development @@ -2,6 +2,7 @@ HOME_RPC_URL=http://ganache_home:8545 HOME_BRIDGE_ADDRESS=0x44c158FE850821ae69DaF37AADF5c539e9d0025B HOME_TOKEN_ADDRESS=0xd5fE0D28e058D375b0b038fFbB446Da37E85fFdc HOME_START_BLOCK=1 +HOME_MAX_FETCH_RANGE_SIZE=10 SIDE_RPC_URL=http://ganache_side:8545 SIDE_SHARED_DB_ADDRESS=0xd5fE0D28e058D375b0b038fFbB446Da37E85fFdc diff --git a/demo/validator2/.env.staging b/demo/validator2/.env.staging index edce271..e2f6756 100644 --- a/demo/validator2/.env.staging +++ b/demo/validator2/.env.staging @@ -2,6 +2,7 @@ HOME_RPC_URL=https://kovan.infura.io/v3/5d7bd94c50ed43fab1cb8e74f58678b0 HOME_BRIDGE_ADDRESS=0x6ADCa5e691341fb9de8927d15c0a89B83A4E665e HOME_TOKEN_ADDRESS=0x57d2533B640cfb58f8f1F69C14c089968Da9fdFc HOME_START_BLOCK=13276224 +HOME_MAX_FETCH_RANGE_SIZE=10 SIDE_RPC_URL=https://sokol.poa.network SIDE_SHARED_DB_ADDRESS=0xda9a1cA2Fcb18cAB02934269369627D2b4ea8902 diff --git a/demo/validator3/.env.development b/demo/validator3/.env.development index 64f6f65..9c175f8 100644 --- a/demo/validator3/.env.development +++ b/demo/validator3/.env.development @@ -2,6 +2,7 @@ HOME_RPC_URL=http://ganache_home:8545 HOME_BRIDGE_ADDRESS=0x44c158FE850821ae69DaF37AADF5c539e9d0025B HOME_TOKEN_ADDRESS=0xd5fE0D28e058D375b0b038fFbB446Da37E85fFdc HOME_START_BLOCK=1 +HOME_MAX_FETCH_RANGE_SIZE=10 SIDE_RPC_URL=http://ganache_side:8545 SIDE_SHARED_DB_ADDRESS=0xd5fE0D28e058D375b0b038fFbB446Da37E85fFdc diff --git a/demo/validator3/.env.staging b/demo/validator3/.env.staging index da39c37..3925fbc 100644 --- a/demo/validator3/.env.staging +++ b/demo/validator3/.env.staging @@ -2,6 +2,7 @@ HOME_RPC_URL=https://kovan.infura.io/v3/5d7bd94c50ed43fab1cb8e74f58678b0 HOME_BRIDGE_ADDRESS=0x6ADCa5e691341fb9de8927d15c0a89B83A4E665e HOME_TOKEN_ADDRESS=0x57d2533B640cfb58f8f1F69C14c089968Da9fdFc HOME_START_BLOCK=13276224 +HOME_MAX_FETCH_RANGE_SIZE=10 SIDE_RPC_URL=https://sokol.poa.network SIDE_SHARED_DB_ADDRESS=0xda9a1cA2Fcb18cAB02934269369627D2b4ea8902 diff --git a/package.json b/package.json index e954bd9..154668e 100644 --- a/package.json +++ b/package.json @@ -10,5 +10,8 @@ }, "engines": { "node": ">=10.6.0" + }, + "dependencies": { + "ethers": "^4.0.39" } } diff --git a/src/oracle/docker-compose-test.yml b/src/oracle/docker-compose-test.yml index 2de2b8b..8725650 100644 --- a/src/oracle/docker-compose-test.yml +++ b/src/oracle/docker-compose-test.yml @@ -84,6 +84,7 @@ services: - HOME_START_BLOCK - BLOCKS_RANGE_SIZE - VALIDATOR_PRIVATE_KEY + - HOME_MAX_FETCH_RANGE_SIZE - 'RABBITMQ_URL=amqp://rabbitmq:5672' - LOG_LEVEL networks: diff --git a/src/oracle/docker-compose.yml b/src/oracle/docker-compose.yml index 994bfa7..e16cbe4 100644 --- a/src/oracle/docker-compose.yml +++ b/src/oracle/docker-compose.yml @@ -93,6 +93,7 @@ services: - HOME_TOKEN_ADDRESS - HOME_START_BLOCK - VALIDATOR_PRIVATE_KEY + - HOME_MAX_FETCH_RANGE_SIZE - 'RABBITMQ_URL=amqp://rabbitmq:5672' - LOG_LEVEL networks: diff --git a/src/oracle/ethWatcher/Bridge.json b/src/oracle/ethWatcher/Bridge.json deleted file mode 100644 index 9eba79e..0000000 --- a/src/oracle/ethWatcher/Bridge.json +++ /dev/null @@ -1,35243 +0,0 @@ -{ - "contractName": "Bridge", - "abi": [ - { - "constant": true, - "inputs": [], - "name": "status", - "outputs": [ - { - "name": "", - "type": "uint8" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "", - "type": "bytes32" - } - ], - "name": "usedRange", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "", - "type": "bytes32" - } - ], - "name": "votes", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "", - "type": "bytes32" - } - ], - "name": "dbTransfer", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "tokenContract", - "outputs": [ - { - "name": "", - "type": "address" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "epoch", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "", - "type": "bytes32" - } - ], - "name": "votesCount", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "nextEpoch", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "", - "type": "bytes32" - } - ], - "name": "dbTransferCount", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "name": "threshold", - "type": "uint256" - }, - { - "name": "validators", - "type": "address[]" - }, - { - "name": "_tokenContract", - "type": "address" - }, - { - "name": "limits", - "type": "uint256[2]" - }, - { - "name": "rangeSize", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "name": "value", - "type": "uint256" - }, - { - "indexed": false, - "name": "nonce", - "type": "uint256" - } - ], - "name": "ExchangeRequest", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "oldEpoch", - "type": "uint256" - }, - { - "indexed": true, - "name": "newEpoch", - "type": "uint256" - } - ], - "name": "NewEpoch", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "epoch", - "type": "uint256" - } - ], - "name": "NewEpochCancelled", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "oldEpoch", - "type": "uint256" - }, - { - "indexed": true, - "name": "newEpoch", - "type": "uint256" - } - ], - "name": "NewFundsTransfer", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "epoch", - "type": "uint256" - }, - { - "indexed": false, - "name": "x", - "type": "uint256" - }, - { - "indexed": false, - "name": "y", - "type": "uint256" - } - ], - "name": "EpochStart", - "type": "event" - }, - { - "constant": false, - "inputs": [ - { - "name": "value", - "type": "uint256" - } - ], - "name": "exchange", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "hash", - "type": "bytes32" - }, - { - "name": "to", - "type": "address" - }, - { - "name": "value", - "type": "uint256" - } - ], - "name": "transfer", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "x", - "type": "uint256" - }, - { - "name": "y", - "type": "uint256" - } - ], - "name": "confirmKeygen", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [], - "name": "confirmFundsTransfer", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "getNextParties", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "getParties", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "_epoch", - "type": "uint256" - } - ], - "name": "getParties", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "getNextThreshold", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "getThreshold", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "_epoch", - "type": "uint256" - } - ], - "name": "getThreshold", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "getStartBlock", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "_epoch", - "type": "uint256" - } - ], - "name": "getStartBlock", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "getNextRangeSize", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "_epoch", - "type": "uint256" - } - ], - "name": "getRangeSize", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "getRangeSize", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "_epoch", - "type": "uint256" - } - ], - "name": "getNonce", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "getNonce", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "getX", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "getY", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "getPartyId", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "a", - "type": "address" - } - ], - "name": "getNextPartyId", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "getValidators", - "outputs": [ - { - "name": "", - "type": "address[]" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "getNextValidators", - "outputs": [ - { - "name": "", - "type": "address[]" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [], - "name": "startVoting", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "validator", - "type": "address" - } - ], - "name": "voteAddValidator", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "validator", - "type": "address" - } - ], - "name": "voteRemoveValidator", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "threshold", - "type": "uint256" - } - ], - "name": "voteChangeThreshold", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "rangeSize", - "type": "uint256" - } - ], - "name": "voteChangeRangeSize", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [], - "name": "voteStartKeygen", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [], - "name": "voteCancelKeygen", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - } - ], - "metadata": "{\"compiler\":{\"version\":\"0.5.9+commit.e560f70d\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":true,\"inputs\":[{\"name\":\"_epoch\",\"type\":\"uint256\"}],\"name\":\"getStartBlock\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getNextParties\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getY\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"a\",\"type\":\"address\"}],\"name\":\"getNextPartyId\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"startVoting\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"status\",\"outputs\":[{\"name\":\"\",\"type\":\"uint8\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"rangeSize\",\"type\":\"uint256\"}],\"name\":\"voteChangeRangeSize\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"usedRange\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getRangeSize\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"votes\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getPartyId\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"voteCancelKeygen\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_epoch\",\"type\":\"uint256\"}],\"name\":\"getNonce\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"hash\",\"type\":\"bytes32\"},{\"name\":\"to\",\"type\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getNextValidators\",\"outputs\":[{\"name\":\"\",\"type\":\"address[]\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_epoch\",\"type\":\"uint256\"}],\"name\":\"getParties\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_epoch\",\"type\":\"uint256\"}],\"name\":\"getThreshold\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"dbTransfer\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getX\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"exchange\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"tokenContract\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"validator\",\"type\":\"address\"}],\"name\":\"voteAddValidator\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getNextThreshold\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"epoch\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"voteStartKeygen\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"validator\",\"type\":\"address\"}],\"name\":\"voteRemoveValidator\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getStartBlock\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"x\",\"type\":\"uint256\"},{\"name\":\"y\",\"type\":\"uint256\"}],\"name\":\"confirmKeygen\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getParties\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"votesCount\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"nextEpoch\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getValidators\",\"outputs\":[{\"name\":\"\",\"type\":\"address[]\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getNextRangeSize\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_epoch\",\"type\":\"uint256\"}],\"name\":\"getRangeSize\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"threshold\",\"type\":\"uint256\"}],\"name\":\"voteChangeThreshold\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getNonce\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"dbTransferCount\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"confirmFundsTransfer\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getThreshold\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"threshold\",\"type\":\"uint256\"},{\"name\":\"validators\",\"type\":\"address[]\"},{\"name\":\"_tokenContract\",\"type\":\"address\"},{\"name\":\"limits\",\"type\":\"uint256[2]\"},{\"name\":\"rangeSize\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"value\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"ExchangeRequest\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"oldEpoch\",\"type\":\"uint256\"},{\"indexed\":true,\"name\":\"newEpoch\",\"type\":\"uint256\"}],\"name\":\"NewEpoch\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"epoch\",\"type\":\"uint256\"}],\"name\":\"NewEpochCancelled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"oldEpoch\",\"type\":\"uint256\"},{\"indexed\":true,\"name\":\"newEpoch\",\"type\":\"uint256\"}],\"name\":\"NewFundsTransfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"epoch\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"x\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"y\",\"type\":\"uint256\"}],\"name\":\"EpochStart\",\"type\":\"event\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/build/contracts/Bridge.sol\":\"Bridge\"},\"evmVersion\":\"petersburg\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":3},\"remappings\":[]},\"sources\":{\"/build/contracts/Bridge.sol\":{\"keccak256\":\"0xedcf62b24f2b47b0e83af55ca6471e82e301f8287aa78e7c41bbca2d3ddc4155\",\"urls\":[\"bzzr://84b325be5714e21d85966ce976f9996d2f7d2305b467c191d37f6e91bb1901fb\",\"dweb:/ipfs/QmY1RVRv3H9E9T2VwmSdyKxAfQFMd7t9yYjcVFVpox9Lf8\"]},\"/build/contracts/openzeppelin-solidity/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0x90e8c2521653bbb1768b05889c5760031e688d9cd361f167489b89215e201b95\",\"urls\":[\"bzzr://aa8b45b57edafc3d67bc5d916327ea16807fae33f753ca163ae0c4061b789766\",\"dweb:/ipfs/QmP5NaEwZthQeM2ESz4WTT3osrP7jhbvu7ocbttBi2JAw6\"]}},\"version\":1}", - "bytecode": "0x60806040523480156200001157600080fd5b5060405162001f4838038062001f48833981810160405260c08110156200003757600080fd5b8151602083018051919392830192916401000000008111156200005957600080fd5b820160208101848111156200006d57600080fd5b81518560208202830111640100000000821117156200008b57600080fd5b505060208201516080830151825192955090935060409092019190620000b057600080fd5b83518510620000be57600080fd5b600b80546001600160a01b0385166001600160a01b0319909116179055600060078190556006805460ff19166002179055600160088190556040805160e08101825287815260208082018a905291810185905260608101849052600019608082015260a0810184905260c081018490529183529182528051805191927fada5013122d395ba3c54772283fb069b10426056ef8ca54750cb9bb552a59e7d926200016b9284920190620001f9565b506020820151600182015560408201516002820155606082015160038201556080820151600482015560a0820151600582015560c09091015160069091015581600060200201516009558160016020020151600a556040516001906000907f3ef85928df9ae51bdb3eb4c00ec73b92b82307f319ac1b029de14796a0972609908290a350505050506200028d565b82805482825590600052602060002090810192821562000251579160200282015b828111156200025157825182546001600160a01b0319166001600160a01b039091161782556020909201916001909101906200021a565b506200025f92915062000263565b5090565b6200028a91905b808211156200025f5780546001600160a01b03191681556001016200026a565b90565b611cab806200029d6000396000f3fe608060405234801561001057600080fd5b50600436106101cd5760003560e01c806301b2320e146101d2578063073ce82d146102015780630b7f166514610209578063197d6ca4146102115780631ec6b60a14610237578063200d2ed2146102415780632493b9fc1461026d5780632a2acafa1461028a5780632a4b93af146102bb5780632b38cd96146102c35780632fb0fc6f146102e057806339f0ebb1146102e85780633d46b819146102f05780633feb1bd81461030d57806340cddab31461033f578063447fe289146103975780634615d5e9146103b457806349f92f63146103d15780635197c7aa146103ee57806353556559146103f657806355a373d61461041357806357456f22146104375780638199d3fd1461045d578063900cf0cf14610465578063915eb0e71461046d5780639bf6a74a14610475578063a5f18c011461049b578063a7699d02146104a3578063a8311aa8146104c6578063aae46bab146104ce578063aea0e78b146104eb578063b7ab4db5146104f3578063c2668caf146104fb578063c3e3a45c14610503578063cc8ee06514610520578063d087d2881461053d578063d09fc00414610545578063df78523014610562578063e75235b81461056a575b600080fd5b6101ef600480360360208110156101e857600080fd5b5035610572565b60408051918252519081900360200190f35b6101ef61058a565b6101ef61059d565b6101ef6004803603602081101561022757600080fd5b50356001600160a01b03166105b5565b61023f610620565b005b610249610778565b6040518082600381111561025957fe5b60ff16815260200191505060405180910390f35b61023f6004803603602081101561028357600080fd5b5035610781565b6102a7600480360360208110156102a057600080fd5b5035610846565b604080519115158252519081900360200190f35b6101ef61085b565b6102a7600480360360208110156102d957600080fd5b5035610868565b6101ef61087d565b61023f6108e7565b6101ef6004803603602081101561030657600080fd5b50356109d3565b61023f6004803603606081101561032357600080fd5b508035906001600160a01b0360208201351690604001356109e8565b610347610b48565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561038357818101518382015260200161036b565b505050509050019250505060405180910390f35b6101ef600480360360208110156103ad57600080fd5b5035610bb3565b6101ef600480360360208110156103ca57600080fd5b5035610bc5565b6102a7600480360360208110156103e757600080fd5b5035610bda565b6101ef610bef565b61023f6004803603602081101561040c57600080fd5b5035610c07565b61041b610e1c565b604080516001600160a01b039092168252519081900360200190f35b61023f6004803603602081101561044d57600080fd5b50356001600160a01b0316610e2b565b6101ef610f63565b6101ef610f70565b61023f610f76565b61023f6004803603602081101561048b57600080fd5b50356001600160a01b031661105d565b6101ef611164565b61023f600480360360408110156104b957600080fd5b5080359060200135611171565b6101ef611304565b6101ef600480360360208110156104e457600080fd5b5035611311565b6101ef611323565b610347611329565b6101ef611392565b6101ef6004803603602081101561051957600080fd5b503561139b565b61023f6004803603602081101561053657600080fd5b50356113b0565b6101ef611471565b6101ef6004803603602081101561055b57600080fd5b503561147e565b61023f611490565b6101ef6115fc565b6000818152602081905260409020600301545b919050565b6000610597600854610bb3565b90505b90565b60075460009081526020819052604090206006015490565b600060606105c1610b48565b905060005b6105ce61058a565b81101561061657836001600160a01b03168282815181106105eb57fe5b60200260200101516001600160a01b0316141561060e5760010191506105859050565b6001016105c6565b5060009392505050565b600060065460ff16600381111561063357fe5b148061064f5750600160065460ff16600381111561064d57fe5b145b61069f576040805162461bcd60e51b815260206004820152601c60248201527b4e6f7420696e207265616479206f7220766f74696e6720737461746560201b604482015290519081900360640190fd5b6106a761087d565b6106e6576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b6106f06002611609565b15610776576008805460019081019091556006805460ff191690911790556107166115fc565b600854600090815260208190526040902060010155610733611329565b60085460009081526020818152604090912082516107579391929190910190611b27565b5061076061085b565b6008546000908152602081905260409020600201555b565b60065460ff1681565b600160065460ff16600381111561079457fe5b146107d4576040805162461bcd60e51b81526020600482015260136024820152600080516020611c0f833981519152604482015290519081900360640190fd5b6107dc61087d565b61081b576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b610826600682611660565b156108435760085460009081526020819052604090206002018190555b50565b60056020526000908152604090205460ff1681565b600061059760075461139b565b60046020526000908152604090205460ff1681565b60006060610889611329565b905060005b610896611304565b8110156108de57336001600160a01b03168282815181106108b357fe5b60200260200101516001600160a01b031614156108d657600101915061059a9050565b60010161088e565b50600091505090565b600260065460ff1660038111156108fa57fe5b14610942576040805162461bcd60e51b81526020600482015260136024820152724e6f7420696e206b657967656e20737461746560681b604482015290519081900360640190fd5b61094a61087d565b610989576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b6109936008611609565b15610776576006805460ff191660011790556008546040517fddbb65cfe1ae4aec03cef0f9667c6d7ba3740927d0c60f4dd4d7104cc31d180a90600090a2565b60009081526020819052604090206004015490565b600060065460ff1660038111156109fb57fe5b1480610a175750600160065460ff166003811115610a1557fe5b145b610a67576040805162461bcd60e51b815260206004820152601c60248201527b4e6f7420696e207265616479206f7220766f74696e6720737461746560201b604482015290519081900360640190fd5b610a6f61087d565b610aae576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b610abb60098484846116c0565b15610b4357600b546040805163a9059cbb60e01b81526001600160a01b038581166004830152602482018590529151919092169163a9059cbb9160448083019260209291908290030181600087803b158015610b1657600080fd5b505af1158015610b2a573d6000803e3d6000fd5b505050506040513d6020811015610b4057600080fd5b50505b505050565b60085460009081526020818152604091829020805483518184028101840190945280845260609392830182828015610ba957602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610b8b575b5050505050905090565b60009081526020819052604090205490565b60009081526020819052604090206001015490565b60026020526000908152604090205460ff1681565b60075460009081526020819052604090206005015490565b600060065460ff166003811115610c1a57fe5b14610c61576040805162461bcd60e51b81526020600482015260126024820152714e6f7420696e20726561647920737461746560701b604482015290519081900360640190fd5b6009548110158015610c7857506402540be4008110155b8015610c865750600a548111155b610c8f57600080fd5b6000610c9961085b565b610ca1611164565b430381610caa57fe5b60075460408051939092046020808501829052848401929092528251808503840181526060909401835283519382019390932060009081526005909152205490915060ff16610d4f57600780546040805160208082018690528183019390935281518082038301815260609091018252805190830120600090815260058352818120805460ff1916600190811790915593548152918290529020600401805490910190555b600b54604080516323b872dd60e01b81523360048201523060248201526044810185905290516001600160a01b03909216916323b872dd916064808201926020929091908290030181600087803b158015610da957600080fd5b505af1158015610dbd573d6000803e3d6000fd5b505050506040513d6020811015610dd357600080fd5b507f9273b6f22cee1ef3d7cdc2a9c031936003526bae368886259511f7dd40044b02905082610e00611471565b6040805192835260208301919091528051918290030190a15050565b600b546001600160a01b031681565b600160065460ff166003811115610e3e57fe5b14610e7e576040805162461bcd60e51b81526020600482015260136024820152600080516020611c0f833981519152604482015290519081900360640190fd5b610e8661087d565b610ec5576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b610ece816105b5565b15610f16576040805162461bcd60e51b815260206004820152601360248201527220b63932b0b23c9030903b30b634b230ba37b960691b604482015290519081900360640190fd5b610f2160038261173d565b15610843576008546000908152602081815260408220805460018101825590835291200180546001600160a01b0383166001600160a01b031990911617905550565b6000610597600854610bc5565b60075481565b600160065460ff166003811115610f8957fe5b14610fc9576040805162461bcd60e51b81526020600482015260136024820152600080516020611c0f833981519152604482015290519081900360640190fd5b610fd161087d565b611010576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b61101a6007611609565b15610776576006805460ff191660021790556008546007546040517f3ef85928df9ae51bdb3eb4c00ec73b92b82307f319ac1b029de14796a097260990600090a3565b600160065460ff16600381111561107057fe5b146110b0576040805162461bcd60e51b81526020600482015260136024820152600080516020611c0f833981519152604482015290519081900360640190fd5b6110b861087d565b6110f7576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b611100816105b5565b61114b576040805162461bcd60e51b815260206004820152601760248201527620b63932b0b23c903737ba1030903b30b634b230ba37b960491b604482015290519081900360640190fd5b61115660048261173d565b1561084357610843816117aa565b6000610597600754610572565b600260065460ff16600381111561118457fe5b146111cc576040805162461bcd60e51b81526020600482015260136024820152724e6f7420696e206b657967656e20737461746560681b604482015290519081900360640190fd5b6111d5336105b5565b61121d576040805162461bcd60e51b81526020600482015260146024820152732737ba1030903732bc3a103b30b634b230ba37b960611b604482015290519081900360640190fd5b611229600083836118e4565b15611300576008805460009081526020819052604080822060050185905582548252902060060182905554600114156112c3576006805460ff191690556008805460009081526020818152604080832043600390910155835483529182902060001960049091015591546007819055815185815292830184905281519092600080516020611bef83398151915292908290030190a2611300565b6006805460ff191660031790556008546007546040517ff4735b85cc98f9a712832825ecab4cfb1649d658f9a73c57a00ea7dde735c79b90600090a35b5050565b6000610597600754610bb3565b60036020526000908152604090205481565b60085481565b60075460009081526020818152604091829020805483518184028101840190945280845260609392830182828015610ba9576020028201919060005260206000209081546001600160a01b03168152600190910190602001808311610b8b575050505050905090565b60006105976008545b60009081526020819052604090206002015490565b600160065460ff1660038111156113c357fe5b14611403576040805162461bcd60e51b81526020600482015260136024820152600080516020611c0f833981519152604482015290519081900360640190fd5b61140b61087d565b61144a576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b611455600582611660565b1561084357600854600090815260208190526040902060010155565b60006105976007546109d3565b60016020526000908152604090205481565b600360065460ff1660038111156114a357fe5b146114f3576040805162461bcd60e51b815260206004820152601b60248201527a4e6f7420696e2066756e6473207472616e7366657220737461746560281b604482015290519081900360640190fd5b6114fb61087d565b61153a576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b60006007541161157b5760405162461bcd60e51b8152600401808060200182810382526028815260200180611c2f6028913960400191505060405180910390fd5b611585600161194d565b15610776576006805460ff191690556008805460009081526020819052604080822043600390910155825482529020600019600490910155546007819055600080516020611bef8339815191526115da610bef565b6115e261059d565b6040805192835260208301919091528051918290030190a2565b6000610597600754610bc5565b600080826008546040516020018083600981111561162357fe5b60ff1660f81b8152600101828152602001925050506040516020818303038152906040528051906020012090506116598161199d565b9392505050565b60008083600854846040516020018084600981111561167b57fe5b60ff1660f81b815260010183815260200182815260200193505050506040516020818303038152906040528051906020012090506116b88161199d565b949350505050565b60008085858585604051602001808560098111156116da57fe5b60ff1660f81b8152600101848152602001836001600160a01b03166001600160a01b031660601b81526014018281526020019450505050506040516020818303038152906040528051906020012090506117338161199d565b9695505050505050565b60008083600854846040516020018084600981111561175857fe5b60ff1660f81b8152600101838152602001826001600160a01b03166001600160a01b031660601b815260140193505050506040516020818303038152906040528051906020012090506116b88161199d565b60005b60016117b761058a565b0381101561188557600854600090815260208190526040902080546001600160a01b0384169190839081106117e857fe5b6000918252602090912001546001600160a01b0316141561187d5761180b610b48565b600161181561058a565b038151811061182057fe5b60200260200101516000806008548152602001908152602001600020600001828154811061184a57fe5b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550611885565b6001016117ad565b50600854600090815260208190526040902060016118a161058a565b03815481106118ac57fe5b6000918252602080832090910180546001600160a01b0319169055600854825281905260409020805490611300906000198301611b8c565b6000808460085485856040516020018085600981111561190057fe5b60ff1660f81b815260010184815260200183815260200182815260200194505050505060405160208183030381529060405280519060200120905061194481611a70565b95945050505050565b600080826008546040516020018083600981111561196757fe5b60ff1660f81b81526001018281526020019250505060405160208183030381529060405280519060200120905061165981611a70565b6000806119a983611af8565b60008181526004602052604090205490915060ff1615611a00576040805162461bcd60e51b815260206004820152600d60248201526c566f74656420616c726561647960981b604482015290519081900360640190fd5b6000818152600460205260409020805460ff19166001179055611a216115fc565b6000848152600360205260409020541415611a545750506000818152600360205260409020600160ff1b90556001610585565b5050600081815260036020526040812080546001019055610585565b600080611a7c83611af8565b60008181526004602052604090205490915060ff1615611ad7576040805162461bcd60e51b8152602060048201526011602482015270436f6e6669726d656420616c726561647960781b604482015290519081900360640190fd5b6000818152600460205260409020805460ff19166001179055611a21610f63565b604080516020808201939093523360601b81830152815180820360340181526054909101909152805191012090565b828054828255906000526020600020908101928215611b7c579160200282015b82811115611b7c57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190611b47565b50611b88929150611bb0565b5090565b815481835581811115610b4357600083815260209020610b43918101908301611bd4565b61059a91905b80821115611b885780546001600160a01b0319168155600101611bb6565b61059a91905b80821115611b885760008155600101611bda56fec33272939f066c227e913a4b3434d860794f185c551685c29451a3a38b9b259c4e6f7420696e20766f74696e672073746174650000000000000000000000000046697273742065706f636820646f6573206e6f74206e6565642066756e6473207472616e736665724e6f7420612063757272656e742076616c696461746f72000000000000000000a265627a7a72305820dfb70a1c283919f9128aabe00d30be35942e7ded3ecf2eb30af4168b8b02e15a64736f6c63430005090032", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101cd5760003560e01c806301b2320e146101d2578063073ce82d146102015780630b7f166514610209578063197d6ca4146102115780631ec6b60a14610237578063200d2ed2146102415780632493b9fc1461026d5780632a2acafa1461028a5780632a4b93af146102bb5780632b38cd96146102c35780632fb0fc6f146102e057806339f0ebb1146102e85780633d46b819146102f05780633feb1bd81461030d57806340cddab31461033f578063447fe289146103975780634615d5e9146103b457806349f92f63146103d15780635197c7aa146103ee57806353556559146103f657806355a373d61461041357806357456f22146104375780638199d3fd1461045d578063900cf0cf14610465578063915eb0e71461046d5780639bf6a74a14610475578063a5f18c011461049b578063a7699d02146104a3578063a8311aa8146104c6578063aae46bab146104ce578063aea0e78b146104eb578063b7ab4db5146104f3578063c2668caf146104fb578063c3e3a45c14610503578063cc8ee06514610520578063d087d2881461053d578063d09fc00414610545578063df78523014610562578063e75235b81461056a575b600080fd5b6101ef600480360360208110156101e857600080fd5b5035610572565b60408051918252519081900360200190f35b6101ef61058a565b6101ef61059d565b6101ef6004803603602081101561022757600080fd5b50356001600160a01b03166105b5565b61023f610620565b005b610249610778565b6040518082600381111561025957fe5b60ff16815260200191505060405180910390f35b61023f6004803603602081101561028357600080fd5b5035610781565b6102a7600480360360208110156102a057600080fd5b5035610846565b604080519115158252519081900360200190f35b6101ef61085b565b6102a7600480360360208110156102d957600080fd5b5035610868565b6101ef61087d565b61023f6108e7565b6101ef6004803603602081101561030657600080fd5b50356109d3565b61023f6004803603606081101561032357600080fd5b508035906001600160a01b0360208201351690604001356109e8565b610347610b48565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561038357818101518382015260200161036b565b505050509050019250505060405180910390f35b6101ef600480360360208110156103ad57600080fd5b5035610bb3565b6101ef600480360360208110156103ca57600080fd5b5035610bc5565b6102a7600480360360208110156103e757600080fd5b5035610bda565b6101ef610bef565b61023f6004803603602081101561040c57600080fd5b5035610c07565b61041b610e1c565b604080516001600160a01b039092168252519081900360200190f35b61023f6004803603602081101561044d57600080fd5b50356001600160a01b0316610e2b565b6101ef610f63565b6101ef610f70565b61023f610f76565b61023f6004803603602081101561048b57600080fd5b50356001600160a01b031661105d565b6101ef611164565b61023f600480360360408110156104b957600080fd5b5080359060200135611171565b6101ef611304565b6101ef600480360360208110156104e457600080fd5b5035611311565b6101ef611323565b610347611329565b6101ef611392565b6101ef6004803603602081101561051957600080fd5b503561139b565b61023f6004803603602081101561053657600080fd5b50356113b0565b6101ef611471565b6101ef6004803603602081101561055b57600080fd5b503561147e565b61023f611490565b6101ef6115fc565b6000818152602081905260409020600301545b919050565b6000610597600854610bb3565b90505b90565b60075460009081526020819052604090206006015490565b600060606105c1610b48565b905060005b6105ce61058a565b81101561061657836001600160a01b03168282815181106105eb57fe5b60200260200101516001600160a01b0316141561060e5760010191506105859050565b6001016105c6565b5060009392505050565b600060065460ff16600381111561063357fe5b148061064f5750600160065460ff16600381111561064d57fe5b145b61069f576040805162461bcd60e51b815260206004820152601c60248201527b4e6f7420696e207265616479206f7220766f74696e6720737461746560201b604482015290519081900360640190fd5b6106a761087d565b6106e6576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b6106f06002611609565b15610776576008805460019081019091556006805460ff191690911790556107166115fc565b600854600090815260208190526040902060010155610733611329565b60085460009081526020818152604090912082516107579391929190910190611b27565b5061076061085b565b6008546000908152602081905260409020600201555b565b60065460ff1681565b600160065460ff16600381111561079457fe5b146107d4576040805162461bcd60e51b81526020600482015260136024820152600080516020611c0f833981519152604482015290519081900360640190fd5b6107dc61087d565b61081b576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b610826600682611660565b156108435760085460009081526020819052604090206002018190555b50565b60056020526000908152604090205460ff1681565b600061059760075461139b565b60046020526000908152604090205460ff1681565b60006060610889611329565b905060005b610896611304565b8110156108de57336001600160a01b03168282815181106108b357fe5b60200260200101516001600160a01b031614156108d657600101915061059a9050565b60010161088e565b50600091505090565b600260065460ff1660038111156108fa57fe5b14610942576040805162461bcd60e51b81526020600482015260136024820152724e6f7420696e206b657967656e20737461746560681b604482015290519081900360640190fd5b61094a61087d565b610989576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b6109936008611609565b15610776576006805460ff191660011790556008546040517fddbb65cfe1ae4aec03cef0f9667c6d7ba3740927d0c60f4dd4d7104cc31d180a90600090a2565b60009081526020819052604090206004015490565b600060065460ff1660038111156109fb57fe5b1480610a175750600160065460ff166003811115610a1557fe5b145b610a67576040805162461bcd60e51b815260206004820152601c60248201527b4e6f7420696e207265616479206f7220766f74696e6720737461746560201b604482015290519081900360640190fd5b610a6f61087d565b610aae576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b610abb60098484846116c0565b15610b4357600b546040805163a9059cbb60e01b81526001600160a01b038581166004830152602482018590529151919092169163a9059cbb9160448083019260209291908290030181600087803b158015610b1657600080fd5b505af1158015610b2a573d6000803e3d6000fd5b505050506040513d6020811015610b4057600080fd5b50505b505050565b60085460009081526020818152604091829020805483518184028101840190945280845260609392830182828015610ba957602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610b8b575b5050505050905090565b60009081526020819052604090205490565b60009081526020819052604090206001015490565b60026020526000908152604090205460ff1681565b60075460009081526020819052604090206005015490565b600060065460ff166003811115610c1a57fe5b14610c61576040805162461bcd60e51b81526020600482015260126024820152714e6f7420696e20726561647920737461746560701b604482015290519081900360640190fd5b6009548110158015610c7857506402540be4008110155b8015610c865750600a548111155b610c8f57600080fd5b6000610c9961085b565b610ca1611164565b430381610caa57fe5b60075460408051939092046020808501829052848401929092528251808503840181526060909401835283519382019390932060009081526005909152205490915060ff16610d4f57600780546040805160208082018690528183019390935281518082038301815260609091018252805190830120600090815260058352818120805460ff1916600190811790915593548152918290529020600401805490910190555b600b54604080516323b872dd60e01b81523360048201523060248201526044810185905290516001600160a01b03909216916323b872dd916064808201926020929091908290030181600087803b158015610da957600080fd5b505af1158015610dbd573d6000803e3d6000fd5b505050506040513d6020811015610dd357600080fd5b507f9273b6f22cee1ef3d7cdc2a9c031936003526bae368886259511f7dd40044b02905082610e00611471565b6040805192835260208301919091528051918290030190a15050565b600b546001600160a01b031681565b600160065460ff166003811115610e3e57fe5b14610e7e576040805162461bcd60e51b81526020600482015260136024820152600080516020611c0f833981519152604482015290519081900360640190fd5b610e8661087d565b610ec5576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b610ece816105b5565b15610f16576040805162461bcd60e51b815260206004820152601360248201527220b63932b0b23c9030903b30b634b230ba37b960691b604482015290519081900360640190fd5b610f2160038261173d565b15610843576008546000908152602081815260408220805460018101825590835291200180546001600160a01b0383166001600160a01b031990911617905550565b6000610597600854610bc5565b60075481565b600160065460ff166003811115610f8957fe5b14610fc9576040805162461bcd60e51b81526020600482015260136024820152600080516020611c0f833981519152604482015290519081900360640190fd5b610fd161087d565b611010576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b61101a6007611609565b15610776576006805460ff191660021790556008546007546040517f3ef85928df9ae51bdb3eb4c00ec73b92b82307f319ac1b029de14796a097260990600090a3565b600160065460ff16600381111561107057fe5b146110b0576040805162461bcd60e51b81526020600482015260136024820152600080516020611c0f833981519152604482015290519081900360640190fd5b6110b861087d565b6110f7576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b611100816105b5565b61114b576040805162461bcd60e51b815260206004820152601760248201527620b63932b0b23c903737ba1030903b30b634b230ba37b960491b604482015290519081900360640190fd5b61115660048261173d565b1561084357610843816117aa565b6000610597600754610572565b600260065460ff16600381111561118457fe5b146111cc576040805162461bcd60e51b81526020600482015260136024820152724e6f7420696e206b657967656e20737461746560681b604482015290519081900360640190fd5b6111d5336105b5565b61121d576040805162461bcd60e51b81526020600482015260146024820152732737ba1030903732bc3a103b30b634b230ba37b960611b604482015290519081900360640190fd5b611229600083836118e4565b15611300576008805460009081526020819052604080822060050185905582548252902060060182905554600114156112c3576006805460ff191690556008805460009081526020818152604080832043600390910155835483529182902060001960049091015591546007819055815185815292830184905281519092600080516020611bef83398151915292908290030190a2611300565b6006805460ff191660031790556008546007546040517ff4735b85cc98f9a712832825ecab4cfb1649d658f9a73c57a00ea7dde735c79b90600090a35b5050565b6000610597600754610bb3565b60036020526000908152604090205481565b60085481565b60075460009081526020818152604091829020805483518184028101840190945280845260609392830182828015610ba9576020028201919060005260206000209081546001600160a01b03168152600190910190602001808311610b8b575050505050905090565b60006105976008545b60009081526020819052604090206002015490565b600160065460ff1660038111156113c357fe5b14611403576040805162461bcd60e51b81526020600482015260136024820152600080516020611c0f833981519152604482015290519081900360640190fd5b61140b61087d565b61144a576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b611455600582611660565b1561084357600854600090815260208190526040902060010155565b60006105976007546109d3565b60016020526000908152604090205481565b600360065460ff1660038111156114a357fe5b146114f3576040805162461bcd60e51b815260206004820152601b60248201527a4e6f7420696e2066756e6473207472616e7366657220737461746560281b604482015290519081900360640190fd5b6114fb61087d565b61153a576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b60006007541161157b5760405162461bcd60e51b8152600401808060200182810382526028815260200180611c2f6028913960400191505060405180910390fd5b611585600161194d565b15610776576006805460ff191690556008805460009081526020819052604080822043600390910155825482529020600019600490910155546007819055600080516020611bef8339815191526115da610bef565b6115e261059d565b6040805192835260208301919091528051918290030190a2565b6000610597600754610bc5565b600080826008546040516020018083600981111561162357fe5b60ff1660f81b8152600101828152602001925050506040516020818303038152906040528051906020012090506116598161199d565b9392505050565b60008083600854846040516020018084600981111561167b57fe5b60ff1660f81b815260010183815260200182815260200193505050506040516020818303038152906040528051906020012090506116b88161199d565b949350505050565b60008085858585604051602001808560098111156116da57fe5b60ff1660f81b8152600101848152602001836001600160a01b03166001600160a01b031660601b81526014018281526020019450505050506040516020818303038152906040528051906020012090506117338161199d565b9695505050505050565b60008083600854846040516020018084600981111561175857fe5b60ff1660f81b8152600101838152602001826001600160a01b03166001600160a01b031660601b815260140193505050506040516020818303038152906040528051906020012090506116b88161199d565b60005b60016117b761058a565b0381101561188557600854600090815260208190526040902080546001600160a01b0384169190839081106117e857fe5b6000918252602090912001546001600160a01b0316141561187d5761180b610b48565b600161181561058a565b038151811061182057fe5b60200260200101516000806008548152602001908152602001600020600001828154811061184a57fe5b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550611885565b6001016117ad565b50600854600090815260208190526040902060016118a161058a565b03815481106118ac57fe5b6000918252602080832090910180546001600160a01b0319169055600854825281905260409020805490611300906000198301611b8c565b6000808460085485856040516020018085600981111561190057fe5b60ff1660f81b815260010184815260200183815260200182815260200194505050505060405160208183030381529060405280519060200120905061194481611a70565b95945050505050565b600080826008546040516020018083600981111561196757fe5b60ff1660f81b81526001018281526020019250505060405160208183030381529060405280519060200120905061165981611a70565b6000806119a983611af8565b60008181526004602052604090205490915060ff1615611a00576040805162461bcd60e51b815260206004820152600d60248201526c566f74656420616c726561647960981b604482015290519081900360640190fd5b6000818152600460205260409020805460ff19166001179055611a216115fc565b6000848152600360205260409020541415611a545750506000818152600360205260409020600160ff1b90556001610585565b5050600081815260036020526040812080546001019055610585565b600080611a7c83611af8565b60008181526004602052604090205490915060ff1615611ad7576040805162461bcd60e51b8152602060048201526011602482015270436f6e6669726d656420616c726561647960781b604482015290519081900360640190fd5b6000818152600460205260409020805460ff19166001179055611a21610f63565b604080516020808201939093523360601b81830152815180820360340181526054909101909152805191012090565b828054828255906000526020600020908101928215611b7c579160200282015b82811115611b7c57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190611b47565b50611b88929150611bb0565b5090565b815481835581811115610b4357600083815260209020610b43918101908301611bd4565b61059a91905b80821115611b885780546001600160a01b0319168155600101611bb6565b61059a91905b80821115611b885760008155600101611bda56fec33272939f066c227e913a4b3434d860794f185c551685c29451a3a38b9b259c4e6f7420696e20766f74696e672073746174650000000000000000000000000046697273742065706f636820646f6573206e6f74206e6565642066756e6473207472616e736665724e6f7420612063757272656e742076616c696461746f72000000000000000000a265627a7a72305820dfb70a1c283919f9128aabe00d30be35942e7ded3ecf2eb30af4168b8b02e15a64736f6c63430005090032", - "sourceMap": "93:11259:0:-;;;1516:530;8:9:-1;5:2;;;30:1;27;20:12;5:2;1516:530:0;;;;;;;;;;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;1516:530:0;;;;;;;;;;;;;;19:11:-1;11:20;;8:2;;;44:1;41;34:12;8:2;62:21;;123:4;114:14;;138:31;;;135:2;;;182:1;179;172:12;135:2;219:3;213:10;331:9;325:2;311:12;307:21;289:16;285:44;282:59;261:11;247:12;244:29;233:116;230:2;;;362:1;359;352:12;230:2;-1:-1;;1516:530:0;;;;;;;;1661:17;;1516:530;;-1:-1:-1;1516:530:0;;-1:-1:-1;1516:530:0;;;;;;1653:30;;;;;;1713:10;:17;1701:9;:29;1693:38;;;;;;1742:13;:38;;-1:-1:-1;;;;;1742:38:0;;-1:-1:-1;;;;;;1742:38:0;;;;;;-1:-1:-1;1791:5:0;:9;;;1810:6;:22;;-1:-1:-1;;1810:22:0;1819:13;1810:22;;;-1:-1:-1;1842:9:0;:13;;;1886:58;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;1886:58:0;;;;;;;;;;;;;;;;1866:17;;;;;;:78;;;;1886:58;;1866:17;;:78;;:17;;:78;;;:::i;:::-;-1:-1:-1;1866:78:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1968:6;-1:-1:-1;1968:9:0;;;;1955:10;:22;2000:6;2007:1;2000:9;;;;1987:10;:22;2025:14;;2037:1;;2034;;2025:14;;2034:1;;2025:14;1516:530;;;;;93:11259;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;93:11259:0;-1:-1:-1;;;;;93:11259:0;;;;;;;;;;;-1:-1:-1;93:11259:0;;;;;;;-1:-1:-1;93:11259:0;;;-1:-1:-1;93:11259:0;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;-1:-1:-1;;;;;;93:11259:0;;;;;;;;;:::o;:::-;;;;;;;", - "deployedSourceMap": "93:11259:0:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;93:11259:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5418:112;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;5418:112:0;;:::i;:::-;;;;;;;;;;;;;;;;4766:98;;;:::i;6148:82::-;;;:::i;6506:276::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;6506:276:0;-1:-1:-1;;;;;6506:276:0;;:::i;7032:357::-;;;:::i;:::-;;1395:20;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8607:204;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;8607:204:0;;:::i;1347:41::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1347:41:0;;:::i;:::-;;;;;;;;;;;;;;;;;;5536:94;;;:::i;1304:37::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1304:37:0;;:::i;6236:264::-;;;:::i;9022:203::-;;;:::i;5952:102::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;5952:102:0;;:::i;3310:213::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;3310:213:0;;;-1:-1:-1;;;;;3310:213:0;;;;;;;;;;:::i;6906:120::-;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:100:-1;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;6906:120:0;;;;;;;;;;;;;;;;;4870:116;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;4870:116:0;;:::i;5200:110::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;5200:110:0;;:::i;1208:42::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1208:42:0;;:::i;6060:82::-;;;:::i;2786:518::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;2786:518:0;;:::i;2052:27::-;;;:::i;:::-;;;;-1:-1:-1;;;;;2052:27:0;;;;;;;;;;;;;;7395:278;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;7395:278:0;-1:-1:-1;;;;;7395:278:0;;:::i;5092:102::-;;;:::i;1422:17::-;;;:::i;8817:199::-;;;:::i;7679:271::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;7679:271:0;-1:-1:-1;;;;;7679:271:0;;:::i;5316:96::-;;;:::i;3529:691::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;3529:691:0;;;;;;;:::i;4670:90::-;;;:::i;1256:42::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1256:42:0;;:::i;1445:21::-;;;:::i;6788:112::-;;;:::i;5636:102::-;;;:::i;5744:110::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;5744:110:0;;:::i;8398:203::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;8398:203:0;;:::i;5860:86::-;;;:::i;1155:47::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1155:47:0;;:::i;4226:438::-;;;:::i;4992:94::-;;;:::i;5418:112::-;5475:4;5498:14;;;;;;;;;;:25;;;5418:112;;;;:::o;4766:98::-;4813:4;4836:21;4847:9;;4836:10;:21::i;:::-;4829:28;;4766:98;;:::o;6148:82::-;6215:5;;6185:4;6208:13;;;;;;;;;;:15;;;6148:82;:::o;6506:276::-;6562:4;6578:27;6608:19;:17;:19::i;:::-;6578:49;-1:-1:-1;6642:6:0;6637:121;6658:16;:14;:16::i;:::-;6654:1;:20;6637:121;;;6716:1;-1:-1:-1;;;;;6699:18:0;:10;6710:1;6699:13;;;;;;;;;;;;;;-1:-1:-1;;;;;6699:18:0;;6695:52;;;6746:1;6742:5;;-1:-1:-1;6735:12:0;;-1:-1:-1;6735:12:0;6695:52;6676:3;;6637:121;;;-1:-1:-1;6774:1:0;;6506:276;-1:-1:-1;;;6506:276:0:o;7032:357::-;2239:12;2229:6;;;;:22;;;;;;;;;:49;;;-1:-1:-1;2265:13:0;2255:6;;;;:23;;;;;;;;;2229:49;2221:90;;;;;-1:-1:-1;;;2221:90:0;;;;;;;;;;;;-1:-1:-1;;;2221:90:0;;;;;;;;;;;;;;;2717:12;:10;:12::i;:::-;2709:53;;;;;-1:-1:-1;;;2709:53:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2709:53:0;;;;;;;;;;;;;;;7107:26;7115:17;7107:7;:26::i;:::-;7103:280;;;7149:9;:11;;;;;;;;;7174:6;:22;;-1:-1:-1;;7174:22:0;;;;;;7240:14;:12;:14::i;:::-;7217:9;;7210:6;:17;;;;;;;;;;:27;;:44;7299:15;:13;:15::i;:::-;7275:9;;7268:6;:17;;;;;;;;;;;:46;;;;:17;;:46;;;;;;:::i;:::-;;7358:14;:12;:14::i;:::-;7335:9;;7328:6;:17;;;;;;;;;;:27;;:44;7103:280;7032:357::o;1395:20::-;;;;;;:::o;8607:204::-;2379:13;2369:6;;;;:23;;;;;;;;;2361:55;;;;;-1:-1:-1;;;2361:55:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2361:55:0;;;;;;;;;;;;;;;2717:12;:10;:12::i;:::-;2709:53;;;;;-1:-1:-1;;;2709:53:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2709:53:0;;;;;;;;;;;;;;;8697:42;8705:22;8729:9;8697:7;:42::i;:::-;8693:112;;;8762:9;;8755:6;:17;;;;;;;;;;:27;;:39;;;8693:112;8607:204;:::o;1347:41::-;;;;;;;;;;;;;;;:::o;5536:94::-;5581:4;5604:19;5617:5;;5604:12;:19::i;1304:37::-;;;;;;;;;;;;;;;:::o;6236:264::-;6279:4;6295:27;6325:15;:13;:15::i;:::-;6295:45;-1:-1:-1;6355:6:0;6350:126;6371:12;:10;:12::i;:::-;6367:1;:16;6350:126;;;6425:10;-1:-1:-1;;;;;6408:27:0;:10;6419:1;6408:13;;;;;;;;;;;;;;-1:-1:-1;;;;;6408:27:0;;6404:61;;;6464:1;6460:5;;-1:-1:-1;6453:12:0;;-1:-1:-1;6453:12:0;6404:61;6385:3;;6350:126;;;;6492:1;6485:8;;;6236:264;:::o;9022:203::-;2484:13;2474:6;;;;:23;;;;;;;;;2466:55;;;;;-1:-1:-1;;;2466:55:0;;;;;;;;;;;;-1:-1:-1;;;2466:55:0;;;;;;;;;;;;;;;2717:12;:10;:12::i;:::-;2709:53;;;;;-1:-1:-1;;;2709:53:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2709:53:0;;;;;;;;;;;;;;;9095:27;9103:18;9095:7;:27::i;:::-;9091:128;;;9138:6;:22;;-1:-1:-1;;9138:22:0;9147:13;9138:22;;;9198:9;;9180:28;;;;-1:-1:-1;;9180:28:0;9022:203::o;5952:102::-;6004:4;6027:14;;;;;;;;;;:20;;;;5952:102::o;3310:213::-;2239:12;2229:6;;;;:22;;;;;;;;;:49;;;-1:-1:-1;2265:13:0;2255:6;;;;:23;;;;;;;;;2229:49;2221:90;;;;;-1:-1:-1;;;2221:90:0;;;;;;;;;;;;-1:-1:-1;;;2221:90:0;;;;;;;;;;;;;;;2717:12;:10;:12::i;:::-;2709:53;;;;;-1:-1:-1;;;2709:53:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2709:53:0;;;;;;;;;;;;;;;3418:39;3426:13;3441:4;3447:2;3451:5;3418:7;:39::i;:::-;3414:103;;;3473:13;;:33;;;-1:-1:-1;;;3473:33:0;;-1:-1:-1;;;;;3473:33:0;;;;;;;;;;;;;;;:13;;;;;:22;;:33;;;;;;;;;;;;;;:13;;:33;;;5:2:-1;;;;30:1;27;20:12;5:2;3473:33:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3473:33:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;3414:103:0;3310:213;;;:::o;6906:120::-;6998:9;;6991:6;:17;;;;;;;;;;;;6984:35;;;;;;;;;;;;;;;;;6956:16;;6984:35;;;6991:17;6984:35;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;6984:35:0;;;;;;;;;;;;;;;;;;;;;;;6906:120;:::o;4870:116::-;4924:4;4947:14;;;;;;;;;;:32;;4870:116::o;5200:110::-;5256:4;5279:14;;;;;;;;;;:24;;;;5200:110::o;1208:42::-;;;;;;;;;;;;;;;:::o;6060:82::-;6127:5;;6097:4;6120:13;;;;;;;;;;:15;;;6060:82;:::o;2786:518::-;2129:12;2119:6;;;;:22;;;;;;;;;2111:53;;;;;-1:-1:-1;;;2111:53:0;;;;;;;;;;;;-1:-1:-1;;;2111:53:0;;;;;;;;;;;;;;;2856:10;;2847:5;:19;;:40;;;;;2879:8;2870:5;:17;;2847:40;:63;;;;;2900:10;;2891:5;:19;;2847:63;2839:72;;;;;;2922:12;2972:14;:12;:14::i;:::-;2953:15;:13;:15::i;:::-;2938:12;:30;2937:49;;;;;3047:5;;3021:32;;;2937:49;;;;3021:32;;;;;;;;;;;;;;;;26:21:-1;;;22:32;;6:49;;3021:32:0;;;;;;3011:43;;;;;;;;;3001:54;;;;:9;:54;;;;;2937:49;;-1:-1:-1;3001:54:0;;2996:182;;3117:5;;;3091:32;;;;;;;;;;;;;;;;;;;26:21:-1;;;22:32;;6:49;;3091:32:0;;;;;;3081:43;;;;;;3071:54;;;;:9;:54;;;;;:61;;-1:-1:-1;;3071:61:0;3128:4;3071:61;;;;;;3153:5;;3146:13;;;;;;;;:19;;:21;;;;;;;2996:182;3188:13;;:60;;;-1:-1:-1;;;3188:60:0;;3215:10;3188:60;;;;3235:4;3188:60;;;;;;;;;;;;-1:-1:-1;;;;;3188:13:0;;;;:26;;:60;;;;;;;;;;;;;;;:13;;:60;;;5:2:-1;;;;30:1;27;20:12;5:2;3188:60:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3188:60:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;3263:34:0;;-1:-1:-1;3279:5:0;3286:10;:8;:10::i;:::-;3263:34;;;;;;;;;;;;;;;;;;;;;;2174:1;2786:518;:::o;2052:27::-;;;-1:-1:-1;;;;;2052:27:0;;:::o;7395:278::-;2379:13;2369:6;;;;:23;;;;;;;;;2361:55;;;;;-1:-1:-1;;;2361:55:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2361:55:0;;;;;;;;;;;;;;;2717:12;:10;:12::i;:::-;2709:53;;;;;-1:-1:-1;;;2709:53:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2709:53:0;;;;;;;;;;;;;;;7489:25;7504:9;7489:14;:25::i;:::-;:30;7481:62;;;;;-1:-1:-1;;;7481:62:0;;;;;;;;;;;;-1:-1:-1;;;7481:62:0;;;;;;;;;;;;;;;7558:38;7566:18;7586:9;7558:7;:38::i;:::-;7554:113;;;7619:9;;7612:6;:17;;;;;;;;;;27:10:-1;;39:1;23:18;;45:23;;7612:44:0;;;;;;;;-1:-1:-1;;;;;7612:44:0;;-1:-1:-1;;;;;;7612:44:0;;;;;;7395:278;:::o;5092:102::-;5141:4;5164:23;5177:9;;5164:12;:23::i;1422:17::-;;;;:::o;8817:199::-;2379:13;2369:6;;;;:23;;;;;;;;;2361:55;;;;;-1:-1:-1;;;2361:55:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2361:55:0;;;;;;;;;;;;;;;2717:12;:10;:12::i;:::-;2709:53;;;;;-1:-1:-1;;;2709:53:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2709:53:0;;;;;;;;;;;;;;;8889:26;8897:17;8889:7;:26::i;:::-;8885:125;;;8931:6;:22;;-1:-1:-1;;8931:22:0;8940:13;8931:22;;;8989:9;;8982:5;;8973:26;;;;-1:-1:-1;;8973:26:0;8817:199::o;7679:271::-;2379:13;2369:6;;;;:23;;;;;;;;;2361:55;;;;;-1:-1:-1;;;2361:55:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2361:55:0;;;;;;;;;;;;;;;2717:12;:10;:12::i;:::-;2709:53;;;;;-1:-1:-1;;;2709:53:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2709:53:0;;;;;;;;;;;;;;;7776:25;7791:9;7776:14;:25::i;:::-;7768:66;;;;;-1:-1:-1;;;7768:66:0;;;;;;;;;;;;-1:-1:-1;;;7768:66:0;;;;;;;;;;;;;;;7849:41;7857:21;7880:9;7849:7;:41::i;:::-;7845:99;;;7906:27;7923:9;7906:16;:27::i;5316:96::-;5362:4;5385:20;5399:5;;5385:13;:20::i;3529:691::-;2484:13;2474:6;;;;:23;;;;;;;;;2466:55;;;;;-1:-1:-1;;;2466:55:0;;;;;;;;;;;;-1:-1:-1;;;2466:55:0;;;;;;;;;;;;;;;3600:26;3615:10;3600:14;:26::i;:::-;3592:64;;;;;-1:-1:-1;;;3592:64:0;;;;;;;;;;;;-1:-1:-1;;;3592:64:0;;;;;;;;;;;;;;;3671:37;3682:19;3703:1;3706;3671:10;:37::i;:::-;3667:547;;;3731:9;;;3724:6;:17;;;;;;;;;;;:19;;:23;;;3768:9;;3761:17;;;;:19;;:23;;;3802:9;3815:1;3802:14;3798:406;;;3836:6;:21;;-1:-1:-1;;3836:21:0;;;3882:9;;;3845:12;3875:17;;;;;;;;;;;3906:12;3875:28;;;;:43;3943:9;;3936:17;;;;;;-1:-1:-1;;3936:23:0;;;;:34;3996:9;;3988:5;:17;;;4028:23;;;;;;;;;;;;;3996:9;;-1:-1:-1;;;;;;;;;;;4028:23:0;;;;;;;;3798:406;;;4102:6;:30;;-1:-1:-1;;4102:30:0;4111:21;4102:30;;;4179:9;;4172:5;;4155:34;;;;-1:-1:-1;;4155:34:0;3798:406;3529:691;;:::o;4670:90::-;4713:4;4736:17;4747:5;;4736:10;:17::i;1256:42::-;;;;;;;;;;;;;:::o;1445:21::-;;;;:::o;6788:112::-;6876:5;;6869:6;:13;;;;;;;;;;;;6862:31;;;;;;;;;;;;;;;;;6834:16;;6862:31;;;6869:13;6862:31;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;6862:31:0;;;;;;;;;;;;;;;;;;;;;;6788:112;:::o;5636:102::-;5685:4;5708:23;5721:9;;5744:110;5800:4;5823:14;;;;;;;;;;:24;;;;5744:110::o;8398:203::-;2379:13;2369:6;;;;:23;;;;;;;;;2361:55;;;;;-1:-1:-1;;;2361:55:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2361:55:0;;;;;;;;;;;;;;;2717:12;:10;:12::i;:::-;2709:53;;;;;-1:-1:-1;;;2709:53:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2709:53:0;;;;;;;;;;;;;;;8488:41;8496:21;8519:9;8488:7;:41::i;:::-;8484:111;;;8552:9;;8545:6;:17;;;;;;;;;;:27;;:39;8398:203::o;5860:86::-;5901:4;5924:15;5933:5;;5924:8;:15::i;1155:47::-;;;;;;;;;;;;;:::o;4226:438::-;2596:21;2586:6;;;;:31;;;;;;;;;2578:71;;;;;-1:-1:-1;;;2578:71:0;;;;;;;;;;;;-1:-1:-1;;;2578:71:0;;;;;;;;;;;;;;;2717:12;:10;:12::i;:::-;2709:53;;;;;-1:-1:-1;;;2709:53:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2709:53:0;;;;;;;;;;;;;;;4322:1;4314:5;;:9;4306:62;;;;-1:-1:-1;;;4306:62:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4383:39;4394:27;4383:10;:39::i;:::-;4379:279;;;4438:6;:21;;-1:-1:-1;;4438:21:0;;;4480:9;;;4447:12;4473:17;;;;;;;;;;;4504:12;4473:28;;;;:43;4537:9;;4530:17;;;;-1:-1:-1;;4530:23:0;;;;:34;4586:9;4578:5;:17;;;-1:-1:-1;;;;;;;;;;;4632:6:0;:4;:6::i;:::-;4640;:4;:6::i;:::-;4614:33;;;;;;;;;;;;;;;;;;;;;;4226:438::o;4992:94::-;5037:4;5060:19;5073:5;;5060:12;:19::i;9231:165::-;9280:4;9296:12;9338:8;9348:9;;9321:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;9321:37:0;;;9311:48;;;;;;9296:63;;9376:13;9384:4;9376:7;:13::i;:::-;9369:20;9231:165;-1:-1:-1;;;9231:165:0:o;9593:180::-;9652:4;9668:12;9710:8;9720:9;;9731:3;9693:42;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;9693:42:0;;;9683:53;;;;;;9668:68;;9753:13;9761:4;9753:7;:13::i;:::-;9746:20;9593:180;-1:-1:-1;;;;9593:180:0:o;9779:209::-;9866:4;9882:12;9924:8;9934:4;9940:2;9944:5;9907:43;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;9907:43:0;-1:-1:-1;;;;;9907:43:0;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;9907:43:0;;;9897:54;;;;;;9882:69;;9968:13;9976:4;9968:7;:13::i;:::-;9961:20;9779:209;-1:-1:-1;;;;;;9779:209:0:o;9402:185::-;9465:4;9481:12;9523:8;9533:9;;9544:4;9506:43;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;9506:43:0;-1:-1:-1;;;;;9506:43:0;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;9506:43:0;;;9496:54;;;;;;9481:69;;9567:13;9575:4;9567:7;:13::i;7956:436::-;8024:6;8019:253;8059:1;8040:16;:14;:16::i;:::-;:20;8036:1;:24;8019:253;;;8092:9;;8085:6;:17;;;;;;;;;;:31;;-1:-1:-1;;;;;8085:44:0;;;:17;8114:1;;8085:31;;;;;;;;;;;;;;;;-1:-1:-1;;;;;8085:31:0;:44;8081:181;;;8183:19;:17;:19::i;:::-;8222:1;8203:16;:14;:16::i;:::-;:20;8183:41;;;;;;;;;;;;;;8149:6;:17;8156:9;;8149:17;;;;;;;;;;;:28;;8178:1;8149:31;;;;;;;;;;;;;;;;:75;;;;;-1:-1:-1;;;;;8149:75:0;;;;;-1:-1:-1;;;;;8149:75:0;;;;;;8242:5;;8081:181;8062:3;;8019:253;;;-1:-1:-1;8295:9:0;;8288:6;:17;;;;;;;;;;8336:1;8317:16;:14;:16::i;:::-;:20;8288:50;;;;;;;;;;;;;;;;;;;8281:57;;-1:-1:-1;;;;;;8281:57:0;;;8355:9;;8348:17;;;;;;;;:37;;;;;-1:-1:-1;;8348:37:0;;;:::i;10171:193::-;10239:4;10255:12;10297:8;10307:9;;10318:1;10321;10280:43;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;10280:43:0;;;10270:54;;;;;;10255:69;;10341:16;10352:4;10341:10;:16::i;:::-;10334:23;10171:193;-1:-1:-1;;;;;10171:193:0:o;9994:171::-;10046:4;10062:12;10104:8;10114:9;;10087:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;10087:37:0;;;10077:48;;;;;;10062:63;;10142:16;10153:4;10142:10;:16::i;10370:409::-;10418:4;10434:20;10457:21;10473:4;10457:15;:21::i;:::-;10497:19;;;;:5;:19;;;;;;10434:44;;-1:-1:-1;10497:19:0;;10496:20;10488:46;;;;;-1:-1:-1;;;10488:46:0;;;;;;;;;;;;-1:-1:-1;;;10488:46:0;;;;;;;;;;;;;;;10545:19;;;;:5;:19;;;;;:26;;-1:-1:-1;;10545:26:0;10567:4;10545:26;;;10605:14;:12;:14::i;:::-;10585:16;;;;:10;:16;;;;;;:34;10581:192;;;-1:-1:-1;;10635:16:0;;;;:10;:16;;;;;-1:-1:-1;;;10635:27:0;;10683:4;10676:11;;10581:192;-1:-1:-1;;10718:16:0;;;;:10;:16;;;;;:18;;;;;;10750:12;;10785:420;10836:4;10852:20;10875:21;10891:4;10875:15;:21::i;:::-;10915:19;;;;:5;:19;;;;;;10852:44;;-1:-1:-1;10915:19:0;;10914:20;10906:50;;;;;-1:-1:-1;;;10906:50:0;;;;;;;;;;;;-1:-1:-1;;;10906:50:0;;;;;;;;;;;;;;;10967:19;;;;:5;:19;;;;;:26;;-1:-1:-1;;10967:26:0;10989:4;10967:26;;;11027:18;:16;:18::i;11211:139::-;11308:34;;;;;;;;;;;11331:10;11308:34;;;;;;;;26:21:-1;;;22:32;;6:49;;11308:34:0;;;;;;;11298:45;;;;;;11211:139::o;93:11259::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;93:11259:0;-1:-1:-1;;;;;93:11259:0;;;;;;;;;;;-1:-1:-1;93:11259:0;;;;;;;-1:-1:-1;93:11259:0;;;-1:-1:-1;93:11259:0;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;-1:-1:-1;;;;;;93:11259:0;;;;;;;;;;;;;;;;;;;;;;;;", - "source": "pragma solidity ^0.5.0;\n\nimport './openzeppelin-solidity/contracts/token/ERC20/IERC20.sol';\n\ncontract Bridge {\n event ExchangeRequest(uint value, uint nonce);\n event NewEpoch(uint indexed oldEpoch, uint indexed newEpoch);\n event NewEpochCancelled(uint indexed epoch);\n event NewFundsTransfer(uint indexed oldEpoch, uint indexed newEpoch);\n event EpochStart(uint indexed epoch, uint x, uint y);\n\n struct State {\n address[] validators;\n uint threshold;\n uint rangeSize;\n uint startBlock;\n uint nonce;\n uint x;\n uint y;\n }\n\n enum Status {\n READY, // bridge is in ready to perform operations\n VOTING, // voting for changing in next epoch, but still ready\n KEYGEN, //keygen, can be cancelled\n FUNDS_TRANSFER // funds transfer, cannot be cancelled\n }\n\n enum Vote {\n CONFIRM_KEYGEN,\n CONFIRM_FUNDS_TRANSFER,\n START_VOTING,\n ADD_VALIDATOR,\n REMOVE_VALIDATOR,\n CHANGE_THRESHOLD,\n CHANGE_RANGE_SIZE,\n START_KEYGEN,\n CANCEL_KEYGEN,\n TRANSFER\n }\n\n mapping(uint => State) states;\n\n mapping(bytes32 => uint) public dbTransferCount;\n mapping(bytes32 => bool) public dbTransfer;\n mapping(bytes32 => uint) public votesCount;\n mapping(bytes32 => bool) public votes;\n mapping(bytes32 => bool) public usedRange;\n\n Status public status;\n\n uint public epoch;\n uint public nextEpoch;\n\n uint minTxLimit;\n uint maxTxLimit;\n\n constructor(uint threshold, address[] memory validators, address _tokenContract, uint[2] memory limits, uint rangeSize) public {\n require(validators.length > 0);\n require(threshold < validators.length);\n\n tokenContract = IERC20(_tokenContract);\n\n epoch = 0;\n status = Status.KEYGEN;\n nextEpoch = 1;\n\n states[nextEpoch] = State(validators, threshold, rangeSize, 0, uint(-1), 0, 0);\n\n minTxLimit = limits[0];\n maxTxLimit = limits[1];\n\n emit NewEpoch(0, 1);\n }\n\n IERC20 public tokenContract;\n\n modifier ready {\n require(status == Status.READY, \"Not in ready state\");\n _;\n }\n\n modifier readyOrVoting {\n require(status == Status.READY || status == Status.VOTING, \"Not in ready or voting state\");\n _;\n }\n\n modifier voting {\n require(status == Status.VOTING, \"Not in voting state\");\n _;\n }\n\n modifier keygen {\n require(status == Status.KEYGEN, \"Not in keygen state\");\n _;\n }\n\n modifier fundsTransfer {\n require(status == Status.FUNDS_TRANSFER, \"Not in funds transfer state\");\n _;\n }\n\n modifier currentValidator {\n require(getPartyId() != 0, \"Not a current validator\");\n _;\n }\n\n function exchange(uint value) public ready {\n require(value >= minTxLimit && value >= 10 ** 10 && value <= maxTxLimit);\n\n uint txRange = (block.number - getStartBlock()) / getRangeSize();\n if (!usedRange[keccak256(abi.encodePacked(txRange, epoch))]) {\n usedRange[keccak256(abi.encodePacked(txRange, epoch))] = true;\n states[epoch].nonce++;\n }\n\n tokenContract.transferFrom(msg.sender, address(this), value);\n emit ExchangeRequest(value, getNonce());\n }\n\n function transfer(bytes32 hash, address to, uint value) public readyOrVoting currentValidator {\n if (tryVote(Vote.TRANSFER, hash, to, value)) {\n tokenContract.transfer(to, value);\n }\n }\n\n function confirmKeygen(uint x, uint y) public keygen {\n require(getNextPartyId(msg.sender) != 0, \"Not a next validator\");\n\n if (tryConfirm(Vote.CONFIRM_KEYGEN, x, y)) {\n states[nextEpoch].x = x;\n states[nextEpoch].y = y;\n if (nextEpoch == 1) {\n status = Status.READY;\n states[nextEpoch].startBlock = block.number;\n states[nextEpoch].nonce = uint(-1);\n epoch = nextEpoch;\n emit EpochStart(epoch, x, y);\n }\n else {\n status = Status.FUNDS_TRANSFER;\n emit NewFundsTransfer(epoch, nextEpoch);\n }\n }\n }\n\n function confirmFundsTransfer() public fundsTransfer currentValidator {\n require(epoch > 0, \"First epoch does not need funds transfer\");\n\n if (tryConfirm(Vote.CONFIRM_FUNDS_TRANSFER)) {\n status = Status.READY;\n states[nextEpoch].startBlock = block.number;\n states[nextEpoch].nonce = uint(-1);\n epoch = nextEpoch;\n emit EpochStart(epoch, getX(), getY());\n }\n }\n\n function getParties() view public returns (uint) {\n return getParties(epoch);\n }\n\n function getNextParties() view public returns (uint) {\n return getParties(nextEpoch);\n }\n\n function getParties(uint _epoch) view public returns (uint) {\n return states[_epoch].validators.length;\n }\n\n function getThreshold() view public returns (uint) {\n return getThreshold(epoch);\n }\n\n function getNextThreshold() view public returns (uint) {\n return getThreshold(nextEpoch);\n }\n\n function getThreshold(uint _epoch) view public returns (uint) {\n return states[_epoch].threshold;\n }\n\n function getStartBlock() view public returns (uint) {\n return getStartBlock(epoch);\n }\n\n function getStartBlock(uint _epoch) view public returns (uint) {\n return states[_epoch].startBlock;\n }\n\n function getRangeSize() view public returns (uint) {\n return getRangeSize(epoch);\n }\n\n function getNextRangeSize() view public returns (uint) {\n return getRangeSize(nextEpoch);\n }\n\n function getRangeSize(uint _epoch) view public returns (uint) {\n return states[_epoch].rangeSize;\n }\n\n function getNonce() view public returns (uint) {\n return getNonce(epoch);\n }\n\n function getNonce(uint _epoch) view public returns (uint) {\n return states[_epoch].nonce;\n }\n\n function getX() view public returns (uint) {\n return states[epoch].x;\n }\n\n function getY() view public returns (uint) {\n return states[epoch].y;\n }\n\n function getPartyId() view public returns (uint) {\n address[] memory validators = getValidators();\n for (uint i = 0; i < getParties(); i++) {\n if (validators[i] == msg.sender)\n return i + 1;\n }\n return 0;\n }\n\n function getNextPartyId(address a) view public returns (uint) {\n address[] memory validators = getNextValidators();\n for (uint i = 0; i < getNextParties(); i++) {\n if (validators[i] == a)\n return i + 1;\n }\n return 0;\n }\n\n function getValidators() view public returns (address[] memory) {\n return states[epoch].validators;\n }\n\n function getNextValidators() view public returns (address[] memory) {\n return states[nextEpoch].validators;\n }\n\n function startVoting() public readyOrVoting currentValidator {\n if (tryVote(Vote.START_VOTING)) {\n nextEpoch++;\n status = Status.VOTING;\n states[nextEpoch].threshold = getThreshold();\n states[nextEpoch].validators = getValidators();\n states[nextEpoch].rangeSize = getRangeSize();\n }\n }\n\n function voteAddValidator(address validator) public voting currentValidator {\n require(getNextPartyId(validator) == 0, \"Already a validator\");\n\n if (tryVote(Vote.ADD_VALIDATOR, validator)) {\n states[nextEpoch].validators.push(validator);\n }\n }\n\n function voteRemoveValidator(address validator) public voting currentValidator {\n require(getNextPartyId(validator) != 0, \"Already not a validator\");\n\n if (tryVote(Vote.REMOVE_VALIDATOR, validator)) {\n _removeValidator(validator);\n }\n }\n\n function _removeValidator(address validator) private {\n for (uint i = 0; i < getNextParties() - 1; i++) {\n if (states[nextEpoch].validators[i] == validator) {\n states[nextEpoch].validators[i] = getNextValidators()[getNextParties() - 1];\n break;\n }\n }\n delete states[nextEpoch].validators[getNextParties() - 1];\n states[nextEpoch].validators.length--;\n }\n\n function voteChangeThreshold(uint threshold) public voting currentValidator {\n if (tryVote(Vote.CHANGE_THRESHOLD, threshold)) {\n states[nextEpoch].threshold = threshold;\n }\n }\n\n function voteChangeRangeSize(uint rangeSize) public voting currentValidator {\n if (tryVote(Vote.CHANGE_RANGE_SIZE, rangeSize)) {\n states[nextEpoch].rangeSize = rangeSize;\n }\n }\n\n function voteStartKeygen() public voting currentValidator {\n if (tryVote(Vote.START_KEYGEN)) {\n status = Status.KEYGEN;\n\n emit NewEpoch(epoch, nextEpoch);\n }\n }\n\n function voteCancelKeygen() public keygen currentValidator {\n if (tryVote(Vote.CANCEL_KEYGEN)) {\n status = Status.VOTING;\n\n emit NewEpochCancelled(nextEpoch);\n }\n }\n\n function tryVote(Vote voteType) private returns (bool) {\n bytes32 vote = keccak256(abi.encodePacked(voteType, nextEpoch));\n return putVote(vote);\n }\n\n function tryVote(Vote voteType, address addr) private returns (bool) {\n bytes32 vote = keccak256(abi.encodePacked(voteType, nextEpoch, addr));\n return putVote(vote);\n }\n\n function tryVote(Vote voteType, uint num) private returns (bool) {\n bytes32 vote = keccak256(abi.encodePacked(voteType, nextEpoch, num));\n return putVote(vote);\n }\n\n function tryVote(Vote voteType, bytes32 hash, address to, uint value) private returns (bool) {\n bytes32 vote = keccak256(abi.encodePacked(voteType, hash, to, value));\n return putVote(vote);\n }\n\n function tryConfirm(Vote voteType) private returns (bool) {\n bytes32 vote = keccak256(abi.encodePacked(voteType, nextEpoch));\n return putConfirm(vote);\n }\n\n function tryConfirm(Vote voteType, uint x, uint y) private returns (bool) {\n bytes32 vote = keccak256(abi.encodePacked(voteType, nextEpoch, x, y));\n return putConfirm(vote);\n }\n\n function putVote(bytes32 vote) private returns (bool) {\n bytes32 personalVote = personalizeVote(vote);\n require(!votes[personalVote], \"Voted already\");\n\n votes[personalVote] = true;\n if (votesCount[vote] == getThreshold()) {\n votesCount[vote] = 2 ** 255;\n return true;\n } else {\n votesCount[vote]++;\n return false;\n }\n }\n\n function putConfirm(bytes32 vote) private returns (bool) {\n bytes32 personalVote = personalizeVote(vote);\n require(!votes[personalVote], \"Confirmed already\");\n\n votes[personalVote] = true;\n if (votesCount[vote] == getNextThreshold()) {\n votesCount[vote] = 2 ** 255;\n return true;\n } else {\n votesCount[vote]++;\n return false;\n }\n }\n\n function personalizeVote(bytes32 vote) private view returns (bytes32) {\n return keccak256(abi.encodePacked(vote, msg.sender));\n }\n}\n", - "sourcePath": "/build/contracts/Bridge.sol", - "ast": { - "absolutePath": "/build/contracts/Bridge.sol", - "exportedSymbols": { - "Bridge": [ - 1340 - ] - }, - "id": 1341, - "nodeType": "SourceUnit", - "nodes": [ - { - "id": 1, - "literals": [ - "solidity", - "^", - "0.5", - ".0" - ], - "nodeType": "PragmaDirective", - "src": "0:23:0" - }, - { - "absolutePath": "/build/contracts/openzeppelin-solidity/contracts/token/ERC20/IERC20.sol", - "file": "./openzeppelin-solidity/contracts/token/ERC20/IERC20.sol", - "id": 2, - "nodeType": "ImportDirective", - "scope": 1341, - "sourceUnit": 10033, - "src": "25:66:0", - "symbolAliases": [], - "unitAlias": "" - }, - { - "baseContracts": [], - "contractDependencies": [], - "contractKind": "contract", - "documentation": null, - "fullyImplemented": true, - "id": 1340, - "linearizedBaseContracts": [ - 1340 - ], - "name": "Bridge", - "nodeType": "ContractDefinition", - "nodes": [ - { - "anonymous": false, - "documentation": null, - "id": 8, - "name": "ExchangeRequest", - "nodeType": "EventDefinition", - "parameters": { - "id": 7, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4, - "indexed": false, - "name": "value", - "nodeType": "VariableDeclaration", - "scope": 8, - "src": "137:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 3, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "137:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 6, - "indexed": false, - "name": "nonce", - "nodeType": "VariableDeclaration", - "scope": 8, - "src": "149:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 5, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "149:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "136:24:0" - }, - "src": "115:46:0" - }, - { - "anonymous": false, - "documentation": null, - "id": 14, - "name": "NewEpoch", - "nodeType": "EventDefinition", - "parameters": { - "id": 13, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 10, - "indexed": true, - "name": "oldEpoch", - "nodeType": "VariableDeclaration", - "scope": 14, - "src": "181:21:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 9, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "181:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 12, - "indexed": true, - "name": "newEpoch", - "nodeType": "VariableDeclaration", - "scope": 14, - "src": "204:21:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 11, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "204:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "180:46:0" - }, - "src": "166:61:0" - }, - { - "anonymous": false, - "documentation": null, - "id": 18, - "name": "NewEpochCancelled", - "nodeType": "EventDefinition", - "parameters": { - "id": 17, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 16, - "indexed": true, - "name": "epoch", - "nodeType": "VariableDeclaration", - "scope": 18, - "src": "256:18:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 15, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "256:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "255:20:0" - }, - "src": "232:44:0" - }, - { - "anonymous": false, - "documentation": null, - "id": 24, - "name": "NewFundsTransfer", - "nodeType": "EventDefinition", - "parameters": { - "id": 23, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 20, - "indexed": true, - "name": "oldEpoch", - "nodeType": "VariableDeclaration", - "scope": 24, - "src": "304:21:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 19, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "304:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 22, - "indexed": true, - "name": "newEpoch", - "nodeType": "VariableDeclaration", - "scope": 24, - "src": "327:21:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 21, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "327:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "303:46:0" - }, - "src": "281:69:0" - }, - { - "anonymous": false, - "documentation": null, - "id": 32, - "name": "EpochStart", - "nodeType": "EventDefinition", - "parameters": { - "id": 31, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 26, - "indexed": true, - "name": "epoch", - "nodeType": "VariableDeclaration", - "scope": 32, - "src": "372:18:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 25, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "372:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 28, - "indexed": false, - "name": "x", - "nodeType": "VariableDeclaration", - "scope": 32, - "src": "392:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 27, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "392:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 30, - "indexed": false, - "name": "y", - "nodeType": "VariableDeclaration", - "scope": 32, - "src": "400:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 29, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "400:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "371:36:0" - }, - "src": "355:53:0" - }, - { - "canonicalName": "Bridge.State", - "id": 48, - "members": [ - { - "constant": false, - "id": 35, - "name": "validators", - "nodeType": "VariableDeclaration", - "scope": 48, - "src": "437:20:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 33, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "437:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 34, - "length": null, - "nodeType": "ArrayTypeName", - "src": "437:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 37, - "name": "threshold", - "nodeType": "VariableDeclaration", - "scope": 48, - "src": "467:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 36, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "467:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 39, - "name": "rangeSize", - "nodeType": "VariableDeclaration", - "scope": 48, - "src": "491:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 38, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "491:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 41, - "name": "startBlock", - "nodeType": "VariableDeclaration", - "scope": 48, - "src": "515:15:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 40, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "515:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 43, - "name": "nonce", - "nodeType": "VariableDeclaration", - "scope": 48, - "src": "540:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 42, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "540:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 45, - "name": "x", - "nodeType": "VariableDeclaration", - "scope": 48, - "src": "560:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 44, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "560:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 47, - "name": "y", - "nodeType": "VariableDeclaration", - "scope": 48, - "src": "576:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 46, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "576:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "name": "State", - "nodeType": "StructDefinition", - "scope": 1340, - "src": "414:175:0", - "visibility": "public" - }, - { - "canonicalName": "Bridge.Status", - "id": 53, - "members": [ - { - "id": 49, - "name": "READY", - "nodeType": "EnumValue", - "src": "617:5:0" - }, - { - "id": 50, - "name": "VOTING", - "nodeType": "EnumValue", - "src": "676:6:0" - }, - { - "id": 51, - "name": "KEYGEN", - "nodeType": "EnumValue", - "src": "746:6:0" - }, - { - "id": 52, - "name": "FUNDS_TRANSFER", - "nodeType": "EnumValue", - "src": "789:14:0" - } - ], - "name": "Status", - "nodeType": "EnumDefinition", - "src": "595:253:0" - }, - { - "canonicalName": "Bridge.Vote", - "id": 64, - "members": [ - { - "id": 54, - "name": "CONFIRM_KEYGEN", - "nodeType": "EnumValue", - "src": "874:14:0" - }, - { - "id": 55, - "name": "CONFIRM_FUNDS_TRANSFER", - "nodeType": "EnumValue", - "src": "898:22:0" - }, - { - "id": 56, - "name": "START_VOTING", - "nodeType": "EnumValue", - "src": "930:12:0" - }, - { - "id": 57, - "name": "ADD_VALIDATOR", - "nodeType": "EnumValue", - "src": "952:13:0" - }, - { - "id": 58, - "name": "REMOVE_VALIDATOR", - "nodeType": "EnumValue", - "src": "975:16:0" - }, - { - "id": 59, - "name": "CHANGE_THRESHOLD", - "nodeType": "EnumValue", - "src": "1001:16:0" - }, - { - "id": 60, - "name": "CHANGE_RANGE_SIZE", - "nodeType": "EnumValue", - "src": "1027:17:0" - }, - { - "id": 61, - "name": "START_KEYGEN", - "nodeType": "EnumValue", - "src": "1054:12:0" - }, - { - "id": 62, - "name": "CANCEL_KEYGEN", - "nodeType": "EnumValue", - "src": "1076:13:0" - }, - { - "id": 63, - "name": "TRANSFER", - "nodeType": "EnumValue", - "src": "1099:8:0" - } - ], - "name": "Vote", - "nodeType": "EnumDefinition", - "src": "854:259:0" - }, - { - "constant": false, - "id": 68, - "name": "states", - "nodeType": "VariableDeclaration", - "scope": 1340, - "src": "1119:29:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State)" - }, - "typeName": { - "id": 67, - "keyType": { - "id": 65, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1127:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Mapping", - "src": "1119:22:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State)" - }, - "valueType": { - "contractScope": null, - "id": 66, - "name": "State", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 48, - "src": "1135:5:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage_ptr", - "typeString": "struct Bridge.State" - } - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 72, - "name": "dbTransferCount", - "nodeType": "VariableDeclaration", - "scope": 1340, - "src": "1155:47:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - }, - "typeName": { - "id": 71, - "keyType": { - "id": 69, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1163:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Mapping", - "src": "1155:24:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - }, - "valueType": { - "id": 70, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1174:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 76, - "name": "dbTransfer", - "nodeType": "VariableDeclaration", - "scope": 1340, - "src": "1208:42:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - }, - "typeName": { - "id": 75, - "keyType": { - "id": 73, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1216:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Mapping", - "src": "1208:24:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - }, - "valueType": { - "id": 74, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "1227:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 80, - "name": "votesCount", - "nodeType": "VariableDeclaration", - "scope": 1340, - "src": "1256:42:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - }, - "typeName": { - "id": 79, - "keyType": { - "id": 77, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1264:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Mapping", - "src": "1256:24:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - }, - "valueType": { - "id": 78, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1275:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 84, - "name": "votes", - "nodeType": "VariableDeclaration", - "scope": 1340, - "src": "1304:37:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - }, - "typeName": { - "id": 83, - "keyType": { - "id": 81, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1312:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Mapping", - "src": "1304:24:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - }, - "valueType": { - "id": 82, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "1323:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 88, - "name": "usedRange", - "nodeType": "VariableDeclaration", - "scope": 1340, - "src": "1347:41:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - }, - "typeName": { - "id": 87, - "keyType": { - "id": 85, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1355:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Mapping", - "src": "1347:24:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - }, - "valueType": { - "id": 86, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "1366:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 90, - "name": "status", - "nodeType": "VariableDeclaration", - "scope": 1340, - "src": "1395:20:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - }, - "typeName": { - "contractScope": null, - "id": 89, - "name": "Status", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 53, - "src": "1395:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 92, - "name": "epoch", - "nodeType": "VariableDeclaration", - "scope": 1340, - "src": "1422:17:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 91, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1422:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 94, - "name": "nextEpoch", - "nodeType": "VariableDeclaration", - "scope": 1340, - "src": "1445:21:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 93, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1445:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 96, - "name": "minTxLimit", - "nodeType": "VariableDeclaration", - "scope": 1340, - "src": "1473:15:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 95, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1473:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 98, - "name": "maxTxLimit", - "nodeType": "VariableDeclaration", - "scope": 1340, - "src": "1494:15:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 97, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1494:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "body": { - "id": 181, - "nodeType": "Block", - "src": "1643:403:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 118, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 115, - "name": "validators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 103, - "src": "1661:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 116, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1661:17:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 117, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1681:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "1661:21:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 114, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 13091, - 13092 - ], - "referencedDeclaration": 13091, - "src": "1653:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 119, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1653:30:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 120, - "nodeType": "ExpressionStatement", - "src": "1653:30:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 125, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 122, - "name": "threshold", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 100, - "src": "1701:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 123, - "name": "validators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 103, - "src": "1713:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 124, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1713:17:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1701:29:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 121, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 13091, - 13092 - ], - "referencedDeclaration": 13091, - "src": "1693:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 126, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1693:38:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 127, - "nodeType": "ExpressionStatement", - "src": "1693:38:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 132, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 128, - "name": "tokenContract", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 184, - "src": "1742:13:0", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$10032", - "typeString": "contract IERC20" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 130, - "name": "_tokenContract", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 105, - "src": "1765:14:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 129, - "name": "IERC20", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 10032, - "src": "1758:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_IERC20_$10032_$", - "typeString": "type(contract IERC20)" - } - }, - "id": 131, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1758:22:0", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$10032", - "typeString": "contract IERC20" - } - }, - "src": "1742:38:0", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$10032", - "typeString": "contract IERC20" - } - }, - "id": 133, - "nodeType": "ExpressionStatement", - "src": "1742:38:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 136, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 134, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "1791:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "30", - "id": 135, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1799:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "1791:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 137, - "nodeType": "ExpressionStatement", - "src": "1791:9:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 141, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 138, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 90, - "src": "1810:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 139, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 53, - "src": "1819:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$53_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 140, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "KEYGEN", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1819:13:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "src": "1810:22:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "id": 142, - "nodeType": "ExpressionStatement", - "src": "1810:22:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 145, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 143, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "1842:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "31", - "id": 144, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1854:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "1842:13:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 146, - "nodeType": "ExpressionStatement", - "src": "1842:13:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 162, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 147, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "1866:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 149, - "indexExpression": { - "argumentTypes": null, - "id": 148, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "1873:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "1866:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 151, - "name": "validators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 103, - "src": "1892:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - { - "argumentTypes": null, - "id": 152, - "name": "threshold", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 100, - "src": "1904:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 153, - "name": "rangeSize", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 111, - "src": "1915:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "hexValue": "30", - "id": 154, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1926:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 157, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "-", - "prefix": true, - "src": "1934:2:0", - "subExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 156, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1935:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "typeDescriptions": { - "typeIdentifier": "t_rational_minus_1_by_1", - "typeString": "int_const -1" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_rational_minus_1_by_1", - "typeString": "int_const -1" - } - ], - "id": 155, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "1929:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_uint256_$", - "typeString": "type(uint256)" - }, - "typeName": "uint" - }, - "id": 158, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1929:8:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "hexValue": "30", - "id": 159, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1939:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - { - "argumentTypes": null, - "hexValue": "30", - "id": 160, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1942:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - } - ], - "id": 150, - "name": "State", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 48, - "src": "1886:5:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_struct$_State_$48_storage_ptr_$", - "typeString": "type(struct Bridge.State storage pointer)" - } - }, - "id": 161, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "structConstructorCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1886:58:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_memory", - "typeString": "struct Bridge.State memory" - } - }, - "src": "1866:78:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 163, - "nodeType": "ExpressionStatement", - "src": "1866:78:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 168, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 164, - "name": "minTxLimit", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 96, - "src": "1955:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 165, - "name": "limits", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 109, - "src": "1968:6:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_memory_ptr", - "typeString": "uint256[2] memory" - } - }, - "id": 167, - "indexExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 166, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1975:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "1968:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1955:22:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 169, - "nodeType": "ExpressionStatement", - "src": "1955:22:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 174, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 170, - "name": "maxTxLimit", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 98, - "src": "1987:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 171, - "name": "limits", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 109, - "src": "2000:6:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_memory_ptr", - "typeString": "uint256[2] memory" - } - }, - "id": 173, - "indexExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 172, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2007:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "2000:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1987:22:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 175, - "nodeType": "ExpressionStatement", - "src": "1987:22:0" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "hexValue": "30", - "id": 177, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2034:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - { - "argumentTypes": null, - "hexValue": "31", - "id": 178, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2037:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - } - ], - "id": 176, - "name": "NewEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 14, - "src": "2025:8:0", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$returns$__$", - "typeString": "function (uint256,uint256)" - } - }, - "id": 179, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2025:14:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 180, - "nodeType": "EmitStatement", - "src": "2020:19:0" - } - ] - }, - "documentation": null, - "id": 182, - "implemented": true, - "kind": "constructor", - "modifiers": [], - "name": "", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 112, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 100, - "name": "threshold", - "nodeType": "VariableDeclaration", - "scope": 182, - "src": "1528:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 99, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1528:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 103, - "name": "validators", - "nodeType": "VariableDeclaration", - "scope": 182, - "src": "1544:27:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 101, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1544:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 102, - "length": null, - "nodeType": "ArrayTypeName", - "src": "1544:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 105, - "name": "_tokenContract", - "nodeType": "VariableDeclaration", - "scope": 182, - "src": "1573:22:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 104, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1573:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 109, - "name": "limits", - "nodeType": "VariableDeclaration", - "scope": 182, - "src": "1597:21:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_memory_ptr", - "typeString": "uint256[2]" - }, - "typeName": { - "baseType": { - "id": 106, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1597:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 108, - "length": { - "argumentTypes": null, - "hexValue": "32", - "id": 107, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1602:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "nodeType": "ArrayTypeName", - "src": "1597:7:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_storage_ptr", - "typeString": "uint256[2]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 111, - "name": "rangeSize", - "nodeType": "VariableDeclaration", - "scope": 182, - "src": "1620:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 110, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1620:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1527:108:0" - }, - "returnParameters": { - "id": 113, - "nodeType": "ParameterList", - "parameters": [], - "src": "1643:0:0" - }, - "scope": 1340, - "src": "1516:530:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "constant": false, - "id": 184, - "name": "tokenContract", - "nodeType": "VariableDeclaration", - "scope": 1340, - "src": "2052:27:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$10032", - "typeString": "contract IERC20" - }, - "typeName": { - "contractScope": null, - "id": 183, - "name": "IERC20", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 10032, - "src": "2052:6:0", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$10032", - "typeString": "contract IERC20" - } - }, - "value": null, - "visibility": "public" - }, - { - "body": { - "id": 195, - "nodeType": "Block", - "src": "2101:81:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - }, - "id": 190, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 187, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 90, - "src": "2119:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 188, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 53, - "src": "2129:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$53_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 189, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "READY", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2129:12:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "src": "2119:22:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4e6f7420696e207265616479207374617465", - "id": 191, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2143:20:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_965c39c15b78dbcd8a954511641ca86e15fc1ae6d6c30a67536872ccde75b679", - "typeString": "literal_string \"Not in ready state\"" - }, - "value": "Not in ready state" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_965c39c15b78dbcd8a954511641ca86e15fc1ae6d6c30a67536872ccde75b679", - "typeString": "literal_string \"Not in ready state\"" - } - ], - "id": 186, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 13091, - 13092 - ], - "referencedDeclaration": 13092, - "src": "2111:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 192, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2111:53:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 193, - "nodeType": "ExpressionStatement", - "src": "2111:53:0" - }, - { - "id": 194, - "nodeType": "PlaceholderStatement", - "src": "2174:1:0" - } - ] - }, - "documentation": null, - "id": 196, - "name": "ready", - "nodeType": "ModifierDefinition", - "parameters": { - "id": 185, - "nodeType": "ParameterList", - "parameters": [], - "src": "2101:0:0" - }, - "src": "2086:96:0", - "visibility": "internal" - }, - { - "body": { - "id": 212, - "nodeType": "Block", - "src": "2211:118:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 207, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - }, - "id": 202, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 199, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 90, - "src": "2229:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 200, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 53, - "src": "2239:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$53_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 201, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "READY", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2239:12:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "src": "2229:22:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "||", - "rightExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - }, - "id": 206, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 203, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 90, - "src": "2255:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 204, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 53, - "src": "2265:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$53_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 205, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "VOTING", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2265:13:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "src": "2255:23:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "2229:49:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4e6f7420696e207265616479206f7220766f74696e67207374617465", - "id": 208, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2280:30:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_7e3f7359baa731593d4e3921720b92600c22ed1d950d208e0c826ad2eddebe96", - "typeString": "literal_string \"Not in ready or voting state\"" - }, - "value": "Not in ready or voting state" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_7e3f7359baa731593d4e3921720b92600c22ed1d950d208e0c826ad2eddebe96", - "typeString": "literal_string \"Not in ready or voting state\"" - } - ], - "id": 198, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 13091, - 13092 - ], - "referencedDeclaration": 13092, - "src": "2221:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 209, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2221:90:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 210, - "nodeType": "ExpressionStatement", - "src": "2221:90:0" - }, - { - "id": 211, - "nodeType": "PlaceholderStatement", - "src": "2321:1:0" - } - ] - }, - "documentation": null, - "id": 213, - "name": "readyOrVoting", - "nodeType": "ModifierDefinition", - "parameters": { - "id": 197, - "nodeType": "ParameterList", - "parameters": [], - "src": "2211:0:0" - }, - "src": "2188:141:0", - "visibility": "internal" - }, - { - "body": { - "id": 224, - "nodeType": "Block", - "src": "2351:83:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - }, - "id": 219, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 216, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 90, - "src": "2369:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 217, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 53, - "src": "2379:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$53_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 218, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "VOTING", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2379:13:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "src": "2369:23:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4e6f7420696e20766f74696e67207374617465", - "id": 220, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2394:21:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_0cbee9834b110b21e0730bf5c3d2972fb9867ff221df239e7ae60883592f05d1", - "typeString": "literal_string \"Not in voting state\"" - }, - "value": "Not in voting state" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_0cbee9834b110b21e0730bf5c3d2972fb9867ff221df239e7ae60883592f05d1", - "typeString": "literal_string \"Not in voting state\"" - } - ], - "id": 215, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 13091, - 13092 - ], - "referencedDeclaration": 13092, - "src": "2361:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 221, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2361:55:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 222, - "nodeType": "ExpressionStatement", - "src": "2361:55:0" - }, - { - "id": 223, - "nodeType": "PlaceholderStatement", - "src": "2426:1:0" - } - ] - }, - "documentation": null, - "id": 225, - "name": "voting", - "nodeType": "ModifierDefinition", - "parameters": { - "id": 214, - "nodeType": "ParameterList", - "parameters": [], - "src": "2351:0:0" - }, - "src": "2335:99:0", - "visibility": "internal" - }, - { - "body": { - "id": 236, - "nodeType": "Block", - "src": "2456:83:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - }, - "id": 231, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 228, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 90, - "src": "2474:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 229, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 53, - "src": "2484:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$53_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 230, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "KEYGEN", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2484:13:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "src": "2474:23:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4e6f7420696e206b657967656e207374617465", - "id": 232, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2499:21:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_ed0fee6382e0651a224348a21558d03a4a439c3bd5edc24945894a3417c14010", - "typeString": "literal_string \"Not in keygen state\"" - }, - "value": "Not in keygen state" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_ed0fee6382e0651a224348a21558d03a4a439c3bd5edc24945894a3417c14010", - "typeString": "literal_string \"Not in keygen state\"" - } - ], - "id": 227, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 13091, - 13092 - ], - "referencedDeclaration": 13092, - "src": "2466:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 233, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2466:55:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 234, - "nodeType": "ExpressionStatement", - "src": "2466:55:0" - }, - { - "id": 235, - "nodeType": "PlaceholderStatement", - "src": "2531:1:0" - } - ] - }, - "documentation": null, - "id": 237, - "name": "keygen", - "nodeType": "ModifierDefinition", - "parameters": { - "id": 226, - "nodeType": "ParameterList", - "parameters": [], - "src": "2456:0:0" - }, - "src": "2440:99:0", - "visibility": "internal" - }, - { - "body": { - "id": 248, - "nodeType": "Block", - "src": "2568:99:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - }, - "id": 243, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 240, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 90, - "src": "2586:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 241, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 53, - "src": "2596:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$53_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 242, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "FUNDS_TRANSFER", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2596:21:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "src": "2586:31:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4e6f7420696e2066756e6473207472616e73666572207374617465", - "id": 244, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2619:29:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_6347c9fecd6f58520ad10dfd1347ce3dc42cc0eed7a4182ca64dd11c69fc3008", - "typeString": "literal_string \"Not in funds transfer state\"" - }, - "value": "Not in funds transfer state" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_6347c9fecd6f58520ad10dfd1347ce3dc42cc0eed7a4182ca64dd11c69fc3008", - "typeString": "literal_string \"Not in funds transfer state\"" - } - ], - "id": 239, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 13091, - 13092 - ], - "referencedDeclaration": 13092, - "src": "2578:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 245, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2578:71:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 246, - "nodeType": "ExpressionStatement", - "src": "2578:71:0" - }, - { - "id": 247, - "nodeType": "PlaceholderStatement", - "src": "2659:1:0" - } - ] - }, - "documentation": null, - "id": 249, - "name": "fundsTransfer", - "nodeType": "ModifierDefinition", - "parameters": { - "id": 238, - "nodeType": "ParameterList", - "parameters": [], - "src": "2568:0:0" - }, - "src": "2545:122:0", - "visibility": "internal" - }, - { - "body": { - "id": 260, - "nodeType": "Block", - "src": "2699:81:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 255, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 252, - "name": "getPartyId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 728, - "src": "2717:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 253, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2717:12:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 254, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2733:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "2717:17:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4e6f7420612063757272656e742076616c696461746f72", - "id": 256, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2736:25:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_8dc18d5bb1361900b9758b388df331056e31071cae84b276c0f03794c4dc634a", - "typeString": "literal_string \"Not a current validator\"" - }, - "value": "Not a current validator" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_8dc18d5bb1361900b9758b388df331056e31071cae84b276c0f03794c4dc634a", - "typeString": "literal_string \"Not a current validator\"" - } - ], - "id": 251, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 13091, - 13092 - ], - "referencedDeclaration": 13092, - "src": "2709:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 257, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2709:53:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 258, - "nodeType": "ExpressionStatement", - "src": "2709:53:0" - }, - { - "id": 259, - "nodeType": "PlaceholderStatement", - "src": "2772:1:0" - } - ] - }, - "documentation": null, - "id": 261, - "name": "currentValidator", - "nodeType": "ModifierDefinition", - "parameters": { - "id": 250, - "nodeType": "ParameterList", - "parameters": [], - "src": "2699:0:0" - }, - "src": "2673:107:0", - "visibility": "internal" - }, - { - "body": { - "id": 343, - "nodeType": "Block", - "src": "2829:475:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 281, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 277, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 271, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 269, - "name": "value", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 263, - "src": "2847:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">=", - "rightExpression": { - "argumentTypes": null, - "id": 270, - "name": "minTxLimit", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 96, - "src": "2856:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2847:19:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "&&", - "rightExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 276, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 272, - "name": "value", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 263, - "src": "2870:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">=", - "rightExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_rational_10000000000_by_1", - "typeString": "int_const 10000000000" - }, - "id": 275, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "hexValue": "3130", - "id": 273, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2879:2:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_10_by_1", - "typeString": "int_const 10" - }, - "value": "10" - }, - "nodeType": "BinaryOperation", - "operator": "**", - "rightExpression": { - "argumentTypes": null, - "hexValue": "3130", - "id": 274, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2885:2:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_10_by_1", - "typeString": "int_const 10" - }, - "value": "10" - }, - "src": "2879:8:0", - "typeDescriptions": { - "typeIdentifier": "t_rational_10000000000_by_1", - "typeString": "int_const 10000000000" - } - }, - "src": "2870:17:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "2847:40:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "&&", - "rightExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 280, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 278, - "name": "value", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 263, - "src": "2891:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<=", - "rightExpression": { - "argumentTypes": null, - "id": 279, - "name": "maxTxLimit", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 98, - "src": "2900:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2891:19:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "2847:63:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 268, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 13091, - 13092 - ], - "referencedDeclaration": 13091, - "src": "2839:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 282, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2839:72:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 283, - "nodeType": "ExpressionStatement", - "src": "2839:72:0" - }, - { - "assignments": [ - 285 - ], - "declarations": [ - { - "constant": false, - "id": 285, - "name": "txRange", - "nodeType": "VariableDeclaration", - "scope": 343, - "src": "2922:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 284, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "2922:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 295, - "initialValue": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 294, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "components": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 290, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 286, - "name": "block", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13078, - "src": "2938:5:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_block", - "typeString": "block" - } - }, - "id": 287, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "number", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2938:12:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 288, - "name": "getStartBlock", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 598, - 611 - ], - "referencedDeclaration": 598, - "src": "2953:13:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 289, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2953:15:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2938:30:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "id": 291, - "isConstant": false, - "isInlineArray": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "TupleExpression", - "src": "2937:32:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "/", - "rightExpression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 292, - "name": "getRangeSize", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 621, - 644 - ], - "referencedDeclaration": 621, - "src": "2972:12:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 293, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2972:14:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2937:49:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "2922:64:0" - }, - { - "condition": { - "argumentTypes": null, - "id": 305, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "!", - "prefix": true, - "src": "3000:55:0", - "subExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 296, - "name": "usedRange", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 88, - "src": "3001:9:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - } - }, - "id": 304, - "indexExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 300, - "name": "txRange", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 285, - "src": "3038:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 301, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "3047:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 298, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13075, - "src": "3021:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 299, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3021:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 302, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3021:32:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 297, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13082, - "src": "3011:9:0", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 303, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3011:43:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3001:54:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 325, - "nodeType": "IfStatement", - "src": "2996:182:0", - "trueBody": { - "id": 324, - "nodeType": "Block", - "src": "3057:121:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 316, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 306, - "name": "usedRange", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 88, - "src": "3071:9:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - } - }, - "id": 314, - "indexExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 310, - "name": "txRange", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 285, - "src": "3108:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 311, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "3117:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 308, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13075, - "src": "3091:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 309, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3091:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 312, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3091:32:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 307, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13082, - "src": "3081:9:0", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 313, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3081:43:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "3071:54:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 315, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3128:4:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "src": "3071:61:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 317, - "nodeType": "ExpressionStatement", - "src": "3071:61:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 322, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "3146:21:0", - "subExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 318, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "3146:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 320, - "indexExpression": { - "argumentTypes": null, - "id": 319, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "3153:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3146:13:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 321, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "nonce", - "nodeType": "MemberAccess", - "referencedDeclaration": 43, - "src": "3146:19:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 323, - "nodeType": "ExpressionStatement", - "src": "3146:21:0" - } - ] - } - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 329, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13088, - "src": "3215:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 330, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3215:10:0", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 332, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13104, - "src": "3235:4:0", - "typeDescriptions": { - "typeIdentifier": "t_contract$_Bridge_$1340", - "typeString": "contract Bridge" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_Bridge_$1340", - "typeString": "contract Bridge" - } - ], - "id": 331, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "3227:7:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 333, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3227:13:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 334, - "name": "value", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 263, - "src": "3242:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 326, - "name": "tokenContract", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 184, - "src": "3188:13:0", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$10032", - "typeString": "contract IERC20" - } - }, - "id": 328, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "transferFrom", - "nodeType": "MemberAccess", - "referencedDeclaration": 10015, - "src": "3188:26:0", - "typeDescriptions": { - "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$_t_bool_$", - "typeString": "function (address,address,uint256) external returns (bool)" - } - }, - "id": 335, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3188:60:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 336, - "nodeType": "ExpressionStatement", - "src": "3188:60:0" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 338, - "name": "value", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 263, - "src": "3279:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 339, - "name": "getNonce", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 654, - 667 - ], - "referencedDeclaration": 654, - "src": "3286:8:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 340, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3286:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 337, - "name": "ExchangeRequest", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 8, - "src": "3263:15:0", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$returns$__$", - "typeString": "function (uint256,uint256)" - } - }, - "id": 341, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3263:34:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 342, - "nodeType": "EmitStatement", - "src": "3258:39:0" - } - ] - }, - "documentation": null, - "id": 344, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 266, - "modifierName": { - "argumentTypes": null, - "id": 265, - "name": "ready", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 196, - "src": "2823:5:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "2823:5:0" - } - ], - "name": "exchange", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 264, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 263, - "name": "value", - "nodeType": "VariableDeclaration", - "scope": 344, - "src": "2804:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 262, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "2804:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2803:12:0" - }, - "returnParameters": { - "id": 267, - "nodeType": "ParameterList", - "parameters": [], - "src": "2829:0:0" - }, - "scope": 1340, - "src": "2786:518:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 373, - "nodeType": "Block", - "src": "3404:119:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 358, - "name": "Vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 64, - "src": "3426:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", - "typeString": "type(enum Bridge.Vote)" - } - }, - "id": 359, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "TRANSFER", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3426:13:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 360, - "name": "hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 346, - "src": "3441:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "id": 361, - "name": "to", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 348, - "src": "3447:2:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 362, - "name": "value", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 350, - "src": "3451:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 357, - "name": "tryVote", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1084, - 1109, - 1134, - 1164 - ], - "referencedDeclaration": 1164, - "src": "3418:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$_t_bytes32_$_t_address_$_t_uint256_$returns$_t_bool_$", - "typeString": "function (enum Bridge.Vote,bytes32,address,uint256) returns (bool)" - } - }, - "id": 363, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3418:39:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 372, - "nodeType": "IfStatement", - "src": "3414:103:0", - "trueBody": { - "id": 371, - "nodeType": "Block", - "src": "3459:58:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 367, - "name": "to", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 348, - "src": "3496:2:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 368, - "name": "value", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 350, - "src": "3500:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 364, - "name": "tokenContract", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 184, - "src": "3473:13:0", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$10032", - "typeString": "contract IERC20" - } - }, - "id": 366, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "transfer", - "nodeType": "MemberAccess", - "referencedDeclaration": 9986, - "src": "3473:22:0", - "typeDescriptions": { - "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$_t_bool_$", - "typeString": "function (address,uint256) external returns (bool)" - } - }, - "id": 369, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3473:33:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 370, - "nodeType": "ExpressionStatement", - "src": "3473:33:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 374, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 353, - "modifierName": { - "argumentTypes": null, - "id": 352, - "name": "readyOrVoting", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 213, - "src": "3373:13:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "3373:13:0" - }, - { - "arguments": null, - "id": 355, - "modifierName": { - "argumentTypes": null, - "id": 354, - "name": "currentValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 261, - "src": "3387:16:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "3387:16:0" - } - ], - "name": "transfer", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 351, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 346, - "name": "hash", - "nodeType": "VariableDeclaration", - "scope": 374, - "src": "3328:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 345, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "3328:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 348, - "name": "to", - "nodeType": "VariableDeclaration", - "scope": 374, - "src": "3342:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 347, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "3342:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 350, - "name": "value", - "nodeType": "VariableDeclaration", - "scope": 374, - "src": "3354:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 349, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "3354:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "3327:38:0" - }, - "returnParameters": { - "id": 356, - "nodeType": "ParameterList", - "parameters": [], - "src": "3404:0:0" - }, - "scope": 1340, - "src": "3310:213:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 464, - "nodeType": "Block", - "src": "3582:638:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 389, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 385, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13088, - "src": "3615:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 386, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3615:10:0", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - ], - "id": 384, - "name": "getNextPartyId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 768, - "src": "3600:14:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_uint256_$", - "typeString": "function (address) view returns (uint256)" - } - }, - "id": 387, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3600:26:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 388, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3630:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "3600:31:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4e6f742061206e6578742076616c696461746f72", - "id": 390, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3633:22:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_44981c92ce908443b2fa5f878c54791e1a0c95d4cc04ea4f4d9224b3ec030922", - "typeString": "literal_string \"Not a next validator\"" - }, - "value": "Not a next validator" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_44981c92ce908443b2fa5f878c54791e1a0c95d4cc04ea4f4d9224b3ec030922", - "typeString": "literal_string \"Not a next validator\"" - } - ], - "id": 383, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 13091, - 13092 - ], - "referencedDeclaration": 13092, - "src": "3592:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 391, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3592:64:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 392, - "nodeType": "ExpressionStatement", - "src": "3592:64:0" - }, - { - "condition": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 394, - "name": "Vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 64, - "src": "3682:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", - "typeString": "type(enum Bridge.Vote)" - } - }, - "id": 395, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "CONFIRM_KEYGEN", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3682:19:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 396, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 376, - "src": "3703:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 397, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 378, - "src": "3706:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 393, - "name": "tryConfirm", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1186, - 1214 - ], - "referencedDeclaration": 1214, - "src": "3671:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$_t_uint256_$_t_uint256_$returns$_t_bool_$", - "typeString": "function (enum Bridge.Vote,uint256,uint256) returns (bool)" - } - }, - "id": 398, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3671:37:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 463, - "nodeType": "IfStatement", - "src": "3667:547:0", - "trueBody": { - "id": 462, - "nodeType": "Block", - "src": "3710:504:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 404, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 399, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "3724:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 401, - "indexExpression": { - "argumentTypes": null, - "id": 400, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "3731:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3724:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 402, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "x", - "nodeType": "MemberAccess", - "referencedDeclaration": 45, - "src": "3724:19:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 403, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 376, - "src": "3746:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3724:23:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 405, - "nodeType": "ExpressionStatement", - "src": "3724:23:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 411, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 406, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "3761:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 408, - "indexExpression": { - "argumentTypes": null, - "id": 407, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "3768:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3761:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 409, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "y", - "nodeType": "MemberAccess", - "referencedDeclaration": 47, - "src": "3761:19:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 410, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 378, - "src": "3783:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3761:23:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 412, - "nodeType": "ExpressionStatement", - "src": "3761:23:0" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 415, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 413, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "3802:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 414, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3815:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "3802:14:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "id": 460, - "nodeType": "Block", - "src": "4084:120:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 453, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 450, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 90, - "src": "4102:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 451, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 53, - "src": "4111:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$53_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 452, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "FUNDS_TRANSFER", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4111:21:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "src": "4102:30:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "id": 454, - "nodeType": "ExpressionStatement", - "src": "4102:30:0" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 456, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "4172:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 457, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "4179:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 455, - "name": "NewFundsTransfer", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 24, - "src": "4155:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$returns$__$", - "typeString": "function (uint256,uint256)" - } - }, - "id": 458, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4155:34:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 459, - "nodeType": "EmitStatement", - "src": "4150:39:0" - } - ] - }, - "id": 461, - "nodeType": "IfStatement", - "src": "3798:406:0", - "trueBody": { - "id": 449, - "nodeType": "Block", - "src": "3818:248:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 419, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 416, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 90, - "src": "3836:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 417, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 53, - "src": "3845:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$53_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 418, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "READY", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3845:12:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "src": "3836:21:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "id": 420, - "nodeType": "ExpressionStatement", - "src": "3836:21:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 427, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 421, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "3875:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 423, - "indexExpression": { - "argumentTypes": null, - "id": 422, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "3882:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3875:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 424, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "startBlock", - "nodeType": "MemberAccess", - "referencedDeclaration": 41, - "src": "3875:28:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 425, - "name": "block", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13078, - "src": "3906:5:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_block", - "typeString": "block" - } - }, - "id": 426, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "number", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3906:12:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3875:43:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 428, - "nodeType": "ExpressionStatement", - "src": "3875:43:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 437, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 429, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "3936:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 431, - "indexExpression": { - "argumentTypes": null, - "id": 430, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "3943:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3936:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 432, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "nonce", - "nodeType": "MemberAccess", - "referencedDeclaration": 43, - "src": "3936:23:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 435, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "-", - "prefix": true, - "src": "3967:2:0", - "subExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 434, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3968:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "typeDescriptions": { - "typeIdentifier": "t_rational_minus_1_by_1", - "typeString": "int_const -1" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_rational_minus_1_by_1", - "typeString": "int_const -1" - } - ], - "id": 433, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "3962:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_uint256_$", - "typeString": "type(uint256)" - }, - "typeName": "uint" - }, - "id": 436, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3962:8:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3936:34:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 438, - "nodeType": "ExpressionStatement", - "src": "3936:34:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 441, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 439, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "3988:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 440, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "3996:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3988:17:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 442, - "nodeType": "ExpressionStatement", - "src": "3988:17:0" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 444, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "4039:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 445, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 376, - "src": "4046:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 446, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 378, - "src": "4049:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 443, - "name": "EpochStart", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 32, - "src": "4028:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$_t_uint256_$returns$__$", - "typeString": "function (uint256,uint256,uint256)" - } - }, - "id": 447, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4028:23:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 448, - "nodeType": "EmitStatement", - "src": "4023:28:0" - } - ] - } - } - ] - } - } - ] - }, - "documentation": null, - "id": 465, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 381, - "modifierName": { - "argumentTypes": null, - "id": 380, - "name": "keygen", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 237, - "src": "3575:6:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "3575:6:0" - } - ], - "name": "confirmKeygen", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 379, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 376, - "name": "x", - "nodeType": "VariableDeclaration", - "scope": 465, - "src": "3552:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 375, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "3552:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 378, - "name": "y", - "nodeType": "VariableDeclaration", - "scope": 465, - "src": "3560:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 377, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "3560:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "3551:16:0" - }, - "returnParameters": { - "id": 382, - "nodeType": "ParameterList", - "parameters": [], - "src": "3582:0:0" - }, - "scope": 1340, - "src": "3529:691:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 520, - "nodeType": "Block", - "src": "4296:368:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 475, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 473, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "4314:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 474, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4322:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "4314:9:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "46697273742065706f636820646f6573206e6f74206e6565642066756e6473207472616e73666572", - "id": 476, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4325:42:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_8ddae2cc9da30ed8c59c39c6a950ef823ea484ac89ff6f37abb0317fb5f679a1", - "typeString": "literal_string \"First epoch does not need funds transfer\"" - }, - "value": "First epoch does not need funds transfer" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_8ddae2cc9da30ed8c59c39c6a950ef823ea484ac89ff6f37abb0317fb5f679a1", - "typeString": "literal_string \"First epoch does not need funds transfer\"" - } - ], - "id": 472, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 13091, - 13092 - ], - "referencedDeclaration": 13092, - "src": "4306:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 477, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4306:62:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 478, - "nodeType": "ExpressionStatement", - "src": "4306:62:0" - }, - { - "condition": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 480, - "name": "Vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 64, - "src": "4394:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", - "typeString": "type(enum Bridge.Vote)" - } - }, - "id": 481, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "CONFIRM_FUNDS_TRANSFER", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4394:27:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - ], - "id": 479, - "name": "tryConfirm", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1186, - 1214 - ], - "referencedDeclaration": 1186, - "src": "4383:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$returns$_t_bool_$", - "typeString": "function (enum Bridge.Vote) returns (bool)" - } - }, - "id": 482, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4383:39:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 519, - "nodeType": "IfStatement", - "src": "4379:279:0", - "trueBody": { - "id": 518, - "nodeType": "Block", - "src": "4424:234:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 486, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 483, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 90, - "src": "4438:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 484, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 53, - "src": "4447:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$53_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 485, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "READY", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4447:12:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "src": "4438:21:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "id": 487, - "nodeType": "ExpressionStatement", - "src": "4438:21:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 494, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 488, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "4473:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 490, - "indexExpression": { - "argumentTypes": null, - "id": 489, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "4480:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4473:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 491, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "startBlock", - "nodeType": "MemberAccess", - "referencedDeclaration": 41, - "src": "4473:28:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 492, - "name": "block", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13078, - "src": "4504:5:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_block", - "typeString": "block" - } - }, - "id": 493, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "number", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4504:12:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4473:43:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 495, - "nodeType": "ExpressionStatement", - "src": "4473:43:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 504, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 496, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "4530:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 498, - "indexExpression": { - "argumentTypes": null, - "id": 497, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "4537:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4530:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 499, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "nonce", - "nodeType": "MemberAccess", - "referencedDeclaration": 43, - "src": "4530:23:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 502, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "-", - "prefix": true, - "src": "4561:2:0", - "subExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 501, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4562:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "typeDescriptions": { - "typeIdentifier": "t_rational_minus_1_by_1", - "typeString": "int_const -1" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_rational_minus_1_by_1", - "typeString": "int_const -1" - } - ], - "id": 500, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "4556:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_uint256_$", - "typeString": "type(uint256)" - }, - "typeName": "uint" - }, - "id": 503, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4556:8:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4530:34:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 505, - "nodeType": "ExpressionStatement", - "src": "4530:34:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 508, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 506, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "4578:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 507, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "4586:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4578:17:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 509, - "nodeType": "ExpressionStatement", - "src": "4578:17:0" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 511, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "4625:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 512, - "name": "getX", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 678, - "src": "4632:4:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 513, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4632:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 514, - "name": "getY", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 689, - "src": "4640:4:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 515, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4640:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 510, - "name": "EpochStart", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 32, - "src": "4614:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$_t_uint256_$returns$__$", - "typeString": "function (uint256,uint256,uint256)" - } - }, - "id": 516, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4614:33:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 517, - "nodeType": "EmitStatement", - "src": "4609:38:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 521, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 468, - "modifierName": { - "argumentTypes": null, - "id": 467, - "name": "fundsTransfer", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 249, - "src": "4265:13:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "4265:13:0" - }, - { - "arguments": null, - "id": 470, - "modifierName": { - "argumentTypes": null, - "id": 469, - "name": "currentValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 261, - "src": "4279:16:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "4279:16:0" - } - ], - "name": "confirmFundsTransfer", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 466, - "nodeType": "ParameterList", - "parameters": [], - "src": "4255:2:0" - }, - "returnParameters": { - "id": 471, - "nodeType": "ParameterList", - "parameters": [], - "src": "4296:0:0" - }, - "scope": 1340, - "src": "4226:438:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 530, - "nodeType": "Block", - "src": "4719:41:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 527, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "4747:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 526, - "name": "getParties", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 531, - 555 - ], - "referencedDeclaration": 555, - "src": "4736:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256) view returns (uint256)" - } - }, - "id": 528, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4736:17:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 525, - "id": 529, - "nodeType": "Return", - "src": "4729:24:0" - } - ] - }, - "documentation": null, - "id": 531, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getParties", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 522, - "nodeType": "ParameterList", - "parameters": [], - "src": "4689:2:0" - }, - "returnParameters": { - "id": 525, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 524, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 531, - "src": "4713:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 523, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "4713:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4712:6:0" - }, - "scope": 1340, - "src": "4670:90:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 540, - "nodeType": "Block", - "src": "4819:45:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 537, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "4847:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 536, - "name": "getParties", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 531, - 555 - ], - "referencedDeclaration": 555, - "src": "4836:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256) view returns (uint256)" - } - }, - "id": 538, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4836:21:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 535, - "id": 539, - "nodeType": "Return", - "src": "4829:28:0" - } - ] - }, - "documentation": null, - "id": 541, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getNextParties", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 532, - "nodeType": "ParameterList", - "parameters": [], - "src": "4789:2:0" - }, - "returnParameters": { - "id": 535, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 534, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 541, - "src": "4813:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 533, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "4813:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4812:6:0" - }, - "scope": 1340, - "src": "4766:98:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 554, - "nodeType": "Block", - "src": "4930:56:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 548, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "4947:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 550, - "indexExpression": { - "argumentTypes": null, - "id": 549, - "name": "_epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 543, - "src": "4954:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4947:14:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 551, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "validators", - "nodeType": "MemberAccess", - "referencedDeclaration": 35, - "src": "4947:25:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 552, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4947:32:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 547, - "id": 553, - "nodeType": "Return", - "src": "4940:39:0" - } - ] - }, - "documentation": null, - "id": 555, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getParties", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 544, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 543, - "name": "_epoch", - "nodeType": "VariableDeclaration", - "scope": 555, - "src": "4890:11:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 542, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "4890:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4889:13:0" - }, - "returnParameters": { - "id": 547, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 546, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 555, - "src": "4924:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 545, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "4924:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4923:6:0" - }, - "scope": 1340, - "src": "4870:116:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 564, - "nodeType": "Block", - "src": "5043:43:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 561, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "5073:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 560, - "name": "getThreshold", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 565, - 588 - ], - "referencedDeclaration": 588, - "src": "5060:12:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256) view returns (uint256)" - } - }, - "id": 562, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5060:19:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 559, - "id": 563, - "nodeType": "Return", - "src": "5053:26:0" - } - ] - }, - "documentation": null, - "id": 565, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getThreshold", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 556, - "nodeType": "ParameterList", - "parameters": [], - "src": "5013:2:0" - }, - "returnParameters": { - "id": 559, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 558, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 565, - "src": "5037:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 557, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5037:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5036:6:0" - }, - "scope": 1340, - "src": "4992:94:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 574, - "nodeType": "Block", - "src": "5147:47:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 571, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "5177:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 570, - "name": "getThreshold", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 565, - 588 - ], - "referencedDeclaration": 588, - "src": "5164:12:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256) view returns (uint256)" - } - }, - "id": 572, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5164:23:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 569, - "id": 573, - "nodeType": "Return", - "src": "5157:30:0" - } - ] - }, - "documentation": null, - "id": 575, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getNextThreshold", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 566, - "nodeType": "ParameterList", - "parameters": [], - "src": "5117:2:0" - }, - "returnParameters": { - "id": 569, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 568, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 575, - "src": "5141:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 567, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5141:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5140:6:0" - }, - "scope": 1340, - "src": "5092:102:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 587, - "nodeType": "Block", - "src": "5262:48:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 582, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "5279:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 584, - "indexExpression": { - "argumentTypes": null, - "id": 583, - "name": "_epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 577, - "src": "5286:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "5279:14:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 585, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "threshold", - "nodeType": "MemberAccess", - "referencedDeclaration": 37, - "src": "5279:24:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 581, - "id": 586, - "nodeType": "Return", - "src": "5272:31:0" - } - ] - }, - "documentation": null, - "id": 588, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getThreshold", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 578, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 577, - "name": "_epoch", - "nodeType": "VariableDeclaration", - "scope": 588, - "src": "5222:11:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 576, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5222:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5221:13:0" - }, - "returnParameters": { - "id": 581, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 580, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 588, - "src": "5256:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 579, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5256:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5255:6:0" - }, - "scope": 1340, - "src": "5200:110:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 597, - "nodeType": "Block", - "src": "5368:44:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 594, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "5399:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 593, - "name": "getStartBlock", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 598, - 611 - ], - "referencedDeclaration": 611, - "src": "5385:13:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256) view returns (uint256)" - } - }, - "id": 595, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5385:20:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 592, - "id": 596, - "nodeType": "Return", - "src": "5378:27:0" - } - ] - }, - "documentation": null, - "id": 598, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getStartBlock", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 589, - "nodeType": "ParameterList", - "parameters": [], - "src": "5338:2:0" - }, - "returnParameters": { - "id": 592, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 591, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 598, - "src": "5362:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 590, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5362:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5361:6:0" - }, - "scope": 1340, - "src": "5316:96:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 610, - "nodeType": "Block", - "src": "5481:49:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 605, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "5498:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 607, - "indexExpression": { - "argumentTypes": null, - "id": 606, - "name": "_epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 600, - "src": "5505:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "5498:14:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 608, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "startBlock", - "nodeType": "MemberAccess", - "referencedDeclaration": 41, - "src": "5498:25:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 604, - "id": 609, - "nodeType": "Return", - "src": "5491:32:0" - } - ] - }, - "documentation": null, - "id": 611, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getStartBlock", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 601, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 600, - "name": "_epoch", - "nodeType": "VariableDeclaration", - "scope": 611, - "src": "5441:11:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 599, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5441:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5440:13:0" - }, - "returnParameters": { - "id": 604, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 603, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 611, - "src": "5475:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 602, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5475:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5474:6:0" - }, - "scope": 1340, - "src": "5418:112:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 620, - "nodeType": "Block", - "src": "5587:43:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 617, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "5617:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 616, - "name": "getRangeSize", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 621, - 644 - ], - "referencedDeclaration": 644, - "src": "5604:12:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256) view returns (uint256)" - } - }, - "id": 618, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5604:19:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 615, - "id": 619, - "nodeType": "Return", - "src": "5597:26:0" - } - ] - }, - "documentation": null, - "id": 621, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getRangeSize", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 612, - "nodeType": "ParameterList", - "parameters": [], - "src": "5557:2:0" - }, - "returnParameters": { - "id": 615, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 614, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 621, - "src": "5581:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 613, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5581:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5580:6:0" - }, - "scope": 1340, - "src": "5536:94:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 630, - "nodeType": "Block", - "src": "5691:47:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 627, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "5721:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 626, - "name": "getRangeSize", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 621, - 644 - ], - "referencedDeclaration": 644, - "src": "5708:12:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256) view returns (uint256)" - } - }, - "id": 628, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5708:23:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 625, - "id": 629, - "nodeType": "Return", - "src": "5701:30:0" - } - ] - }, - "documentation": null, - "id": 631, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getNextRangeSize", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 622, - "nodeType": "ParameterList", - "parameters": [], - "src": "5661:2:0" - }, - "returnParameters": { - "id": 625, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 624, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 631, - "src": "5685:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 623, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5685:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5684:6:0" - }, - "scope": 1340, - "src": "5636:102:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 643, - "nodeType": "Block", - "src": "5806:48:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 638, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "5823:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 640, - "indexExpression": { - "argumentTypes": null, - "id": 639, - "name": "_epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 633, - "src": "5830:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "5823:14:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 641, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "rangeSize", - "nodeType": "MemberAccess", - "referencedDeclaration": 39, - "src": "5823:24:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 637, - "id": 642, - "nodeType": "Return", - "src": "5816:31:0" - } - ] - }, - "documentation": null, - "id": 644, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getRangeSize", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 634, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 633, - "name": "_epoch", - "nodeType": "VariableDeclaration", - "scope": 644, - "src": "5766:11:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 632, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5766:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5765:13:0" - }, - "returnParameters": { - "id": 637, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 636, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 644, - "src": "5800:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 635, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5800:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5799:6:0" - }, - "scope": 1340, - "src": "5744:110:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 653, - "nodeType": "Block", - "src": "5907:39:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 650, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "5933:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 649, - "name": "getNonce", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 654, - 667 - ], - "referencedDeclaration": 667, - "src": "5924:8:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256) view returns (uint256)" - } - }, - "id": 651, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5924:15:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 648, - "id": 652, - "nodeType": "Return", - "src": "5917:22:0" - } - ] - }, - "documentation": null, - "id": 654, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getNonce", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 645, - "nodeType": "ParameterList", - "parameters": [], - "src": "5877:2:0" - }, - "returnParameters": { - "id": 648, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 647, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 654, - "src": "5901:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 646, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5901:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5900:6:0" - }, - "scope": 1340, - "src": "5860:86:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 666, - "nodeType": "Block", - "src": "6010:44:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 661, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "6027:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 663, - "indexExpression": { - "argumentTypes": null, - "id": 662, - "name": "_epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 656, - "src": "6034:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6027:14:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 664, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "nonce", - "nodeType": "MemberAccess", - "referencedDeclaration": 43, - "src": "6027:20:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 660, - "id": 665, - "nodeType": "Return", - "src": "6020:27:0" - } - ] - }, - "documentation": null, - "id": 667, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getNonce", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 657, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 656, - "name": "_epoch", - "nodeType": "VariableDeclaration", - "scope": 667, - "src": "5970:11:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 655, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5970:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5969:13:0" - }, - "returnParameters": { - "id": 660, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 659, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 667, - "src": "6004:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 658, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "6004:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "6003:6:0" - }, - "scope": 1340, - "src": "5952:102:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 677, - "nodeType": "Block", - "src": "6103:39:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 672, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "6120:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 674, - "indexExpression": { - "argumentTypes": null, - "id": 673, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "6127:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6120:13:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 675, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "x", - "nodeType": "MemberAccess", - "referencedDeclaration": 45, - "src": "6120:15:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 671, - "id": 676, - "nodeType": "Return", - "src": "6113:22:0" - } - ] - }, - "documentation": null, - "id": 678, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getX", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 668, - "nodeType": "ParameterList", - "parameters": [], - "src": "6073:2:0" - }, - "returnParameters": { - "id": 671, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 670, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 678, - "src": "6097:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 669, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "6097:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "6096:6:0" - }, - "scope": 1340, - "src": "6060:82:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 688, - "nodeType": "Block", - "src": "6191:39:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 683, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "6208:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 685, - "indexExpression": { - "argumentTypes": null, - "id": 684, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "6215:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6208:13:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 686, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "y", - "nodeType": "MemberAccess", - "referencedDeclaration": 47, - "src": "6208:15:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 682, - "id": 687, - "nodeType": "Return", - "src": "6201:22:0" - } - ] - }, - "documentation": null, - "id": 689, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getY", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 679, - "nodeType": "ParameterList", - "parameters": [], - "src": "6161:2:0" - }, - "returnParameters": { - "id": 682, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 681, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 689, - "src": "6185:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 680, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "6185:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "6184:6:0" - }, - "scope": 1340, - "src": "6148:82:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 727, - "nodeType": "Block", - "src": "6285:215:0", - "statements": [ - { - "assignments": [ - 697 - ], - "declarations": [ - { - "constant": false, - "id": 697, - "name": "validators", - "nodeType": "VariableDeclaration", - "scope": 727, - "src": "6295:27:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 695, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "6295:7:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 696, - "length": null, - "nodeType": "ArrayTypeName", - "src": "6295:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 700, - "initialValue": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 698, - "name": "getValidators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 780, - "src": "6325:13:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_array$_t_address_$dyn_memory_ptr_$", - "typeString": "function () view returns (address[] memory)" - } - }, - "id": 699, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6325:15:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "6295:45:0" - }, - { - "body": { - "id": 723, - "nodeType": "Block", - "src": "6390:86:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 717, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 712, - "name": "validators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 697, - "src": "6408:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 714, - "indexExpression": { - "argumentTypes": null, - "id": 713, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 702, - "src": "6419:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6408:13:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 715, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13088, - "src": "6425:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 716, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "6425:10:0", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "src": "6408:27:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 722, - "nodeType": "IfStatement", - "src": "6404:61:0", - "trueBody": { - "expression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 720, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 718, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 702, - "src": "6460:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 719, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6464:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "6460:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 693, - "id": 721, - "nodeType": "Return", - "src": "6453:12:0" - } - } - ] - }, - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 708, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 705, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 702, - "src": "6367:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 706, - "name": "getParties", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 531, - 555 - ], - "referencedDeclaration": 531, - "src": "6371:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 707, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6371:12:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "6367:16:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 724, - "initializationExpression": { - "assignments": [ - 702 - ], - "declarations": [ - { - "constant": false, - "id": 702, - "name": "i", - "nodeType": "VariableDeclaration", - "scope": 724, - "src": "6355:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 701, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "6355:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 704, - "initialValue": { - "argumentTypes": null, - "hexValue": "30", - "id": 703, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6364:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "6355:10:0" - }, - "loopExpression": { - "expression": { - "argumentTypes": null, - "id": 710, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "6385:3:0", - "subExpression": { - "argumentTypes": null, - "id": 709, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 702, - "src": "6385:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 711, - "nodeType": "ExpressionStatement", - "src": "6385:3:0" - }, - "nodeType": "ForStatement", - "src": "6350:126:0" - }, - { - "expression": { - "argumentTypes": null, - "hexValue": "30", - "id": 725, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6492:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "functionReturnParameters": 693, - "id": 726, - "nodeType": "Return", - "src": "6485:8:0" - } - ] - }, - "documentation": null, - "id": 728, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getPartyId", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 690, - "nodeType": "ParameterList", - "parameters": [], - "src": "6255:2:0" - }, - "returnParameters": { - "id": 693, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 692, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 728, - "src": "6279:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 691, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "6279:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "6278:6:0" - }, - "scope": 1340, - "src": "6236:264:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 767, - "nodeType": "Block", - "src": "6568:214:0", - "statements": [ - { - "assignments": [ - 738 - ], - "declarations": [ - { - "constant": false, - "id": 738, - "name": "validators", - "nodeType": "VariableDeclaration", - "scope": 767, - "src": "6578:27:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 736, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "6578:7:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 737, - "length": null, - "nodeType": "ArrayTypeName", - "src": "6578:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 741, - "initialValue": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 739, - "name": "getNextValidators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 792, - "src": "6608:17:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_array$_t_address_$dyn_memory_ptr_$", - "typeString": "function () view returns (address[] memory)" - } - }, - "id": 740, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6608:19:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "6578:49:0" - }, - { - "body": { - "id": 763, - "nodeType": "Block", - "src": "6681:77:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 757, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 753, - "name": "validators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 738, - "src": "6699:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 755, - "indexExpression": { - "argumentTypes": null, - "id": 754, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 743, - "src": "6710:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6699:13:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "id": 756, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 730, - "src": "6716:1:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "6699:18:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 762, - "nodeType": "IfStatement", - "src": "6695:52:0", - "trueBody": { - "expression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 760, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 758, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 743, - "src": "6742:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 759, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6746:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "6742:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 734, - "id": 761, - "nodeType": "Return", - "src": "6735:12:0" - } - } - ] - }, - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 749, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 746, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 743, - "src": "6654:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 747, - "name": "getNextParties", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 541, - "src": "6658:14:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 748, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6658:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "6654:20:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 764, - "initializationExpression": { - "assignments": [ - 743 - ], - "declarations": [ - { - "constant": false, - "id": 743, - "name": "i", - "nodeType": "VariableDeclaration", - "scope": 764, - "src": "6642:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 742, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "6642:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 745, - "initialValue": { - "argumentTypes": null, - "hexValue": "30", - "id": 744, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6651:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "6642:10:0" - }, - "loopExpression": { - "expression": { - "argumentTypes": null, - "id": 751, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "6676:3:0", - "subExpression": { - "argumentTypes": null, - "id": 750, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 743, - "src": "6676:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 752, - "nodeType": "ExpressionStatement", - "src": "6676:3:0" - }, - "nodeType": "ForStatement", - "src": "6637:121:0" - }, - { - "expression": { - "argumentTypes": null, - "hexValue": "30", - "id": 765, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6774:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "functionReturnParameters": 734, - "id": 766, - "nodeType": "Return", - "src": "6767:8:0" - } - ] - }, - "documentation": null, - "id": 768, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getNextPartyId", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 731, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 730, - "name": "a", - "nodeType": "VariableDeclaration", - "scope": 768, - "src": "6530:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 729, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "6530:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "6529:11:0" - }, - "returnParameters": { - "id": 734, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 733, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 768, - "src": "6562:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 732, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "6562:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "6561:6:0" - }, - "scope": 1340, - "src": "6506:276:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 779, - "nodeType": "Block", - "src": "6852:48:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 774, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "6869:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 776, - "indexExpression": { - "argumentTypes": null, - "id": 775, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "6876:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6869:13:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 777, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "validators", - "nodeType": "MemberAccess", - "referencedDeclaration": 35, - "src": "6869:24:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "functionReturnParameters": 773, - "id": 778, - "nodeType": "Return", - "src": "6862:31:0" - } - ] - }, - "documentation": null, - "id": 780, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getValidators", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 769, - "nodeType": "ParameterList", - "parameters": [], - "src": "6810:2:0" - }, - "returnParameters": { - "id": 773, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 772, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 780, - "src": "6834:16:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 770, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "6834:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 771, - "length": null, - "nodeType": "ArrayTypeName", - "src": "6834:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "6833:18:0" - }, - "scope": 1340, - "src": "6788:112:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 791, - "nodeType": "Block", - "src": "6974:52:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 786, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "6991:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 788, - "indexExpression": { - "argumentTypes": null, - "id": 787, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "6998:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6991:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 789, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "validators", - "nodeType": "MemberAccess", - "referencedDeclaration": 35, - "src": "6991:28:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "functionReturnParameters": 785, - "id": 790, - "nodeType": "Return", - "src": "6984:35:0" - } - ] - }, - "documentation": null, - "id": 792, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getNextValidators", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 781, - "nodeType": "ParameterList", - "parameters": [], - "src": "6932:2:0" - }, - "returnParameters": { - "id": 785, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 784, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 792, - "src": "6956:16:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 782, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "6956:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 783, - "length": null, - "nodeType": "ArrayTypeName", - "src": "6956:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "6955:18:0" - }, - "scope": 1340, - "src": "6906:120:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 837, - "nodeType": "Block", - "src": "7093:296:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 800, - "name": "Vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 64, - "src": "7115:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", - "typeString": "type(enum Bridge.Vote)" - } - }, - "id": 801, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "START_VOTING", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "7115:17:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - ], - "id": 799, - "name": "tryVote", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1084, - 1109, - 1134, - 1164 - ], - "referencedDeclaration": 1084, - "src": "7107:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$returns$_t_bool_$", - "typeString": "function (enum Bridge.Vote) returns (bool)" - } - }, - "id": 802, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7107:26:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 836, - "nodeType": "IfStatement", - "src": "7103:280:0", - "trueBody": { - "id": 835, - "nodeType": "Block", - "src": "7135:248:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 804, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "7149:11:0", - "subExpression": { - "argumentTypes": null, - "id": 803, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "7149:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 805, - "nodeType": "ExpressionStatement", - "src": "7149:11:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 809, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 806, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 90, - "src": "7174:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 807, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 53, - "src": "7183:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$53_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 808, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "VOTING", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "7183:13:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "src": "7174:22:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "id": 810, - "nodeType": "ExpressionStatement", - "src": "7174:22:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 817, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 811, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "7210:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 813, - "indexExpression": { - "argumentTypes": null, - "id": 812, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "7217:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "7210:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 814, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "threshold", - "nodeType": "MemberAccess", - "referencedDeclaration": 37, - "src": "7210:27:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 815, - "name": "getThreshold", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 565, - 588 - ], - "referencedDeclaration": 565, - "src": "7240:12:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 816, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7240:14:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "7210:44:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 818, - "nodeType": "ExpressionStatement", - "src": "7210:44:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 825, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 819, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "7268:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 821, - "indexExpression": { - "argumentTypes": null, - "id": 820, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "7275:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "7268:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 822, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "validators", - "nodeType": "MemberAccess", - "referencedDeclaration": 35, - "src": "7268:28:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 823, - "name": "getValidators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 780, - "src": "7299:13:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_array$_t_address_$dyn_memory_ptr_$", - "typeString": "function () view returns (address[] memory)" - } - }, - "id": 824, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7299:15:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "src": "7268:46:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 826, - "nodeType": "ExpressionStatement", - "src": "7268:46:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 833, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 827, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "7328:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 829, - "indexExpression": { - "argumentTypes": null, - "id": 828, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "7335:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "7328:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 830, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "rangeSize", - "nodeType": "MemberAccess", - "referencedDeclaration": 39, - "src": "7328:27:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 831, - "name": "getRangeSize", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 621, - 644 - ], - "referencedDeclaration": 621, - "src": "7358:12:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 832, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7358:14:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "7328:44:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 834, - "nodeType": "ExpressionStatement", - "src": "7328:44:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 838, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 795, - "modifierName": { - "argumentTypes": null, - "id": 794, - "name": "readyOrVoting", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 213, - "src": "7062:13:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "7062:13:0" - }, - { - "arguments": null, - "id": 797, - "modifierName": { - "argumentTypes": null, - "id": 796, - "name": "currentValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 261, - "src": "7076:16:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "7076:16:0" - } - ], - "name": "startVoting", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 793, - "nodeType": "ParameterList", - "parameters": [], - "src": "7052:2:0" - }, - "returnParameters": { - "id": 798, - "nodeType": "ParameterList", - "parameters": [], - "src": "7093:0:0" - }, - "scope": 1340, - "src": "7032:357:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 871, - "nodeType": "Block", - "src": "7471:202:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 852, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 849, - "name": "validator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 840, - "src": "7504:9:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 848, - "name": "getNextPartyId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 768, - "src": "7489:14:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_uint256_$", - "typeString": "function (address) view returns (uint256)" - } - }, - "id": 850, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7489:25:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 851, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "7518:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "7489:30:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "416c726561647920612076616c696461746f72", - "id": 853, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "7521:21:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_aeb0fe100da2796aa6136a3b1c66282f002b435141be331237dfa7127e6df6ff", - "typeString": "literal_string \"Already a validator\"" - }, - "value": "Already a validator" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_aeb0fe100da2796aa6136a3b1c66282f002b435141be331237dfa7127e6df6ff", - "typeString": "literal_string \"Already a validator\"" - } - ], - "id": 847, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 13091, - 13092 - ], - "referencedDeclaration": 13092, - "src": "7481:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 854, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7481:62:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 855, - "nodeType": "ExpressionStatement", - "src": "7481:62:0" - }, - { - "condition": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 857, - "name": "Vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 64, - "src": "7566:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", - "typeString": "type(enum Bridge.Vote)" - } - }, - "id": 858, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "ADD_VALIDATOR", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "7566:18:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 859, - "name": "validator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 840, - "src": "7586:9:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 856, - "name": "tryVote", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1084, - 1109, - 1134, - 1164 - ], - "referencedDeclaration": 1109, - "src": "7558:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$_t_address_$returns$_t_bool_$", - "typeString": "function (enum Bridge.Vote,address) returns (bool)" - } - }, - "id": 860, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7558:38:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 870, - "nodeType": "IfStatement", - "src": "7554:113:0", - "trueBody": { - "id": 869, - "nodeType": "Block", - "src": "7598:69:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 866, - "name": "validator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 840, - "src": "7646:9:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 861, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "7612:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 863, - "indexExpression": { - "argumentTypes": null, - "id": 862, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "7619:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "7612:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 864, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "validators", - "nodeType": "MemberAccess", - "referencedDeclaration": 35, - "src": "7612:28:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 865, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "push", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "7612:33:0", - "typeDescriptions": { - "typeIdentifier": "t_function_arraypush_nonpayable$_t_address_$returns$_t_uint256_$", - "typeString": "function (address) returns (uint256)" - } - }, - "id": 867, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7612:44:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 868, - "nodeType": "ExpressionStatement", - "src": "7612:44:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 872, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 843, - "modifierName": { - "argumentTypes": null, - "id": 842, - "name": "voting", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 225, - "src": "7447:6:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "7447:6:0" - }, - { - "arguments": null, - "id": 845, - "modifierName": { - "argumentTypes": null, - "id": 844, - "name": "currentValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 261, - "src": "7454:16:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "7454:16:0" - } - ], - "name": "voteAddValidator", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 841, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 840, - "name": "validator", - "nodeType": "VariableDeclaration", - "scope": 872, - "src": "7421:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 839, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "7421:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "7420:19:0" - }, - "returnParameters": { - "id": 846, - "nodeType": "ParameterList", - "parameters": [], - "src": "7471:0:0" - }, - "scope": 1340, - "src": "7395:278:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 901, - "nodeType": "Block", - "src": "7758:192:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 886, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 883, - "name": "validator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 874, - "src": "7791:9:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 882, - "name": "getNextPartyId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 768, - "src": "7776:14:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_uint256_$", - "typeString": "function (address) view returns (uint256)" - } - }, - "id": 884, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7776:25:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 885, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "7805:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "7776:30:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "416c7265616479206e6f7420612076616c696461746f72", - "id": 887, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "7808:25:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_2332ed568e8af3d64f1f2b0b098c504cab97ba4128fb9f08cfa3f851ced05961", - "typeString": "literal_string \"Already not a validator\"" - }, - "value": "Already not a validator" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_2332ed568e8af3d64f1f2b0b098c504cab97ba4128fb9f08cfa3f851ced05961", - "typeString": "literal_string \"Already not a validator\"" - } - ], - "id": 881, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 13091, - 13092 - ], - "referencedDeclaration": 13092, - "src": "7768:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 888, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7768:66:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 889, - "nodeType": "ExpressionStatement", - "src": "7768:66:0" - }, - { - "condition": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 891, - "name": "Vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 64, - "src": "7857:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", - "typeString": "type(enum Bridge.Vote)" - } - }, - "id": 892, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "REMOVE_VALIDATOR", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "7857:21:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 893, - "name": "validator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 874, - "src": "7880:9:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 890, - "name": "tryVote", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1084, - 1109, - 1134, - 1164 - ], - "referencedDeclaration": 1109, - "src": "7849:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$_t_address_$returns$_t_bool_$", - "typeString": "function (enum Bridge.Vote,address) returns (bool)" - } - }, - "id": 894, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7849:41:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 900, - "nodeType": "IfStatement", - "src": "7845:99:0", - "trueBody": { - "id": 899, - "nodeType": "Block", - "src": "7892:52:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 896, - "name": "validator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 874, - "src": "7923:9:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 895, - "name": "_removeValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 967, - "src": "7906:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$", - "typeString": "function (address)" - } - }, - "id": 897, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7906:27:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 898, - "nodeType": "ExpressionStatement", - "src": "7906:27:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 902, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 877, - "modifierName": { - "argumentTypes": null, - "id": 876, - "name": "voting", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 225, - "src": "7734:6:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "7734:6:0" - }, - { - "arguments": null, - "id": 879, - "modifierName": { - "argumentTypes": null, - "id": 878, - "name": "currentValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 261, - "src": "7741:16:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "7741:16:0" - } - ], - "name": "voteRemoveValidator", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 875, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 874, - "name": "validator", - "nodeType": "VariableDeclaration", - "scope": 902, - "src": "7708:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 873, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "7708:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "7707:19:0" - }, - "returnParameters": { - "id": 880, - "nodeType": "ParameterList", - "parameters": [], - "src": "7758:0:0" - }, - "scope": 1340, - "src": "7679:271:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 966, - "nodeType": "Block", - "src": "8009:383:0", - "statements": [ - { - "body": { - "id": 946, - "nodeType": "Block", - "src": "8067:205:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 927, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 920, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "8085:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 922, - "indexExpression": { - "argumentTypes": null, - "id": 921, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "8092:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8085:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 923, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "validators", - "nodeType": "MemberAccess", - "referencedDeclaration": 35, - "src": "8085:28:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 925, - "indexExpression": { - "argumentTypes": null, - "id": 924, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 908, - "src": "8114:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8085:31:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "id": 926, - "name": "validator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 904, - "src": "8120:9:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "8085:44:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 945, - "nodeType": "IfStatement", - "src": "8081:181:0", - "trueBody": { - "id": 944, - "nodeType": "Block", - "src": "8131:131:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 941, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 928, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "8149:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 930, - "indexExpression": { - "argumentTypes": null, - "id": 929, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "8156:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8149:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 931, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "validators", - "nodeType": "MemberAccess", - "referencedDeclaration": 35, - "src": "8149:28:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 933, - "indexExpression": { - "argumentTypes": null, - "id": 932, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 908, - "src": "8178:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "8149:31:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 934, - "name": "getNextValidators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 792, - "src": "8183:17:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_array$_t_address_$dyn_memory_ptr_$", - "typeString": "function () view returns (address[] memory)" - } - }, - "id": 935, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8183:19:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 940, - "indexExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 939, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 936, - "name": "getNextParties", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 541, - "src": "8203:14:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 937, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8203:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 938, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8222:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "8203:20:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8183:41:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "8149:75:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 942, - "nodeType": "ExpressionStatement", - "src": "8149:75:0" - }, - { - "id": 943, - "nodeType": "Break", - "src": "8242:5:0" - } - ] - } - } - ] - }, - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 916, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 911, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 908, - "src": "8036:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 915, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 912, - "name": "getNextParties", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 541, - "src": "8040:14:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 913, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8040:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 914, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8059:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "8040:20:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "8036:24:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 947, - "initializationExpression": { - "assignments": [ - 908 - ], - "declarations": [ - { - "constant": false, - "id": 908, - "name": "i", - "nodeType": "VariableDeclaration", - "scope": 947, - "src": "8024:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 907, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "8024:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 910, - "initialValue": { - "argumentTypes": null, - "hexValue": "30", - "id": 909, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8033:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "8024:10:0" - }, - "loopExpression": { - "expression": { - "argumentTypes": null, - "id": 918, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "8062:3:0", - "subExpression": { - "argumentTypes": null, - "id": 917, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 908, - "src": "8062:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 919, - "nodeType": "ExpressionStatement", - "src": "8062:3:0" - }, - "nodeType": "ForStatement", - "src": "8019:253:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 957, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "delete", - "prefix": true, - "src": "8281:57:0", - "subExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 948, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "8288:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 950, - "indexExpression": { - "argumentTypes": null, - "id": 949, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "8295:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8288:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 951, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "validators", - "nodeType": "MemberAccess", - "referencedDeclaration": 35, - "src": "8288:28:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 956, - "indexExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 955, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 952, - "name": "getNextParties", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 541, - "src": "8317:14:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 953, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8317:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 954, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8336:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "8317:20:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "8288:50:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 958, - "nodeType": "ExpressionStatement", - "src": "8281:57:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 964, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "--", - "prefix": false, - "src": "8348:37:0", - "subExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 959, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "8348:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 961, - "indexExpression": { - "argumentTypes": null, - "id": 960, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "8355:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8348:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 962, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "validators", - "nodeType": "MemberAccess", - "referencedDeclaration": 35, - "src": "8348:28:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 963, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "8348:35:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 965, - "nodeType": "ExpressionStatement", - "src": "8348:37:0" - } - ] - }, - "documentation": null, - "id": 967, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "_removeValidator", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 905, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 904, - "name": "validator", - "nodeType": "VariableDeclaration", - "scope": 967, - "src": "7982:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 903, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "7982:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "7981:19:0" - }, - "returnParameters": { - "id": 906, - "nodeType": "ParameterList", - "parameters": [], - "src": "8009:0:0" - }, - "scope": 1340, - "src": "7956:436:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "private" - }, - { - "body": { - "id": 990, - "nodeType": "Block", - "src": "8474:127:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 977, - "name": "Vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 64, - "src": "8496:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", - "typeString": "type(enum Bridge.Vote)" - } - }, - "id": 978, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "CHANGE_THRESHOLD", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "8496:21:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 979, - "name": "threshold", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 969, - "src": "8519:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 976, - "name": "tryVote", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1084, - 1109, - 1134, - 1164 - ], - "referencedDeclaration": 1134, - "src": "8488:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$_t_uint256_$returns$_t_bool_$", - "typeString": "function (enum Bridge.Vote,uint256) returns (bool)" - } - }, - "id": 980, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8488:41:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 989, - "nodeType": "IfStatement", - "src": "8484:111:0", - "trueBody": { - "id": 988, - "nodeType": "Block", - "src": "8531:64:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 986, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 981, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "8545:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 983, - "indexExpression": { - "argumentTypes": null, - "id": 982, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "8552:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8545:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 984, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "threshold", - "nodeType": "MemberAccess", - "referencedDeclaration": 37, - "src": "8545:27:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 985, - "name": "threshold", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 969, - "src": "8575:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "8545:39:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 987, - "nodeType": "ExpressionStatement", - "src": "8545:39:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 991, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 972, - "modifierName": { - "argumentTypes": null, - "id": 971, - "name": "voting", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 225, - "src": "8450:6:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "8450:6:0" - }, - { - "arguments": null, - "id": 974, - "modifierName": { - "argumentTypes": null, - "id": 973, - "name": "currentValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 261, - "src": "8457:16:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "8457:16:0" - } - ], - "name": "voteChangeThreshold", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 970, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 969, - "name": "threshold", - "nodeType": "VariableDeclaration", - "scope": 991, - "src": "8427:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 968, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "8427:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "8426:16:0" - }, - "returnParameters": { - "id": 975, - "nodeType": "ParameterList", - "parameters": [], - "src": "8474:0:0" - }, - "scope": 1340, - "src": "8398:203:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 1014, - "nodeType": "Block", - "src": "8683:128:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1001, - "name": "Vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 64, - "src": "8705:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", - "typeString": "type(enum Bridge.Vote)" - } - }, - "id": 1002, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "CHANGE_RANGE_SIZE", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "8705:22:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 1003, - "name": "rangeSize", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 993, - "src": "8729:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 1000, - "name": "tryVote", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1084, - 1109, - 1134, - 1164 - ], - "referencedDeclaration": 1134, - "src": "8697:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$_t_uint256_$returns$_t_bool_$", - "typeString": "function (enum Bridge.Vote,uint256) returns (bool)" - } - }, - "id": 1004, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8697:42:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 1013, - "nodeType": "IfStatement", - "src": "8693:112:0", - "trueBody": { - "id": 1012, - "nodeType": "Block", - "src": "8741:64:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 1010, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1005, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "8755:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 1007, - "indexExpression": { - "argumentTypes": null, - "id": 1006, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "8762:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8755:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 1008, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "rangeSize", - "nodeType": "MemberAccess", - "referencedDeclaration": 39, - "src": "8755:27:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 1009, - "name": "rangeSize", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 993, - "src": "8785:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "8755:39:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 1011, - "nodeType": "ExpressionStatement", - "src": "8755:39:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 1015, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 996, - "modifierName": { - "argumentTypes": null, - "id": 995, - "name": "voting", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 225, - "src": "8659:6:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "8659:6:0" - }, - { - "arguments": null, - "id": 998, - "modifierName": { - "argumentTypes": null, - "id": 997, - "name": "currentValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 261, - "src": "8666:16:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "8666:16:0" - } - ], - "name": "voteChangeRangeSize", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 994, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 993, - "name": "rangeSize", - "nodeType": "VariableDeclaration", - "scope": 1015, - "src": "8636:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 992, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "8636:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "8635:16:0" - }, - "returnParameters": { - "id": 999, - "nodeType": "ParameterList", - "parameters": [], - "src": "8683:0:0" - }, - "scope": 1340, - "src": "8607:204:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 1038, - "nodeType": "Block", - "src": "8875:141:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1023, - "name": "Vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 64, - "src": "8897:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", - "typeString": "type(enum Bridge.Vote)" - } - }, - "id": 1024, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "START_KEYGEN", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "8897:17:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - ], - "id": 1022, - "name": "tryVote", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1084, - 1109, - 1134, - 1164 - ], - "referencedDeclaration": 1084, - "src": "8889:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$returns$_t_bool_$", - "typeString": "function (enum Bridge.Vote) returns (bool)" - } - }, - "id": 1025, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8889:26:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 1037, - "nodeType": "IfStatement", - "src": "8885:125:0", - "trueBody": { - "id": 1036, - "nodeType": "Block", - "src": "8917:93:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 1029, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 1026, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 90, - "src": "8931:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1027, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 53, - "src": "8940:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$53_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 1028, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "KEYGEN", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "8940:13:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "src": "8931:22:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "id": 1030, - "nodeType": "ExpressionStatement", - "src": "8931:22:0" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1032, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "8982:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 1033, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "8989:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 1031, - "name": "NewEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 14, - "src": "8973:8:0", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$returns$__$", - "typeString": "function (uint256,uint256)" - } - }, - "id": 1034, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8973:26:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 1035, - "nodeType": "EmitStatement", - "src": "8968:31:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 1039, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 1018, - "modifierName": { - "argumentTypes": null, - "id": 1017, - "name": "voting", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 225, - "src": "8851:6:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "8851:6:0" - }, - { - "arguments": null, - "id": 1020, - "modifierName": { - "argumentTypes": null, - "id": 1019, - "name": "currentValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 261, - "src": "8858:16:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "8858:16:0" - } - ], - "name": "voteStartKeygen", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1016, - "nodeType": "ParameterList", - "parameters": [], - "src": "8841:2:0" - }, - "returnParameters": { - "id": 1021, - "nodeType": "ParameterList", - "parameters": [], - "src": "8875:0:0" - }, - "scope": 1340, - "src": "8817:199:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 1061, - "nodeType": "Block", - "src": "9081:144:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1047, - "name": "Vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 64, - "src": "9103:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", - "typeString": "type(enum Bridge.Vote)" - } - }, - "id": 1048, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "CANCEL_KEYGEN", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "9103:18:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - ], - "id": 1046, - "name": "tryVote", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1084, - 1109, - 1134, - 1164 - ], - "referencedDeclaration": 1084, - "src": "9095:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$returns$_t_bool_$", - "typeString": "function (enum Bridge.Vote) returns (bool)" - } - }, - "id": 1049, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9095:27:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 1060, - "nodeType": "IfStatement", - "src": "9091:128:0", - "trueBody": { - "id": 1059, - "nodeType": "Block", - "src": "9124:95:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 1053, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 1050, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 90, - "src": "9138:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1051, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 53, - "src": "9147:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$53_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 1052, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "VOTING", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "9147:13:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "src": "9138:22:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "id": 1054, - "nodeType": "ExpressionStatement", - "src": "9138:22:0" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1056, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "9198:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 1055, - "name": "NewEpochCancelled", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 18, - "src": "9180:17:0", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$returns$__$", - "typeString": "function (uint256)" - } - }, - "id": 1057, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9180:28:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 1058, - "nodeType": "EmitStatement", - "src": "9175:33:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 1062, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 1042, - "modifierName": { - "argumentTypes": null, - "id": 1041, - "name": "keygen", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 237, - "src": "9057:6:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "9057:6:0" - }, - { - "arguments": null, - "id": 1044, - "modifierName": { - "argumentTypes": null, - "id": 1043, - "name": "currentValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 261, - "src": "9064:16:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "9064:16:0" - } - ], - "name": "voteCancelKeygen", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1040, - "nodeType": "ParameterList", - "parameters": [], - "src": "9047:2:0" - }, - "returnParameters": { - "id": 1045, - "nodeType": "ParameterList", - "parameters": [], - "src": "9081:0:0" - }, - "scope": 1340, - "src": "9022:203:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 1083, - "nodeType": "Block", - "src": "9286:110:0", - "statements": [ - { - "assignments": [ - 1070 - ], - "declarations": [ - { - "constant": false, - "id": 1070, - "name": "vote", - "nodeType": "VariableDeclaration", - "scope": 1083, - "src": "9296:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1069, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "9296:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 1078, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1074, - "name": "voteType", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1064, - "src": "9338:8:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 1075, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "9348:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 1072, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13075, - "src": "9321:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 1073, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "9321:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 1076, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9321:37:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 1071, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13082, - "src": "9311:9:0", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 1077, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9311:48:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "9296:63:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1080, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1070, - "src": "9384:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "id": 1079, - "name": "putVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1268, - "src": "9376:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$_t_bool_$", - "typeString": "function (bytes32) returns (bool)" - } - }, - "id": 1081, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9376:13:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "functionReturnParameters": 1068, - "id": 1082, - "nodeType": "Return", - "src": "9369:20:0" - } - ] - }, - "documentation": null, - "id": 1084, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "tryVote", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1065, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1064, - "name": "voteType", - "nodeType": "VariableDeclaration", - "scope": 1084, - "src": "9248:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - "typeName": { - "contractScope": null, - "id": 1063, - "name": "Vote", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 64, - "src": "9248:4:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "9247:15:0" - }, - "returnParameters": { - "id": 1068, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1067, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 1084, - "src": "9280:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 1066, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "9280:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "9279:6:0" - }, - "scope": 1340, - "src": "9231:165:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "private" - }, - { - "body": { - "id": 1108, - "nodeType": "Block", - "src": "9471:116:0", - "statements": [ - { - "assignments": [ - 1094 - ], - "declarations": [ - { - "constant": false, - "id": 1094, - "name": "vote", - "nodeType": "VariableDeclaration", - "scope": 1108, - "src": "9481:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1093, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "9481:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 1103, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1098, - "name": "voteType", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1086, - "src": "9523:8:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 1099, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "9533:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 1100, - "name": "addr", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1088, - "src": "9544:4:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "expression": { - "argumentTypes": null, - "id": 1096, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13075, - "src": "9506:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 1097, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "9506:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 1101, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9506:43:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 1095, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13082, - "src": "9496:9:0", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 1102, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9496:54:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "9481:69:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1105, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1094, - "src": "9575:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "id": 1104, - "name": "putVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1268, - "src": "9567:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$_t_bool_$", - "typeString": "function (bytes32) returns (bool)" - } - }, - "id": 1106, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9567:13:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "functionReturnParameters": 1092, - "id": 1107, - "nodeType": "Return", - "src": "9560:20:0" - } - ] - }, - "documentation": null, - "id": 1109, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "tryVote", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1089, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1086, - "name": "voteType", - "nodeType": "VariableDeclaration", - "scope": 1109, - "src": "9419:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - "typeName": { - "contractScope": null, - "id": 1085, - "name": "Vote", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 64, - "src": "9419:4:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 1088, - "name": "addr", - "nodeType": "VariableDeclaration", - "scope": 1109, - "src": "9434:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1087, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "9434:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "9418:29:0" - }, - "returnParameters": { - "id": 1092, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1091, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 1109, - "src": "9465:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 1090, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "9465:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "9464:6:0" - }, - "scope": 1340, - "src": "9402:185:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "private" - }, - { - "body": { - "id": 1133, - "nodeType": "Block", - "src": "9658:115:0", - "statements": [ - { - "assignments": [ - 1119 - ], - "declarations": [ - { - "constant": false, - "id": 1119, - "name": "vote", - "nodeType": "VariableDeclaration", - "scope": 1133, - "src": "9668:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1118, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "9668:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 1128, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1123, - "name": "voteType", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1111, - "src": "9710:8:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 1124, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "9720:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 1125, - "name": "num", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1113, - "src": "9731:3:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 1121, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13075, - "src": "9693:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 1122, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "9693:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 1126, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9693:42:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 1120, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13082, - "src": "9683:9:0", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 1127, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9683:53:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "9668:68:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1130, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1119, - "src": "9761:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "id": 1129, - "name": "putVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1268, - "src": "9753:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$_t_bool_$", - "typeString": "function (bytes32) returns (bool)" - } - }, - "id": 1131, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9753:13:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "functionReturnParameters": 1117, - "id": 1132, - "nodeType": "Return", - "src": "9746:20:0" - } - ] - }, - "documentation": null, - "id": 1134, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "tryVote", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1114, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1111, - "name": "voteType", - "nodeType": "VariableDeclaration", - "scope": 1134, - "src": "9610:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - "typeName": { - "contractScope": null, - "id": 1110, - "name": "Vote", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 64, - "src": "9610:4:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 1113, - "name": "num", - "nodeType": "VariableDeclaration", - "scope": 1134, - "src": "9625:8:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1112, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "9625:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "9609:25:0" - }, - "returnParameters": { - "id": 1117, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1116, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 1134, - "src": "9652:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 1115, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "9652:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "9651:6:0" - }, - "scope": 1340, - "src": "9593:180:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "private" - }, - { - "body": { - "id": 1163, - "nodeType": "Block", - "src": "9872:116:0", - "statements": [ - { - "assignments": [ - 1148 - ], - "declarations": [ - { - "constant": false, - "id": 1148, - "name": "vote", - "nodeType": "VariableDeclaration", - "scope": 1163, - "src": "9882:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1147, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "9882:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 1158, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1152, - "name": "voteType", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1136, - "src": "9924:8:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 1153, - "name": "hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1138, - "src": "9934:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "id": 1154, - "name": "to", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1140, - "src": "9940:2:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 1155, - "name": "value", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1142, - "src": "9944:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 1150, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13075, - "src": "9907:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 1151, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "9907:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 1156, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9907:43:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 1149, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13082, - "src": "9897:9:0", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 1157, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9897:54:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "9882:69:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1160, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1148, - "src": "9976:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "id": 1159, - "name": "putVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1268, - "src": "9968:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$_t_bool_$", - "typeString": "function (bytes32) returns (bool)" - } - }, - "id": 1161, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9968:13:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "functionReturnParameters": 1146, - "id": 1162, - "nodeType": "Return", - "src": "9961:20:0" - } - ] - }, - "documentation": null, - "id": 1164, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "tryVote", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1143, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1136, - "name": "voteType", - "nodeType": "VariableDeclaration", - "scope": 1164, - "src": "9796:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - "typeName": { - "contractScope": null, - "id": 1135, - "name": "Vote", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 64, - "src": "9796:4:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 1138, - "name": "hash", - "nodeType": "VariableDeclaration", - "scope": 1164, - "src": "9811:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1137, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "9811:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 1140, - "name": "to", - "nodeType": "VariableDeclaration", - "scope": 1164, - "src": "9825:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1139, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "9825:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 1142, - "name": "value", - "nodeType": "VariableDeclaration", - "scope": 1164, - "src": "9837:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1141, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "9837:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "9795:53:0" - }, - "returnParameters": { - "id": 1146, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1145, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 1164, - "src": "9866:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 1144, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "9866:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "9865:6:0" - }, - "scope": 1340, - "src": "9779:209:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "private" - }, - { - "body": { - "id": 1185, - "nodeType": "Block", - "src": "10052:113:0", - "statements": [ - { - "assignments": [ - 1172 - ], - "declarations": [ - { - "constant": false, - "id": 1172, - "name": "vote", - "nodeType": "VariableDeclaration", - "scope": 1185, - "src": "10062:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1171, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "10062:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 1180, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1176, - "name": "voteType", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1166, - "src": "10104:8:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 1177, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "10114:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 1174, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13075, - "src": "10087:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 1175, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "10087:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 1178, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10087:37:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 1173, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13082, - "src": "10077:9:0", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 1179, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10077:48:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "10062:63:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1182, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1172, - "src": "10153:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "id": 1181, - "name": "putConfirm", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1322, - "src": "10142:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$_t_bool_$", - "typeString": "function (bytes32) returns (bool)" - } - }, - "id": 1183, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10142:16:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "functionReturnParameters": 1170, - "id": 1184, - "nodeType": "Return", - "src": "10135:23:0" - } - ] - }, - "documentation": null, - "id": 1186, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "tryConfirm", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1167, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1166, - "name": "voteType", - "nodeType": "VariableDeclaration", - "scope": 1186, - "src": "10014:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - "typeName": { - "contractScope": null, - "id": 1165, - "name": "Vote", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 64, - "src": "10014:4:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "10013:15:0" - }, - "returnParameters": { - "id": 1170, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1169, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 1186, - "src": "10046:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 1168, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "10046:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "10045:6:0" - }, - "scope": 1340, - "src": "9994:171:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "private" - }, - { - "body": { - "id": 1213, - "nodeType": "Block", - "src": "10245:119:0", - "statements": [ - { - "assignments": [ - 1198 - ], - "declarations": [ - { - "constant": false, - "id": 1198, - "name": "vote", - "nodeType": "VariableDeclaration", - "scope": 1213, - "src": "10255:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1197, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "10255:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 1208, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1202, - "name": "voteType", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1188, - "src": "10297:8:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 1203, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "10307:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 1204, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1190, - "src": "10318:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 1205, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1192, - "src": "10321:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 1200, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13075, - "src": "10280:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 1201, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "10280:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 1206, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10280:43:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 1199, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13082, - "src": "10270:9:0", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 1207, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10270:54:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "10255:69:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1210, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1198, - "src": "10352:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "id": 1209, - "name": "putConfirm", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1322, - "src": "10341:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$_t_bool_$", - "typeString": "function (bytes32) returns (bool)" - } - }, - "id": 1211, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10341:16:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "functionReturnParameters": 1196, - "id": 1212, - "nodeType": "Return", - "src": "10334:23:0" - } - ] - }, - "documentation": null, - "id": 1214, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "tryConfirm", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1193, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1188, - "name": "voteType", - "nodeType": "VariableDeclaration", - "scope": 1214, - "src": "10191:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - "typeName": { - "contractScope": null, - "id": 1187, - "name": "Vote", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 64, - "src": "10191:4:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 1190, - "name": "x", - "nodeType": "VariableDeclaration", - "scope": 1214, - "src": "10206:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1189, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "10206:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 1192, - "name": "y", - "nodeType": "VariableDeclaration", - "scope": 1214, - "src": "10214:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1191, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "10214:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "10190:31:0" - }, - "returnParameters": { - "id": 1196, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1195, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 1214, - "src": "10239:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 1194, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "10239:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "10238:6:0" - }, - "scope": 1340, - "src": "10171:193:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "private" - }, - { - "body": { - "id": 1267, - "nodeType": "Block", - "src": "10424:355:0", - "statements": [ - { - "assignments": [ - 1222 - ], - "declarations": [ - { - "constant": false, - "id": 1222, - "name": "personalVote", - "nodeType": "VariableDeclaration", - "scope": 1267, - "src": "10434:20:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1221, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "10434:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 1226, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1224, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1216, - "src": "10473:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "id": 1223, - "name": "personalizeVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1339, - "src": "10457:15:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_bytes32_$", - "typeString": "function (bytes32) view returns (bytes32)" - } - }, - "id": 1225, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10457:21:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "10434:44:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1231, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "!", - "prefix": true, - "src": "10496:20:0", - "subExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1228, - "name": "votes", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 84, - "src": "10497:5:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - } - }, - "id": 1230, - "indexExpression": { - "argumentTypes": null, - "id": 1229, - "name": "personalVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1222, - "src": "10503:12:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "10497:19:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "566f74656420616c7265616479", - "id": 1232, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "10518:15:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_230c30109b60c15b21799291aaf5c571045da3dc3f224d8bbd2f2e688c149a47", - "typeString": "literal_string \"Voted already\"" - }, - "value": "Voted already" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_230c30109b60c15b21799291aaf5c571045da3dc3f224d8bbd2f2e688c149a47", - "typeString": "literal_string \"Voted already\"" - } - ], - "id": 1227, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 13091, - 13092 - ], - "referencedDeclaration": 13092, - "src": "10488:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 1233, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10488:46:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 1234, - "nodeType": "ExpressionStatement", - "src": "10488:46:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 1239, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1235, - "name": "votes", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 84, - "src": "10545:5:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - } - }, - "id": 1237, - "indexExpression": { - "argumentTypes": null, - "id": 1236, - "name": "personalVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1222, - "src": "10551:12:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "10545:19:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 1238, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "10567:4:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "src": "10545:26:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 1240, - "nodeType": "ExpressionStatement", - "src": "10545:26:0" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 1246, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1241, - "name": "votesCount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 80, - "src": "10585:10:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - } - }, - "id": 1243, - "indexExpression": { - "argumentTypes": null, - "id": 1242, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1216, - "src": "10596:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "10585:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 1244, - "name": "getThreshold", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 565, - 588 - ], - "referencedDeclaration": 565, - "src": "10605:12:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 1245, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10605:14:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "10585:34:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "id": 1265, - "nodeType": "Block", - "src": "10704:69:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 1261, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "10718:18:0", - "subExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1258, - "name": "votesCount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 80, - "src": "10718:10:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - } - }, - "id": 1260, - "indexExpression": { - "argumentTypes": null, - "id": 1259, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1216, - "src": "10729:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "10718:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 1262, - "nodeType": "ExpressionStatement", - "src": "10718:18:0" - }, - { - "expression": { - "argumentTypes": null, - "hexValue": "66616c7365", - "id": 1263, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "10757:5:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "false" - }, - "functionReturnParameters": 1220, - "id": 1264, - "nodeType": "Return", - "src": "10750:12:0" - } - ] - }, - "id": 1266, - "nodeType": "IfStatement", - "src": "10581:192:0", - "trueBody": { - "id": 1257, - "nodeType": "Block", - "src": "10621:77:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 1253, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1247, - "name": "votesCount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 80, - "src": "10635:10:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - } - }, - "id": 1249, - "indexExpression": { - "argumentTypes": null, - "id": 1248, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1216, - "src": "10646:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "10635:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_rational_57896044618658097711785492504343953926634992332820282019728792003956564819968_by_1", - "typeString": "int_const 5789...(69 digits omitted)...9968" - }, - "id": 1252, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "hexValue": "32", - "id": 1250, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "10654:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "nodeType": "BinaryOperation", - "operator": "**", - "rightExpression": { - "argumentTypes": null, - "hexValue": "323535", - "id": 1251, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "10659:3:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_255_by_1", - "typeString": "int_const 255" - }, - "value": "255" - }, - "src": "10654:8:0", - "typeDescriptions": { - "typeIdentifier": "t_rational_57896044618658097711785492504343953926634992332820282019728792003956564819968_by_1", - "typeString": "int_const 5789...(69 digits omitted)...9968" - } - }, - "src": "10635:27:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 1254, - "nodeType": "ExpressionStatement", - "src": "10635:27:0" - }, - { - "expression": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 1255, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "10683:4:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "functionReturnParameters": 1220, - "id": 1256, - "nodeType": "Return", - "src": "10676:11:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 1268, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "putVote", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1217, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1216, - "name": "vote", - "nodeType": "VariableDeclaration", - "scope": 1268, - "src": "10387:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1215, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "10387:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "10386:14:0" - }, - "returnParameters": { - "id": 1220, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1219, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 1268, - "src": "10418:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 1218, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "10418:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "10417:6:0" - }, - "scope": 1340, - "src": "10370:409:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "private" - }, - { - "body": { - "id": 1321, - "nodeType": "Block", - "src": "10842:363:0", - "statements": [ - { - "assignments": [ - 1276 - ], - "declarations": [ - { - "constant": false, - "id": 1276, - "name": "personalVote", - "nodeType": "VariableDeclaration", - "scope": 1321, - "src": "10852:20:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1275, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "10852:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 1280, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1278, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1270, - "src": "10891:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "id": 1277, - "name": "personalizeVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1339, - "src": "10875:15:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_bytes32_$", - "typeString": "function (bytes32) view returns (bytes32)" - } - }, - "id": 1279, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10875:21:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "10852:44:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1285, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "!", - "prefix": true, - "src": "10914:20:0", - "subExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1282, - "name": "votes", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 84, - "src": "10915:5:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - } - }, - "id": 1284, - "indexExpression": { - "argumentTypes": null, - "id": 1283, - "name": "personalVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1276, - "src": "10921:12:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "10915:19:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "436f6e6669726d656420616c7265616479", - "id": 1286, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "10936:19:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_762a97ce67d271844ad9c09d89a5271fde7fe7537af208da055a904cd67ac7bc", - "typeString": "literal_string \"Confirmed already\"" - }, - "value": "Confirmed already" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_762a97ce67d271844ad9c09d89a5271fde7fe7537af208da055a904cd67ac7bc", - "typeString": "literal_string \"Confirmed already\"" - } - ], - "id": 1281, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 13091, - 13092 - ], - "referencedDeclaration": 13092, - "src": "10906:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 1287, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10906:50:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 1288, - "nodeType": "ExpressionStatement", - "src": "10906:50:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 1293, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1289, - "name": "votes", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 84, - "src": "10967:5:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - } - }, - "id": 1291, - "indexExpression": { - "argumentTypes": null, - "id": 1290, - "name": "personalVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1276, - "src": "10973:12:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "10967:19:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 1292, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "10989:4:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "src": "10967:26:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 1294, - "nodeType": "ExpressionStatement", - "src": "10967:26:0" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 1300, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1295, - "name": "votesCount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 80, - "src": "11007:10:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - } - }, - "id": 1297, - "indexExpression": { - "argumentTypes": null, - "id": 1296, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1270, - "src": "11018:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "11007:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 1298, - "name": "getNextThreshold", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 575, - "src": "11027:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 1299, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "11027:18:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "11007:38:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "id": 1319, - "nodeType": "Block", - "src": "11130:69:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 1315, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "11144:18:0", - "subExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1312, - "name": "votesCount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 80, - "src": "11144:10:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - } - }, - "id": 1314, - "indexExpression": { - "argumentTypes": null, - "id": 1313, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1270, - "src": "11155:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "11144:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 1316, - "nodeType": "ExpressionStatement", - "src": "11144:18:0" - }, - { - "expression": { - "argumentTypes": null, - "hexValue": "66616c7365", - "id": 1317, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "11183:5:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "false" - }, - "functionReturnParameters": 1274, - "id": 1318, - "nodeType": "Return", - "src": "11176:12:0" - } - ] - }, - "id": 1320, - "nodeType": "IfStatement", - "src": "11003:196:0", - "trueBody": { - "id": 1311, - "nodeType": "Block", - "src": "11047:77:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 1307, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1301, - "name": "votesCount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 80, - "src": "11061:10:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - } - }, - "id": 1303, - "indexExpression": { - "argumentTypes": null, - "id": 1302, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1270, - "src": "11072:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "11061:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_rational_57896044618658097711785492504343953926634992332820282019728792003956564819968_by_1", - "typeString": "int_const 5789...(69 digits omitted)...9968" - }, - "id": 1306, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "hexValue": "32", - "id": 1304, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "11080:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "nodeType": "BinaryOperation", - "operator": "**", - "rightExpression": { - "argumentTypes": null, - "hexValue": "323535", - "id": 1305, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "11085:3:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_255_by_1", - "typeString": "int_const 255" - }, - "value": "255" - }, - "src": "11080:8:0", - "typeDescriptions": { - "typeIdentifier": "t_rational_57896044618658097711785492504343953926634992332820282019728792003956564819968_by_1", - "typeString": "int_const 5789...(69 digits omitted)...9968" - } - }, - "src": "11061:27:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 1308, - "nodeType": "ExpressionStatement", - "src": "11061:27:0" - }, - { - "expression": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 1309, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "11109:4:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "functionReturnParameters": 1274, - "id": 1310, - "nodeType": "Return", - "src": "11102:11:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 1322, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "putConfirm", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1271, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1270, - "name": "vote", - "nodeType": "VariableDeclaration", - "scope": 1322, - "src": "10805:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1269, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "10805:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "10804:14:0" - }, - "returnParameters": { - "id": 1274, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1273, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 1322, - "src": "10836:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 1272, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "10836:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "10835:6:0" - }, - "scope": 1340, - "src": "10785:420:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "private" - }, - { - "body": { - "id": 1338, - "nodeType": "Block", - "src": "11281:69:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1332, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1324, - "src": "11325:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1333, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13088, - "src": "11331:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 1334, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "11331:10:0", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - ], - "expression": { - "argumentTypes": null, - "id": 1330, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13075, - "src": "11308:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 1331, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "11308:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 1335, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "11308:34:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 1329, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13082, - "src": "11298:9:0", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 1336, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "11298:45:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "functionReturnParameters": 1328, - "id": 1337, - "nodeType": "Return", - "src": "11291:52:0" - } - ] - }, - "documentation": null, - "id": 1339, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "personalizeVote", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1325, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1324, - "name": "vote", - "nodeType": "VariableDeclaration", - "scope": 1339, - "src": "11236:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1323, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "11236:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "11235:14:0" - }, - "returnParameters": { - "id": 1328, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1327, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 1339, - "src": "11272:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1326, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "11272:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "11271:9:0" - }, - "scope": 1340, - "src": "11211:139:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "private" - } - ], - "scope": 1341, - "src": "93:11259:0" - } - ], - "src": "0:11353:0" - }, - "legacyAST": { - "absolutePath": "/build/contracts/Bridge.sol", - "exportedSymbols": { - "Bridge": [ - 1340 - ] - }, - "id": 1341, - "nodeType": "SourceUnit", - "nodes": [ - { - "id": 1, - "literals": [ - "solidity", - "^", - "0.5", - ".0" - ], - "nodeType": "PragmaDirective", - "src": "0:23:0" - }, - { - "absolutePath": "/build/contracts/openzeppelin-solidity/contracts/token/ERC20/IERC20.sol", - "file": "./openzeppelin-solidity/contracts/token/ERC20/IERC20.sol", - "id": 2, - "nodeType": "ImportDirective", - "scope": 1341, - "sourceUnit": 10033, - "src": "25:66:0", - "symbolAliases": [], - "unitAlias": "" - }, - { - "baseContracts": [], - "contractDependencies": [], - "contractKind": "contract", - "documentation": null, - "fullyImplemented": true, - "id": 1340, - "linearizedBaseContracts": [ - 1340 - ], - "name": "Bridge", - "nodeType": "ContractDefinition", - "nodes": [ - { - "anonymous": false, - "documentation": null, - "id": 8, - "name": "ExchangeRequest", - "nodeType": "EventDefinition", - "parameters": { - "id": 7, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4, - "indexed": false, - "name": "value", - "nodeType": "VariableDeclaration", - "scope": 8, - "src": "137:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 3, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "137:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 6, - "indexed": false, - "name": "nonce", - "nodeType": "VariableDeclaration", - "scope": 8, - "src": "149:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 5, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "149:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "136:24:0" - }, - "src": "115:46:0" - }, - { - "anonymous": false, - "documentation": null, - "id": 14, - "name": "NewEpoch", - "nodeType": "EventDefinition", - "parameters": { - "id": 13, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 10, - "indexed": true, - "name": "oldEpoch", - "nodeType": "VariableDeclaration", - "scope": 14, - "src": "181:21:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 9, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "181:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 12, - "indexed": true, - "name": "newEpoch", - "nodeType": "VariableDeclaration", - "scope": 14, - "src": "204:21:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 11, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "204:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "180:46:0" - }, - "src": "166:61:0" - }, - { - "anonymous": false, - "documentation": null, - "id": 18, - "name": "NewEpochCancelled", - "nodeType": "EventDefinition", - "parameters": { - "id": 17, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 16, - "indexed": true, - "name": "epoch", - "nodeType": "VariableDeclaration", - "scope": 18, - "src": "256:18:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 15, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "256:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "255:20:0" - }, - "src": "232:44:0" - }, - { - "anonymous": false, - "documentation": null, - "id": 24, - "name": "NewFundsTransfer", - "nodeType": "EventDefinition", - "parameters": { - "id": 23, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 20, - "indexed": true, - "name": "oldEpoch", - "nodeType": "VariableDeclaration", - "scope": 24, - "src": "304:21:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 19, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "304:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 22, - "indexed": true, - "name": "newEpoch", - "nodeType": "VariableDeclaration", - "scope": 24, - "src": "327:21:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 21, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "327:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "303:46:0" - }, - "src": "281:69:0" - }, - { - "anonymous": false, - "documentation": null, - "id": 32, - "name": "EpochStart", - "nodeType": "EventDefinition", - "parameters": { - "id": 31, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 26, - "indexed": true, - "name": "epoch", - "nodeType": "VariableDeclaration", - "scope": 32, - "src": "372:18:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 25, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "372:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 28, - "indexed": false, - "name": "x", - "nodeType": "VariableDeclaration", - "scope": 32, - "src": "392:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 27, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "392:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 30, - "indexed": false, - "name": "y", - "nodeType": "VariableDeclaration", - "scope": 32, - "src": "400:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 29, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "400:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "371:36:0" - }, - "src": "355:53:0" - }, - { - "canonicalName": "Bridge.State", - "id": 48, - "members": [ - { - "constant": false, - "id": 35, - "name": "validators", - "nodeType": "VariableDeclaration", - "scope": 48, - "src": "437:20:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 33, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "437:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 34, - "length": null, - "nodeType": "ArrayTypeName", - "src": "437:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 37, - "name": "threshold", - "nodeType": "VariableDeclaration", - "scope": 48, - "src": "467:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 36, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "467:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 39, - "name": "rangeSize", - "nodeType": "VariableDeclaration", - "scope": 48, - "src": "491:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 38, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "491:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 41, - "name": "startBlock", - "nodeType": "VariableDeclaration", - "scope": 48, - "src": "515:15:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 40, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "515:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 43, - "name": "nonce", - "nodeType": "VariableDeclaration", - "scope": 48, - "src": "540:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 42, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "540:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 45, - "name": "x", - "nodeType": "VariableDeclaration", - "scope": 48, - "src": "560:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 44, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "560:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 47, - "name": "y", - "nodeType": "VariableDeclaration", - "scope": 48, - "src": "576:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 46, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "576:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "name": "State", - "nodeType": "StructDefinition", - "scope": 1340, - "src": "414:175:0", - "visibility": "public" - }, - { - "canonicalName": "Bridge.Status", - "id": 53, - "members": [ - { - "id": 49, - "name": "READY", - "nodeType": "EnumValue", - "src": "617:5:0" - }, - { - "id": 50, - "name": "VOTING", - "nodeType": "EnumValue", - "src": "676:6:0" - }, - { - "id": 51, - "name": "KEYGEN", - "nodeType": "EnumValue", - "src": "746:6:0" - }, - { - "id": 52, - "name": "FUNDS_TRANSFER", - "nodeType": "EnumValue", - "src": "789:14:0" - } - ], - "name": "Status", - "nodeType": "EnumDefinition", - "src": "595:253:0" - }, - { - "canonicalName": "Bridge.Vote", - "id": 64, - "members": [ - { - "id": 54, - "name": "CONFIRM_KEYGEN", - "nodeType": "EnumValue", - "src": "874:14:0" - }, - { - "id": 55, - "name": "CONFIRM_FUNDS_TRANSFER", - "nodeType": "EnumValue", - "src": "898:22:0" - }, - { - "id": 56, - "name": "START_VOTING", - "nodeType": "EnumValue", - "src": "930:12:0" - }, - { - "id": 57, - "name": "ADD_VALIDATOR", - "nodeType": "EnumValue", - "src": "952:13:0" - }, - { - "id": 58, - "name": "REMOVE_VALIDATOR", - "nodeType": "EnumValue", - "src": "975:16:0" - }, - { - "id": 59, - "name": "CHANGE_THRESHOLD", - "nodeType": "EnumValue", - "src": "1001:16:0" - }, - { - "id": 60, - "name": "CHANGE_RANGE_SIZE", - "nodeType": "EnumValue", - "src": "1027:17:0" - }, - { - "id": 61, - "name": "START_KEYGEN", - "nodeType": "EnumValue", - "src": "1054:12:0" - }, - { - "id": 62, - "name": "CANCEL_KEYGEN", - "nodeType": "EnumValue", - "src": "1076:13:0" - }, - { - "id": 63, - "name": "TRANSFER", - "nodeType": "EnumValue", - "src": "1099:8:0" - } - ], - "name": "Vote", - "nodeType": "EnumDefinition", - "src": "854:259:0" - }, - { - "constant": false, - "id": 68, - "name": "states", - "nodeType": "VariableDeclaration", - "scope": 1340, - "src": "1119:29:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State)" - }, - "typeName": { - "id": 67, - "keyType": { - "id": 65, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1127:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Mapping", - "src": "1119:22:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State)" - }, - "valueType": { - "contractScope": null, - "id": 66, - "name": "State", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 48, - "src": "1135:5:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage_ptr", - "typeString": "struct Bridge.State" - } - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 72, - "name": "dbTransferCount", - "nodeType": "VariableDeclaration", - "scope": 1340, - "src": "1155:47:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - }, - "typeName": { - "id": 71, - "keyType": { - "id": 69, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1163:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Mapping", - "src": "1155:24:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - }, - "valueType": { - "id": 70, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1174:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 76, - "name": "dbTransfer", - "nodeType": "VariableDeclaration", - "scope": 1340, - "src": "1208:42:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - }, - "typeName": { - "id": 75, - "keyType": { - "id": 73, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1216:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Mapping", - "src": "1208:24:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - }, - "valueType": { - "id": 74, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "1227:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 80, - "name": "votesCount", - "nodeType": "VariableDeclaration", - "scope": 1340, - "src": "1256:42:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - }, - "typeName": { - "id": 79, - "keyType": { - "id": 77, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1264:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Mapping", - "src": "1256:24:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - }, - "valueType": { - "id": 78, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1275:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 84, - "name": "votes", - "nodeType": "VariableDeclaration", - "scope": 1340, - "src": "1304:37:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - }, - "typeName": { - "id": 83, - "keyType": { - "id": 81, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1312:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Mapping", - "src": "1304:24:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - }, - "valueType": { - "id": 82, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "1323:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 88, - "name": "usedRange", - "nodeType": "VariableDeclaration", - "scope": 1340, - "src": "1347:41:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - }, - "typeName": { - "id": 87, - "keyType": { - "id": 85, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1355:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Mapping", - "src": "1347:24:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - }, - "valueType": { - "id": 86, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "1366:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 90, - "name": "status", - "nodeType": "VariableDeclaration", - "scope": 1340, - "src": "1395:20:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - }, - "typeName": { - "contractScope": null, - "id": 89, - "name": "Status", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 53, - "src": "1395:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 92, - "name": "epoch", - "nodeType": "VariableDeclaration", - "scope": 1340, - "src": "1422:17:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 91, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1422:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 94, - "name": "nextEpoch", - "nodeType": "VariableDeclaration", - "scope": 1340, - "src": "1445:21:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 93, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1445:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 96, - "name": "minTxLimit", - "nodeType": "VariableDeclaration", - "scope": 1340, - "src": "1473:15:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 95, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1473:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 98, - "name": "maxTxLimit", - "nodeType": "VariableDeclaration", - "scope": 1340, - "src": "1494:15:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 97, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1494:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "body": { - "id": 181, - "nodeType": "Block", - "src": "1643:403:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 118, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 115, - "name": "validators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 103, - "src": "1661:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 116, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1661:17:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 117, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1681:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "1661:21:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 114, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 13091, - 13092 - ], - "referencedDeclaration": 13091, - "src": "1653:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 119, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1653:30:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 120, - "nodeType": "ExpressionStatement", - "src": "1653:30:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 125, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 122, - "name": "threshold", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 100, - "src": "1701:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 123, - "name": "validators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 103, - "src": "1713:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 124, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1713:17:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1701:29:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 121, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 13091, - 13092 - ], - "referencedDeclaration": 13091, - "src": "1693:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 126, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1693:38:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 127, - "nodeType": "ExpressionStatement", - "src": "1693:38:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 132, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 128, - "name": "tokenContract", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 184, - "src": "1742:13:0", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$10032", - "typeString": "contract IERC20" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 130, - "name": "_tokenContract", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 105, - "src": "1765:14:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 129, - "name": "IERC20", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 10032, - "src": "1758:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_IERC20_$10032_$", - "typeString": "type(contract IERC20)" - } - }, - "id": 131, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1758:22:0", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$10032", - "typeString": "contract IERC20" - } - }, - "src": "1742:38:0", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$10032", - "typeString": "contract IERC20" - } - }, - "id": 133, - "nodeType": "ExpressionStatement", - "src": "1742:38:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 136, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 134, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "1791:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "30", - "id": 135, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1799:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "1791:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 137, - "nodeType": "ExpressionStatement", - "src": "1791:9:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 141, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 138, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 90, - "src": "1810:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 139, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 53, - "src": "1819:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$53_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 140, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "KEYGEN", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1819:13:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "src": "1810:22:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "id": 142, - "nodeType": "ExpressionStatement", - "src": "1810:22:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 145, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 143, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "1842:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "31", - "id": 144, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1854:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "1842:13:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 146, - "nodeType": "ExpressionStatement", - "src": "1842:13:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 162, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 147, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "1866:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 149, - "indexExpression": { - "argumentTypes": null, - "id": 148, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "1873:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "1866:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 151, - "name": "validators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 103, - "src": "1892:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - { - "argumentTypes": null, - "id": 152, - "name": "threshold", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 100, - "src": "1904:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 153, - "name": "rangeSize", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 111, - "src": "1915:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "hexValue": "30", - "id": 154, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1926:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 157, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "-", - "prefix": true, - "src": "1934:2:0", - "subExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 156, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1935:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "typeDescriptions": { - "typeIdentifier": "t_rational_minus_1_by_1", - "typeString": "int_const -1" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_rational_minus_1_by_1", - "typeString": "int_const -1" - } - ], - "id": 155, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "1929:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_uint256_$", - "typeString": "type(uint256)" - }, - "typeName": "uint" - }, - "id": 158, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1929:8:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "hexValue": "30", - "id": 159, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1939:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - { - "argumentTypes": null, - "hexValue": "30", - "id": 160, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1942:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - } - ], - "id": 150, - "name": "State", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 48, - "src": "1886:5:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_struct$_State_$48_storage_ptr_$", - "typeString": "type(struct Bridge.State storage pointer)" - } - }, - "id": 161, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "structConstructorCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1886:58:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_memory", - "typeString": "struct Bridge.State memory" - } - }, - "src": "1866:78:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 163, - "nodeType": "ExpressionStatement", - "src": "1866:78:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 168, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 164, - "name": "minTxLimit", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 96, - "src": "1955:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 165, - "name": "limits", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 109, - "src": "1968:6:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_memory_ptr", - "typeString": "uint256[2] memory" - } - }, - "id": 167, - "indexExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 166, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1975:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "1968:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1955:22:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 169, - "nodeType": "ExpressionStatement", - "src": "1955:22:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 174, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 170, - "name": "maxTxLimit", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 98, - "src": "1987:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 171, - "name": "limits", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 109, - "src": "2000:6:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_memory_ptr", - "typeString": "uint256[2] memory" - } - }, - "id": 173, - "indexExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 172, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2007:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "2000:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1987:22:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 175, - "nodeType": "ExpressionStatement", - "src": "1987:22:0" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "hexValue": "30", - "id": 177, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2034:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - { - "argumentTypes": null, - "hexValue": "31", - "id": 178, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2037:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - } - ], - "id": 176, - "name": "NewEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 14, - "src": "2025:8:0", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$returns$__$", - "typeString": "function (uint256,uint256)" - } - }, - "id": 179, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2025:14:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 180, - "nodeType": "EmitStatement", - "src": "2020:19:0" - } - ] - }, - "documentation": null, - "id": 182, - "implemented": true, - "kind": "constructor", - "modifiers": [], - "name": "", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 112, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 100, - "name": "threshold", - "nodeType": "VariableDeclaration", - "scope": 182, - "src": "1528:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 99, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1528:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 103, - "name": "validators", - "nodeType": "VariableDeclaration", - "scope": 182, - "src": "1544:27:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 101, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1544:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 102, - "length": null, - "nodeType": "ArrayTypeName", - "src": "1544:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 105, - "name": "_tokenContract", - "nodeType": "VariableDeclaration", - "scope": 182, - "src": "1573:22:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 104, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1573:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 109, - "name": "limits", - "nodeType": "VariableDeclaration", - "scope": 182, - "src": "1597:21:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_memory_ptr", - "typeString": "uint256[2]" - }, - "typeName": { - "baseType": { - "id": 106, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1597:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 108, - "length": { - "argumentTypes": null, - "hexValue": "32", - "id": 107, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1602:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "nodeType": "ArrayTypeName", - "src": "1597:7:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_storage_ptr", - "typeString": "uint256[2]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 111, - "name": "rangeSize", - "nodeType": "VariableDeclaration", - "scope": 182, - "src": "1620:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 110, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1620:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1527:108:0" - }, - "returnParameters": { - "id": 113, - "nodeType": "ParameterList", - "parameters": [], - "src": "1643:0:0" - }, - "scope": 1340, - "src": "1516:530:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "constant": false, - "id": 184, - "name": "tokenContract", - "nodeType": "VariableDeclaration", - "scope": 1340, - "src": "2052:27:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$10032", - "typeString": "contract IERC20" - }, - "typeName": { - "contractScope": null, - "id": 183, - "name": "IERC20", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 10032, - "src": "2052:6:0", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$10032", - "typeString": "contract IERC20" - } - }, - "value": null, - "visibility": "public" - }, - { - "body": { - "id": 195, - "nodeType": "Block", - "src": "2101:81:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - }, - "id": 190, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 187, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 90, - "src": "2119:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 188, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 53, - "src": "2129:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$53_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 189, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "READY", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2129:12:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "src": "2119:22:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4e6f7420696e207265616479207374617465", - "id": 191, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2143:20:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_965c39c15b78dbcd8a954511641ca86e15fc1ae6d6c30a67536872ccde75b679", - "typeString": "literal_string \"Not in ready state\"" - }, - "value": "Not in ready state" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_965c39c15b78dbcd8a954511641ca86e15fc1ae6d6c30a67536872ccde75b679", - "typeString": "literal_string \"Not in ready state\"" - } - ], - "id": 186, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 13091, - 13092 - ], - "referencedDeclaration": 13092, - "src": "2111:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 192, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2111:53:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 193, - "nodeType": "ExpressionStatement", - "src": "2111:53:0" - }, - { - "id": 194, - "nodeType": "PlaceholderStatement", - "src": "2174:1:0" - } - ] - }, - "documentation": null, - "id": 196, - "name": "ready", - "nodeType": "ModifierDefinition", - "parameters": { - "id": 185, - "nodeType": "ParameterList", - "parameters": [], - "src": "2101:0:0" - }, - "src": "2086:96:0", - "visibility": "internal" - }, - { - "body": { - "id": 212, - "nodeType": "Block", - "src": "2211:118:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 207, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - }, - "id": 202, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 199, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 90, - "src": "2229:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 200, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 53, - "src": "2239:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$53_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 201, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "READY", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2239:12:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "src": "2229:22:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "||", - "rightExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - }, - "id": 206, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 203, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 90, - "src": "2255:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 204, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 53, - "src": "2265:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$53_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 205, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "VOTING", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2265:13:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "src": "2255:23:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "2229:49:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4e6f7420696e207265616479206f7220766f74696e67207374617465", - "id": 208, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2280:30:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_7e3f7359baa731593d4e3921720b92600c22ed1d950d208e0c826ad2eddebe96", - "typeString": "literal_string \"Not in ready or voting state\"" - }, - "value": "Not in ready or voting state" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_7e3f7359baa731593d4e3921720b92600c22ed1d950d208e0c826ad2eddebe96", - "typeString": "literal_string \"Not in ready or voting state\"" - } - ], - "id": 198, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 13091, - 13092 - ], - "referencedDeclaration": 13092, - "src": "2221:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 209, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2221:90:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 210, - "nodeType": "ExpressionStatement", - "src": "2221:90:0" - }, - { - "id": 211, - "nodeType": "PlaceholderStatement", - "src": "2321:1:0" - } - ] - }, - "documentation": null, - "id": 213, - "name": "readyOrVoting", - "nodeType": "ModifierDefinition", - "parameters": { - "id": 197, - "nodeType": "ParameterList", - "parameters": [], - "src": "2211:0:0" - }, - "src": "2188:141:0", - "visibility": "internal" - }, - { - "body": { - "id": 224, - "nodeType": "Block", - "src": "2351:83:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - }, - "id": 219, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 216, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 90, - "src": "2369:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 217, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 53, - "src": "2379:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$53_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 218, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "VOTING", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2379:13:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "src": "2369:23:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4e6f7420696e20766f74696e67207374617465", - "id": 220, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2394:21:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_0cbee9834b110b21e0730bf5c3d2972fb9867ff221df239e7ae60883592f05d1", - "typeString": "literal_string \"Not in voting state\"" - }, - "value": "Not in voting state" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_0cbee9834b110b21e0730bf5c3d2972fb9867ff221df239e7ae60883592f05d1", - "typeString": "literal_string \"Not in voting state\"" - } - ], - "id": 215, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 13091, - 13092 - ], - "referencedDeclaration": 13092, - "src": "2361:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 221, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2361:55:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 222, - "nodeType": "ExpressionStatement", - "src": "2361:55:0" - }, - { - "id": 223, - "nodeType": "PlaceholderStatement", - "src": "2426:1:0" - } - ] - }, - "documentation": null, - "id": 225, - "name": "voting", - "nodeType": "ModifierDefinition", - "parameters": { - "id": 214, - "nodeType": "ParameterList", - "parameters": [], - "src": "2351:0:0" - }, - "src": "2335:99:0", - "visibility": "internal" - }, - { - "body": { - "id": 236, - "nodeType": "Block", - "src": "2456:83:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - }, - "id": 231, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 228, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 90, - "src": "2474:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 229, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 53, - "src": "2484:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$53_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 230, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "KEYGEN", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2484:13:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "src": "2474:23:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4e6f7420696e206b657967656e207374617465", - "id": 232, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2499:21:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_ed0fee6382e0651a224348a21558d03a4a439c3bd5edc24945894a3417c14010", - "typeString": "literal_string \"Not in keygen state\"" - }, - "value": "Not in keygen state" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_ed0fee6382e0651a224348a21558d03a4a439c3bd5edc24945894a3417c14010", - "typeString": "literal_string \"Not in keygen state\"" - } - ], - "id": 227, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 13091, - 13092 - ], - "referencedDeclaration": 13092, - "src": "2466:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 233, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2466:55:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 234, - "nodeType": "ExpressionStatement", - "src": "2466:55:0" - }, - { - "id": 235, - "nodeType": "PlaceholderStatement", - "src": "2531:1:0" - } - ] - }, - "documentation": null, - "id": 237, - "name": "keygen", - "nodeType": "ModifierDefinition", - "parameters": { - "id": 226, - "nodeType": "ParameterList", - "parameters": [], - "src": "2456:0:0" - }, - "src": "2440:99:0", - "visibility": "internal" - }, - { - "body": { - "id": 248, - "nodeType": "Block", - "src": "2568:99:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - }, - "id": 243, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 240, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 90, - "src": "2586:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 241, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 53, - "src": "2596:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$53_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 242, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "FUNDS_TRANSFER", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2596:21:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "src": "2586:31:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4e6f7420696e2066756e6473207472616e73666572207374617465", - "id": 244, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2619:29:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_6347c9fecd6f58520ad10dfd1347ce3dc42cc0eed7a4182ca64dd11c69fc3008", - "typeString": "literal_string \"Not in funds transfer state\"" - }, - "value": "Not in funds transfer state" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_6347c9fecd6f58520ad10dfd1347ce3dc42cc0eed7a4182ca64dd11c69fc3008", - "typeString": "literal_string \"Not in funds transfer state\"" - } - ], - "id": 239, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 13091, - 13092 - ], - "referencedDeclaration": 13092, - "src": "2578:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 245, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2578:71:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 246, - "nodeType": "ExpressionStatement", - "src": "2578:71:0" - }, - { - "id": 247, - "nodeType": "PlaceholderStatement", - "src": "2659:1:0" - } - ] - }, - "documentation": null, - "id": 249, - "name": "fundsTransfer", - "nodeType": "ModifierDefinition", - "parameters": { - "id": 238, - "nodeType": "ParameterList", - "parameters": [], - "src": "2568:0:0" - }, - "src": "2545:122:0", - "visibility": "internal" - }, - { - "body": { - "id": 260, - "nodeType": "Block", - "src": "2699:81:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 255, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 252, - "name": "getPartyId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 728, - "src": "2717:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 253, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2717:12:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 254, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2733:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "2717:17:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4e6f7420612063757272656e742076616c696461746f72", - "id": 256, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2736:25:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_8dc18d5bb1361900b9758b388df331056e31071cae84b276c0f03794c4dc634a", - "typeString": "literal_string \"Not a current validator\"" - }, - "value": "Not a current validator" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_8dc18d5bb1361900b9758b388df331056e31071cae84b276c0f03794c4dc634a", - "typeString": "literal_string \"Not a current validator\"" - } - ], - "id": 251, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 13091, - 13092 - ], - "referencedDeclaration": 13092, - "src": "2709:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 257, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2709:53:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 258, - "nodeType": "ExpressionStatement", - "src": "2709:53:0" - }, - { - "id": 259, - "nodeType": "PlaceholderStatement", - "src": "2772:1:0" - } - ] - }, - "documentation": null, - "id": 261, - "name": "currentValidator", - "nodeType": "ModifierDefinition", - "parameters": { - "id": 250, - "nodeType": "ParameterList", - "parameters": [], - "src": "2699:0:0" - }, - "src": "2673:107:0", - "visibility": "internal" - }, - { - "body": { - "id": 343, - "nodeType": "Block", - "src": "2829:475:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 281, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 277, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 271, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 269, - "name": "value", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 263, - "src": "2847:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">=", - "rightExpression": { - "argumentTypes": null, - "id": 270, - "name": "minTxLimit", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 96, - "src": "2856:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2847:19:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "&&", - "rightExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 276, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 272, - "name": "value", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 263, - "src": "2870:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">=", - "rightExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_rational_10000000000_by_1", - "typeString": "int_const 10000000000" - }, - "id": 275, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "hexValue": "3130", - "id": 273, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2879:2:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_10_by_1", - "typeString": "int_const 10" - }, - "value": "10" - }, - "nodeType": "BinaryOperation", - "operator": "**", - "rightExpression": { - "argumentTypes": null, - "hexValue": "3130", - "id": 274, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2885:2:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_10_by_1", - "typeString": "int_const 10" - }, - "value": "10" - }, - "src": "2879:8:0", - "typeDescriptions": { - "typeIdentifier": "t_rational_10000000000_by_1", - "typeString": "int_const 10000000000" - } - }, - "src": "2870:17:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "2847:40:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "&&", - "rightExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 280, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 278, - "name": "value", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 263, - "src": "2891:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<=", - "rightExpression": { - "argumentTypes": null, - "id": 279, - "name": "maxTxLimit", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 98, - "src": "2900:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2891:19:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "2847:63:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 268, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 13091, - 13092 - ], - "referencedDeclaration": 13091, - "src": "2839:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 282, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2839:72:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 283, - "nodeType": "ExpressionStatement", - "src": "2839:72:0" - }, - { - "assignments": [ - 285 - ], - "declarations": [ - { - "constant": false, - "id": 285, - "name": "txRange", - "nodeType": "VariableDeclaration", - "scope": 343, - "src": "2922:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 284, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "2922:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 295, - "initialValue": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 294, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "components": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 290, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 286, - "name": "block", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13078, - "src": "2938:5:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_block", - "typeString": "block" - } - }, - "id": 287, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "number", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2938:12:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 288, - "name": "getStartBlock", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 598, - 611 - ], - "referencedDeclaration": 598, - "src": "2953:13:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 289, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2953:15:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2938:30:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "id": 291, - "isConstant": false, - "isInlineArray": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "TupleExpression", - "src": "2937:32:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "/", - "rightExpression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 292, - "name": "getRangeSize", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 621, - 644 - ], - "referencedDeclaration": 621, - "src": "2972:12:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 293, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2972:14:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2937:49:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "2922:64:0" - }, - { - "condition": { - "argumentTypes": null, - "id": 305, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "!", - "prefix": true, - "src": "3000:55:0", - "subExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 296, - "name": "usedRange", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 88, - "src": "3001:9:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - } - }, - "id": 304, - "indexExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 300, - "name": "txRange", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 285, - "src": "3038:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 301, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "3047:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 298, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13075, - "src": "3021:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 299, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3021:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 302, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3021:32:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 297, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13082, - "src": "3011:9:0", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 303, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3011:43:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3001:54:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 325, - "nodeType": "IfStatement", - "src": "2996:182:0", - "trueBody": { - "id": 324, - "nodeType": "Block", - "src": "3057:121:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 316, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 306, - "name": "usedRange", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 88, - "src": "3071:9:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - } - }, - "id": 314, - "indexExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 310, - "name": "txRange", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 285, - "src": "3108:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 311, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "3117:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 308, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13075, - "src": "3091:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 309, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3091:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 312, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3091:32:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 307, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13082, - "src": "3081:9:0", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 313, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3081:43:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "3071:54:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 315, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3128:4:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "src": "3071:61:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 317, - "nodeType": "ExpressionStatement", - "src": "3071:61:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 322, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "3146:21:0", - "subExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 318, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "3146:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 320, - "indexExpression": { - "argumentTypes": null, - "id": 319, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "3153:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3146:13:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 321, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "nonce", - "nodeType": "MemberAccess", - "referencedDeclaration": 43, - "src": "3146:19:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 323, - "nodeType": "ExpressionStatement", - "src": "3146:21:0" - } - ] - } - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 329, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13088, - "src": "3215:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 330, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3215:10:0", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 332, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13104, - "src": "3235:4:0", - "typeDescriptions": { - "typeIdentifier": "t_contract$_Bridge_$1340", - "typeString": "contract Bridge" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_Bridge_$1340", - "typeString": "contract Bridge" - } - ], - "id": 331, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "3227:7:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 333, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3227:13:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 334, - "name": "value", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 263, - "src": "3242:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 326, - "name": "tokenContract", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 184, - "src": "3188:13:0", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$10032", - "typeString": "contract IERC20" - } - }, - "id": 328, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "transferFrom", - "nodeType": "MemberAccess", - "referencedDeclaration": 10015, - "src": "3188:26:0", - "typeDescriptions": { - "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$_t_bool_$", - "typeString": "function (address,address,uint256) external returns (bool)" - } - }, - "id": 335, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3188:60:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 336, - "nodeType": "ExpressionStatement", - "src": "3188:60:0" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 338, - "name": "value", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 263, - "src": "3279:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 339, - "name": "getNonce", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 654, - 667 - ], - "referencedDeclaration": 654, - "src": "3286:8:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 340, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3286:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 337, - "name": "ExchangeRequest", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 8, - "src": "3263:15:0", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$returns$__$", - "typeString": "function (uint256,uint256)" - } - }, - "id": 341, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3263:34:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 342, - "nodeType": "EmitStatement", - "src": "3258:39:0" - } - ] - }, - "documentation": null, - "id": 344, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 266, - "modifierName": { - "argumentTypes": null, - "id": 265, - "name": "ready", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 196, - "src": "2823:5:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "2823:5:0" - } - ], - "name": "exchange", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 264, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 263, - "name": "value", - "nodeType": "VariableDeclaration", - "scope": 344, - "src": "2804:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 262, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "2804:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2803:12:0" - }, - "returnParameters": { - "id": 267, - "nodeType": "ParameterList", - "parameters": [], - "src": "2829:0:0" - }, - "scope": 1340, - "src": "2786:518:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 373, - "nodeType": "Block", - "src": "3404:119:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 358, - "name": "Vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 64, - "src": "3426:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", - "typeString": "type(enum Bridge.Vote)" - } - }, - "id": 359, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "TRANSFER", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3426:13:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 360, - "name": "hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 346, - "src": "3441:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "id": 361, - "name": "to", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 348, - "src": "3447:2:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 362, - "name": "value", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 350, - "src": "3451:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 357, - "name": "tryVote", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1084, - 1109, - 1134, - 1164 - ], - "referencedDeclaration": 1164, - "src": "3418:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$_t_bytes32_$_t_address_$_t_uint256_$returns$_t_bool_$", - "typeString": "function (enum Bridge.Vote,bytes32,address,uint256) returns (bool)" - } - }, - "id": 363, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3418:39:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 372, - "nodeType": "IfStatement", - "src": "3414:103:0", - "trueBody": { - "id": 371, - "nodeType": "Block", - "src": "3459:58:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 367, - "name": "to", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 348, - "src": "3496:2:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 368, - "name": "value", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 350, - "src": "3500:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 364, - "name": "tokenContract", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 184, - "src": "3473:13:0", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$10032", - "typeString": "contract IERC20" - } - }, - "id": 366, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "transfer", - "nodeType": "MemberAccess", - "referencedDeclaration": 9986, - "src": "3473:22:0", - "typeDescriptions": { - "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$_t_bool_$", - "typeString": "function (address,uint256) external returns (bool)" - } - }, - "id": 369, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3473:33:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 370, - "nodeType": "ExpressionStatement", - "src": "3473:33:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 374, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 353, - "modifierName": { - "argumentTypes": null, - "id": 352, - "name": "readyOrVoting", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 213, - "src": "3373:13:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "3373:13:0" - }, - { - "arguments": null, - "id": 355, - "modifierName": { - "argumentTypes": null, - "id": 354, - "name": "currentValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 261, - "src": "3387:16:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "3387:16:0" - } - ], - "name": "transfer", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 351, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 346, - "name": "hash", - "nodeType": "VariableDeclaration", - "scope": 374, - "src": "3328:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 345, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "3328:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 348, - "name": "to", - "nodeType": "VariableDeclaration", - "scope": 374, - "src": "3342:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 347, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "3342:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 350, - "name": "value", - "nodeType": "VariableDeclaration", - "scope": 374, - "src": "3354:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 349, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "3354:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "3327:38:0" - }, - "returnParameters": { - "id": 356, - "nodeType": "ParameterList", - "parameters": [], - "src": "3404:0:0" - }, - "scope": 1340, - "src": "3310:213:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 464, - "nodeType": "Block", - "src": "3582:638:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 389, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 385, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13088, - "src": "3615:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 386, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3615:10:0", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - ], - "id": 384, - "name": "getNextPartyId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 768, - "src": "3600:14:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_uint256_$", - "typeString": "function (address) view returns (uint256)" - } - }, - "id": 387, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3600:26:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 388, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3630:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "3600:31:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4e6f742061206e6578742076616c696461746f72", - "id": 390, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3633:22:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_44981c92ce908443b2fa5f878c54791e1a0c95d4cc04ea4f4d9224b3ec030922", - "typeString": "literal_string \"Not a next validator\"" - }, - "value": "Not a next validator" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_44981c92ce908443b2fa5f878c54791e1a0c95d4cc04ea4f4d9224b3ec030922", - "typeString": "literal_string \"Not a next validator\"" - } - ], - "id": 383, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 13091, - 13092 - ], - "referencedDeclaration": 13092, - "src": "3592:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 391, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3592:64:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 392, - "nodeType": "ExpressionStatement", - "src": "3592:64:0" - }, - { - "condition": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 394, - "name": "Vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 64, - "src": "3682:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", - "typeString": "type(enum Bridge.Vote)" - } - }, - "id": 395, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "CONFIRM_KEYGEN", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3682:19:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 396, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 376, - "src": "3703:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 397, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 378, - "src": "3706:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 393, - "name": "tryConfirm", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1186, - 1214 - ], - "referencedDeclaration": 1214, - "src": "3671:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$_t_uint256_$_t_uint256_$returns$_t_bool_$", - "typeString": "function (enum Bridge.Vote,uint256,uint256) returns (bool)" - } - }, - "id": 398, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3671:37:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 463, - "nodeType": "IfStatement", - "src": "3667:547:0", - "trueBody": { - "id": 462, - "nodeType": "Block", - "src": "3710:504:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 404, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 399, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "3724:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 401, - "indexExpression": { - "argumentTypes": null, - "id": 400, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "3731:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3724:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 402, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "x", - "nodeType": "MemberAccess", - "referencedDeclaration": 45, - "src": "3724:19:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 403, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 376, - "src": "3746:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3724:23:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 405, - "nodeType": "ExpressionStatement", - "src": "3724:23:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 411, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 406, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "3761:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 408, - "indexExpression": { - "argumentTypes": null, - "id": 407, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "3768:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3761:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 409, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "y", - "nodeType": "MemberAccess", - "referencedDeclaration": 47, - "src": "3761:19:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 410, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 378, - "src": "3783:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3761:23:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 412, - "nodeType": "ExpressionStatement", - "src": "3761:23:0" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 415, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 413, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "3802:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 414, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3815:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "3802:14:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "id": 460, - "nodeType": "Block", - "src": "4084:120:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 453, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 450, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 90, - "src": "4102:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 451, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 53, - "src": "4111:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$53_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 452, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "FUNDS_TRANSFER", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4111:21:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "src": "4102:30:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "id": 454, - "nodeType": "ExpressionStatement", - "src": "4102:30:0" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 456, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "4172:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 457, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "4179:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 455, - "name": "NewFundsTransfer", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 24, - "src": "4155:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$returns$__$", - "typeString": "function (uint256,uint256)" - } - }, - "id": 458, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4155:34:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 459, - "nodeType": "EmitStatement", - "src": "4150:39:0" - } - ] - }, - "id": 461, - "nodeType": "IfStatement", - "src": "3798:406:0", - "trueBody": { - "id": 449, - "nodeType": "Block", - "src": "3818:248:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 419, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 416, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 90, - "src": "3836:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 417, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 53, - "src": "3845:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$53_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 418, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "READY", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3845:12:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "src": "3836:21:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "id": 420, - "nodeType": "ExpressionStatement", - "src": "3836:21:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 427, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 421, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "3875:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 423, - "indexExpression": { - "argumentTypes": null, - "id": 422, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "3882:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3875:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 424, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "startBlock", - "nodeType": "MemberAccess", - "referencedDeclaration": 41, - "src": "3875:28:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 425, - "name": "block", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13078, - "src": "3906:5:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_block", - "typeString": "block" - } - }, - "id": 426, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "number", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3906:12:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3875:43:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 428, - "nodeType": "ExpressionStatement", - "src": "3875:43:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 437, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 429, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "3936:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 431, - "indexExpression": { - "argumentTypes": null, - "id": 430, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "3943:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3936:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 432, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "nonce", - "nodeType": "MemberAccess", - "referencedDeclaration": 43, - "src": "3936:23:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 435, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "-", - "prefix": true, - "src": "3967:2:0", - "subExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 434, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3968:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "typeDescriptions": { - "typeIdentifier": "t_rational_minus_1_by_1", - "typeString": "int_const -1" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_rational_minus_1_by_1", - "typeString": "int_const -1" - } - ], - "id": 433, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "3962:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_uint256_$", - "typeString": "type(uint256)" - }, - "typeName": "uint" - }, - "id": 436, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3962:8:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3936:34:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 438, - "nodeType": "ExpressionStatement", - "src": "3936:34:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 441, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 439, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "3988:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 440, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "3996:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3988:17:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 442, - "nodeType": "ExpressionStatement", - "src": "3988:17:0" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 444, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "4039:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 445, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 376, - "src": "4046:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 446, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 378, - "src": "4049:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 443, - "name": "EpochStart", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 32, - "src": "4028:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$_t_uint256_$returns$__$", - "typeString": "function (uint256,uint256,uint256)" - } - }, - "id": 447, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4028:23:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 448, - "nodeType": "EmitStatement", - "src": "4023:28:0" - } - ] - } - } - ] - } - } - ] - }, - "documentation": null, - "id": 465, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 381, - "modifierName": { - "argumentTypes": null, - "id": 380, - "name": "keygen", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 237, - "src": "3575:6:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "3575:6:0" - } - ], - "name": "confirmKeygen", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 379, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 376, - "name": "x", - "nodeType": "VariableDeclaration", - "scope": 465, - "src": "3552:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 375, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "3552:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 378, - "name": "y", - "nodeType": "VariableDeclaration", - "scope": 465, - "src": "3560:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 377, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "3560:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "3551:16:0" - }, - "returnParameters": { - "id": 382, - "nodeType": "ParameterList", - "parameters": [], - "src": "3582:0:0" - }, - "scope": 1340, - "src": "3529:691:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 520, - "nodeType": "Block", - "src": "4296:368:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 475, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 473, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "4314:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 474, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4322:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "4314:9:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "46697273742065706f636820646f6573206e6f74206e6565642066756e6473207472616e73666572", - "id": 476, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4325:42:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_8ddae2cc9da30ed8c59c39c6a950ef823ea484ac89ff6f37abb0317fb5f679a1", - "typeString": "literal_string \"First epoch does not need funds transfer\"" - }, - "value": "First epoch does not need funds transfer" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_8ddae2cc9da30ed8c59c39c6a950ef823ea484ac89ff6f37abb0317fb5f679a1", - "typeString": "literal_string \"First epoch does not need funds transfer\"" - } - ], - "id": 472, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 13091, - 13092 - ], - "referencedDeclaration": 13092, - "src": "4306:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 477, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4306:62:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 478, - "nodeType": "ExpressionStatement", - "src": "4306:62:0" - }, - { - "condition": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 480, - "name": "Vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 64, - "src": "4394:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", - "typeString": "type(enum Bridge.Vote)" - } - }, - "id": 481, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "CONFIRM_FUNDS_TRANSFER", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4394:27:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - ], - "id": 479, - "name": "tryConfirm", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1186, - 1214 - ], - "referencedDeclaration": 1186, - "src": "4383:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$returns$_t_bool_$", - "typeString": "function (enum Bridge.Vote) returns (bool)" - } - }, - "id": 482, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4383:39:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 519, - "nodeType": "IfStatement", - "src": "4379:279:0", - "trueBody": { - "id": 518, - "nodeType": "Block", - "src": "4424:234:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 486, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 483, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 90, - "src": "4438:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 484, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 53, - "src": "4447:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$53_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 485, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "READY", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4447:12:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "src": "4438:21:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "id": 487, - "nodeType": "ExpressionStatement", - "src": "4438:21:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 494, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 488, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "4473:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 490, - "indexExpression": { - "argumentTypes": null, - "id": 489, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "4480:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4473:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 491, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "startBlock", - "nodeType": "MemberAccess", - "referencedDeclaration": 41, - "src": "4473:28:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 492, - "name": "block", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13078, - "src": "4504:5:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_block", - "typeString": "block" - } - }, - "id": 493, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "number", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4504:12:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4473:43:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 495, - "nodeType": "ExpressionStatement", - "src": "4473:43:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 504, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 496, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "4530:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 498, - "indexExpression": { - "argumentTypes": null, - "id": 497, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "4537:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4530:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 499, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "nonce", - "nodeType": "MemberAccess", - "referencedDeclaration": 43, - "src": "4530:23:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 502, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "-", - "prefix": true, - "src": "4561:2:0", - "subExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 501, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4562:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "typeDescriptions": { - "typeIdentifier": "t_rational_minus_1_by_1", - "typeString": "int_const -1" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_rational_minus_1_by_1", - "typeString": "int_const -1" - } - ], - "id": 500, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "4556:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_uint256_$", - "typeString": "type(uint256)" - }, - "typeName": "uint" - }, - "id": 503, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4556:8:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4530:34:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 505, - "nodeType": "ExpressionStatement", - "src": "4530:34:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 508, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 506, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "4578:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 507, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "4586:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4578:17:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 509, - "nodeType": "ExpressionStatement", - "src": "4578:17:0" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 511, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "4625:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 512, - "name": "getX", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 678, - "src": "4632:4:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 513, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4632:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 514, - "name": "getY", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 689, - "src": "4640:4:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 515, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4640:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 510, - "name": "EpochStart", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 32, - "src": "4614:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$_t_uint256_$returns$__$", - "typeString": "function (uint256,uint256,uint256)" - } - }, - "id": 516, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4614:33:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 517, - "nodeType": "EmitStatement", - "src": "4609:38:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 521, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 468, - "modifierName": { - "argumentTypes": null, - "id": 467, - "name": "fundsTransfer", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 249, - "src": "4265:13:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "4265:13:0" - }, - { - "arguments": null, - "id": 470, - "modifierName": { - "argumentTypes": null, - "id": 469, - "name": "currentValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 261, - "src": "4279:16:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "4279:16:0" - } - ], - "name": "confirmFundsTransfer", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 466, - "nodeType": "ParameterList", - "parameters": [], - "src": "4255:2:0" - }, - "returnParameters": { - "id": 471, - "nodeType": "ParameterList", - "parameters": [], - "src": "4296:0:0" - }, - "scope": 1340, - "src": "4226:438:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 530, - "nodeType": "Block", - "src": "4719:41:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 527, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "4747:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 526, - "name": "getParties", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 531, - 555 - ], - "referencedDeclaration": 555, - "src": "4736:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256) view returns (uint256)" - } - }, - "id": 528, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4736:17:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 525, - "id": 529, - "nodeType": "Return", - "src": "4729:24:0" - } - ] - }, - "documentation": null, - "id": 531, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getParties", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 522, - "nodeType": "ParameterList", - "parameters": [], - "src": "4689:2:0" - }, - "returnParameters": { - "id": 525, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 524, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 531, - "src": "4713:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 523, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "4713:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4712:6:0" - }, - "scope": 1340, - "src": "4670:90:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 540, - "nodeType": "Block", - "src": "4819:45:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 537, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "4847:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 536, - "name": "getParties", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 531, - 555 - ], - "referencedDeclaration": 555, - "src": "4836:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256) view returns (uint256)" - } - }, - "id": 538, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4836:21:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 535, - "id": 539, - "nodeType": "Return", - "src": "4829:28:0" - } - ] - }, - "documentation": null, - "id": 541, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getNextParties", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 532, - "nodeType": "ParameterList", - "parameters": [], - "src": "4789:2:0" - }, - "returnParameters": { - "id": 535, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 534, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 541, - "src": "4813:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 533, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "4813:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4812:6:0" - }, - "scope": 1340, - "src": "4766:98:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 554, - "nodeType": "Block", - "src": "4930:56:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 548, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "4947:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 550, - "indexExpression": { - "argumentTypes": null, - "id": 549, - "name": "_epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 543, - "src": "4954:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4947:14:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 551, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "validators", - "nodeType": "MemberAccess", - "referencedDeclaration": 35, - "src": "4947:25:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 552, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4947:32:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 547, - "id": 553, - "nodeType": "Return", - "src": "4940:39:0" - } - ] - }, - "documentation": null, - "id": 555, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getParties", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 544, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 543, - "name": "_epoch", - "nodeType": "VariableDeclaration", - "scope": 555, - "src": "4890:11:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 542, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "4890:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4889:13:0" - }, - "returnParameters": { - "id": 547, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 546, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 555, - "src": "4924:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 545, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "4924:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4923:6:0" - }, - "scope": 1340, - "src": "4870:116:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 564, - "nodeType": "Block", - "src": "5043:43:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 561, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "5073:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 560, - "name": "getThreshold", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 565, - 588 - ], - "referencedDeclaration": 588, - "src": "5060:12:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256) view returns (uint256)" - } - }, - "id": 562, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5060:19:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 559, - "id": 563, - "nodeType": "Return", - "src": "5053:26:0" - } - ] - }, - "documentation": null, - "id": 565, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getThreshold", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 556, - "nodeType": "ParameterList", - "parameters": [], - "src": "5013:2:0" - }, - "returnParameters": { - "id": 559, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 558, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 565, - "src": "5037:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 557, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5037:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5036:6:0" - }, - "scope": 1340, - "src": "4992:94:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 574, - "nodeType": "Block", - "src": "5147:47:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 571, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "5177:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 570, - "name": "getThreshold", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 565, - 588 - ], - "referencedDeclaration": 588, - "src": "5164:12:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256) view returns (uint256)" - } - }, - "id": 572, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5164:23:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 569, - "id": 573, - "nodeType": "Return", - "src": "5157:30:0" - } - ] - }, - "documentation": null, - "id": 575, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getNextThreshold", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 566, - "nodeType": "ParameterList", - "parameters": [], - "src": "5117:2:0" - }, - "returnParameters": { - "id": 569, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 568, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 575, - "src": "5141:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 567, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5141:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5140:6:0" - }, - "scope": 1340, - "src": "5092:102:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 587, - "nodeType": "Block", - "src": "5262:48:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 582, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "5279:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 584, - "indexExpression": { - "argumentTypes": null, - "id": 583, - "name": "_epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 577, - "src": "5286:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "5279:14:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 585, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "threshold", - "nodeType": "MemberAccess", - "referencedDeclaration": 37, - "src": "5279:24:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 581, - "id": 586, - "nodeType": "Return", - "src": "5272:31:0" - } - ] - }, - "documentation": null, - "id": 588, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getThreshold", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 578, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 577, - "name": "_epoch", - "nodeType": "VariableDeclaration", - "scope": 588, - "src": "5222:11:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 576, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5222:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5221:13:0" - }, - "returnParameters": { - "id": 581, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 580, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 588, - "src": "5256:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 579, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5256:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5255:6:0" - }, - "scope": 1340, - "src": "5200:110:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 597, - "nodeType": "Block", - "src": "5368:44:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 594, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "5399:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 593, - "name": "getStartBlock", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 598, - 611 - ], - "referencedDeclaration": 611, - "src": "5385:13:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256) view returns (uint256)" - } - }, - "id": 595, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5385:20:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 592, - "id": 596, - "nodeType": "Return", - "src": "5378:27:0" - } - ] - }, - "documentation": null, - "id": 598, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getStartBlock", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 589, - "nodeType": "ParameterList", - "parameters": [], - "src": "5338:2:0" - }, - "returnParameters": { - "id": 592, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 591, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 598, - "src": "5362:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 590, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5362:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5361:6:0" - }, - "scope": 1340, - "src": "5316:96:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 610, - "nodeType": "Block", - "src": "5481:49:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 605, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "5498:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 607, - "indexExpression": { - "argumentTypes": null, - "id": 606, - "name": "_epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 600, - "src": "5505:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "5498:14:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 608, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "startBlock", - "nodeType": "MemberAccess", - "referencedDeclaration": 41, - "src": "5498:25:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 604, - "id": 609, - "nodeType": "Return", - "src": "5491:32:0" - } - ] - }, - "documentation": null, - "id": 611, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getStartBlock", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 601, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 600, - "name": "_epoch", - "nodeType": "VariableDeclaration", - "scope": 611, - "src": "5441:11:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 599, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5441:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5440:13:0" - }, - "returnParameters": { - "id": 604, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 603, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 611, - "src": "5475:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 602, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5475:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5474:6:0" - }, - "scope": 1340, - "src": "5418:112:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 620, - "nodeType": "Block", - "src": "5587:43:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 617, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "5617:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 616, - "name": "getRangeSize", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 621, - 644 - ], - "referencedDeclaration": 644, - "src": "5604:12:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256) view returns (uint256)" - } - }, - "id": 618, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5604:19:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 615, - "id": 619, - "nodeType": "Return", - "src": "5597:26:0" - } - ] - }, - "documentation": null, - "id": 621, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getRangeSize", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 612, - "nodeType": "ParameterList", - "parameters": [], - "src": "5557:2:0" - }, - "returnParameters": { - "id": 615, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 614, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 621, - "src": "5581:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 613, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5581:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5580:6:0" - }, - "scope": 1340, - "src": "5536:94:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 630, - "nodeType": "Block", - "src": "5691:47:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 627, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "5721:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 626, - "name": "getRangeSize", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 621, - 644 - ], - "referencedDeclaration": 644, - "src": "5708:12:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256) view returns (uint256)" - } - }, - "id": 628, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5708:23:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 625, - "id": 629, - "nodeType": "Return", - "src": "5701:30:0" - } - ] - }, - "documentation": null, - "id": 631, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getNextRangeSize", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 622, - "nodeType": "ParameterList", - "parameters": [], - "src": "5661:2:0" - }, - "returnParameters": { - "id": 625, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 624, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 631, - "src": "5685:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 623, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5685:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5684:6:0" - }, - "scope": 1340, - "src": "5636:102:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 643, - "nodeType": "Block", - "src": "5806:48:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 638, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "5823:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 640, - "indexExpression": { - "argumentTypes": null, - "id": 639, - "name": "_epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 633, - "src": "5830:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "5823:14:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 641, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "rangeSize", - "nodeType": "MemberAccess", - "referencedDeclaration": 39, - "src": "5823:24:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 637, - "id": 642, - "nodeType": "Return", - "src": "5816:31:0" - } - ] - }, - "documentation": null, - "id": 644, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getRangeSize", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 634, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 633, - "name": "_epoch", - "nodeType": "VariableDeclaration", - "scope": 644, - "src": "5766:11:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 632, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5766:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5765:13:0" - }, - "returnParameters": { - "id": 637, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 636, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 644, - "src": "5800:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 635, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5800:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5799:6:0" - }, - "scope": 1340, - "src": "5744:110:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 653, - "nodeType": "Block", - "src": "5907:39:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 650, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "5933:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 649, - "name": "getNonce", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 654, - 667 - ], - "referencedDeclaration": 667, - "src": "5924:8:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256) view returns (uint256)" - } - }, - "id": 651, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5924:15:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 648, - "id": 652, - "nodeType": "Return", - "src": "5917:22:0" - } - ] - }, - "documentation": null, - "id": 654, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getNonce", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 645, - "nodeType": "ParameterList", - "parameters": [], - "src": "5877:2:0" - }, - "returnParameters": { - "id": 648, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 647, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 654, - "src": "5901:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 646, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5901:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5900:6:0" - }, - "scope": 1340, - "src": "5860:86:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 666, - "nodeType": "Block", - "src": "6010:44:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 661, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "6027:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 663, - "indexExpression": { - "argumentTypes": null, - "id": 662, - "name": "_epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 656, - "src": "6034:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6027:14:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 664, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "nonce", - "nodeType": "MemberAccess", - "referencedDeclaration": 43, - "src": "6027:20:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 660, - "id": 665, - "nodeType": "Return", - "src": "6020:27:0" - } - ] - }, - "documentation": null, - "id": 667, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getNonce", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 657, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 656, - "name": "_epoch", - "nodeType": "VariableDeclaration", - "scope": 667, - "src": "5970:11:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 655, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5970:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5969:13:0" - }, - "returnParameters": { - "id": 660, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 659, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 667, - "src": "6004:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 658, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "6004:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "6003:6:0" - }, - "scope": 1340, - "src": "5952:102:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 677, - "nodeType": "Block", - "src": "6103:39:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 672, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "6120:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 674, - "indexExpression": { - "argumentTypes": null, - "id": 673, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "6127:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6120:13:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 675, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "x", - "nodeType": "MemberAccess", - "referencedDeclaration": 45, - "src": "6120:15:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 671, - "id": 676, - "nodeType": "Return", - "src": "6113:22:0" - } - ] - }, - "documentation": null, - "id": 678, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getX", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 668, - "nodeType": "ParameterList", - "parameters": [], - "src": "6073:2:0" - }, - "returnParameters": { - "id": 671, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 670, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 678, - "src": "6097:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 669, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "6097:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "6096:6:0" - }, - "scope": 1340, - "src": "6060:82:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 688, - "nodeType": "Block", - "src": "6191:39:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 683, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "6208:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 685, - "indexExpression": { - "argumentTypes": null, - "id": 684, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "6215:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6208:13:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 686, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "y", - "nodeType": "MemberAccess", - "referencedDeclaration": 47, - "src": "6208:15:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 682, - "id": 687, - "nodeType": "Return", - "src": "6201:22:0" - } - ] - }, - "documentation": null, - "id": 689, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getY", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 679, - "nodeType": "ParameterList", - "parameters": [], - "src": "6161:2:0" - }, - "returnParameters": { - "id": 682, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 681, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 689, - "src": "6185:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 680, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "6185:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "6184:6:0" - }, - "scope": 1340, - "src": "6148:82:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 727, - "nodeType": "Block", - "src": "6285:215:0", - "statements": [ - { - "assignments": [ - 697 - ], - "declarations": [ - { - "constant": false, - "id": 697, - "name": "validators", - "nodeType": "VariableDeclaration", - "scope": 727, - "src": "6295:27:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 695, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "6295:7:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 696, - "length": null, - "nodeType": "ArrayTypeName", - "src": "6295:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 700, - "initialValue": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 698, - "name": "getValidators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 780, - "src": "6325:13:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_array$_t_address_$dyn_memory_ptr_$", - "typeString": "function () view returns (address[] memory)" - } - }, - "id": 699, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6325:15:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "6295:45:0" - }, - { - "body": { - "id": 723, - "nodeType": "Block", - "src": "6390:86:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 717, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 712, - "name": "validators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 697, - "src": "6408:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 714, - "indexExpression": { - "argumentTypes": null, - "id": 713, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 702, - "src": "6419:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6408:13:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 715, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13088, - "src": "6425:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 716, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "6425:10:0", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "src": "6408:27:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 722, - "nodeType": "IfStatement", - "src": "6404:61:0", - "trueBody": { - "expression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 720, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 718, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 702, - "src": "6460:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 719, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6464:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "6460:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 693, - "id": 721, - "nodeType": "Return", - "src": "6453:12:0" - } - } - ] - }, - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 708, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 705, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 702, - "src": "6367:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 706, - "name": "getParties", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 531, - 555 - ], - "referencedDeclaration": 531, - "src": "6371:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 707, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6371:12:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "6367:16:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 724, - "initializationExpression": { - "assignments": [ - 702 - ], - "declarations": [ - { - "constant": false, - "id": 702, - "name": "i", - "nodeType": "VariableDeclaration", - "scope": 724, - "src": "6355:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 701, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "6355:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 704, - "initialValue": { - "argumentTypes": null, - "hexValue": "30", - "id": 703, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6364:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "6355:10:0" - }, - "loopExpression": { - "expression": { - "argumentTypes": null, - "id": 710, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "6385:3:0", - "subExpression": { - "argumentTypes": null, - "id": 709, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 702, - "src": "6385:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 711, - "nodeType": "ExpressionStatement", - "src": "6385:3:0" - }, - "nodeType": "ForStatement", - "src": "6350:126:0" - }, - { - "expression": { - "argumentTypes": null, - "hexValue": "30", - "id": 725, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6492:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "functionReturnParameters": 693, - "id": 726, - "nodeType": "Return", - "src": "6485:8:0" - } - ] - }, - "documentation": null, - "id": 728, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getPartyId", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 690, - "nodeType": "ParameterList", - "parameters": [], - "src": "6255:2:0" - }, - "returnParameters": { - "id": 693, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 692, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 728, - "src": "6279:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 691, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "6279:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "6278:6:0" - }, - "scope": 1340, - "src": "6236:264:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 767, - "nodeType": "Block", - "src": "6568:214:0", - "statements": [ - { - "assignments": [ - 738 - ], - "declarations": [ - { - "constant": false, - "id": 738, - "name": "validators", - "nodeType": "VariableDeclaration", - "scope": 767, - "src": "6578:27:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 736, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "6578:7:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 737, - "length": null, - "nodeType": "ArrayTypeName", - "src": "6578:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 741, - "initialValue": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 739, - "name": "getNextValidators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 792, - "src": "6608:17:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_array$_t_address_$dyn_memory_ptr_$", - "typeString": "function () view returns (address[] memory)" - } - }, - "id": 740, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6608:19:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "6578:49:0" - }, - { - "body": { - "id": 763, - "nodeType": "Block", - "src": "6681:77:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 757, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 753, - "name": "validators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 738, - "src": "6699:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 755, - "indexExpression": { - "argumentTypes": null, - "id": 754, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 743, - "src": "6710:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6699:13:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "id": 756, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 730, - "src": "6716:1:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "6699:18:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 762, - "nodeType": "IfStatement", - "src": "6695:52:0", - "trueBody": { - "expression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 760, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 758, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 743, - "src": "6742:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 759, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6746:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "6742:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 734, - "id": 761, - "nodeType": "Return", - "src": "6735:12:0" - } - } - ] - }, - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 749, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 746, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 743, - "src": "6654:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 747, - "name": "getNextParties", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 541, - "src": "6658:14:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 748, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6658:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "6654:20:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 764, - "initializationExpression": { - "assignments": [ - 743 - ], - "declarations": [ - { - "constant": false, - "id": 743, - "name": "i", - "nodeType": "VariableDeclaration", - "scope": 764, - "src": "6642:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 742, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "6642:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 745, - "initialValue": { - "argumentTypes": null, - "hexValue": "30", - "id": 744, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6651:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "6642:10:0" - }, - "loopExpression": { - "expression": { - "argumentTypes": null, - "id": 751, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "6676:3:0", - "subExpression": { - "argumentTypes": null, - "id": 750, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 743, - "src": "6676:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 752, - "nodeType": "ExpressionStatement", - "src": "6676:3:0" - }, - "nodeType": "ForStatement", - "src": "6637:121:0" - }, - { - "expression": { - "argumentTypes": null, - "hexValue": "30", - "id": 765, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6774:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "functionReturnParameters": 734, - "id": 766, - "nodeType": "Return", - "src": "6767:8:0" - } - ] - }, - "documentation": null, - "id": 768, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getNextPartyId", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 731, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 730, - "name": "a", - "nodeType": "VariableDeclaration", - "scope": 768, - "src": "6530:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 729, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "6530:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "6529:11:0" - }, - "returnParameters": { - "id": 734, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 733, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 768, - "src": "6562:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 732, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "6562:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "6561:6:0" - }, - "scope": 1340, - "src": "6506:276:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 779, - "nodeType": "Block", - "src": "6852:48:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 774, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "6869:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 776, - "indexExpression": { - "argumentTypes": null, - "id": 775, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "6876:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6869:13:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 777, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "validators", - "nodeType": "MemberAccess", - "referencedDeclaration": 35, - "src": "6869:24:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "functionReturnParameters": 773, - "id": 778, - "nodeType": "Return", - "src": "6862:31:0" - } - ] - }, - "documentation": null, - "id": 780, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getValidators", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 769, - "nodeType": "ParameterList", - "parameters": [], - "src": "6810:2:0" - }, - "returnParameters": { - "id": 773, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 772, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 780, - "src": "6834:16:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 770, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "6834:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 771, - "length": null, - "nodeType": "ArrayTypeName", - "src": "6834:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "6833:18:0" - }, - "scope": 1340, - "src": "6788:112:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 791, - "nodeType": "Block", - "src": "6974:52:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 786, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "6991:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 788, - "indexExpression": { - "argumentTypes": null, - "id": 787, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "6998:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6991:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 789, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "validators", - "nodeType": "MemberAccess", - "referencedDeclaration": 35, - "src": "6991:28:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "functionReturnParameters": 785, - "id": 790, - "nodeType": "Return", - "src": "6984:35:0" - } - ] - }, - "documentation": null, - "id": 792, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getNextValidators", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 781, - "nodeType": "ParameterList", - "parameters": [], - "src": "6932:2:0" - }, - "returnParameters": { - "id": 785, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 784, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 792, - "src": "6956:16:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 782, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "6956:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 783, - "length": null, - "nodeType": "ArrayTypeName", - "src": "6956:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "6955:18:0" - }, - "scope": 1340, - "src": "6906:120:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 837, - "nodeType": "Block", - "src": "7093:296:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 800, - "name": "Vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 64, - "src": "7115:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", - "typeString": "type(enum Bridge.Vote)" - } - }, - "id": 801, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "START_VOTING", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "7115:17:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - ], - "id": 799, - "name": "tryVote", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1084, - 1109, - 1134, - 1164 - ], - "referencedDeclaration": 1084, - "src": "7107:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$returns$_t_bool_$", - "typeString": "function (enum Bridge.Vote) returns (bool)" - } - }, - "id": 802, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7107:26:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 836, - "nodeType": "IfStatement", - "src": "7103:280:0", - "trueBody": { - "id": 835, - "nodeType": "Block", - "src": "7135:248:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 804, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "7149:11:0", - "subExpression": { - "argumentTypes": null, - "id": 803, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "7149:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 805, - "nodeType": "ExpressionStatement", - "src": "7149:11:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 809, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 806, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 90, - "src": "7174:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 807, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 53, - "src": "7183:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$53_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 808, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "VOTING", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "7183:13:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "src": "7174:22:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "id": 810, - "nodeType": "ExpressionStatement", - "src": "7174:22:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 817, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 811, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "7210:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 813, - "indexExpression": { - "argumentTypes": null, - "id": 812, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "7217:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "7210:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 814, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "threshold", - "nodeType": "MemberAccess", - "referencedDeclaration": 37, - "src": "7210:27:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 815, - "name": "getThreshold", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 565, - 588 - ], - "referencedDeclaration": 565, - "src": "7240:12:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 816, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7240:14:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "7210:44:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 818, - "nodeType": "ExpressionStatement", - "src": "7210:44:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 825, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 819, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "7268:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 821, - "indexExpression": { - "argumentTypes": null, - "id": 820, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "7275:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "7268:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 822, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "validators", - "nodeType": "MemberAccess", - "referencedDeclaration": 35, - "src": "7268:28:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 823, - "name": "getValidators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 780, - "src": "7299:13:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_array$_t_address_$dyn_memory_ptr_$", - "typeString": "function () view returns (address[] memory)" - } - }, - "id": 824, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7299:15:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "src": "7268:46:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 826, - "nodeType": "ExpressionStatement", - "src": "7268:46:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 833, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 827, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "7328:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 829, - "indexExpression": { - "argumentTypes": null, - "id": 828, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "7335:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "7328:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 830, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "rangeSize", - "nodeType": "MemberAccess", - "referencedDeclaration": 39, - "src": "7328:27:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 831, - "name": "getRangeSize", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 621, - 644 - ], - "referencedDeclaration": 621, - "src": "7358:12:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 832, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7358:14:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "7328:44:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 834, - "nodeType": "ExpressionStatement", - "src": "7328:44:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 838, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 795, - "modifierName": { - "argumentTypes": null, - "id": 794, - "name": "readyOrVoting", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 213, - "src": "7062:13:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "7062:13:0" - }, - { - "arguments": null, - "id": 797, - "modifierName": { - "argumentTypes": null, - "id": 796, - "name": "currentValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 261, - "src": "7076:16:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "7076:16:0" - } - ], - "name": "startVoting", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 793, - "nodeType": "ParameterList", - "parameters": [], - "src": "7052:2:0" - }, - "returnParameters": { - "id": 798, - "nodeType": "ParameterList", - "parameters": [], - "src": "7093:0:0" - }, - "scope": 1340, - "src": "7032:357:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 871, - "nodeType": "Block", - "src": "7471:202:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 852, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 849, - "name": "validator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 840, - "src": "7504:9:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 848, - "name": "getNextPartyId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 768, - "src": "7489:14:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_uint256_$", - "typeString": "function (address) view returns (uint256)" - } - }, - "id": 850, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7489:25:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 851, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "7518:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "7489:30:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "416c726561647920612076616c696461746f72", - "id": 853, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "7521:21:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_aeb0fe100da2796aa6136a3b1c66282f002b435141be331237dfa7127e6df6ff", - "typeString": "literal_string \"Already a validator\"" - }, - "value": "Already a validator" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_aeb0fe100da2796aa6136a3b1c66282f002b435141be331237dfa7127e6df6ff", - "typeString": "literal_string \"Already a validator\"" - } - ], - "id": 847, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 13091, - 13092 - ], - "referencedDeclaration": 13092, - "src": "7481:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 854, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7481:62:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 855, - "nodeType": "ExpressionStatement", - "src": "7481:62:0" - }, - { - "condition": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 857, - "name": "Vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 64, - "src": "7566:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", - "typeString": "type(enum Bridge.Vote)" - } - }, - "id": 858, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "ADD_VALIDATOR", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "7566:18:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 859, - "name": "validator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 840, - "src": "7586:9:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 856, - "name": "tryVote", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1084, - 1109, - 1134, - 1164 - ], - "referencedDeclaration": 1109, - "src": "7558:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$_t_address_$returns$_t_bool_$", - "typeString": "function (enum Bridge.Vote,address) returns (bool)" - } - }, - "id": 860, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7558:38:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 870, - "nodeType": "IfStatement", - "src": "7554:113:0", - "trueBody": { - "id": 869, - "nodeType": "Block", - "src": "7598:69:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 866, - "name": "validator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 840, - "src": "7646:9:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 861, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "7612:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 863, - "indexExpression": { - "argumentTypes": null, - "id": 862, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "7619:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "7612:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 864, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "validators", - "nodeType": "MemberAccess", - "referencedDeclaration": 35, - "src": "7612:28:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 865, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "push", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "7612:33:0", - "typeDescriptions": { - "typeIdentifier": "t_function_arraypush_nonpayable$_t_address_$returns$_t_uint256_$", - "typeString": "function (address) returns (uint256)" - } - }, - "id": 867, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7612:44:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 868, - "nodeType": "ExpressionStatement", - "src": "7612:44:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 872, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 843, - "modifierName": { - "argumentTypes": null, - "id": 842, - "name": "voting", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 225, - "src": "7447:6:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "7447:6:0" - }, - { - "arguments": null, - "id": 845, - "modifierName": { - "argumentTypes": null, - "id": 844, - "name": "currentValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 261, - "src": "7454:16:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "7454:16:0" - } - ], - "name": "voteAddValidator", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 841, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 840, - "name": "validator", - "nodeType": "VariableDeclaration", - "scope": 872, - "src": "7421:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 839, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "7421:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "7420:19:0" - }, - "returnParameters": { - "id": 846, - "nodeType": "ParameterList", - "parameters": [], - "src": "7471:0:0" - }, - "scope": 1340, - "src": "7395:278:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 901, - "nodeType": "Block", - "src": "7758:192:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 886, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 883, - "name": "validator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 874, - "src": "7791:9:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 882, - "name": "getNextPartyId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 768, - "src": "7776:14:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_uint256_$", - "typeString": "function (address) view returns (uint256)" - } - }, - "id": 884, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7776:25:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 885, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "7805:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "7776:30:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "416c7265616479206e6f7420612076616c696461746f72", - "id": 887, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "7808:25:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_2332ed568e8af3d64f1f2b0b098c504cab97ba4128fb9f08cfa3f851ced05961", - "typeString": "literal_string \"Already not a validator\"" - }, - "value": "Already not a validator" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_2332ed568e8af3d64f1f2b0b098c504cab97ba4128fb9f08cfa3f851ced05961", - "typeString": "literal_string \"Already not a validator\"" - } - ], - "id": 881, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 13091, - 13092 - ], - "referencedDeclaration": 13092, - "src": "7768:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 888, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7768:66:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 889, - "nodeType": "ExpressionStatement", - "src": "7768:66:0" - }, - { - "condition": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 891, - "name": "Vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 64, - "src": "7857:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", - "typeString": "type(enum Bridge.Vote)" - } - }, - "id": 892, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "REMOVE_VALIDATOR", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "7857:21:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 893, - "name": "validator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 874, - "src": "7880:9:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 890, - "name": "tryVote", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1084, - 1109, - 1134, - 1164 - ], - "referencedDeclaration": 1109, - "src": "7849:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$_t_address_$returns$_t_bool_$", - "typeString": "function (enum Bridge.Vote,address) returns (bool)" - } - }, - "id": 894, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7849:41:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 900, - "nodeType": "IfStatement", - "src": "7845:99:0", - "trueBody": { - "id": 899, - "nodeType": "Block", - "src": "7892:52:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 896, - "name": "validator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 874, - "src": "7923:9:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 895, - "name": "_removeValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 967, - "src": "7906:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$", - "typeString": "function (address)" - } - }, - "id": 897, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7906:27:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 898, - "nodeType": "ExpressionStatement", - "src": "7906:27:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 902, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 877, - "modifierName": { - "argumentTypes": null, - "id": 876, - "name": "voting", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 225, - "src": "7734:6:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "7734:6:0" - }, - { - "arguments": null, - "id": 879, - "modifierName": { - "argumentTypes": null, - "id": 878, - "name": "currentValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 261, - "src": "7741:16:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "7741:16:0" - } - ], - "name": "voteRemoveValidator", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 875, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 874, - "name": "validator", - "nodeType": "VariableDeclaration", - "scope": 902, - "src": "7708:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 873, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "7708:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "7707:19:0" - }, - "returnParameters": { - "id": 880, - "nodeType": "ParameterList", - "parameters": [], - "src": "7758:0:0" - }, - "scope": 1340, - "src": "7679:271:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 966, - "nodeType": "Block", - "src": "8009:383:0", - "statements": [ - { - "body": { - "id": 946, - "nodeType": "Block", - "src": "8067:205:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 927, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 920, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "8085:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 922, - "indexExpression": { - "argumentTypes": null, - "id": 921, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "8092:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8085:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 923, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "validators", - "nodeType": "MemberAccess", - "referencedDeclaration": 35, - "src": "8085:28:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 925, - "indexExpression": { - "argumentTypes": null, - "id": 924, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 908, - "src": "8114:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8085:31:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "id": 926, - "name": "validator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 904, - "src": "8120:9:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "8085:44:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 945, - "nodeType": "IfStatement", - "src": "8081:181:0", - "trueBody": { - "id": 944, - "nodeType": "Block", - "src": "8131:131:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 941, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 928, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "8149:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 930, - "indexExpression": { - "argumentTypes": null, - "id": 929, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "8156:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8149:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 931, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "validators", - "nodeType": "MemberAccess", - "referencedDeclaration": 35, - "src": "8149:28:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 933, - "indexExpression": { - "argumentTypes": null, - "id": 932, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 908, - "src": "8178:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "8149:31:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 934, - "name": "getNextValidators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 792, - "src": "8183:17:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_array$_t_address_$dyn_memory_ptr_$", - "typeString": "function () view returns (address[] memory)" - } - }, - "id": 935, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8183:19:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 940, - "indexExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 939, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 936, - "name": "getNextParties", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 541, - "src": "8203:14:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 937, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8203:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 938, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8222:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "8203:20:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8183:41:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "8149:75:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 942, - "nodeType": "ExpressionStatement", - "src": "8149:75:0" - }, - { - "id": 943, - "nodeType": "Break", - "src": "8242:5:0" - } - ] - } - } - ] - }, - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 916, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 911, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 908, - "src": "8036:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 915, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 912, - "name": "getNextParties", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 541, - "src": "8040:14:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 913, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8040:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 914, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8059:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "8040:20:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "8036:24:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 947, - "initializationExpression": { - "assignments": [ - 908 - ], - "declarations": [ - { - "constant": false, - "id": 908, - "name": "i", - "nodeType": "VariableDeclaration", - "scope": 947, - "src": "8024:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 907, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "8024:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 910, - "initialValue": { - "argumentTypes": null, - "hexValue": "30", - "id": 909, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8033:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "8024:10:0" - }, - "loopExpression": { - "expression": { - "argumentTypes": null, - "id": 918, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "8062:3:0", - "subExpression": { - "argumentTypes": null, - "id": 917, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 908, - "src": "8062:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 919, - "nodeType": "ExpressionStatement", - "src": "8062:3:0" - }, - "nodeType": "ForStatement", - "src": "8019:253:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 957, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "delete", - "prefix": true, - "src": "8281:57:0", - "subExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 948, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "8288:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 950, - "indexExpression": { - "argumentTypes": null, - "id": 949, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "8295:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8288:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 951, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "validators", - "nodeType": "MemberAccess", - "referencedDeclaration": 35, - "src": "8288:28:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 956, - "indexExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 955, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 952, - "name": "getNextParties", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 541, - "src": "8317:14:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 953, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8317:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 954, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8336:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "8317:20:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "8288:50:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 958, - "nodeType": "ExpressionStatement", - "src": "8281:57:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 964, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "--", - "prefix": false, - "src": "8348:37:0", - "subExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 959, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "8348:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 961, - "indexExpression": { - "argumentTypes": null, - "id": 960, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "8355:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8348:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 962, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "validators", - "nodeType": "MemberAccess", - "referencedDeclaration": 35, - "src": "8348:28:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 963, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "8348:35:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 965, - "nodeType": "ExpressionStatement", - "src": "8348:37:0" - } - ] - }, - "documentation": null, - "id": 967, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "_removeValidator", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 905, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 904, - "name": "validator", - "nodeType": "VariableDeclaration", - "scope": 967, - "src": "7982:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 903, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "7982:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "7981:19:0" - }, - "returnParameters": { - "id": 906, - "nodeType": "ParameterList", - "parameters": [], - "src": "8009:0:0" - }, - "scope": 1340, - "src": "7956:436:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "private" - }, - { - "body": { - "id": 990, - "nodeType": "Block", - "src": "8474:127:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 977, - "name": "Vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 64, - "src": "8496:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", - "typeString": "type(enum Bridge.Vote)" - } - }, - "id": 978, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "CHANGE_THRESHOLD", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "8496:21:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 979, - "name": "threshold", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 969, - "src": "8519:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 976, - "name": "tryVote", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1084, - 1109, - 1134, - 1164 - ], - "referencedDeclaration": 1134, - "src": "8488:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$_t_uint256_$returns$_t_bool_$", - "typeString": "function (enum Bridge.Vote,uint256) returns (bool)" - } - }, - "id": 980, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8488:41:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 989, - "nodeType": "IfStatement", - "src": "8484:111:0", - "trueBody": { - "id": 988, - "nodeType": "Block", - "src": "8531:64:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 986, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 981, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "8545:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 983, - "indexExpression": { - "argumentTypes": null, - "id": 982, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "8552:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8545:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 984, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "threshold", - "nodeType": "MemberAccess", - "referencedDeclaration": 37, - "src": "8545:27:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 985, - "name": "threshold", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 969, - "src": "8575:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "8545:39:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 987, - "nodeType": "ExpressionStatement", - "src": "8545:39:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 991, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 972, - "modifierName": { - "argumentTypes": null, - "id": 971, - "name": "voting", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 225, - "src": "8450:6:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "8450:6:0" - }, - { - "arguments": null, - "id": 974, - "modifierName": { - "argumentTypes": null, - "id": 973, - "name": "currentValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 261, - "src": "8457:16:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "8457:16:0" - } - ], - "name": "voteChangeThreshold", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 970, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 969, - "name": "threshold", - "nodeType": "VariableDeclaration", - "scope": 991, - "src": "8427:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 968, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "8427:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "8426:16:0" - }, - "returnParameters": { - "id": 975, - "nodeType": "ParameterList", - "parameters": [], - "src": "8474:0:0" - }, - "scope": 1340, - "src": "8398:203:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 1014, - "nodeType": "Block", - "src": "8683:128:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1001, - "name": "Vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 64, - "src": "8705:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", - "typeString": "type(enum Bridge.Vote)" - } - }, - "id": 1002, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "CHANGE_RANGE_SIZE", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "8705:22:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 1003, - "name": "rangeSize", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 993, - "src": "8729:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 1000, - "name": "tryVote", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1084, - 1109, - 1134, - 1164 - ], - "referencedDeclaration": 1134, - "src": "8697:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$_t_uint256_$returns$_t_bool_$", - "typeString": "function (enum Bridge.Vote,uint256) returns (bool)" - } - }, - "id": 1004, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8697:42:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 1013, - "nodeType": "IfStatement", - "src": "8693:112:0", - "trueBody": { - "id": 1012, - "nodeType": "Block", - "src": "8741:64:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 1010, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1005, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "8755:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 1007, - "indexExpression": { - "argumentTypes": null, - "id": 1006, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "8762:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8755:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 1008, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "rangeSize", - "nodeType": "MemberAccess", - "referencedDeclaration": 39, - "src": "8755:27:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 1009, - "name": "rangeSize", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 993, - "src": "8785:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "8755:39:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 1011, - "nodeType": "ExpressionStatement", - "src": "8755:39:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 1015, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 996, - "modifierName": { - "argumentTypes": null, - "id": 995, - "name": "voting", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 225, - "src": "8659:6:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "8659:6:0" - }, - { - "arguments": null, - "id": 998, - "modifierName": { - "argumentTypes": null, - "id": 997, - "name": "currentValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 261, - "src": "8666:16:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "8666:16:0" - } - ], - "name": "voteChangeRangeSize", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 994, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 993, - "name": "rangeSize", - "nodeType": "VariableDeclaration", - "scope": 1015, - "src": "8636:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 992, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "8636:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "8635:16:0" - }, - "returnParameters": { - "id": 999, - "nodeType": "ParameterList", - "parameters": [], - "src": "8683:0:0" - }, - "scope": 1340, - "src": "8607:204:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 1038, - "nodeType": "Block", - "src": "8875:141:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1023, - "name": "Vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 64, - "src": "8897:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", - "typeString": "type(enum Bridge.Vote)" - } - }, - "id": 1024, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "START_KEYGEN", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "8897:17:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - ], - "id": 1022, - "name": "tryVote", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1084, - 1109, - 1134, - 1164 - ], - "referencedDeclaration": 1084, - "src": "8889:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$returns$_t_bool_$", - "typeString": "function (enum Bridge.Vote) returns (bool)" - } - }, - "id": 1025, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8889:26:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 1037, - "nodeType": "IfStatement", - "src": "8885:125:0", - "trueBody": { - "id": 1036, - "nodeType": "Block", - "src": "8917:93:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 1029, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 1026, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 90, - "src": "8931:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1027, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 53, - "src": "8940:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$53_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 1028, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "KEYGEN", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "8940:13:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "src": "8931:22:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "id": 1030, - "nodeType": "ExpressionStatement", - "src": "8931:22:0" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1032, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "8982:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 1033, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "8989:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 1031, - "name": "NewEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 14, - "src": "8973:8:0", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$returns$__$", - "typeString": "function (uint256,uint256)" - } - }, - "id": 1034, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8973:26:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 1035, - "nodeType": "EmitStatement", - "src": "8968:31:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 1039, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 1018, - "modifierName": { - "argumentTypes": null, - "id": 1017, - "name": "voting", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 225, - "src": "8851:6:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "8851:6:0" - }, - { - "arguments": null, - "id": 1020, - "modifierName": { - "argumentTypes": null, - "id": 1019, - "name": "currentValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 261, - "src": "8858:16:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "8858:16:0" - } - ], - "name": "voteStartKeygen", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1016, - "nodeType": "ParameterList", - "parameters": [], - "src": "8841:2:0" - }, - "returnParameters": { - "id": 1021, - "nodeType": "ParameterList", - "parameters": [], - "src": "8875:0:0" - }, - "scope": 1340, - "src": "8817:199:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 1061, - "nodeType": "Block", - "src": "9081:144:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1047, - "name": "Vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 64, - "src": "9103:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", - "typeString": "type(enum Bridge.Vote)" - } - }, - "id": 1048, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "CANCEL_KEYGEN", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "9103:18:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - ], - "id": 1046, - "name": "tryVote", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1084, - 1109, - 1134, - 1164 - ], - "referencedDeclaration": 1084, - "src": "9095:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$returns$_t_bool_$", - "typeString": "function (enum Bridge.Vote) returns (bool)" - } - }, - "id": 1049, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9095:27:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 1060, - "nodeType": "IfStatement", - "src": "9091:128:0", - "trueBody": { - "id": 1059, - "nodeType": "Block", - "src": "9124:95:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 1053, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 1050, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 90, - "src": "9138:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1051, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 53, - "src": "9147:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$53_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 1052, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "VOTING", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "9147:13:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "src": "9138:22:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "id": 1054, - "nodeType": "ExpressionStatement", - "src": "9138:22:0" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1056, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "9198:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 1055, - "name": "NewEpochCancelled", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 18, - "src": "9180:17:0", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$returns$__$", - "typeString": "function (uint256)" - } - }, - "id": 1057, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9180:28:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 1058, - "nodeType": "EmitStatement", - "src": "9175:33:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 1062, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 1042, - "modifierName": { - "argumentTypes": null, - "id": 1041, - "name": "keygen", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 237, - "src": "9057:6:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "9057:6:0" - }, - { - "arguments": null, - "id": 1044, - "modifierName": { - "argumentTypes": null, - "id": 1043, - "name": "currentValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 261, - "src": "9064:16:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "9064:16:0" - } - ], - "name": "voteCancelKeygen", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1040, - "nodeType": "ParameterList", - "parameters": [], - "src": "9047:2:0" - }, - "returnParameters": { - "id": 1045, - "nodeType": "ParameterList", - "parameters": [], - "src": "9081:0:0" - }, - "scope": 1340, - "src": "9022:203:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 1083, - "nodeType": "Block", - "src": "9286:110:0", - "statements": [ - { - "assignments": [ - 1070 - ], - "declarations": [ - { - "constant": false, - "id": 1070, - "name": "vote", - "nodeType": "VariableDeclaration", - "scope": 1083, - "src": "9296:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1069, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "9296:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 1078, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1074, - "name": "voteType", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1064, - "src": "9338:8:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 1075, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "9348:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 1072, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13075, - "src": "9321:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 1073, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "9321:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 1076, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9321:37:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 1071, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13082, - "src": "9311:9:0", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 1077, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9311:48:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "9296:63:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1080, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1070, - "src": "9384:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "id": 1079, - "name": "putVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1268, - "src": "9376:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$_t_bool_$", - "typeString": "function (bytes32) returns (bool)" - } - }, - "id": 1081, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9376:13:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "functionReturnParameters": 1068, - "id": 1082, - "nodeType": "Return", - "src": "9369:20:0" - } - ] - }, - "documentation": null, - "id": 1084, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "tryVote", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1065, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1064, - "name": "voteType", - "nodeType": "VariableDeclaration", - "scope": 1084, - "src": "9248:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - "typeName": { - "contractScope": null, - "id": 1063, - "name": "Vote", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 64, - "src": "9248:4:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "9247:15:0" - }, - "returnParameters": { - "id": 1068, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1067, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 1084, - "src": "9280:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 1066, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "9280:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "9279:6:0" - }, - "scope": 1340, - "src": "9231:165:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "private" - }, - { - "body": { - "id": 1108, - "nodeType": "Block", - "src": "9471:116:0", - "statements": [ - { - "assignments": [ - 1094 - ], - "declarations": [ - { - "constant": false, - "id": 1094, - "name": "vote", - "nodeType": "VariableDeclaration", - "scope": 1108, - "src": "9481:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1093, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "9481:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 1103, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1098, - "name": "voteType", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1086, - "src": "9523:8:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 1099, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "9533:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 1100, - "name": "addr", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1088, - "src": "9544:4:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "expression": { - "argumentTypes": null, - "id": 1096, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13075, - "src": "9506:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 1097, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "9506:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 1101, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9506:43:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 1095, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13082, - "src": "9496:9:0", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 1102, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9496:54:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "9481:69:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1105, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1094, - "src": "9575:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "id": 1104, - "name": "putVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1268, - "src": "9567:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$_t_bool_$", - "typeString": "function (bytes32) returns (bool)" - } - }, - "id": 1106, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9567:13:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "functionReturnParameters": 1092, - "id": 1107, - "nodeType": "Return", - "src": "9560:20:0" - } - ] - }, - "documentation": null, - "id": 1109, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "tryVote", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1089, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1086, - "name": "voteType", - "nodeType": "VariableDeclaration", - "scope": 1109, - "src": "9419:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - "typeName": { - "contractScope": null, - "id": 1085, - "name": "Vote", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 64, - "src": "9419:4:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 1088, - "name": "addr", - "nodeType": "VariableDeclaration", - "scope": 1109, - "src": "9434:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1087, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "9434:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "9418:29:0" - }, - "returnParameters": { - "id": 1092, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1091, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 1109, - "src": "9465:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 1090, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "9465:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "9464:6:0" - }, - "scope": 1340, - "src": "9402:185:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "private" - }, - { - "body": { - "id": 1133, - "nodeType": "Block", - "src": "9658:115:0", - "statements": [ - { - "assignments": [ - 1119 - ], - "declarations": [ - { - "constant": false, - "id": 1119, - "name": "vote", - "nodeType": "VariableDeclaration", - "scope": 1133, - "src": "9668:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1118, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "9668:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 1128, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1123, - "name": "voteType", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1111, - "src": "9710:8:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 1124, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "9720:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 1125, - "name": "num", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1113, - "src": "9731:3:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 1121, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13075, - "src": "9693:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 1122, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "9693:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 1126, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9693:42:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 1120, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13082, - "src": "9683:9:0", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 1127, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9683:53:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "9668:68:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1130, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1119, - "src": "9761:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "id": 1129, - "name": "putVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1268, - "src": "9753:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$_t_bool_$", - "typeString": "function (bytes32) returns (bool)" - } - }, - "id": 1131, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9753:13:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "functionReturnParameters": 1117, - "id": 1132, - "nodeType": "Return", - "src": "9746:20:0" - } - ] - }, - "documentation": null, - "id": 1134, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "tryVote", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1114, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1111, - "name": "voteType", - "nodeType": "VariableDeclaration", - "scope": 1134, - "src": "9610:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - "typeName": { - "contractScope": null, - "id": 1110, - "name": "Vote", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 64, - "src": "9610:4:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 1113, - "name": "num", - "nodeType": "VariableDeclaration", - "scope": 1134, - "src": "9625:8:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1112, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "9625:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "9609:25:0" - }, - "returnParameters": { - "id": 1117, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1116, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 1134, - "src": "9652:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 1115, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "9652:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "9651:6:0" - }, - "scope": 1340, - "src": "9593:180:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "private" - }, - { - "body": { - "id": 1163, - "nodeType": "Block", - "src": "9872:116:0", - "statements": [ - { - "assignments": [ - 1148 - ], - "declarations": [ - { - "constant": false, - "id": 1148, - "name": "vote", - "nodeType": "VariableDeclaration", - "scope": 1163, - "src": "9882:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1147, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "9882:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 1158, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1152, - "name": "voteType", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1136, - "src": "9924:8:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 1153, - "name": "hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1138, - "src": "9934:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "id": 1154, - "name": "to", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1140, - "src": "9940:2:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 1155, - "name": "value", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1142, - "src": "9944:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 1150, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13075, - "src": "9907:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 1151, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "9907:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 1156, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9907:43:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 1149, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13082, - "src": "9897:9:0", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 1157, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9897:54:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "9882:69:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1160, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1148, - "src": "9976:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "id": 1159, - "name": "putVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1268, - "src": "9968:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$_t_bool_$", - "typeString": "function (bytes32) returns (bool)" - } - }, - "id": 1161, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9968:13:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "functionReturnParameters": 1146, - "id": 1162, - "nodeType": "Return", - "src": "9961:20:0" - } - ] - }, - "documentation": null, - "id": 1164, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "tryVote", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1143, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1136, - "name": "voteType", - "nodeType": "VariableDeclaration", - "scope": 1164, - "src": "9796:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - "typeName": { - "contractScope": null, - "id": 1135, - "name": "Vote", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 64, - "src": "9796:4:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 1138, - "name": "hash", - "nodeType": "VariableDeclaration", - "scope": 1164, - "src": "9811:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1137, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "9811:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 1140, - "name": "to", - "nodeType": "VariableDeclaration", - "scope": 1164, - "src": "9825:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1139, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "9825:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 1142, - "name": "value", - "nodeType": "VariableDeclaration", - "scope": 1164, - "src": "9837:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1141, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "9837:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "9795:53:0" - }, - "returnParameters": { - "id": 1146, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1145, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 1164, - "src": "9866:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 1144, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "9866:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "9865:6:0" - }, - "scope": 1340, - "src": "9779:209:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "private" - }, - { - "body": { - "id": 1185, - "nodeType": "Block", - "src": "10052:113:0", - "statements": [ - { - "assignments": [ - 1172 - ], - "declarations": [ - { - "constant": false, - "id": 1172, - "name": "vote", - "nodeType": "VariableDeclaration", - "scope": 1185, - "src": "10062:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1171, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "10062:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 1180, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1176, - "name": "voteType", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1166, - "src": "10104:8:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 1177, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "10114:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 1174, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13075, - "src": "10087:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 1175, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "10087:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 1178, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10087:37:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 1173, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13082, - "src": "10077:9:0", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 1179, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10077:48:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "10062:63:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1182, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1172, - "src": "10153:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "id": 1181, - "name": "putConfirm", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1322, - "src": "10142:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$_t_bool_$", - "typeString": "function (bytes32) returns (bool)" - } - }, - "id": 1183, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10142:16:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "functionReturnParameters": 1170, - "id": 1184, - "nodeType": "Return", - "src": "10135:23:0" - } - ] - }, - "documentation": null, - "id": 1186, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "tryConfirm", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1167, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1166, - "name": "voteType", - "nodeType": "VariableDeclaration", - "scope": 1186, - "src": "10014:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - "typeName": { - "contractScope": null, - "id": 1165, - "name": "Vote", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 64, - "src": "10014:4:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "10013:15:0" - }, - "returnParameters": { - "id": 1170, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1169, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 1186, - "src": "10046:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 1168, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "10046:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "10045:6:0" - }, - "scope": 1340, - "src": "9994:171:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "private" - }, - { - "body": { - "id": 1213, - "nodeType": "Block", - "src": "10245:119:0", - "statements": [ - { - "assignments": [ - 1198 - ], - "declarations": [ - { - "constant": false, - "id": 1198, - "name": "vote", - "nodeType": "VariableDeclaration", - "scope": 1213, - "src": "10255:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1197, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "10255:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 1208, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1202, - "name": "voteType", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1188, - "src": "10297:8:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 1203, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "10307:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 1204, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1190, - "src": "10318:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 1205, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1192, - "src": "10321:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 1200, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13075, - "src": "10280:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 1201, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "10280:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 1206, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10280:43:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 1199, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13082, - "src": "10270:9:0", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 1207, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10270:54:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "10255:69:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1210, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1198, - "src": "10352:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "id": 1209, - "name": "putConfirm", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1322, - "src": "10341:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$_t_bool_$", - "typeString": "function (bytes32) returns (bool)" - } - }, - "id": 1211, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10341:16:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "functionReturnParameters": 1196, - "id": 1212, - "nodeType": "Return", - "src": "10334:23:0" - } - ] - }, - "documentation": null, - "id": 1214, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "tryConfirm", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1193, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1188, - "name": "voteType", - "nodeType": "VariableDeclaration", - "scope": 1214, - "src": "10191:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - "typeName": { - "contractScope": null, - "id": 1187, - "name": "Vote", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 64, - "src": "10191:4:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 1190, - "name": "x", - "nodeType": "VariableDeclaration", - "scope": 1214, - "src": "10206:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1189, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "10206:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 1192, - "name": "y", - "nodeType": "VariableDeclaration", - "scope": 1214, - "src": "10214:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1191, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "10214:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "10190:31:0" - }, - "returnParameters": { - "id": 1196, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1195, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 1214, - "src": "10239:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 1194, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "10239:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "10238:6:0" - }, - "scope": 1340, - "src": "10171:193:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "private" - }, - { - "body": { - "id": 1267, - "nodeType": "Block", - "src": "10424:355:0", - "statements": [ - { - "assignments": [ - 1222 - ], - "declarations": [ - { - "constant": false, - "id": 1222, - "name": "personalVote", - "nodeType": "VariableDeclaration", - "scope": 1267, - "src": "10434:20:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1221, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "10434:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 1226, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1224, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1216, - "src": "10473:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "id": 1223, - "name": "personalizeVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1339, - "src": "10457:15:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_bytes32_$", - "typeString": "function (bytes32) view returns (bytes32)" - } - }, - "id": 1225, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10457:21:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "10434:44:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1231, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "!", - "prefix": true, - "src": "10496:20:0", - "subExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1228, - "name": "votes", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 84, - "src": "10497:5:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - } - }, - "id": 1230, - "indexExpression": { - "argumentTypes": null, - "id": 1229, - "name": "personalVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1222, - "src": "10503:12:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "10497:19:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "566f74656420616c7265616479", - "id": 1232, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "10518:15:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_230c30109b60c15b21799291aaf5c571045da3dc3f224d8bbd2f2e688c149a47", - "typeString": "literal_string \"Voted already\"" - }, - "value": "Voted already" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_230c30109b60c15b21799291aaf5c571045da3dc3f224d8bbd2f2e688c149a47", - "typeString": "literal_string \"Voted already\"" - } - ], - "id": 1227, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 13091, - 13092 - ], - "referencedDeclaration": 13092, - "src": "10488:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 1233, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10488:46:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 1234, - "nodeType": "ExpressionStatement", - "src": "10488:46:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 1239, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1235, - "name": "votes", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 84, - "src": "10545:5:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - } - }, - "id": 1237, - "indexExpression": { - "argumentTypes": null, - "id": 1236, - "name": "personalVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1222, - "src": "10551:12:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "10545:19:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 1238, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "10567:4:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "src": "10545:26:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 1240, - "nodeType": "ExpressionStatement", - "src": "10545:26:0" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 1246, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1241, - "name": "votesCount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 80, - "src": "10585:10:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - } - }, - "id": 1243, - "indexExpression": { - "argumentTypes": null, - "id": 1242, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1216, - "src": "10596:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "10585:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 1244, - "name": "getThreshold", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 565, - 588 - ], - "referencedDeclaration": 565, - "src": "10605:12:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 1245, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10605:14:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "10585:34:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "id": 1265, - "nodeType": "Block", - "src": "10704:69:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 1261, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "10718:18:0", - "subExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1258, - "name": "votesCount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 80, - "src": "10718:10:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - } - }, - "id": 1260, - "indexExpression": { - "argumentTypes": null, - "id": 1259, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1216, - "src": "10729:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "10718:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 1262, - "nodeType": "ExpressionStatement", - "src": "10718:18:0" - }, - { - "expression": { - "argumentTypes": null, - "hexValue": "66616c7365", - "id": 1263, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "10757:5:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "false" - }, - "functionReturnParameters": 1220, - "id": 1264, - "nodeType": "Return", - "src": "10750:12:0" - } - ] - }, - "id": 1266, - "nodeType": "IfStatement", - "src": "10581:192:0", - "trueBody": { - "id": 1257, - "nodeType": "Block", - "src": "10621:77:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 1253, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1247, - "name": "votesCount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 80, - "src": "10635:10:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - } - }, - "id": 1249, - "indexExpression": { - "argumentTypes": null, - "id": 1248, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1216, - "src": "10646:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "10635:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_rational_57896044618658097711785492504343953926634992332820282019728792003956564819968_by_1", - "typeString": "int_const 5789...(69 digits omitted)...9968" - }, - "id": 1252, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "hexValue": "32", - "id": 1250, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "10654:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "nodeType": "BinaryOperation", - "operator": "**", - "rightExpression": { - "argumentTypes": null, - "hexValue": "323535", - "id": 1251, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "10659:3:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_255_by_1", - "typeString": "int_const 255" - }, - "value": "255" - }, - "src": "10654:8:0", - "typeDescriptions": { - "typeIdentifier": "t_rational_57896044618658097711785492504343953926634992332820282019728792003956564819968_by_1", - "typeString": "int_const 5789...(69 digits omitted)...9968" - } - }, - "src": "10635:27:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 1254, - "nodeType": "ExpressionStatement", - "src": "10635:27:0" - }, - { - "expression": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 1255, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "10683:4:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "functionReturnParameters": 1220, - "id": 1256, - "nodeType": "Return", - "src": "10676:11:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 1268, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "putVote", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1217, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1216, - "name": "vote", - "nodeType": "VariableDeclaration", - "scope": 1268, - "src": "10387:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1215, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "10387:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "10386:14:0" - }, - "returnParameters": { - "id": 1220, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1219, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 1268, - "src": "10418:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 1218, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "10418:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "10417:6:0" - }, - "scope": 1340, - "src": "10370:409:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "private" - }, - { - "body": { - "id": 1321, - "nodeType": "Block", - "src": "10842:363:0", - "statements": [ - { - "assignments": [ - 1276 - ], - "declarations": [ - { - "constant": false, - "id": 1276, - "name": "personalVote", - "nodeType": "VariableDeclaration", - "scope": 1321, - "src": "10852:20:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1275, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "10852:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 1280, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1278, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1270, - "src": "10891:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "id": 1277, - "name": "personalizeVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1339, - "src": "10875:15:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_bytes32_$", - "typeString": "function (bytes32) view returns (bytes32)" - } - }, - "id": 1279, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10875:21:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "10852:44:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1285, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "!", - "prefix": true, - "src": "10914:20:0", - "subExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1282, - "name": "votes", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 84, - "src": "10915:5:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - } - }, - "id": 1284, - "indexExpression": { - "argumentTypes": null, - "id": 1283, - "name": "personalVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1276, - "src": "10921:12:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "10915:19:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "436f6e6669726d656420616c7265616479", - "id": 1286, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "10936:19:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_762a97ce67d271844ad9c09d89a5271fde7fe7537af208da055a904cd67ac7bc", - "typeString": "literal_string \"Confirmed already\"" - }, - "value": "Confirmed already" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_762a97ce67d271844ad9c09d89a5271fde7fe7537af208da055a904cd67ac7bc", - "typeString": "literal_string \"Confirmed already\"" - } - ], - "id": 1281, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 13091, - 13092 - ], - "referencedDeclaration": 13092, - "src": "10906:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 1287, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10906:50:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 1288, - "nodeType": "ExpressionStatement", - "src": "10906:50:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 1293, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1289, - "name": "votes", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 84, - "src": "10967:5:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - } - }, - "id": 1291, - "indexExpression": { - "argumentTypes": null, - "id": 1290, - "name": "personalVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1276, - "src": "10973:12:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "10967:19:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 1292, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "10989:4:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "src": "10967:26:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 1294, - "nodeType": "ExpressionStatement", - "src": "10967:26:0" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 1300, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1295, - "name": "votesCount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 80, - "src": "11007:10:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - } - }, - "id": 1297, - "indexExpression": { - "argumentTypes": null, - "id": 1296, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1270, - "src": "11018:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "11007:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 1298, - "name": "getNextThreshold", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 575, - "src": "11027:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 1299, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "11027:18:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "11007:38:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "id": 1319, - "nodeType": "Block", - "src": "11130:69:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 1315, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "11144:18:0", - "subExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1312, - "name": "votesCount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 80, - "src": "11144:10:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - } - }, - "id": 1314, - "indexExpression": { - "argumentTypes": null, - "id": 1313, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1270, - "src": "11155:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "11144:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 1316, - "nodeType": "ExpressionStatement", - "src": "11144:18:0" - }, - { - "expression": { - "argumentTypes": null, - "hexValue": "66616c7365", - "id": 1317, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "11183:5:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "false" - }, - "functionReturnParameters": 1274, - "id": 1318, - "nodeType": "Return", - "src": "11176:12:0" - } - ] - }, - "id": 1320, - "nodeType": "IfStatement", - "src": "11003:196:0", - "trueBody": { - "id": 1311, - "nodeType": "Block", - "src": "11047:77:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 1307, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1301, - "name": "votesCount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 80, - "src": "11061:10:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - } - }, - "id": 1303, - "indexExpression": { - "argumentTypes": null, - "id": 1302, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1270, - "src": "11072:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "11061:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_rational_57896044618658097711785492504343953926634992332820282019728792003956564819968_by_1", - "typeString": "int_const 5789...(69 digits omitted)...9968" - }, - "id": 1306, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "hexValue": "32", - "id": 1304, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "11080:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "nodeType": "BinaryOperation", - "operator": "**", - "rightExpression": { - "argumentTypes": null, - "hexValue": "323535", - "id": 1305, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "11085:3:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_255_by_1", - "typeString": "int_const 255" - }, - "value": "255" - }, - "src": "11080:8:0", - "typeDescriptions": { - "typeIdentifier": "t_rational_57896044618658097711785492504343953926634992332820282019728792003956564819968_by_1", - "typeString": "int_const 5789...(69 digits omitted)...9968" - } - }, - "src": "11061:27:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 1308, - "nodeType": "ExpressionStatement", - "src": "11061:27:0" - }, - { - "expression": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 1309, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "11109:4:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "functionReturnParameters": 1274, - "id": 1310, - "nodeType": "Return", - "src": "11102:11:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 1322, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "putConfirm", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1271, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1270, - "name": "vote", - "nodeType": "VariableDeclaration", - "scope": 1322, - "src": "10805:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1269, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "10805:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "10804:14:0" - }, - "returnParameters": { - "id": 1274, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1273, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 1322, - "src": "10836:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 1272, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "10836:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "10835:6:0" - }, - "scope": 1340, - "src": "10785:420:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "private" - }, - { - "body": { - "id": 1338, - "nodeType": "Block", - "src": "11281:69:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1332, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1324, - "src": "11325:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1333, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13088, - "src": "11331:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 1334, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "11331:10:0", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - ], - "expression": { - "argumentTypes": null, - "id": 1330, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13075, - "src": "11308:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 1331, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "11308:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 1335, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "11308:34:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 1329, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13082, - "src": "11298:9:0", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 1336, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "11298:45:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "functionReturnParameters": 1328, - "id": 1337, - "nodeType": "Return", - "src": "11291:52:0" - } - ] - }, - "documentation": null, - "id": 1339, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "personalizeVote", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1325, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1324, - "name": "vote", - "nodeType": "VariableDeclaration", - "scope": 1339, - "src": "11236:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1323, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "11236:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "11235:14:0" - }, - "returnParameters": { - "id": 1328, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1327, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 1339, - "src": "11272:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1326, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "11272:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "11271:9:0" - }, - "scope": 1340, - "src": "11211:139:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "private" - } - ], - "scope": 1341, - "src": "93:11259:0" - } - ], - "src": "0:11353:0" - }, - "compiler": { - "name": "solc", - "version": "0.5.9+commit.e560f70d.Emscripten.clang" - }, - "networks": { - "44": { - "events": { - "0x3ef85928df9ae51bdb3eb4c00ec73b92b82307f319ac1b029de14796a0972609": { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "oldEpoch", - "type": "uint256" - }, - { - "indexed": true, - "name": "newEpoch", - "type": "uint256" - } - ], - "name": "NewEpoch", - "type": "event", - "signature": "0x3ef85928df9ae51bdb3eb4c00ec73b92b82307f319ac1b029de14796a0972609" - }, - "0xddbb65cfe1ae4aec03cef0f9667c6d7ba3740927d0c60f4dd4d7104cc31d180a": { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "epoch", - "type": "uint256" - } - ], - "name": "NewEpochCancelled", - "type": "event", - "signature": "0xddbb65cfe1ae4aec03cef0f9667c6d7ba3740927d0c60f4dd4d7104cc31d180a" - }, - "0xf4735b85cc98f9a712832825ecab4cfb1649d658f9a73c57a00ea7dde735c79b": { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "oldEpoch", - "type": "uint256" - }, - { - "indexed": true, - "name": "newEpoch", - "type": "uint256" - } - ], - "name": "NewFundsTransfer", - "type": "event", - "signature": "0xf4735b85cc98f9a712832825ecab4cfb1649d658f9a73c57a00ea7dde735c79b" - }, - "0xc33272939f066c227e913a4b3434d860794f185c551685c29451a3a38b9b259c": { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "epoch", - "type": "uint256" - }, - { - "indexed": false, - "name": "x", - "type": "uint256" - }, - { - "indexed": false, - "name": "y", - "type": "uint256" - } - ], - "name": "EpochStart", - "type": "event", - "signature": "0xc33272939f066c227e913a4b3434d860794f185c551685c29451a3a38b9b259c" - }, - "0x62e1f484b3909b2c013673bad76a9f14b010600ba983f11ad26e83082883570e": { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "name": "value", - "type": "uint256" - } - ], - "name": "ExchangeRequest", - "type": "event", - "signature": "0x62e1f484b3909b2c013673bad76a9f14b010600ba983f11ad26e83082883570e" - }, - "0x9273b6f22cee1ef3d7cdc2a9c031936003526bae368886259511f7dd40044b02": { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "name": "value", - "type": "uint256" - }, - { - "indexed": false, - "name": "nonce", - "type": "uint256" - } - ], - "name": "ExchangeRequest", - "type": "event", - "signature": "0x9273b6f22cee1ef3d7cdc2a9c031936003526bae368886259511f7dd40044b02" - } - }, - "links": {}, - "address": "0x44c158FE850821ae69DaF37AADF5c539e9d0025B", - "transactionHash": "0x912e1b3c5341609e1d0c0cd5d81ff6b7d9b2e8f497bd393ea91af1a4038cba78" - } - }, - "schemaVersion": "3.0.11", - "updatedAt": "2019-10-28T13:22:54.868Z", - "devdoc": { - "methods": {} - }, - "userdoc": { - "methods": {} - } -} \ No newline at end of file diff --git a/src/oracle/ethWatcher/Dockerfile b/src/oracle/ethWatcher/Dockerfile index 5b67a29..9ca8e0f 100644 --- a/src/oracle/ethWatcher/Dockerfile +++ b/src/oracle/ethWatcher/Dockerfile @@ -10,6 +10,5 @@ COPY ./ethWatcher/package.json /watcher/ RUN npm install COPY ./ethWatcher/ethWatcher.js ./shared/db.js ./shared/logger.js ./shared/amqp.js ./shared/crypto.js ./shared/wait.js /watcher/ -COPY ./ethWatcher/Bridge.json /watcher/contracts_data/ ENTRYPOINT ["node", "ethWatcher.js"] diff --git a/src/oracle/ethWatcher/ethWatcher.js b/src/oracle/ethWatcher/ethWatcher.js index 23a83d6..f770fda 100644 --- a/src/oracle/ethWatcher/ethWatcher.js +++ b/src/oracle/ethWatcher/ethWatcher.js @@ -1,5 +1,4 @@ -const Web3 = require('web3') -const { utils } = require('ethers') +const ethers = require('ethers') const BN = require('bignumber.js') const axios = require('axios') @@ -9,15 +8,25 @@ const { connectRabbit, assertQueue } = require('./amqp') const { publicKeyToAddress } = require('./crypto') const { delay } = require('./wait') -const abiBridge = require('./contracts_data/Bridge.json').abi - const { HOME_RPC_URL, HOME_BRIDGE_ADDRESS, RABBITMQ_URL, HOME_START_BLOCK, VALIDATOR_PRIVATE_KEY } = process.env +const HOME_MAX_FETCH_RANGE_SIZE = parseInt(process.env.HOME_MAX_FETCH_RANGE_SIZE, 10) -const homeWeb3 = new Web3(HOME_RPC_URL) -const bridge = new homeWeb3.eth.Contract(abiBridge, HOME_BRIDGE_ADDRESS) -const validatorAddress = homeWeb3.eth.accounts.privateKeyToAccount(`0x${VALIDATOR_PRIVATE_KEY}`).address +const provider = new ethers.providers.JsonRpcProvider(HOME_RPC_URL) +const bridgeAbi = [ + 'event ExchangeRequest(uint value, uint nonce)', + 'event NewEpoch(uint indexed oldEpoch, uint indexed newEpoch)', + 'event NewEpochCancelled(uint indexed epoch)', + 'event NewFundsTransfer(uint indexed oldEpoch, uint indexed newEpoch)', + 'event EpochStart(uint indexed epoch, uint x, uint y)', + 'function getThreshold(uint epoch) view returns (uint)', + 'function getParties(uint epoch) view returns (uint)', + 'function getRangeSize() view returns (uint)', + 'function getValidators() view returns (address[])' +] +const bridge = new ethers.Contract(HOME_BRIDGE_ADDRESS, bridgeAbi, provider) +const validatorAddress = ethers.utils.computeAddress(`0x${VALIDATOR_PRIVATE_KEY}`) const foreignNonce = [] let channel @@ -25,6 +34,7 @@ let exchangeQueue let signQueue let keygenQueue let cancelKeygenQueue +let chainId let blockNumber let epoch let epochStart @@ -72,20 +82,18 @@ async function resetFutureMessages(queue) { } async function sendKeygen(event) { - const newEpoch = event.returnValues.newEpoch.toNumber() + const newEpoch = event.values.newEpoch.toNumber() keygenQueue.send({ epoch: newEpoch, blockNumber, - threshold: (await bridge.methods.getThreshold(newEpoch) - .call()).toNumber(), - parties: (await bridge.methods.getParties(newEpoch) - .call()).toNumber() + threshold: (await bridge.getThreshold(newEpoch)).toNumber(), + parties: (await bridge.getParties(newEpoch)).toNumber() }) logger.debug('Sent keygen start event') } function sendKeygenCancellation(event) { - const eventEpoch = event.returnValues.epoch.toNumber() + const eventEpoch = event.values.epoch.toNumber() cancelKeygenQueue.send({ epoch: eventEpoch, blockNumber @@ -94,36 +102,33 @@ function sendKeygenCancellation(event) { } async function sendSignFundsTransfer(event) { - const newEpoch = event.returnValues.newEpoch.toNumber() - const oldEpoch = event.returnValues.oldEpoch.toNumber() + const newEpoch = event.values.newEpoch.toNumber() + const oldEpoch = event.values.oldEpoch.toNumber() signQueue.send({ epoch: oldEpoch, blockNumber, newEpoch, nonce: foreignNonce[oldEpoch], - threshold: (await bridge.methods.getThreshold(oldEpoch) - .call()).toNumber(), - parties: (await bridge.methods.getParties(oldEpoch) - .call()).toNumber() + threshold: (await bridge.getThreshold(oldEpoch)).toNumber(), + parties: (await bridge.getParties(oldEpoch)).toNumber() }) logger.debug('Sent sign funds transfer event') foreignNonce[oldEpoch] += 1 redisTx.incr(`foreignNonce${oldEpoch}`) } -async function sendSign(event) { - const tx = await homeWeb3.eth.getTransaction(event.transactionHash) - const msg = utils.serializeTransaction({ +async function sendSign(event, transactionHash) { + const tx = await provider.getTransaction(transactionHash) + const msg = ethers.utils.serializeTransaction({ nonce: tx.nonce, - gasPrice: `0x${new BN(tx.gasPrice).toString(16)}`, - gasLimit: `0x${new BN(tx.gas).toString(16)}`, + gasPrice: tx.gasPrice, + gasLimit: tx.gasLimit, to: tx.to, - value: `0x${new BN(tx.value).toString(16)}`, - data: tx.input, - chainId: await homeWeb3.eth.net.getId() + data: tx.data, + chainId }) - const hash = homeWeb3.utils.sha3(msg) - const publicKey = utils.recoverPublicKey(hash, { + const hash = ethers.utils.keccak256(msg) + const publicKey = ethers.utils.recoverPublicKey(hash, { r: tx.r, s: tx.s, v: tx.v @@ -135,9 +140,8 @@ async function sendSign(event) { x: publicKey.substr(4, 64), y: publicKey.substr(68, 64) }), - value: (new BN(event.returnValues.value)).dividedBy(10 ** 18) - .toFixed(8, 3), - nonce: event.returnValues.nonce.toNumber() + value: (new BN(event.values.value)).dividedBy(10 ** 18).toFixed(8, 3), + nonce: event.values.nonce.toNumber() } exchangeQueue.send(msgToQueue) @@ -154,22 +158,19 @@ async function sendStartSign() { epoch, blockNumber, nonce: foreignNonce[epoch], - threshold: (await bridge.methods.getThreshold(epoch) - .call()).toNumber(), - parties: (await bridge.methods.getParties(epoch) - .call()).toNumber() + threshold: (await bridge.getThreshold(epoch)).toNumber(), + parties: (await bridge.getParties(epoch)).toNumber() }) foreignNonce[epoch] += 1 } async function processEpochStart(event) { - epoch = event.returnValues.epoch.toNumber() + epoch = event.values.epoch.toNumber() epochStart = blockNumber logger.info(`Epoch ${epoch} started`) - rangeSize = (await bridge.methods.getRangeSize() - .call()).toNumber() - isCurrentValidator = (await bridge.methods.getValidators() - .call()).includes(validatorAddress) + rangeSize = (await bridge.getRangeSize()).toNumber() + isCurrentValidator = (await bridge.getValidators()) + .includes(validatorAddress) if (isCurrentValidator) { logger.info(`${validatorAddress} is a current validator`) } else { @@ -186,10 +187,16 @@ async function initialize() { keygenQueue = await assertQueue(channel, 'keygenQueue') cancelKeygenQueue = await assertQueue(channel, 'cancelKeygenQueue') - const events = await bridge.getPastEvents('EpochStart', { - fromBlock: 1 - }) - epoch = events.length ? events[events.length - 1].returnValues.epoch.toNumber() : 0 + chainId = (await provider.getNetwork()).chainId + + const events = (await provider.getLogs({ + address: HOME_BRIDGE_ADDRESS, + fromBlock: 1, + toBlock: 'latest', + topics: bridge.filters.EpochStart().topics + })).map((log) => bridge.interface.parseLog(log)) + + epoch = events.length ? events[events.length - 1].values.epoch.toNumber() : 0 logger.info(`Current epoch ${epoch}`) epochStart = events.length ? events[events.length - 1].blockNumber : 1 const saved = (parseInt(await redis.get('homeBlock'), 10) + 1) || parseInt(HOME_START_BLOCK, 10) @@ -206,10 +213,11 @@ async function initialize() { blockNumber = saved foreignNonce[epoch] = parseInt(await redis.get(`foreignNonce${epoch}`), 10) || 0 } - rangeSize = (await bridge.methods.getRangeSize().call()).toNumber() + rangeSize = (await bridge.getRangeSize()).toNumber() logger.debug(`Range size ${rangeSize}`) logger.debug('Checking if current validator') - isCurrentValidator = (await bridge.methods.getValidators().call()).includes(validatorAddress) + isCurrentValidator = (await bridge.getValidators()) + .includes(validatorAddress) if (isCurrentValidator) { logger.info(`${validatorAddress} is a current validator`) } else { @@ -226,60 +234,68 @@ async function initialize() { } async function loop() { - logger.debug(`Watching events in block #${blockNumber}`) - if (await homeWeb3.eth.getBlock(blockNumber) === null) { - logger.debug('No block') - await delay(1000) + const latestBlockNumber = await provider.getBlockNumber() + if (latestBlockNumber < blockNumber) { + logger.debug(`No block after ${latestBlockNumber}`) + await delay(2000) return } + const endBlock = Math.min(latestBlockNumber, blockNumber + HOME_MAX_FETCH_RANGE_SIZE - 1) + redisTx = redis.multi() - const bridgeEvents = await bridge.getPastEvents('allEvents', { + logger.debug(`Watching events in blocks #${blockNumber}-${endBlock}`) + + const bridgeEvents = (await provider.getLogs({ + address: HOME_BRIDGE_ADDRESS, fromBlock: blockNumber, - toBlock: blockNumber - }) + toBlock: endBlock, + topics: [] + })) - for (let i = 0; i < bridgeEvents.length; i += 1) { - const event = bridgeEvents[i] - switch (event.event) { - case 'NewEpoch': - await sendKeygen(event) - break - case 'NewEpochCancelled': - sendKeygenCancellation(event) - break - case 'NewFundsTransfer': - if (isCurrentValidator) { - await sendSignFundsTransfer(event) - } - break - case 'ExchangeRequest': - if (isCurrentValidator) { - await sendSign(event) - } - break - case 'EpochStart': - await processEpochStart(event) - break - default: - logger.warn('Unknown event %o', event) + for (let curBlockNumber = blockNumber, i = 0; curBlockNumber <= endBlock; curBlockNumber += 1) { + while (i < bridgeEvents.length && bridgeEvents[i].blockNumber === curBlockNumber) { + const event = bridge.interface.parseLog(bridgeEvents[i]) + logger.debug('%o %o', event, bridgeEvents[i]) + switch (event.name) { + case 'NewEpoch': + await sendKeygen(event) + break + case 'NewEpochCancelled': + sendKeygenCancellation(event) + break + case 'NewFundsTransfer': + if (isCurrentValidator) { + await sendSignFundsTransfer(event) + } + break + case 'ExchangeRequest': + if (isCurrentValidator) { + await sendSign(event, bridgeEvents[i].transactionHash) + } + break + case 'EpochStart': + await processEpochStart(event) + break + default: + logger.warn('Unknown event %o', event) + } + i += 1 + } + if ((curBlockNumber + 1 - epochStart) % rangeSize === 0) { + logger.info('Reached end of the current block range') + + if (lastTransactionBlockNumber > curBlockNumber - rangeSize) { + logger.info('Sending message to start signature generation for the ended range') + await sendStartSign() + } } } - if ((blockNumber + 1 - epochStart) % rangeSize === 0) { - logger.info('Reached end of the current block range') - - if (lastTransactionBlockNumber > blockNumber - rangeSize) { - logger.info('Sending message to start signature generation for the ended range') - await sendStartSign() - } - } - - blockNumber += 1 + blockNumber = endBlock + 1 // Exec redis tx - await redisTx.incr('homeBlock') - .exec() + await redisTx.incr('homeBlock').exec() await redis.save() } diff --git a/src/oracle/ethWatcher/package.json b/src/oracle/ethWatcher/package.json index 26ec5a6..a7517af 100644 --- a/src/oracle/ethWatcher/package.json +++ b/src/oracle/ethWatcher/package.json @@ -4,7 +4,6 @@ "dependencies": { "ioredis": "4.10.0", "amqplib": "0.5.3", - "web3": "1.0.0-beta.55", "ethers": "4.0.33", "bignumber.js": "9.0.0", "bech32": "1.1.3", From 4f66ae95782958987fcf20da9398103d7b7b5a49 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Mon, 4 Nov 2019 18:01:35 +0300 Subject: [PATCH 060/129] Get rid of web3js in test-services --- src/test-services/ethereumBalance/Dockerfile | 2 +- src/test-services/ethereumBalance/IERC20.json | 1884 - .../ethereumBalance/package.json | 2 +- .../ethereumBalance/testGetEthereumBalance.js | 29 +- src/test-services/ethereumSend/Bridge.json | 29782 ---------------- src/test-services/ethereumSend/Dockerfile | 2 +- src/test-services/ethereumSend/IERC20.json | 1884 - src/test-services/ethereumSend/package.json | 3 +- .../ethereumSend/testEthereumSend.js | 103 +- src/test-services/sidePrefund/Dockerfile | 4 +- src/test-services/sidePrefund/package.json | 3 +- .../sidePrefund/testEthereumSend.js | 33 - .../sidePrefund/testSidePrefund.js | 26 + 13 files changed, 78 insertions(+), 33679 deletions(-) delete mode 100644 src/test-services/ethereumBalance/IERC20.json delete mode 100644 src/test-services/ethereumSend/Bridge.json delete mode 100644 src/test-services/ethereumSend/IERC20.json delete mode 100644 src/test-services/sidePrefund/testEthereumSend.js create mode 100644 src/test-services/sidePrefund/testSidePrefund.js diff --git a/src/test-services/ethereumBalance/Dockerfile b/src/test-services/ethereumBalance/Dockerfile index 7b6b094..0086b3e 100644 --- a/src/test-services/ethereumBalance/Dockerfile +++ b/src/test-services/ethereumBalance/Dockerfile @@ -6,6 +6,6 @@ COPY package.json /test/ RUN npm install -COPY testGetEthereumBalance.js IERC20.json /test/ +COPY testGetEthereumBalance.js /test/ ENTRYPOINT ["node", "testGetEthereumBalance.js"] diff --git a/src/test-services/ethereumBalance/IERC20.json b/src/test-services/ethereumBalance/IERC20.json deleted file mode 100644 index 066d309..0000000 --- a/src/test-services/ethereumBalance/IERC20.json +++ /dev/null @@ -1,1884 +0,0 @@ -{ - "contractName": "IERC20", - "abi": [ - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "from", - "type": "address" - }, - { - "indexed": true, - "name": "to", - "type": "address" - }, - { - "indexed": false, - "name": "value", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "name": "value", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "constant": true, - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "account", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "recipient", - "type": "address" - }, - { - "name": "amount", - "type": "uint256" - } - ], - "name": "transfer", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "owner", - "type": "address" - }, - { - "name": "spender", - "type": "address" - } - ], - "name": "allowance", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "spender", - "type": "address" - }, - { - "name": "amount", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "sender", - "type": "address" - }, - { - "name": "recipient", - "type": "address" - }, - { - "name": "amount", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - } - ], - "metadata": "{\"compiler\":{\"version\":\"0.5.9+commit.e560f70d\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":false,\"inputs\":[{\"name\":\"spender\",\"type\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"sender\",\"type\":\"address\"},{\"name\":\"recipient\",\"type\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"recipient\",\"type\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"owner\",\"type\":\"address\"},{\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"}],\"devdoc\":{\"details\":\"Interface of the ERC20 standard as defined in the EIP. Does not include the optional functions; to access them see `ERC20Detailed`.\",\"methods\":{\"allowance(address,address)\":{\"details\":\"Returns the remaining number of tokens that `spender` will be allowed to spend on behalf of `owner` through `transferFrom`. This is zero by default. * This value changes when `approve` or `transferFrom` are called.\"},\"approve(address,uint256)\":{\"details\":\"Sets `amount` as the allowance of `spender` over the caller's tokens. * Returns a boolean value indicating whether the operation succeeded. * > Beware that changing an allowance with this method brings the risk that someone may use both the old and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * Emits an `Approval` event.\"},\"balanceOf(address)\":{\"details\":\"Returns the amount of tokens owned by `account`.\"},\"totalSupply()\":{\"details\":\"Returns the amount of tokens in existence.\"},\"transfer(address,uint256)\":{\"details\":\"Moves `amount` tokens from the caller's account to `recipient`. * Returns a boolean value indicating whether the operation succeeded. * Emits a `Transfer` event.\"},\"transferFrom(address,address,uint256)\":{\"details\":\"Moves `amount` tokens from `sender` to `recipient` using the allowance mechanism. `amount` is then deducted from the caller's allowance. * Returns a boolean value indicating whether the operation succeeded. * Emits a `Transfer` event.\"}}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/build/contracts/openzeppelin-solidity/contracts/token/ERC20/IERC20.sol\":\"IERC20\"},\"evmVersion\":\"petersburg\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":3},\"remappings\":[]},\"sources\":{\"/build/contracts/openzeppelin-solidity/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0x90e8c2521653bbb1768b05889c5760031e688d9cd361f167489b89215e201b95\",\"urls\":[\"bzzr://aa8b45b57edafc3d67bc5d916327ea16807fae33f753ca163ae0c4061b789766\",\"dweb:/ipfs/QmP5NaEwZthQeM2ESz4WTT3osrP7jhbvu7ocbttBi2JAw6\"]}},\"version\":1}", - "bytecode": "0x", - "deployedBytecode": "0x", - "sourceMap": "", - "deployedSourceMap": "", - "source": "pragma solidity ^0.5.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP. Does not include\n * the optional functions; to access them see `ERC20Detailed`.\n */\ninterface IERC20 {\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a `Transfer` event.\n */\n function transfer(address recipient, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through `transferFrom`. This is\n * zero by default.\n *\n * This value changes when `approve` or `transferFrom` are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * > Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an `Approval` event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a `Transfer` event.\n */\n function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);\n\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to `approve`. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n}\n", - "sourcePath": "/build/contracts/openzeppelin-solidity/contracts/token/ERC20/IERC20.sol", - "ast": { - "absolutePath": "/build/contracts/openzeppelin-solidity/contracts/token/ERC20/IERC20.sol", - "exportedSymbols": { - "IERC20": [ - 9841 - ] - }, - "id": 9842, - "nodeType": "SourceUnit", - "nodes": [ - { - "id": 9774, - "literals": [ - "solidity", - "^", - "0.5", - ".0" - ], - "nodeType": "PragmaDirective", - "src": "0:23:114" - }, - { - "baseContracts": [], - "contractDependencies": [], - "contractKind": "interface", - "documentation": "@dev Interface of the ERC20 standard as defined in the EIP. Does not include\nthe optional functions; to access them see `ERC20Detailed`.", - "fullyImplemented": false, - "id": 9841, - "linearizedBaseContracts": [ - 9841 - ], - "name": "IERC20", - "nodeType": "ContractDefinition", - "nodes": [ - { - "body": null, - "documentation": "@dev Returns the amount of tokens in existence.", - "id": 9779, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "totalSupply", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 9775, - "nodeType": "ParameterList", - "parameters": [], - "src": "290:2:114" - }, - "returnParameters": { - "id": 9778, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 9777, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 9779, - "src": "316:7:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 9776, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "316:7:114", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "315:9:114" - }, - "scope": 9841, - "src": "270:55:114", - "stateMutability": "view", - "superFunction": 12575, - "visibility": "external" - }, - { - "body": null, - "documentation": "@dev Returns the amount of tokens owned by `account`.", - "id": 9786, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "balanceOf", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 9782, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 9781, - "name": "account", - "nodeType": "VariableDeclaration", - "scope": 9786, - "src": "427:15:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 9780, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "427:7:114", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "426:17:114" - }, - "returnParameters": { - "id": 9785, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 9784, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 9786, - "src": "467:7:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 9783, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "467:7:114", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "466:9:114" - }, - "scope": 9841, - "src": "408:68:114", - "stateMutability": "view", - "superFunction": 12582, - "visibility": "external" - }, - { - "body": null, - "documentation": "@dev Moves `amount` tokens from the caller's account to `recipient`.\n * Returns a boolean value indicating whether the operation succeeded.\n * Emits a `Transfer` event.", - "id": 9795, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "transfer", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 9791, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 9788, - "name": "recipient", - "nodeType": "VariableDeclaration", - "scope": 9795, - "src": "714:17:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 9787, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "714:7:114", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 9790, - "name": "amount", - "nodeType": "VariableDeclaration", - "scope": 9795, - "src": "733:14:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 9789, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "733:7:114", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "713:35:114" - }, - "returnParameters": { - "id": 9794, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 9793, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 9795, - "src": "767:4:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 9792, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "767:4:114", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "766:6:114" - }, - "scope": 9841, - "src": "696:77:114", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "external" - }, - { - "body": null, - "documentation": "@dev Returns the remaining number of tokens that `spender` will be\nallowed to spend on behalf of `owner` through `transferFrom`. This is\nzero by default.\n * This value changes when `approve` or `transferFrom` are called.", - "id": 9804, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "allowance", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 9800, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 9797, - "name": "owner", - "nodeType": "VariableDeclaration", - "scope": 9804, - "src": "1067:13:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 9796, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1067:7:114", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 9799, - "name": "spender", - "nodeType": "VariableDeclaration", - "scope": 9804, - "src": "1082:15:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 9798, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1082:7:114", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1066:32:114" - }, - "returnParameters": { - "id": 9803, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 9802, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 9804, - "src": "1122:7:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 9801, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1122:7:114", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1121:9:114" - }, - "scope": 9841, - "src": "1048:83:114", - "stateMutability": "view", - "superFunction": null, - "visibility": "external" - }, - { - "body": null, - "documentation": "@dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n * Returns a boolean value indicating whether the operation succeeded.\n * > Beware that changing an allowance with this method brings the risk\nthat someone may use both the old and the new allowance by unfortunate\ntransaction ordering. One possible solution to mitigate this race\ncondition is to first reduce the spender's allowance to 0 and set the\ndesired value afterwards:\nhttps://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n * Emits an `Approval` event.", - "id": 9813, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "approve", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 9809, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 9806, - "name": "spender", - "nodeType": "VariableDeclaration", - "scope": 9813, - "src": "1792:15:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 9805, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1792:7:114", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 9808, - "name": "amount", - "nodeType": "VariableDeclaration", - "scope": 9813, - "src": "1809:14:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 9807, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1809:7:114", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1791:33:114" - }, - "returnParameters": { - "id": 9812, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 9811, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 9813, - "src": "1843:4:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 9810, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "1843:4:114", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1842:6:114" - }, - "scope": 9841, - "src": "1775:74:114", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "external" - }, - { - "body": null, - "documentation": "@dev Moves `amount` tokens from `sender` to `recipient` using the\nallowance mechanism. `amount` is then deducted from the caller's\nallowance.\n * Returns a boolean value indicating whether the operation succeeded.\n * Emits a `Transfer` event.", - "id": 9824, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "transferFrom", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 9820, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 9815, - "name": "sender", - "nodeType": "VariableDeclaration", - "scope": 9824, - "src": "2178:14:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 9814, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2178:7:114", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 9817, - "name": "recipient", - "nodeType": "VariableDeclaration", - "scope": 9824, - "src": "2194:17:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 9816, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2194:7:114", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 9819, - "name": "amount", - "nodeType": "VariableDeclaration", - "scope": 9824, - "src": "2213:14:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 9818, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2213:7:114", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2177:51:114" - }, - "returnParameters": { - "id": 9823, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 9822, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 9824, - "src": "2247:4:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 9821, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "2247:4:114", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2246:6:114" - }, - "scope": 9841, - "src": "2156:97:114", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "external" - }, - { - "anonymous": false, - "documentation": "@dev Emitted when `value` tokens are moved from one account (`from`) to\nanother (`to`).\n * Note that `value` may be zero.", - "id": 9832, - "name": "Transfer", - "nodeType": "EventDefinition", - "parameters": { - "id": 9831, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 9826, - "indexed": true, - "name": "from", - "nodeType": "VariableDeclaration", - "scope": 9832, - "src": "2437:20:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 9825, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2437:7:114", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 9828, - "indexed": true, - "name": "to", - "nodeType": "VariableDeclaration", - "scope": 9832, - "src": "2459:18:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 9827, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2459:7:114", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 9830, - "indexed": false, - "name": "value", - "nodeType": "VariableDeclaration", - "scope": 9832, - "src": "2479:13:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 9829, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2479:7:114", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2436:57:114" - }, - "src": "2422:72:114" - }, - { - "anonymous": false, - "documentation": "@dev Emitted when the allowance of a `spender` for an `owner` is set by\na call to `approve`. `value` is the new allowance.", - "id": 9840, - "name": "Approval", - "nodeType": "EventDefinition", - "parameters": { - "id": 9839, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 9834, - "indexed": true, - "name": "owner", - "nodeType": "VariableDeclaration", - "scope": 9840, - "src": "2668:21:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 9833, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2668:7:114", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 9836, - "indexed": true, - "name": "spender", - "nodeType": "VariableDeclaration", - "scope": 9840, - "src": "2691:23:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 9835, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2691:7:114", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 9838, - "indexed": false, - "name": "value", - "nodeType": "VariableDeclaration", - "scope": 9840, - "src": "2716:13:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 9837, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2716:7:114", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2667:63:114" - }, - "src": "2653:78:114" - } - ], - "scope": 9842, - "src": "176:2557:114" - } - ], - "src": "0:2734:114" - }, - "legacyAST": { - "absolutePath": "/build/contracts/openzeppelin-solidity/contracts/token/ERC20/IERC20.sol", - "exportedSymbols": { - "IERC20": [ - 9841 - ] - }, - "id": 9842, - "nodeType": "SourceUnit", - "nodes": [ - { - "id": 9774, - "literals": [ - "solidity", - "^", - "0.5", - ".0" - ], - "nodeType": "PragmaDirective", - "src": "0:23:114" - }, - { - "baseContracts": [], - "contractDependencies": [], - "contractKind": "interface", - "documentation": "@dev Interface of the ERC20 standard as defined in the EIP. Does not include\nthe optional functions; to access them see `ERC20Detailed`.", - "fullyImplemented": false, - "id": 9841, - "linearizedBaseContracts": [ - 9841 - ], - "name": "IERC20", - "nodeType": "ContractDefinition", - "nodes": [ - { - "body": null, - "documentation": "@dev Returns the amount of tokens in existence.", - "id": 9779, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "totalSupply", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 9775, - "nodeType": "ParameterList", - "parameters": [], - "src": "290:2:114" - }, - "returnParameters": { - "id": 9778, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 9777, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 9779, - "src": "316:7:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 9776, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "316:7:114", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "315:9:114" - }, - "scope": 9841, - "src": "270:55:114", - "stateMutability": "view", - "superFunction": 12575, - "visibility": "external" - }, - { - "body": null, - "documentation": "@dev Returns the amount of tokens owned by `account`.", - "id": 9786, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "balanceOf", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 9782, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 9781, - "name": "account", - "nodeType": "VariableDeclaration", - "scope": 9786, - "src": "427:15:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 9780, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "427:7:114", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "426:17:114" - }, - "returnParameters": { - "id": 9785, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 9784, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 9786, - "src": "467:7:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 9783, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "467:7:114", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "466:9:114" - }, - "scope": 9841, - "src": "408:68:114", - "stateMutability": "view", - "superFunction": 12582, - "visibility": "external" - }, - { - "body": null, - "documentation": "@dev Moves `amount` tokens from the caller's account to `recipient`.\n * Returns a boolean value indicating whether the operation succeeded.\n * Emits a `Transfer` event.", - "id": 9795, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "transfer", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 9791, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 9788, - "name": "recipient", - "nodeType": "VariableDeclaration", - "scope": 9795, - "src": "714:17:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 9787, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "714:7:114", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 9790, - "name": "amount", - "nodeType": "VariableDeclaration", - "scope": 9795, - "src": "733:14:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 9789, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "733:7:114", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "713:35:114" - }, - "returnParameters": { - "id": 9794, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 9793, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 9795, - "src": "767:4:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 9792, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "767:4:114", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "766:6:114" - }, - "scope": 9841, - "src": "696:77:114", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "external" - }, - { - "body": null, - "documentation": "@dev Returns the remaining number of tokens that `spender` will be\nallowed to spend on behalf of `owner` through `transferFrom`. This is\nzero by default.\n * This value changes when `approve` or `transferFrom` are called.", - "id": 9804, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "allowance", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 9800, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 9797, - "name": "owner", - "nodeType": "VariableDeclaration", - "scope": 9804, - "src": "1067:13:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 9796, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1067:7:114", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 9799, - "name": "spender", - "nodeType": "VariableDeclaration", - "scope": 9804, - "src": "1082:15:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 9798, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1082:7:114", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1066:32:114" - }, - "returnParameters": { - "id": 9803, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 9802, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 9804, - "src": "1122:7:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 9801, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1122:7:114", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1121:9:114" - }, - "scope": 9841, - "src": "1048:83:114", - "stateMutability": "view", - "superFunction": null, - "visibility": "external" - }, - { - "body": null, - "documentation": "@dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n * Returns a boolean value indicating whether the operation succeeded.\n * > Beware that changing an allowance with this method brings the risk\nthat someone may use both the old and the new allowance by unfortunate\ntransaction ordering. One possible solution to mitigate this race\ncondition is to first reduce the spender's allowance to 0 and set the\ndesired value afterwards:\nhttps://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n * Emits an `Approval` event.", - "id": 9813, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "approve", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 9809, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 9806, - "name": "spender", - "nodeType": "VariableDeclaration", - "scope": 9813, - "src": "1792:15:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 9805, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1792:7:114", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 9808, - "name": "amount", - "nodeType": "VariableDeclaration", - "scope": 9813, - "src": "1809:14:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 9807, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1809:7:114", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1791:33:114" - }, - "returnParameters": { - "id": 9812, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 9811, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 9813, - "src": "1843:4:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 9810, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "1843:4:114", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1842:6:114" - }, - "scope": 9841, - "src": "1775:74:114", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "external" - }, - { - "body": null, - "documentation": "@dev Moves `amount` tokens from `sender` to `recipient` using the\nallowance mechanism. `amount` is then deducted from the caller's\nallowance.\n * Returns a boolean value indicating whether the operation succeeded.\n * Emits a `Transfer` event.", - "id": 9824, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "transferFrom", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 9820, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 9815, - "name": "sender", - "nodeType": "VariableDeclaration", - "scope": 9824, - "src": "2178:14:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 9814, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2178:7:114", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 9817, - "name": "recipient", - "nodeType": "VariableDeclaration", - "scope": 9824, - "src": "2194:17:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 9816, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2194:7:114", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 9819, - "name": "amount", - "nodeType": "VariableDeclaration", - "scope": 9824, - "src": "2213:14:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 9818, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2213:7:114", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2177:51:114" - }, - "returnParameters": { - "id": 9823, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 9822, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 9824, - "src": "2247:4:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 9821, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "2247:4:114", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2246:6:114" - }, - "scope": 9841, - "src": "2156:97:114", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "external" - }, - { - "anonymous": false, - "documentation": "@dev Emitted when `value` tokens are moved from one account (`from`) to\nanother (`to`).\n * Note that `value` may be zero.", - "id": 9832, - "name": "Transfer", - "nodeType": "EventDefinition", - "parameters": { - "id": 9831, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 9826, - "indexed": true, - "name": "from", - "nodeType": "VariableDeclaration", - "scope": 9832, - "src": "2437:20:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 9825, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2437:7:114", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 9828, - "indexed": true, - "name": "to", - "nodeType": "VariableDeclaration", - "scope": 9832, - "src": "2459:18:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 9827, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2459:7:114", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 9830, - "indexed": false, - "name": "value", - "nodeType": "VariableDeclaration", - "scope": 9832, - "src": "2479:13:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 9829, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2479:7:114", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2436:57:114" - }, - "src": "2422:72:114" - }, - { - "anonymous": false, - "documentation": "@dev Emitted when the allowance of a `spender` for an `owner` is set by\na call to `approve`. `value` is the new allowance.", - "id": 9840, - "name": "Approval", - "nodeType": "EventDefinition", - "parameters": { - "id": 9839, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 9834, - "indexed": true, - "name": "owner", - "nodeType": "VariableDeclaration", - "scope": 9840, - "src": "2668:21:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 9833, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2668:7:114", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 9836, - "indexed": true, - "name": "spender", - "nodeType": "VariableDeclaration", - "scope": 9840, - "src": "2691:23:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 9835, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2691:7:114", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 9838, - "indexed": false, - "name": "value", - "nodeType": "VariableDeclaration", - "scope": 9840, - "src": "2716:13:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 9837, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2716:7:114", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2667:63:114" - }, - "src": "2653:78:114" - } - ], - "scope": 9842, - "src": "176:2557:114" - } - ], - "src": "0:2734:114" - }, - "compiler": { - "name": "solc", - "version": "0.5.9+commit.e560f70d.Emscripten.clang" - }, - "networks": {}, - "schemaVersion": "3.0.11", - "updatedAt": "2019-07-17T07:17:15.653Z", - "devdoc": { - "details": "Interface of the ERC20 standard as defined in the EIP. Does not include the optional functions; to access them see `ERC20Detailed`.", - "methods": { - "allowance(address,address)": { - "details": "Returns the remaining number of tokens that `spender` will be allowed to spend on behalf of `owner` through `transferFrom`. This is zero by default. * This value changes when `approve` or `transferFrom` are called." - }, - "approve(address,uint256)": { - "details": "Sets `amount` as the allowance of `spender` over the caller's tokens. * Returns a boolean value indicating whether the operation succeeded. * > Beware that changing an allowance with this method brings the risk that someone may use both the old and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * Emits an `Approval` event." - }, - "balanceOf(address)": { - "details": "Returns the amount of tokens owned by `account`." - }, - "totalSupply()": { - "details": "Returns the amount of tokens in existence." - }, - "transfer(address,uint256)": { - "details": "Moves `amount` tokens from the caller's account to `recipient`. * Returns a boolean value indicating whether the operation succeeded. * Emits a `Transfer` event." - }, - "transferFrom(address,address,uint256)": { - "details": "Moves `amount` tokens from `sender` to `recipient` using the allowance mechanism. `amount` is then deducted from the caller's allowance. * Returns a boolean value indicating whether the operation succeeded. * Emits a `Transfer` event." - } - } - }, - "userdoc": { - "methods": {} - } -} \ No newline at end of file diff --git a/src/test-services/ethereumBalance/package.json b/src/test-services/ethereumBalance/package.json index fcb5d8c..f593cf6 100644 --- a/src/test-services/ethereumBalance/package.json +++ b/src/test-services/ethereumBalance/package.json @@ -2,7 +2,7 @@ "name": "ethereum-balance", "version": "0.0.1", "dependencies": { - "web3": "1.0.0-beta.55", + "ethers": "4.0.39", "bignumber.js": "9.0.0" } } diff --git a/src/test-services/ethereumBalance/testGetEthereumBalance.js b/src/test-services/ethereumBalance/testGetEthereumBalance.js index 8b9ac8a..582707c 100644 --- a/src/test-services/ethereumBalance/testGetEthereumBalance.js +++ b/src/test-services/ethereumBalance/testGetEthereumBalance.js @@ -1,25 +1,28 @@ -const Web3 = require('web3') +const ethers = require('ethers') const BN = require('bignumber.js') const { HOME_RPC_URL, HOME_TOKEN_ADDRESS } = process.env -const abiToken = require('./IERC20').abi +const tokenAbi = [ + 'function balanceOf(address account) view returns (uint256)' +] -const web3 = new Web3(HOME_RPC_URL, null, { transactionConfirmationBlocks: 1 }) -const token = new web3.eth.Contract(abiToken, HOME_TOKEN_ADDRESS) +const provider = new ethers.providers.JsonRpcProvider(HOME_RPC_URL) +const token = new ethers.Contract(HOME_TOKEN_ADDRESS, tokenAbi, provider) -function main() { +async function main() { const address = process.argv[2] - web3.eth.getBalance(address) - .then((balance) => console.log(`${balance.toString()} wei`)) + const ethBalance = await provider.getBalance(address) + console.log(`${ethBalance.toString()} wei`) - token.methods.balanceOf(address) - .call() - .then((balance) => parseFloat(new BN(balance).dividedBy(10 ** 18) - .toFixed(8, 3))) - .then((balance) => console.log(`${balance.toString()} tokens`)) - .catch(() => console.log('0 tokens')) + try { + const ercBalance = await token.balanceOf(address) + const floatBalance = new BN(ercBalance).dividedBy(10 ** 18).toFixed(8, 3) + console.log(`${floatBalance.toString()} tokens`) + } catch (e) { + console.log('0 tokens') + } } main() diff --git a/src/test-services/ethereumSend/Bridge.json b/src/test-services/ethereumSend/Bridge.json deleted file mode 100644 index ff90709..0000000 --- a/src/test-services/ethereumSend/Bridge.json +++ /dev/null @@ -1,29782 +0,0 @@ -{ - "contractName": "Bridge", - "abi": [ - { - "constant": true, - "inputs": [], - "name": "status", - "outputs": [ - { - "name": "", - "type": "uint8" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "", - "type": "bytes32" - } - ], - "name": "votes", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "", - "type": "bytes32" - } - ], - "name": "dbTransfer", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "tokenContract", - "outputs": [ - { - "name": "", - "type": "address" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "epoch", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "", - "type": "bytes32" - } - ], - "name": "votesCount", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "nextEpoch", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "", - "type": "bytes32" - } - ], - "name": "dbTransferCount", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "name": "threshold", - "type": "uint256" - }, - { - "name": "validators", - "type": "address[]" - }, - { - "name": "_tokenContract", - "type": "address" - }, - { - "name": "limits", - "type": "uint256[2]" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "name": "value", - "type": "uint256" - } - ], - "name": "ExchangeRequest", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "oldEpoch", - "type": "uint256" - }, - { - "indexed": true, - "name": "newEpoch", - "type": "uint256" - } - ], - "name": "NewEpoch", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "epoch", - "type": "uint256" - } - ], - "name": "NewEpochCancelled", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "oldEpoch", - "type": "uint256" - }, - { - "indexed": true, - "name": "newEpoch", - "type": "uint256" - } - ], - "name": "NewFundsTransfer", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "epoch", - "type": "uint256" - }, - { - "indexed": false, - "name": "x", - "type": "uint256" - }, - { - "indexed": false, - "name": "y", - "type": "uint256" - } - ], - "name": "EpochStart", - "type": "event" - }, - { - "constant": false, - "inputs": [ - { - "name": "value", - "type": "uint256" - } - ], - "name": "exchange", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "hash", - "type": "bytes32" - }, - { - "name": "to", - "type": "address" - }, - { - "name": "value", - "type": "uint256" - } - ], - "name": "transfer", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "x", - "type": "uint256" - }, - { - "name": "y", - "type": "uint256" - } - ], - "name": "confirmKeygen", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [], - "name": "confirmFundsTransfer", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "getNextParties", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "getParties", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "_epoch", - "type": "uint256" - } - ], - "name": "getParties", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "getNextThreshold", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "getThreshold", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "_epoch", - "type": "uint256" - } - ], - "name": "getThreshold", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "getX", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "getY", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "getPartyId", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "a", - "type": "address" - } - ], - "name": "getNextPartyId", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "getValidators", - "outputs": [ - { - "name": "", - "type": "address[]" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "getNextValidators", - "outputs": [ - { - "name": "", - "type": "address[]" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [], - "name": "startVoting", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "validator", - "type": "address" - } - ], - "name": "voteAddValidator", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "validator", - "type": "address" - } - ], - "name": "voteRemoveValidator", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "threshold", - "type": "uint256" - } - ], - "name": "voteChangeThreshold", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [], - "name": "voteStartKeygen", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [], - "name": "voteCancelKeygen", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - } - ], - "metadata": "{\"compiler\":{\"version\":\"0.5.9+commit.e560f70d\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":true,\"inputs\":[],\"name\":\"getNextParties\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getY\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"a\",\"type\":\"address\"}],\"name\":\"getNextPartyId\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"startVoting\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"status\",\"outputs\":[{\"name\":\"\",\"type\":\"uint8\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"votes\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getPartyId\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"voteCancelKeygen\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"hash\",\"type\":\"bytes32\"},{\"name\":\"to\",\"type\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getNextValidators\",\"outputs\":[{\"name\":\"\",\"type\":\"address[]\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_epoch\",\"type\":\"uint256\"}],\"name\":\"getParties\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_epoch\",\"type\":\"uint256\"}],\"name\":\"getThreshold\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"dbTransfer\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getX\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"exchange\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"tokenContract\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"validator\",\"type\":\"address\"}],\"name\":\"voteAddValidator\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getNextThreshold\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"epoch\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"voteStartKeygen\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"validator\",\"type\":\"address\"}],\"name\":\"voteRemoveValidator\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"x\",\"type\":\"uint256\"},{\"name\":\"y\",\"type\":\"uint256\"}],\"name\":\"confirmKeygen\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getParties\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"votesCount\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"nextEpoch\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getValidators\",\"outputs\":[{\"name\":\"\",\"type\":\"address[]\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"threshold\",\"type\":\"uint256\"}],\"name\":\"voteChangeThreshold\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"dbTransferCount\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"confirmFundsTransfer\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getThreshold\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"threshold\",\"type\":\"uint256\"},{\"name\":\"validators\",\"type\":\"address[]\"},{\"name\":\"_tokenContract\",\"type\":\"address\"},{\"name\":\"limits\",\"type\":\"uint256[2]\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"ExchangeRequest\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"oldEpoch\",\"type\":\"uint256\"},{\"indexed\":true,\"name\":\"newEpoch\",\"type\":\"uint256\"}],\"name\":\"NewEpoch\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"epoch\",\"type\":\"uint256\"}],\"name\":\"NewEpochCancelled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"oldEpoch\",\"type\":\"uint256\"},{\"indexed\":true,\"name\":\"newEpoch\",\"type\":\"uint256\"}],\"name\":\"NewFundsTransfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"epoch\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"x\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"y\",\"type\":\"uint256\"}],\"name\":\"EpochStart\",\"type\":\"event\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/Users/kirillfedoseev/Innopolis/My own projects/bridge/bridge/src/deploy/deploy-home/contracts/Bridge.sol\":\"Bridge\"},\"evmVersion\":\"petersburg\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":3},\"remappings\":[]},\"sources\":{\"/Users/kirillfedoseev/Innopolis/My own projects/bridge/bridge/src/deploy/deploy-home/contracts/Bridge.sol\":{\"keccak256\":\"0xb6dedd38aa6fa77b6a773e2bc87673d94587af628b2bc99a7fa7343b52e9afd7\",\"urls\":[\"bzzr://ac452822ae25877586c3e6280f8c5ca00bbe37a5558e4560f70d18448ee92122\",\"dweb:/ipfs/QmZ6bwZLh8Jzs5Aw2ec347YrXapwRWDZBgFqUkPHASoChU\"]},\"/Users/kirillfedoseev/Innopolis/My own projects/bridge/bridge/src/deploy/deploy-home/contracts/openzeppelin-solidity/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0x90e8c2521653bbb1768b05889c5760031e688d9cd361f167489b89215e201b95\",\"urls\":[\"bzzr://aa8b45b57edafc3d67bc5d916327ea16807fae33f753ca163ae0c4061b789766\",\"dweb:/ipfs/QmP5NaEwZthQeM2ESz4WTT3osrP7jhbvu7ocbttBi2JAw6\"]}},\"version\":1}", - "bytecode": "0x60806040523480156200001157600080fd5b5060405162001b6b38038062001b6b833981810160405260a08110156200003757600080fd5b8151602083018051919392830192916401000000008111156200005957600080fd5b820160208101848111156200006d57600080fd5b81518560208202830111640100000000821117156200008b57600080fd5b5050602082015181519194509250604090910190620000a957600080fd5b82518410620000b757600080fd5b600a80546001600160a01b0384166001600160a01b0319909116179055600060068190556005805460ff1916600217905560016007819055604080516080810182528681526020808201899052918101849052606081018490529183529182528051805191927fada5013122d395ba3c54772283fb069b10426056ef8ca54750cb9bb552a59e7d926200014e9284920190620001bd565b506020820151600182015560408201516002820155606090910151600390910155806000602002015160085580600160200201516009556040516001906000907f3ef85928df9ae51bdb3eb4c00ec73b92b82307f319ac1b029de14796a0972609908290a35050505062000251565b82805482825590600052602060002090810192821562000215579160200282015b828111156200021557825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190620001de565b506200022392915062000227565b5090565b6200024e91905b80821115620002235780546001600160a01b03191681556001016200022e565b90565b61190a80620002616000396000f3fe608060405234801561001057600080fd5b506004361061016a5760003560e01c8063073ce82d1461016f5780630b7f166514610189578063197d6ca4146101915780631ec6b60a146101b7578063200d2ed2146101c15780632b38cd96146101ed5780632fb0fc6f1461021e57806339f0ebb1146102265780633feb1bd81461022e57806340cddab314610260578063447fe289146102b85780634615d5e9146102d557806349f92f63146102f25780635197c7aa1461030f578063535565591461031757806355a373d61461033457806357456f22146103585780638199d3fd1461037e578063900cf0cf14610386578063915eb0e71461038e5780639bf6a74a14610396578063a7699d02146103bc578063a8311aa8146103df578063aae46bab146103e7578063aea0e78b14610404578063b7ab4db51461040c578063cc8ee06514610414578063d09fc00414610431578063df7852301461044e578063e75235b814610456575b600080fd5b61017761045e565b60408051918252519081900360200190f35b610177610471565b610177600480360360208110156101a757600080fd5b50356001600160a01b0316610489565b6101bf6104f6565b005b6101c9610621565b604051808260038111156101d957fe5b60ff16815260200191505060405180910390f35b61020a6004803603602081101561020357600080fd5b503561062a565b604080519115158252519081900360200190f35b61017761063f565b6101bf6106a9565b6101bf6004803603606081101561024457600080fd5b508035906001600160a01b036020820135169060400135610795565b6102686108f5565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156102a457818101518382015260200161028c565b505050509050019250505060405180910390f35b610177600480360360208110156102ce57600080fd5b5035610960565b610177600480360360208110156102eb57600080fd5b5035610972565b61020a6004803603602081101561030857600080fd5b5035610987565b61017761099c565b6101bf6004803603602081101561032d57600080fd5b50356109b4565b61033c610af8565b604080516001600160a01b039092168252519081900360200190f35b6101bf6004803603602081101561036e57600080fd5b50356001600160a01b0316610b07565b610177610c47565b610177610c54565b6101bf610c5a565b6101bf600480360360208110156103ac57600080fd5b50356001600160a01b0316610d49565b6101bf600480360360408110156103d257600080fd5b5080359060200135610e58565b610177610fc4565b610177600480360360208110156103fd57600080fd5b5035610fd1565b610177610fe3565b610268610fe9565b6101bf6004803603602081101561042a57600080fd5b5035611052565b6101776004803603602081101561044757600080fd5b503561111b565b6101bf61112d565b61017761127d565b600061046b600754610960565b90505b90565b60065460009081526020819052604090206003015490565b600060606104956108f5565b905060005b6104a261045e565b8110156104ea57836001600160a01b03168282815181106104bf57fe5b60200260200101516001600160a01b031614156104e25760010191506104f19050565b60010161049a565b5060009150505b919050565b600060055460ff16600381111561050957fe5b14806105255750600160055460ff16600381111561052357fe5b145b610575576040805162461bcd60e51b815260206004820152601c60248201527b4e6f7420696e207265616479206f7220766f74696e6720737461746560201b604482015290519081900360640190fd5b61057d61063f565b6105bc576040805162461bcd60e51b815260206004820152601760248201526000805160206118b6833981519152604482015290519081900360640190fd5b6105c6600261128a565b1561061f576007805460019081018083556005805460ff19168317905560068054600090815260208190526040808220850154938252808220909401929092555481528181209254815220815461061d92906117bb565b505b565b60055460ff1681565b60046020526000908152604090205460ff1681565b6000606061064b610fe9565b905060005b610658610fc4565b8110156106a057336001600160a01b031682828151811061067557fe5b60200260200101516001600160a01b0316141561069857600101915061046e9050565b600101610650565b50600091505090565b600260055460ff1660038111156106bc57fe5b14610704576040805162461bcd60e51b81526020600482015260136024820152724e6f7420696e206b657967656e20737461746560681b604482015290519081900360640190fd5b61070c61063f565b61074b576040805162461bcd60e51b815260206004820152601760248201526000805160206118b6833981519152604482015290519081900360640190fd5b610755600761128a565b1561061f576005805460ff191660011790556007546040517fddbb65cfe1ae4aec03cef0f9667c6d7ba3740927d0c60f4dd4d7104cc31d180a90600090a2565b600060055460ff1660038111156107a857fe5b14806107c45750600160055460ff1660038111156107c257fe5b145b610814576040805162461bcd60e51b815260206004820152601c60248201527b4e6f7420696e207265616479206f7220766f74696e6720737461746560201b604482015290519081900360640190fd5b61081c61063f565b61085b576040805162461bcd60e51b815260206004820152601760248201526000805160206118b6833981519152604482015290519081900360640190fd5b61086860088484846112e1565b156108f057600a546040805163a9059cbb60e01b81526001600160a01b038581166004830152602482018590529151919092169163a9059cbb9160448083019260209291908290030181600087803b1580156108c357600080fd5b505af11580156108d7573d6000803e3d6000fd5b505050506040513d60208110156108ed57600080fd5b50505b505050565b6007546000908152602081815260409182902080548351818402810184019094528084526060939283018282801561095657602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610938575b5050505050905090565b60009081526020819052604090205490565b60009081526020819052604090206001015490565b60026020526000908152604090205460ff1681565b60065460009081526020819052604090206002015490565b600060055460ff1660038111156109c757fe5b14610a0e576040805162461bcd60e51b81526020600482015260126024820152714e6f7420696e20726561647920737461746560701b604482015290519081900360640190fd5b6008548110158015610a2557506402540be4008110155b8015610a3357506009548111155b610a3c57600080fd5b600a54604080516323b872dd60e01b81523360048201523060248201526044810184905290516001600160a01b03909216916323b872dd916064808201926020929091908290030181600087803b158015610a9657600080fd5b505af1158015610aaa573d6000803e3d6000fd5b505050506040513d6020811015610ac057600080fd5b50506040805182815290517f62e1f484b3909b2c013673bad76a9f14b010600ba983f11ad26e83082883570e9181900360200190a150565b600a546001600160a01b031681565b600160055460ff166003811115610b1a57fe5b14610b62576040805162461bcd60e51b81526020600482015260136024820152724e6f7420696e20766f74696e6720737461746560681b604482015290519081900360640190fd5b610b6a61063f565b610ba9576040805162461bcd60e51b815260206004820152601760248201526000805160206118b6833981519152604482015290519081900360640190fd5b610bb281610489565b15610bfa576040805162461bcd60e51b815260206004820152601360248201527220b63932b0b23c9030903b30b634b230ba37b960691b604482015290519081900360640190fd5b610c0560038261135e565b1561061d576007546000908152602081815260408220805460018101825590835291200180546001600160a01b0383166001600160a01b031990911617905550565b600061046b600754610972565b60065481565b600160055460ff166003811115610c6d57fe5b14610cb5576040805162461bcd60e51b81526020600482015260136024820152724e6f7420696e20766f74696e6720737461746560681b604482015290519081900360640190fd5b610cbd61063f565b610cfc576040805162461bcd60e51b815260206004820152601760248201526000805160206118b6833981519152604482015290519081900360640190fd5b610d06600661128a565b1561061f576005805460ff191660021790556007546006546040517f3ef85928df9ae51bdb3eb4c00ec73b92b82307f319ac1b029de14796a097260990600090a3565b600160055460ff166003811115610d5c57fe5b14610da4576040805162461bcd60e51b81526020600482015260136024820152724e6f7420696e20766f74696e6720737461746560681b604482015290519081900360640190fd5b610dac61063f565b610deb576040805162461bcd60e51b815260206004820152601760248201526000805160206118b6833981519152604482015290519081900360640190fd5b610df481610489565b610e3f576040805162461bcd60e51b815260206004820152601760248201527620b63932b0b23c903737ba1030903b30b634b230ba37b960491b604482015290519081900360640190fd5b610e4a60048261135e565b1561061d5761061d816113d3565b600260055460ff166003811115610e6b57fe5b14610eb3576040805162461bcd60e51b81526020600482015260136024820152724e6f7420696e206b657967656e20737461746560681b604482015290519081900360640190fd5b610ebc33610489565b610f04576040805162461bcd60e51b81526020600482015260146024820152732737ba1030903732bc3a103b30b634b230ba37b960611b604482015290519081900360640190fd5b610f1060008383611520565b15610fc057600780546000908152602081905260408082206002018590558254825290206003018290555460011415610f83576005805460ff1916905560075460068190556040805184815260208101849052815160008051602061186e833981519152929181900390910190a2610fc0565b6005805460ff191660031790556007546006546040517ff4735b85cc98f9a712832825ecab4cfb1649d658f9a73c57a00ea7dde735c79b90600090a35b5050565b600061046b600654610960565b60036020526000908152604090205481565b60075481565b60065460009081526020818152604091829020805483518184028101840190945280845260609392830182828015610956576020028201919060005260206000209081546001600160a01b03168152600190910190602001808311610938575050505050905090565b600160055460ff16600381111561106557fe5b146110ad576040805162461bcd60e51b81526020600482015260136024820152724e6f7420696e20766f74696e6720737461746560681b604482015290519081900360640190fd5b6110b561063f565b6110f4576040805162461bcd60e51b815260206004820152601760248201526000805160206118b6833981519152604482015290519081900360640190fd5b6110ff600582611589565b1561061d57600754600090815260208190526040902060010155565b60016020526000908152604090205481565b600360055460ff16600381111561114057fe5b14611190576040805162461bcd60e51b815260206004820152601b60248201527a4e6f7420696e2066756e6473207472616e7366657220737461746560281b604482015290519081900360640190fd5b61119861063f565b6111d7576040805162461bcd60e51b815260206004820152601760248201526000805160206118b6833981519152604482015290519081900360640190fd5b6000600654116112185760405162461bcd60e51b815260040180806020018281038252602881526020018061188e6028913960400191505060405180910390fd5b61122260016115e1565b1561061f576005805460ff191690556007546006819055600081815260208181526040918290206002810154600390910154835191825291810191909152815160008051602061186e833981519152929181900390910190a2565b600061046b600654610972565b60008082600754604051602001808360088111156112a457fe5b60ff1660f81b8152600101828152602001925050506040516020818303038152906040528051906020012090506112da81611631565b9392505050565b60008085858585604051602001808560088111156112fb57fe5b60ff1660f81b8152600101848152602001836001600160a01b03166001600160a01b031660601b815260140182815260200194505050505060405160208183030381529060405280519060200120905061135481611631565b9695505050505050565b60008083600754846040516020018084600881111561137957fe5b60ff1660f81b8152600101838152602001826001600160a01b03166001600160a01b031660601b815260140193505050506040516020818303038152906040528051906020012090506113cb81611631565b949350505050565b60005b60016113e061045e565b038110156114c157600754600090815260208190526040902080546001600160a01b03841691908390811061141157fe5b6000918252602090912001546001600160a01b031614156114b9576007546000908152602081905260409020600161144761045e565b038154811061145257fe5b6000918252602080832090910154600754835290829052604090912080546001600160a01b03909216918390811061148657fe5b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506114c1565b6001016113d6565b50600754600090815260208190526040902060016114dd61045e565b03815481106114e857fe5b6000918252602080832090910180546001600160a01b0319169055600754825281905260409020805490610fc090600019830161180b565b6000808460075485856040516020018085600881111561153c57fe5b60ff1660f81b815260010184815260200183815260200182815260200194505050505060405160208183030381529060405280519060200120905061158081611704565b95945050505050565b6000808360075484604051602001808460088111156115a457fe5b60ff1660f81b815260010183815260200182815260200193505050506040516020818303038152906040528051906020012090506113cb81611631565b60008082600754604051602001808360088111156115fb57fe5b60ff1660f81b8152600101828152602001925050506040516020818303038152906040528051906020012090506112da81611704565b60008061163d8361178c565b60008181526004602052604090205490915060ff1615611694576040805162461bcd60e51b815260206004820152600d60248201526c566f74656420616c726561647960981b604482015290519081900360640190fd5b6000818152600460205260409020805460ff191660011790556116b561127d565b60008481526003602052604090205414156116e85750506000818152600360205260409020600160ff1b905560016104f1565b50506000818152600360205260408120805460010190556104f1565b6000806117108361178c565b60008181526004602052604090205490915060ff161561176b576040805162461bcd60e51b8152602060048201526011602482015270436f6e6669726d656420616c726561647960781b604482015290519081900360640190fd5b6000818152600460205260409020805460ff191660011790556116b5610c47565b604080516020808201939093523360601b81830152815180820360340181526054909101909152805191012090565b8280548282559060005260206000209081019282156117fb5760005260206000209182015b828111156117fb5782548255916001019190600101906117e0565b5061180792915061182f565b5090565b8154818355818111156108f0576000838152602090206108f0918101908301611853565b61046e91905b808211156118075780546001600160a01b0319168155600101611835565b61046e91905b80821115611807576000815560010161185956fec33272939f066c227e913a4b3434d860794f185c551685c29451a3a38b9b259c46697273742065706f636820646f6573206e6f74206e6565642066756e6473207472616e736665724e6f7420612063757272656e742076616c696461746f72000000000000000000a265627a7a72305820d9301198933836c8992bbab8e6c0ca596e021ff34c7db645c59302c42a24ea3264736f6c63430005090032", - "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061016a5760003560e01c8063073ce82d1461016f5780630b7f166514610189578063197d6ca4146101915780631ec6b60a146101b7578063200d2ed2146101c15780632b38cd96146101ed5780632fb0fc6f1461021e57806339f0ebb1146102265780633feb1bd81461022e57806340cddab314610260578063447fe289146102b85780634615d5e9146102d557806349f92f63146102f25780635197c7aa1461030f578063535565591461031757806355a373d61461033457806357456f22146103585780638199d3fd1461037e578063900cf0cf14610386578063915eb0e71461038e5780639bf6a74a14610396578063a7699d02146103bc578063a8311aa8146103df578063aae46bab146103e7578063aea0e78b14610404578063b7ab4db51461040c578063cc8ee06514610414578063d09fc00414610431578063df7852301461044e578063e75235b814610456575b600080fd5b61017761045e565b60408051918252519081900360200190f35b610177610471565b610177600480360360208110156101a757600080fd5b50356001600160a01b0316610489565b6101bf6104f6565b005b6101c9610621565b604051808260038111156101d957fe5b60ff16815260200191505060405180910390f35b61020a6004803603602081101561020357600080fd5b503561062a565b604080519115158252519081900360200190f35b61017761063f565b6101bf6106a9565b6101bf6004803603606081101561024457600080fd5b508035906001600160a01b036020820135169060400135610795565b6102686108f5565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156102a457818101518382015260200161028c565b505050509050019250505060405180910390f35b610177600480360360208110156102ce57600080fd5b5035610960565b610177600480360360208110156102eb57600080fd5b5035610972565b61020a6004803603602081101561030857600080fd5b5035610987565b61017761099c565b6101bf6004803603602081101561032d57600080fd5b50356109b4565b61033c610af8565b604080516001600160a01b039092168252519081900360200190f35b6101bf6004803603602081101561036e57600080fd5b50356001600160a01b0316610b07565b610177610c47565b610177610c54565b6101bf610c5a565b6101bf600480360360208110156103ac57600080fd5b50356001600160a01b0316610d49565b6101bf600480360360408110156103d257600080fd5b5080359060200135610e58565b610177610fc4565b610177600480360360208110156103fd57600080fd5b5035610fd1565b610177610fe3565b610268610fe9565b6101bf6004803603602081101561042a57600080fd5b5035611052565b6101776004803603602081101561044757600080fd5b503561111b565b6101bf61112d565b61017761127d565b600061046b600754610960565b90505b90565b60065460009081526020819052604090206003015490565b600060606104956108f5565b905060005b6104a261045e565b8110156104ea57836001600160a01b03168282815181106104bf57fe5b60200260200101516001600160a01b031614156104e25760010191506104f19050565b60010161049a565b5060009150505b919050565b600060055460ff16600381111561050957fe5b14806105255750600160055460ff16600381111561052357fe5b145b610575576040805162461bcd60e51b815260206004820152601c60248201527b4e6f7420696e207265616479206f7220766f74696e6720737461746560201b604482015290519081900360640190fd5b61057d61063f565b6105bc576040805162461bcd60e51b815260206004820152601760248201526000805160206118b6833981519152604482015290519081900360640190fd5b6105c6600261128a565b1561061f576007805460019081018083556005805460ff19168317905560068054600090815260208190526040808220850154938252808220909401929092555481528181209254815220815461061d92906117bb565b505b565b60055460ff1681565b60046020526000908152604090205460ff1681565b6000606061064b610fe9565b905060005b610658610fc4565b8110156106a057336001600160a01b031682828151811061067557fe5b60200260200101516001600160a01b0316141561069857600101915061046e9050565b600101610650565b50600091505090565b600260055460ff1660038111156106bc57fe5b14610704576040805162461bcd60e51b81526020600482015260136024820152724e6f7420696e206b657967656e20737461746560681b604482015290519081900360640190fd5b61070c61063f565b61074b576040805162461bcd60e51b815260206004820152601760248201526000805160206118b6833981519152604482015290519081900360640190fd5b610755600761128a565b1561061f576005805460ff191660011790556007546040517fddbb65cfe1ae4aec03cef0f9667c6d7ba3740927d0c60f4dd4d7104cc31d180a90600090a2565b600060055460ff1660038111156107a857fe5b14806107c45750600160055460ff1660038111156107c257fe5b145b610814576040805162461bcd60e51b815260206004820152601c60248201527b4e6f7420696e207265616479206f7220766f74696e6720737461746560201b604482015290519081900360640190fd5b61081c61063f565b61085b576040805162461bcd60e51b815260206004820152601760248201526000805160206118b6833981519152604482015290519081900360640190fd5b61086860088484846112e1565b156108f057600a546040805163a9059cbb60e01b81526001600160a01b038581166004830152602482018590529151919092169163a9059cbb9160448083019260209291908290030181600087803b1580156108c357600080fd5b505af11580156108d7573d6000803e3d6000fd5b505050506040513d60208110156108ed57600080fd5b50505b505050565b6007546000908152602081815260409182902080548351818402810184019094528084526060939283018282801561095657602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610938575b5050505050905090565b60009081526020819052604090205490565b60009081526020819052604090206001015490565b60026020526000908152604090205460ff1681565b60065460009081526020819052604090206002015490565b600060055460ff1660038111156109c757fe5b14610a0e576040805162461bcd60e51b81526020600482015260126024820152714e6f7420696e20726561647920737461746560701b604482015290519081900360640190fd5b6008548110158015610a2557506402540be4008110155b8015610a3357506009548111155b610a3c57600080fd5b600a54604080516323b872dd60e01b81523360048201523060248201526044810184905290516001600160a01b03909216916323b872dd916064808201926020929091908290030181600087803b158015610a9657600080fd5b505af1158015610aaa573d6000803e3d6000fd5b505050506040513d6020811015610ac057600080fd5b50506040805182815290517f62e1f484b3909b2c013673bad76a9f14b010600ba983f11ad26e83082883570e9181900360200190a150565b600a546001600160a01b031681565b600160055460ff166003811115610b1a57fe5b14610b62576040805162461bcd60e51b81526020600482015260136024820152724e6f7420696e20766f74696e6720737461746560681b604482015290519081900360640190fd5b610b6a61063f565b610ba9576040805162461bcd60e51b815260206004820152601760248201526000805160206118b6833981519152604482015290519081900360640190fd5b610bb281610489565b15610bfa576040805162461bcd60e51b815260206004820152601360248201527220b63932b0b23c9030903b30b634b230ba37b960691b604482015290519081900360640190fd5b610c0560038261135e565b1561061d576007546000908152602081815260408220805460018101825590835291200180546001600160a01b0383166001600160a01b031990911617905550565b600061046b600754610972565b60065481565b600160055460ff166003811115610c6d57fe5b14610cb5576040805162461bcd60e51b81526020600482015260136024820152724e6f7420696e20766f74696e6720737461746560681b604482015290519081900360640190fd5b610cbd61063f565b610cfc576040805162461bcd60e51b815260206004820152601760248201526000805160206118b6833981519152604482015290519081900360640190fd5b610d06600661128a565b1561061f576005805460ff191660021790556007546006546040517f3ef85928df9ae51bdb3eb4c00ec73b92b82307f319ac1b029de14796a097260990600090a3565b600160055460ff166003811115610d5c57fe5b14610da4576040805162461bcd60e51b81526020600482015260136024820152724e6f7420696e20766f74696e6720737461746560681b604482015290519081900360640190fd5b610dac61063f565b610deb576040805162461bcd60e51b815260206004820152601760248201526000805160206118b6833981519152604482015290519081900360640190fd5b610df481610489565b610e3f576040805162461bcd60e51b815260206004820152601760248201527620b63932b0b23c903737ba1030903b30b634b230ba37b960491b604482015290519081900360640190fd5b610e4a60048261135e565b1561061d5761061d816113d3565b600260055460ff166003811115610e6b57fe5b14610eb3576040805162461bcd60e51b81526020600482015260136024820152724e6f7420696e206b657967656e20737461746560681b604482015290519081900360640190fd5b610ebc33610489565b610f04576040805162461bcd60e51b81526020600482015260146024820152732737ba1030903732bc3a103b30b634b230ba37b960611b604482015290519081900360640190fd5b610f1060008383611520565b15610fc057600780546000908152602081905260408082206002018590558254825290206003018290555460011415610f83576005805460ff1916905560075460068190556040805184815260208101849052815160008051602061186e833981519152929181900390910190a2610fc0565b6005805460ff191660031790556007546006546040517ff4735b85cc98f9a712832825ecab4cfb1649d658f9a73c57a00ea7dde735c79b90600090a35b5050565b600061046b600654610960565b60036020526000908152604090205481565b60075481565b60065460009081526020818152604091829020805483518184028101840190945280845260609392830182828015610956576020028201919060005260206000209081546001600160a01b03168152600190910190602001808311610938575050505050905090565b600160055460ff16600381111561106557fe5b146110ad576040805162461bcd60e51b81526020600482015260136024820152724e6f7420696e20766f74696e6720737461746560681b604482015290519081900360640190fd5b6110b561063f565b6110f4576040805162461bcd60e51b815260206004820152601760248201526000805160206118b6833981519152604482015290519081900360640190fd5b6110ff600582611589565b1561061d57600754600090815260208190526040902060010155565b60016020526000908152604090205481565b600360055460ff16600381111561114057fe5b14611190576040805162461bcd60e51b815260206004820152601b60248201527a4e6f7420696e2066756e6473207472616e7366657220737461746560281b604482015290519081900360640190fd5b61119861063f565b6111d7576040805162461bcd60e51b815260206004820152601760248201526000805160206118b6833981519152604482015290519081900360640190fd5b6000600654116112185760405162461bcd60e51b815260040180806020018281038252602881526020018061188e6028913960400191505060405180910390fd5b61122260016115e1565b1561061f576005805460ff191690556007546006819055600081815260208181526040918290206002810154600390910154835191825291810191909152815160008051602061186e833981519152929181900390910190a2565b600061046b600654610972565b60008082600754604051602001808360088111156112a457fe5b60ff1660f81b8152600101828152602001925050506040516020818303038152906040528051906020012090506112da81611631565b9392505050565b60008085858585604051602001808560088111156112fb57fe5b60ff1660f81b8152600101848152602001836001600160a01b03166001600160a01b031660601b815260140182815260200194505050505060405160208183030381529060405280519060200120905061135481611631565b9695505050505050565b60008083600754846040516020018084600881111561137957fe5b60ff1660f81b8152600101838152602001826001600160a01b03166001600160a01b031660601b815260140193505050506040516020818303038152906040528051906020012090506113cb81611631565b949350505050565b60005b60016113e061045e565b038110156114c157600754600090815260208190526040902080546001600160a01b03841691908390811061141157fe5b6000918252602090912001546001600160a01b031614156114b9576007546000908152602081905260409020600161144761045e565b038154811061145257fe5b6000918252602080832090910154600754835290829052604090912080546001600160a01b03909216918390811061148657fe5b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506114c1565b6001016113d6565b50600754600090815260208190526040902060016114dd61045e565b03815481106114e857fe5b6000918252602080832090910180546001600160a01b0319169055600754825281905260409020805490610fc090600019830161180b565b6000808460075485856040516020018085600881111561153c57fe5b60ff1660f81b815260010184815260200183815260200182815260200194505050505060405160208183030381529060405280519060200120905061158081611704565b95945050505050565b6000808360075484604051602001808460088111156115a457fe5b60ff1660f81b815260010183815260200182815260200193505050506040516020818303038152906040528051906020012090506113cb81611631565b60008082600754604051602001808360088111156115fb57fe5b60ff1660f81b8152600101828152602001925050506040516020818303038152906040528051906020012090506112da81611704565b60008061163d8361178c565b60008181526004602052604090205490915060ff1615611694576040805162461bcd60e51b815260206004820152600d60248201526c566f74656420616c726561647960981b604482015290519081900360640190fd5b6000818152600460205260409020805460ff191660011790556116b561127d565b60008481526003602052604090205414156116e85750506000818152600360205260409020600160ff1b905560016104f1565b50506000818152600360205260408120805460010190556104f1565b6000806117108361178c565b60008181526004602052604090205490915060ff161561176b576040805162461bcd60e51b8152602060048201526011602482015270436f6e6669726d656420616c726561647960781b604482015290519081900360640190fd5b6000818152600460205260409020805460ff191660011790556116b5610c47565b604080516020808201939093523360601b81830152815180820360340181526054909101909152805191012090565b8280548282559060005260206000209081019282156117fb5760005260206000209182015b828111156117fb5782548255916001019190600101906117e0565b5061180792915061182f565b5090565b8154818355818111156108f0576000838152602090206108f0918101908301611853565b61046e91905b808211156118075780546001600160a01b0319168155600101611835565b61046e91905b80821115611807576000815560010161185956fec33272939f066c227e913a4b3434d860794f185c551685c29451a3a38b9b259c46697273742065706f636820646f6573206e6f74206e6565642066756e6473207472616e736665724e6f7420612063757272656e742076616c696461746f72000000000000000000a265627a7a72305820d9301198933836c8992bbab8e6c0ca596e021ff34c7db645c59302c42a24ea3264736f6c63430005090032", - "sourceMap": "93:9593:0:-;;;1361:482;8:9:-1;5:2;;;30:1;27;20:12;5:2;1361:482:0;;;;;;;;;;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;1361:482:0;;;;;;;;;;;;;;19:11:-1;11:20;;8:2;;;44:1;41;34:12;8:2;62:21;;123:4;114:14;;138:31;;;135:2;;;182:1;179;172:12;135:2;219:3;213:10;331:9;325:2;311:12;307:21;289:16;285:44;282:59;261:11;247:12;244:29;233:116;230:2;;;362:1;359;352:12;230:2;-1:-1;;1361:482:0;;;;1490:17;;1361:482;;-1:-1:-1;1361:482:0;-1:-1:-1;1361:482:0;;;;;1482:30;;;;;;1542:10;:17;1530:9;:29;1522:38;;;;;;1571:13;:38;;-1:-1:-1;;;;;1571:38:0;;-1:-1:-1;;;;;;1571:38:0;;;;;;-1:-1:-1;1620:5:0;:9;;;1639:6;:22;;-1:-1:-1;;1639:22:0;1648:13;1639:22;;;-1:-1:-1;1671:9:0;:13;;;1707:34;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1695:9;;;;;;:46;;;;1707:34;;1695:9;;:46;;:9;;:46;;;:::i;:::-;-1:-1:-1;1695:46:0;;;;;;;;;;;;;;;;;;;;;;;;;;1765:6;-1:-1:-1;1765:9:0;;;;1752:10;:22;1797:6;1804:1;1797:9;;;;1784:10;:22;1822:14;;1834:1;;1831;;1822:14;;1831:1;;1822:14;1361:482;;;;93:9593;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;93:9593:0;-1:-1:-1;;;;;93:9593:0;;;;;;;;;;;-1:-1:-1;93:9593:0;;;;;;;-1:-1:-1;93:9593:0;;;-1:-1:-1;93:9593:0;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;-1:-1:-1;;;;;;93:9593:0;;;;;;;;;:::o;:::-;;;;;;;", - "deployedSourceMap": "93:9593:0:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;93:9593:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4085:98;;;:::i;:::-;;;;;;;;;;;;;;;;4723:82;;;:::i;5081:276::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;5081:276:0;-1:-1:-1;;;;;5081:276:0;;:::i;5607:317::-;;;:::i;:::-;;1240:20;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1196:37;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1196:37:0;;:::i;:::-;;;;;;;;;;;;;;;;;;4811:264;;;:::i;7356:203::-;;;:::i;2829:213::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;2829:213:0;;;-1:-1:-1;;;;;2829:213:0;;;;;;;;;;:::i;5481:120::-;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:100:-1;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;5481:120:0;;;;;;;;;;;;;;;;;4189:116;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;4189:116:0;;:::i;4519:110::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;4519:110:0;;:::i;1100:42::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1100:42:0;;:::i;4635:82::-;;;:::i;2583:240::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;2583:240:0;;:::i;1849:27::-;;;:::i;:::-;;;;-1:-1:-1;;;;;1849:27:0;;;;;;;;;;;;;;5930:278;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;5930:278:0;-1:-1:-1;;;;;5930:278:0;;:::i;4411:102::-;;;:::i;1267:17::-;;;:::i;7151:199::-;;;:::i;6214:271::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;6214:271:0;-1:-1:-1;;;;;6214:271:0;;:::i;3048:578::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;3048:578:0;;;;;;;:::i;3989:90::-;;;:::i;1148:42::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1148:42:0;;:::i;1290:21::-;;;:::i;5363:112::-;;;:::i;6942:203::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;6942:203:0;;:::i;1047:47::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1047:47:0;;:::i;3632:351::-;;;:::i;4311:94::-;;;:::i;4085:98::-;4132:4;4155:21;4166:9;;4155:10;:21::i;:::-;4148:28;;4085:98;;:::o;4723:82::-;4790:5;;4760:4;4783:13;;;;;;;;;;:15;;;4723:82;:::o;5081:276::-;5137:4;5153:27;5183:19;:17;:19::i;:::-;5153:49;-1:-1:-1;5217:6:0;5212:121;5233:16;:14;:16::i;:::-;5229:1;:20;5212:121;;;5291:1;-1:-1:-1;;;;;5274:18:0;:10;5285:1;5274:13;;;;;;;;;;;;;;-1:-1:-1;;;;;5274:18:0;;5270:52;;;5321:1;5317:5;;-1:-1:-1;5310:12:0;;-1:-1:-1;5310:12:0;5270:52;5251:3;;5212:121;;;;5349:1;5342:8;;;5081:276;;;;:::o;5607:317::-;2036:12;2026:6;;;;:22;;;;;;;;;:49;;;-1:-1:-1;2062:13:0;2052:6;;;;:23;;;;;;;;;2026:49;2018:90;;;;;-1:-1:-1;;;2018:90:0;;;;;;;;;;;;-1:-1:-1;;;2018:90:0;;;;;;;;;;;;;;;2514:12;:10;:12::i;:::-;2506:53;;;;;-1:-1:-1;;;2506:53:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2506:53:0;;;;;;;;;;;;;;;5682:26;5690:17;5682:7;:26::i;:::-;5678:240;;;5724:9;:11;;;;;;;;;5749:6;:22;;-1:-1:-1;;5749:22:0;;;;;5822:5;;;-1:-1:-1;5815:13:0;;;;;;;;;;;:23;;;5785:17;;;;;;:27;;;:53;;;;5890:5;5883:13;;;;;5859:9;;5852:17;;;:55;;;;5883:13;5852:55;:::i;:::-;;5678:240;5607:317::o;1240:20::-;;;;;;:::o;1196:37::-;;;;;;;;;;;;;;;:::o;4811:264::-;4854:4;4870:27;4900:15;:13;:15::i;:::-;4870:45;-1:-1:-1;4930:6:0;4925:126;4946:12;:10;:12::i;:::-;4942:1;:16;4925:126;;;5000:10;-1:-1:-1;;;;;4983:27:0;:10;4994:1;4983:13;;;;;;;;;;;;;;-1:-1:-1;;;;;4983:27:0;;4979:61;;;5039:1;5035:5;;-1:-1:-1;5028:12:0;;-1:-1:-1;5028:12:0;4979:61;4960:3;;4925:126;;;;5067:1;5060:8;;;4811:264;:::o;7356:203::-;2281:13;2271:6;;;;:23;;;;;;;;;2263:55;;;;;-1:-1:-1;;;2263:55:0;;;;;;;;;;;;-1:-1:-1;;;2263:55:0;;;;;;;;;;;;;;;2514:12;:10;:12::i;:::-;2506:53;;;;;-1:-1:-1;;;2506:53:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2506:53:0;;;;;;;;;;;;;;;7429:27;7437:18;7429:7;:27::i;:::-;7425:128;;;7472:6;:22;;-1:-1:-1;;7472:22:0;7481:13;7472:22;;;7532:9;;7514:28;;;;-1:-1:-1;;7514:28:0;7356:203::o;2829:213::-;2036:12;2026:6;;;;:22;;;;;;;;;:49;;;-1:-1:-1;2062:13:0;2052:6;;;;:23;;;;;;;;;2026:49;2018:90;;;;;-1:-1:-1;;;2018:90:0;;;;;;;;;;;;-1:-1:-1;;;2018:90:0;;;;;;;;;;;;;;;2514:12;:10;:12::i;:::-;2506:53;;;;;-1:-1:-1;;;2506:53:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2506:53:0;;;;;;;;;;;;;;;2937:39;2945:13;2960:4;2966:2;2970:5;2937:7;:39::i;:::-;2933:103;;;2992:13;;:33;;;-1:-1:-1;;;2992:33:0;;-1:-1:-1;;;;;2992:33:0;;;;;;;;;;;;;;;:13;;;;;:22;;:33;;;;;;;;;;;;;;:13;;:33;;;5:2:-1;;;;30:1;27;20:12;5:2;2992:33:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;2992:33:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;2933:103:0;2829:213;;;:::o;5481:120::-;5573:9;;5566:6;:17;;;;;;;;;;;;5559:35;;;;;;;;;;;;;;;;;5531:16;;5559:35;;;5566:17;5559:35;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;5559:35:0;;;;;;;;;;;;;;;;;;;;;;;5481:120;:::o;4189:116::-;4243:4;4266:14;;;;;;;;;;:32;;4189:116::o;4519:110::-;4575:4;4598:14;;;;;;;;;;:24;;;;4519:110::o;1100:42::-;;;;;;;;;;;;;;;:::o;4635:82::-;4702:5;;4672:4;4695:13;;;;;;;;;;:15;;;4635:82;:::o;2583:240::-;1926:12;1916:6;;;;:22;;;;;;;;;1908:53;;;;;-1:-1:-1;;;1908:53:0;;;;;;;;;;;;-1:-1:-1;;;1908:53:0;;;;;;;;;;;;;;;2653:10;;2644:5;:19;;:40;;;;;2676:8;2667:5;:17;;2644:40;:63;;;;;2697:10;;2688:5;:19;;2644:63;2636:72;;;;;;2719:13;;:60;;;-1:-1:-1;;;2719:60:0;;2746:10;2719:60;;;;2766:4;2719:60;;;;;;;;;;;;-1:-1:-1;;;;;2719:13:0;;;;:26;;:60;;;;;;;;;;;;;;;:13;;:60;;;5:2:-1;;;;30:1;27;20:12;5:2;2719:60:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;2719:60:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;2794:22:0;;;;;;;;;;;;;2719:60;2794:22;;;2583:240;:::o;1849:27::-;;;-1:-1:-1;;;;;1849:27:0;;:::o;5930:278::-;2176:13;2166:6;;;;:23;;;;;;;;;2158:55;;;;;-1:-1:-1;;;2158:55:0;;;;;;;;;;;;-1:-1:-1;;;2158:55:0;;;;;;;;;;;;;;;2514:12;:10;:12::i;:::-;2506:53;;;;;-1:-1:-1;;;2506:53:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2506:53:0;;;;;;;;;;;;;;;6024:25;6039:9;6024:14;:25::i;:::-;:30;6016:62;;;;;-1:-1:-1;;;6016:62:0;;;;;;;;;;;;-1:-1:-1;;;6016:62:0;;;;;;;;;;;;;;;6093:38;6101:18;6121:9;6093:7;:38::i;:::-;6089:113;;;6154:9;;6147:6;:17;;;;;;;;;;27:10:-1;;39:1;23:18;;45:23;;6147:44:0;;;;;;;;-1:-1:-1;;;;;6147:44:0;;-1:-1:-1;;;;;;6147:44:0;;;;;;5930:278;:::o;4411:102::-;4460:4;4483:23;4496:9;;4483:12;:23::i;1267:17::-;;;;:::o;7151:199::-;2176:13;2166:6;;;;:23;;;;;;;;;2158:55;;;;;-1:-1:-1;;;2158:55:0;;;;;;;;;;;;-1:-1:-1;;;2158:55:0;;;;;;;;;;;;;;;2514:12;:10;:12::i;:::-;2506:53;;;;;-1:-1:-1;;;2506:53:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2506:53:0;;;;;;;;;;;;;;;7223:26;7231:17;7223:7;:26::i;:::-;7219:125;;;7265:6;:22;;-1:-1:-1;;7265:22:0;7274:13;7265:22;;;7323:9;;7316:5;;7307:26;;;;-1:-1:-1;;7307:26:0;7151:199::o;6214:271::-;2176:13;2166:6;;;;:23;;;;;;;;;2158:55;;;;;-1:-1:-1;;;2158:55:0;;;;;;;;;;;;-1:-1:-1;;;2158:55:0;;;;;;;;;;;;;;;2514:12;:10;:12::i;:::-;2506:53;;;;;-1:-1:-1;;;2506:53:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2506:53:0;;;;;;;;;;;;;;;6311:25;6326:9;6311:14;:25::i;:::-;6303:66;;;;;-1:-1:-1;;;6303:66:0;;;;;;;;;;;;-1:-1:-1;;;6303:66:0;;;;;;;;;;;;;;;6384:41;6392:21;6415:9;6384:7;:41::i;:::-;6380:99;;;6441:27;6458:9;6441:16;:27::i;3048:578::-;2281:13;2271:6;;;;:23;;;;;;;;;2263:55;;;;;-1:-1:-1;;;2263:55:0;;;;;;;;;;;;-1:-1:-1;;;2263:55:0;;;;;;;;;;;;;;;3119:26;3134:10;3119:14;:26::i;:::-;3111:64;;;;;-1:-1:-1;;;3111:64:0;;;;;;;;;;;;-1:-1:-1;;;3111:64:0;;;;;;;;;;;;;;;3190:37;3201:19;3222:1;3225;3190:10;:37::i;:::-;3186:434;;;3250:9;;;3243:6;:17;;;;;;;;;;;:19;;:23;;;3287:9;;3280:17;;;;:19;;:23;;;3321:9;3334:1;3321:14;3317:293;;;3355:6;:21;;-1:-1:-1;;3355:21:0;;;3402:9;;3394:5;:17;;;3434:23;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;3434:23:0;;;;;;;;;;3317:293;;;3508:6;:30;;-1:-1:-1;;3508:30:0;3517:21;3508:30;;;3585:9;;3578:5;;3561:34;;;;-1:-1:-1;;3561:34:0;3317:293;3048:578;;:::o;3989:90::-;4032:4;4055:17;4066:5;;4055:10;:17::i;1148:42::-;;;;;;;;;;;;;:::o;1290:21::-;;;;:::o;5363:112::-;5451:5;;5444:6;:13;;;;;;;;;;;;5437:31;;;;;;;;;;;;;;;;;5409:16;;5437:31;;;5444:13;5437:31;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;5437:31:0;;;;;;;;;;;;;;;;;;;;;;5363:112;:::o;6942:203::-;2176:13;2166:6;;;;:23;;;;;;;;;2158:55;;;;;-1:-1:-1;;;2158:55:0;;;;;;;;;;;;-1:-1:-1;;;2158:55:0;;;;;;;;;;;;;;;2514:12;:10;:12::i;:::-;2506:53;;;;;-1:-1:-1;;;2506:53:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2506:53:0;;;;;;;;;;;;;;;7032:41;7040:21;7063:9;7032:7;:41::i;:::-;7028:111;;;7096:9;;7089:6;:17;;;;;;;;;;:27;;:39;6942:203::o;1047:47::-;;;;;;;;;;;;;:::o;3632:351::-;2393:21;2383:6;;;;:31;;;;;;;;;2375:71;;;;;-1:-1:-1;;;2375:71:0;;;;;;;;;;;;-1:-1:-1;;;2375:71:0;;;;;;;;;;;;;;;2514:12;:10;:12::i;:::-;2506:53;;;;;-1:-1:-1;;;2506:53:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2506:53:0;;;;;;;;;;;;;;;3728:1;3720:5;;:9;3712:62;;;;-1:-1:-1;;;3712:62:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3789:39;3800:27;3789:10;:39::i;:::-;3785:192;;;3844:6;:21;;-1:-1:-1;;3844:21:0;;;3887:9;;3879:5;:17;;;3853:12;3933:13;;;;;;;;;;;;:15;;;;3950;;;;;3915:51;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;3915:51:0;;;;;;;;;;3632:351::o;4311:94::-;4356:4;4379:19;4392:5;;4379:12;:19::i;7565:165::-;7614:4;7630:12;7672:8;7682:9;;7655:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;7655:37:0;;;7645:48;;;;;;7630:63;;7710:13;7718:4;7710:7;:13::i;:::-;7703:20;7565:165;-1:-1:-1;;;7565:165:0:o;8113:209::-;8200:4;8216:12;8258:8;8268:4;8274:2;8278:5;8241:43;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;8241:43:0;-1:-1:-1;;;;;8241:43:0;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;8241:43:0;;;8231:54;;;;;;8216:69;;8302:13;8310:4;8302:7;:13::i;:::-;8295:20;8113:209;-1:-1:-1;;;;;;8113:209:0:o;7736:185::-;7799:4;7815:12;7857:8;7867:9;;7878:4;7840:43;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;7840:43:0;-1:-1:-1;;;;;7840:43:0;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;7840:43:0;;;7830:54;;;;;;7815:69;;7901:13;7909:4;7901:7;:13::i;:::-;7894:20;7736:185;-1:-1:-1;;;;7736:185:0:o;6491:445::-;6559:6;6554:262;6594:1;6575:16;:14;:16::i;:::-;:20;6571:1;:24;6554:262;;;6627:9;;6620:6;:17;;;;;;;;;;:31;;-1:-1:-1;;;;;6620:44:0;;;:17;6649:1;;6620:31;;;;;;;;;;;;;;;;-1:-1:-1;;;;;6620:31:0;:44;6616:190;;;6725:9;;6718:6;:17;;;;;;;;;;6766:1;6747:16;:14;:16::i;:::-;:20;6718:50;;;;;;;;;;;;;;;;;;;;6691:9;;6684:17;;;;;;;;;;:31;;-1:-1:-1;;;;;6718:50:0;;;;6713:1;;6684:31;;;;;;;;;;;;;;:84;;;;;-1:-1:-1;;;;;6684:84:0;;;;;-1:-1:-1;;;;;6684:84:0;;;;;;6786:5;;6616:190;6597:3;;6554:262;;;-1:-1:-1;6839:9:0;;6832:6;:17;;;;;;;;;;6880:1;6861:16;:14;:16::i;:::-;:20;6832:50;;;;;;;;;;;;;;;;;;;6825:57;;-1:-1:-1;;;;;;6825:57:0;;;6899:9;;6892:17;;;;;;;;:37;;;;;-1:-1:-1;;6892:37:0;;;:::i;8505:193::-;8573:4;8589:12;8631:8;8641:9;;8652:1;8655;8614:43;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;8614:43:0;;;8604:54;;;;;;8589:69;;8675:16;8686:4;8675:10;:16::i;:::-;8668:23;8505:193;-1:-1:-1;;;;;8505:193:0:o;7927:180::-;7986:4;8002:12;8044:8;8054:9;;8065:3;8027:42;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;8027:42:0;;;8017:53;;;;;;8002:68;;8087:13;8095:4;8087:7;:13::i;8328:171::-;8380:4;8396:12;8438:8;8448:9;;8421:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;8421:37:0;;;8411:48;;;;;;8396:63;;8476:16;8487:4;8476:10;:16::i;8704:409::-;8752:4;8768:20;8791:21;8807:4;8791:15;:21::i;:::-;8831:19;;;;:5;:19;;;;;;8768:44;;-1:-1:-1;8831:19:0;;8830:20;8822:46;;;;;-1:-1:-1;;;8822:46:0;;;;;;;;;;;;-1:-1:-1;;;8822:46:0;;;;;;;;;;;;;;;8879:19;;;;:5;:19;;;;;:26;;-1:-1:-1;;8879:26:0;8901:4;8879:26;;;8939:14;:12;:14::i;:::-;8919:16;;;;:10;:16;;;;;;:34;8915:192;;;-1:-1:-1;;8969:16:0;;;;:10;:16;;;;;-1:-1:-1;;;8969:27:0;;9017:4;9010:11;;8915:192;-1:-1:-1;;9052:16:0;;;;:10;:16;;;;;:18;;;;;;9084:12;;9119:420;9170:4;9186:20;9209:21;9225:4;9209:15;:21::i;:::-;9249:19;;;;:5;:19;;;;;;9186:44;;-1:-1:-1;9249:19:0;;9248:20;9240:50;;;;;-1:-1:-1;;;9240:50:0;;;;;;;;;;;;-1:-1:-1;;;9240:50:0;;;;;;;;;;;;;;;9301:19;;;;:5;:19;;;;;:26;;-1:-1:-1;;9301:26:0;9323:4;9301:26;;;9361:18;:16;:18::i;9545:139::-;9642:34;;;;;;;;;;;9665:10;9642:34;;;;;;;;26:21:-1;;;22:32;;6:49;;9642:34:0;;;;;;;9632:45;;;;;;9545:139::o;93:9593::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;93:9593:0;;;-1:-1:-1;93:9593:0;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;-1:-1:-1;;;;;;93:9593:0;;;;;;;;;;;;;;;;;;;;;;;;", - "source": "pragma solidity ^0.5.0;\n\nimport './openzeppelin-solidity/contracts/token/ERC20/IERC20.sol';\n\ncontract Bridge {\n event ExchangeRequest(uint value);\n event NewEpoch(uint indexed oldEpoch, uint indexed newEpoch);\n event NewEpochCancelled(uint indexed epoch);\n event NewFundsTransfer(uint indexed oldEpoch, uint indexed newEpoch);\n event EpochStart(uint indexed epoch, uint x, uint y);\n\n struct State {\n address[] validators;\n uint threshold;\n uint x;\n uint y;\n }\n\n enum Status {\n READY, // bridge is in ready to perform operations\n VOTING, // voting for changing in next epoch, but still ready\n KEYGEN, //keygen, can be cancelled\n FUNDS_TRANSFER // funds transfer, cannot be cancelled\n }\n\n enum Vote {\n CONFIRM_KEYGEN,\n CONFIRM_FUNDS_TRANSFER,\n START_VOTING,\n ADD_VALIDATOR,\n REMOVE_VALIDATOR,\n CHANGE_THRESHOLD,\n START_KEYGEN,\n CANCEL_KEYGEN,\n TRANSFER\n }\n\n mapping(uint => State) states;\n\n mapping(bytes32 => uint) public dbTransferCount;\n mapping(bytes32 => bool) public dbTransfer;\n mapping(bytes32 => uint) public votesCount;\n mapping(bytes32 => bool) public votes;\n\n Status public status;\n\n uint public epoch;\n uint public nextEpoch;\n\n uint minTxLimit;\n uint maxTxLimit;\n\n constructor(uint threshold, address[] memory validators, address _tokenContract, uint[2] memory limits) public {\n require(validators.length > 0);\n require(threshold < validators.length);\n\n tokenContract = IERC20(_tokenContract);\n\n epoch = 0;\n status = Status.KEYGEN;\n nextEpoch = 1;\n\n states[1] = State(validators, threshold, 0, 0);\n\n minTxLimit = limits[0];\n maxTxLimit = limits[1];\n\n emit NewEpoch(0, 1);\n }\n\n IERC20 public tokenContract;\n\n modifier ready {\n require(status == Status.READY, \"Not in ready state\");\n _;\n }\n\n modifier readyOrVoting {\n require(status == Status.READY || status == Status.VOTING, \"Not in ready or voting state\");\n _;\n }\n\n modifier voting {\n require(status == Status.VOTING, \"Not in voting state\");\n _;\n }\n\n modifier keygen {\n require(status == Status.KEYGEN, \"Not in keygen state\");\n _;\n }\n\n modifier fundsTransfer {\n require(status == Status.FUNDS_TRANSFER, \"Not in funds transfer state\");\n _;\n }\n\n modifier currentValidator {\n require(getPartyId() != 0, \"Not a current validator\");\n _;\n }\n\n function exchange(uint value) public ready {\n require(value >= minTxLimit && value >= 10 ** 10 && value <= maxTxLimit);\n\n tokenContract.transferFrom(msg.sender, address(this), value);\n emit ExchangeRequest(value);\n }\n\n function transfer(bytes32 hash, address to, uint value) public readyOrVoting currentValidator {\n if (tryVote(Vote.TRANSFER, hash, to, value)) {\n tokenContract.transfer(to, value);\n }\n }\n\n function confirmKeygen(uint x, uint y) public keygen {\n require(getNextPartyId(msg.sender) != 0, \"Not a next validator\");\n\n if (tryConfirm(Vote.CONFIRM_KEYGEN, x, y)) {\n states[nextEpoch].x = x;\n states[nextEpoch].y = y;\n if (nextEpoch == 1) {\n status = Status.READY;\n epoch = nextEpoch;\n emit EpochStart(epoch, x, y);\n }\n else {\n status = Status.FUNDS_TRANSFER;\n emit NewFundsTransfer(epoch, nextEpoch);\n }\n }\n }\n\n function confirmFundsTransfer() public fundsTransfer currentValidator {\n require(epoch > 0, \"First epoch does not need funds transfer\");\n\n if (tryConfirm(Vote.CONFIRM_FUNDS_TRANSFER)) {\n status = Status.READY;\n epoch = nextEpoch;\n emit EpochStart(epoch, states[epoch].x, states[epoch].y);\n }\n }\n\n function getParties() view public returns (uint) {\n return getParties(epoch);\n }\n\n function getNextParties() view public returns (uint) {\n return getParties(nextEpoch);\n }\n\n function getParties(uint _epoch) view public returns (uint) {\n return states[_epoch].validators.length;\n }\n\n function getThreshold() view public returns (uint) {\n return getThreshold(epoch);\n }\n\n function getNextThreshold() view public returns (uint) {\n return getThreshold(nextEpoch);\n }\n\n function getThreshold(uint _epoch) view public returns (uint) {\n return states[_epoch].threshold;\n }\n\n function getX() view public returns (uint) {\n return states[epoch].x;\n }\n\n function getY() view public returns (uint) {\n return states[epoch].y;\n }\n\n function getPartyId() view public returns (uint) {\n address[] memory validators = getValidators();\n for (uint i = 0; i < getParties(); i++) {\n if (validators[i] == msg.sender)\n return i + 1;\n }\n return 0;\n }\n\n function getNextPartyId(address a) view public returns (uint) {\n address[] memory validators = getNextValidators();\n for (uint i = 0; i < getNextParties(); i++) {\n if (validators[i] == a)\n return i + 1;\n }\n return 0;\n }\n\n function getValidators() view public returns (address[] memory) {\n return states[epoch].validators;\n }\n\n function getNextValidators() view public returns (address[] memory) {\n return states[nextEpoch].validators;\n }\n\n function startVoting() public readyOrVoting currentValidator {\n if (tryVote(Vote.START_VOTING)) {\n nextEpoch++;\n status = Status.VOTING;\n states[nextEpoch].threshold = states[epoch].threshold;\n states[nextEpoch].validators = states[epoch].validators;\n }\n }\n\n function voteAddValidator(address validator) public voting currentValidator {\n require(getNextPartyId(validator) == 0, \"Already a validator\");\n\n if (tryVote(Vote.ADD_VALIDATOR, validator)) {\n states[nextEpoch].validators.push(validator);\n }\n }\n\n function voteRemoveValidator(address validator) public voting currentValidator {\n require(getNextPartyId(validator) != 0, \"Already not a validator\");\n\n if (tryVote(Vote.REMOVE_VALIDATOR, validator)) {\n _removeValidator(validator);\n }\n }\n\n function _removeValidator(address validator) private {\n for (uint i = 0; i < getNextParties() - 1; i++) {\n if (states[nextEpoch].validators[i] == validator) {\n states[nextEpoch].validators[i] = states[nextEpoch].validators[getNextParties() - 1];\n break;\n }\n }\n delete states[nextEpoch].validators[getNextParties() - 1];\n states[nextEpoch].validators.length--;\n }\n\n function voteChangeThreshold(uint threshold) public voting currentValidator {\n if (tryVote(Vote.CHANGE_THRESHOLD, threshold)) {\n states[nextEpoch].threshold = threshold;\n }\n }\n\n function voteStartKeygen() public voting currentValidator {\n if (tryVote(Vote.START_KEYGEN)) {\n status = Status.KEYGEN;\n\n emit NewEpoch(epoch, nextEpoch);\n }\n }\n\n function voteCancelKeygen() public keygen currentValidator {\n if (tryVote(Vote.CANCEL_KEYGEN)) {\n status = Status.VOTING;\n\n emit NewEpochCancelled(nextEpoch);\n }\n }\n\n function tryVote(Vote voteType) private returns (bool) {\n bytes32 vote = keccak256(abi.encodePacked(voteType, nextEpoch));\n return putVote(vote);\n }\n\n function tryVote(Vote voteType, address addr) private returns (bool) {\n bytes32 vote = keccak256(abi.encodePacked(voteType, nextEpoch, addr));\n return putVote(vote);\n }\n\n function tryVote(Vote voteType, uint num) private returns (bool) {\n bytes32 vote = keccak256(abi.encodePacked(voteType, nextEpoch, num));\n return putVote(vote);\n }\n\n function tryVote(Vote voteType, bytes32 hash, address to, uint value) private returns (bool) {\n bytes32 vote = keccak256(abi.encodePacked(voteType, hash, to, value));\n return putVote(vote);\n }\n\n function tryConfirm(Vote voteType) private returns (bool) {\n bytes32 vote = keccak256(abi.encodePacked(voteType, nextEpoch));\n return putConfirm(vote);\n }\n\n function tryConfirm(Vote voteType, uint x, uint y) private returns (bool) {\n bytes32 vote = keccak256(abi.encodePacked(voteType, nextEpoch, x, y));\n return putConfirm(vote);\n }\n\n function putVote(bytes32 vote) private returns (bool) {\n bytes32 personalVote = personalizeVote(vote);\n require(!votes[personalVote], \"Voted already\");\n\n votes[personalVote] = true;\n if (votesCount[vote] == getThreshold()) {\n votesCount[vote] = 2 ** 255;\n return true;\n } else {\n votesCount[vote]++;\n return false;\n }\n }\n\n function putConfirm(bytes32 vote) private returns (bool) {\n bytes32 personalVote = personalizeVote(vote);\n require(!votes[personalVote], \"Confirmed already\");\n\n votes[personalVote] = true;\n if (votesCount[vote] == getNextThreshold()) {\n votesCount[vote] = 2 ** 255;\n return true;\n } else {\n votesCount[vote]++;\n return false;\n }\n }\n\n function personalizeVote(bytes32 vote) private view returns (bytes32) {\n return keccak256(abi.encodePacked(vote, msg.sender));\n }\n}\n", - "sourcePath": "/Users/kirillfedoseev/Innopolis/My own projects/bridge/bridge/src/deploy/deploy-home/contracts/Bridge.sol", - "ast": { - "absolutePath": "/Users/kirillfedoseev/Innopolis/My own projects/bridge/bridge/src/deploy/deploy-home/contracts/Bridge.sol", - "exportedSymbols": { - "Bridge": [ - 1138 - ] - }, - "id": 1139, - "nodeType": "SourceUnit", - "nodes": [ - { - "id": 1, - "literals": [ - "solidity", - "^", - "0.5", - ".0" - ], - "nodeType": "PragmaDirective", - "src": "0:23:0" - }, - { - "absolutePath": "/Users/kirillfedoseev/Innopolis/My own projects/bridge/bridge/src/deploy/deploy-home/contracts/openzeppelin-solidity/contracts/token/ERC20/IERC20.sol", - "file": "./openzeppelin-solidity/contracts/token/ERC20/IERC20.sol", - "id": 2, - "nodeType": "ImportDirective", - "scope": 1139, - "sourceUnit": 9774, - "src": "25:66:0", - "symbolAliases": [], - "unitAlias": "" - }, - { - "baseContracts": [], - "contractDependencies": [], - "contractKind": "contract", - "documentation": null, - "fullyImplemented": true, - "id": 1138, - "linearizedBaseContracts": [ - 1138 - ], - "name": "Bridge", - "nodeType": "ContractDefinition", - "nodes": [ - { - "anonymous": false, - "documentation": null, - "id": 6, - "name": "ExchangeRequest", - "nodeType": "EventDefinition", - "parameters": { - "id": 5, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4, - "indexed": false, - "name": "value", - "nodeType": "VariableDeclaration", - "scope": 6, - "src": "137:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 3, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "137:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "136:12:0" - }, - "src": "115:34:0" - }, - { - "anonymous": false, - "documentation": null, - "id": 12, - "name": "NewEpoch", - "nodeType": "EventDefinition", - "parameters": { - "id": 11, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 8, - "indexed": true, - "name": "oldEpoch", - "nodeType": "VariableDeclaration", - "scope": 12, - "src": "169:21:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 7, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "169:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 10, - "indexed": true, - "name": "newEpoch", - "nodeType": "VariableDeclaration", - "scope": 12, - "src": "192:21:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 9, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "192:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "168:46:0" - }, - "src": "154:61:0" - }, - { - "anonymous": false, - "documentation": null, - "id": 16, - "name": "NewEpochCancelled", - "nodeType": "EventDefinition", - "parameters": { - "id": 15, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 14, - "indexed": true, - "name": "epoch", - "nodeType": "VariableDeclaration", - "scope": 16, - "src": "244:18:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 13, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "244:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "243:20:0" - }, - "src": "220:44:0" - }, - { - "anonymous": false, - "documentation": null, - "id": 22, - "name": "NewFundsTransfer", - "nodeType": "EventDefinition", - "parameters": { - "id": 21, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 18, - "indexed": true, - "name": "oldEpoch", - "nodeType": "VariableDeclaration", - "scope": 22, - "src": "292:21:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 17, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "292:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 20, - "indexed": true, - "name": "newEpoch", - "nodeType": "VariableDeclaration", - "scope": 22, - "src": "315:21:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 19, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "315:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "291:46:0" - }, - "src": "269:69:0" - }, - { - "anonymous": false, - "documentation": null, - "id": 30, - "name": "EpochStart", - "nodeType": "EventDefinition", - "parameters": { - "id": 29, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 24, - "indexed": true, - "name": "epoch", - "nodeType": "VariableDeclaration", - "scope": 30, - "src": "360:18:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 23, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "360:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 26, - "indexed": false, - "name": "x", - "nodeType": "VariableDeclaration", - "scope": 30, - "src": "380:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 25, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "380:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 28, - "indexed": false, - "name": "y", - "nodeType": "VariableDeclaration", - "scope": 30, - "src": "388:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 27, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "388:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "359:36:0" - }, - "src": "343:53:0" - }, - { - "canonicalName": "Bridge.State", - "id": 40, - "members": [ - { - "constant": false, - "id": 33, - "name": "validators", - "nodeType": "VariableDeclaration", - "scope": 40, - "src": "425:20:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 31, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "425:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 32, - "length": null, - "nodeType": "ArrayTypeName", - "src": "425:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 35, - "name": "threshold", - "nodeType": "VariableDeclaration", - "scope": 40, - "src": "455:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 34, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "455:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 37, - "name": "x", - "nodeType": "VariableDeclaration", - "scope": 40, - "src": "479:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 36, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "479:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 39, - "name": "y", - "nodeType": "VariableDeclaration", - "scope": 40, - "src": "495:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 38, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "495:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "name": "State", - "nodeType": "StructDefinition", - "scope": 1138, - "src": "402:106:0", - "visibility": "public" - }, - { - "canonicalName": "Bridge.Status", - "id": 45, - "members": [ - { - "id": 41, - "name": "READY", - "nodeType": "EnumValue", - "src": "536:5:0" - }, - { - "id": 42, - "name": "VOTING", - "nodeType": "EnumValue", - "src": "595:6:0" - }, - { - "id": 43, - "name": "KEYGEN", - "nodeType": "EnumValue", - "src": "665:6:0" - }, - { - "id": 44, - "name": "FUNDS_TRANSFER", - "nodeType": "EnumValue", - "src": "708:14:0" - } - ], - "name": "Status", - "nodeType": "EnumDefinition", - "src": "514:253:0" - }, - { - "canonicalName": "Bridge.Vote", - "id": 55, - "members": [ - { - "id": 46, - "name": "CONFIRM_KEYGEN", - "nodeType": "EnumValue", - "src": "793:14:0" - }, - { - "id": 47, - "name": "CONFIRM_FUNDS_TRANSFER", - "nodeType": "EnumValue", - "src": "817:22:0" - }, - { - "id": 48, - "name": "START_VOTING", - "nodeType": "EnumValue", - "src": "849:12:0" - }, - { - "id": 49, - "name": "ADD_VALIDATOR", - "nodeType": "EnumValue", - "src": "871:13:0" - }, - { - "id": 50, - "name": "REMOVE_VALIDATOR", - "nodeType": "EnumValue", - "src": "894:16:0" - }, - { - "id": 51, - "name": "CHANGE_THRESHOLD", - "nodeType": "EnumValue", - "src": "920:16:0" - }, - { - "id": 52, - "name": "START_KEYGEN", - "nodeType": "EnumValue", - "src": "946:12:0" - }, - { - "id": 53, - "name": "CANCEL_KEYGEN", - "nodeType": "EnumValue", - "src": "968:13:0" - }, - { - "id": 54, - "name": "TRANSFER", - "nodeType": "EnumValue", - "src": "991:8:0" - } - ], - "name": "Vote", - "nodeType": "EnumDefinition", - "src": "773:232:0" - }, - { - "constant": false, - "id": 59, - "name": "states", - "nodeType": "VariableDeclaration", - "scope": 1138, - "src": "1011:29:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$40_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State)" - }, - "typeName": { - "id": 58, - "keyType": { - "id": 56, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1019:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Mapping", - "src": "1011:22:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$40_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State)" - }, - "valueType": { - "contractScope": null, - "id": 57, - "name": "State", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 40, - "src": "1027:5:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$40_storage_ptr", - "typeString": "struct Bridge.State" - } - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 63, - "name": "dbTransferCount", - "nodeType": "VariableDeclaration", - "scope": 1138, - "src": "1047:47:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - }, - "typeName": { - "id": 62, - "keyType": { - "id": 60, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1055:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Mapping", - "src": "1047:24:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - }, - "valueType": { - "id": 61, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1066:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 67, - "name": "dbTransfer", - "nodeType": "VariableDeclaration", - "scope": 1138, - "src": "1100:42:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - }, - "typeName": { - "id": 66, - "keyType": { - "id": 64, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1108:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Mapping", - "src": "1100:24:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - }, - "valueType": { - "id": 65, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "1119:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 71, - "name": "votesCount", - "nodeType": "VariableDeclaration", - "scope": 1138, - "src": "1148:42:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - }, - "typeName": { - "id": 70, - "keyType": { - "id": 68, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1156:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Mapping", - "src": "1148:24:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - }, - "valueType": { - "id": 69, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1167:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 75, - "name": "votes", - "nodeType": "VariableDeclaration", - "scope": 1138, - "src": "1196:37:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - }, - "typeName": { - "id": 74, - "keyType": { - "id": 72, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1204:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Mapping", - "src": "1196:24:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - }, - "valueType": { - "id": 73, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "1215:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 77, - "name": "status", - "nodeType": "VariableDeclaration", - "scope": 1138, - "src": "1240:20:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - }, - "typeName": { - "contractScope": null, - "id": 76, - "name": "Status", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 45, - "src": "1240:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 79, - "name": "epoch", - "nodeType": "VariableDeclaration", - "scope": 1138, - "src": "1267:17:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 78, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1267:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 81, - "name": "nextEpoch", - "nodeType": "VariableDeclaration", - "scope": 1138, - "src": "1290:21:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 80, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1290:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 83, - "name": "minTxLimit", - "nodeType": "VariableDeclaration", - "scope": 1138, - "src": "1318:15:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 82, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1318:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 85, - "name": "maxTxLimit", - "nodeType": "VariableDeclaration", - "scope": 1138, - "src": "1339:15:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 84, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1339:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "body": { - "id": 160, - "nodeType": "Block", - "src": "1472:371:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 103, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 100, - "name": "validators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 90, - "src": "1490:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 101, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1490:17:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 102, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1510:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "1490:21:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 99, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 12832, - 12833 - ], - "referencedDeclaration": 12832, - "src": "1482:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 104, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1482:30:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 105, - "nodeType": "ExpressionStatement", - "src": "1482:30:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 110, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 107, - "name": "threshold", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 87, - "src": "1530:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 108, - "name": "validators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 90, - "src": "1542:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 109, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1542:17:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1530:29:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 106, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 12832, - 12833 - ], - "referencedDeclaration": 12832, - "src": "1522:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 111, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1522:38:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 112, - "nodeType": "ExpressionStatement", - "src": "1522:38:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 117, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 113, - "name": "tokenContract", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 163, - "src": "1571:13:0", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$9773", - "typeString": "contract IERC20" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 115, - "name": "_tokenContract", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "1594:14:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 114, - "name": "IERC20", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 9773, - "src": "1587:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_IERC20_$9773_$", - "typeString": "type(contract IERC20)" - } - }, - "id": 116, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1587:22:0", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$9773", - "typeString": "contract IERC20" - } - }, - "src": "1571:38:0", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$9773", - "typeString": "contract IERC20" - } - }, - "id": 118, - "nodeType": "ExpressionStatement", - "src": "1571:38:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 121, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 119, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 79, - "src": "1620:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "30", - "id": 120, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1628:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "1620:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 122, - "nodeType": "ExpressionStatement", - "src": "1620:9:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 126, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 123, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "1639:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 124, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 45, - "src": "1648:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$45_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 125, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "KEYGEN", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1648:13:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "src": "1639:22:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "id": 127, - "nodeType": "ExpressionStatement", - "src": "1639:22:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 130, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 128, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 81, - "src": "1671:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "31", - "id": 129, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1683:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "1671:13:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 131, - "nodeType": "ExpressionStatement", - "src": "1671:13:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 141, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 132, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 59, - "src": "1695:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$40_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 134, - "indexExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 133, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1702:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "1695:9:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$40_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 136, - "name": "validators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 90, - "src": "1713:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - { - "argumentTypes": null, - "id": 137, - "name": "threshold", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 87, - "src": "1725:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "hexValue": "30", - "id": 138, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1736:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - { - "argumentTypes": null, - "hexValue": "30", - "id": 139, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1739:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - } - ], - "id": 135, - "name": "State", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 40, - "src": "1707:5:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_struct$_State_$40_storage_ptr_$", - "typeString": "type(struct Bridge.State storage pointer)" - } - }, - "id": 140, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "structConstructorCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1707:34:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$40_memory", - "typeString": "struct Bridge.State memory" - } - }, - "src": "1695:46:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$40_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 142, - "nodeType": "ExpressionStatement", - "src": "1695:46:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 147, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 143, - "name": "minTxLimit", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 83, - "src": "1752:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 144, - "name": "limits", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 96, - "src": "1765:6:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_memory_ptr", - "typeString": "uint256[2] memory" - } - }, - "id": 146, - "indexExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 145, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1772:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "1765:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1752:22:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 148, - "nodeType": "ExpressionStatement", - "src": "1752:22:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 153, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 149, - "name": "maxTxLimit", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 85, - "src": "1784:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 150, - "name": "limits", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 96, - "src": "1797:6:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_memory_ptr", - "typeString": "uint256[2] memory" - } - }, - "id": 152, - "indexExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 151, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1804:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "1797:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1784:22:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 154, - "nodeType": "ExpressionStatement", - "src": "1784:22:0" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "hexValue": "30", - "id": 156, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1831:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - { - "argumentTypes": null, - "hexValue": "31", - "id": 157, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1834:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - } - ], - "id": 155, - "name": "NewEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12, - "src": "1822:8:0", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$returns$__$", - "typeString": "function (uint256,uint256)" - } - }, - "id": 158, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1822:14:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 159, - "nodeType": "EmitStatement", - "src": "1817:19:0" - } - ] - }, - "documentation": null, - "id": 161, - "implemented": true, - "kind": "constructor", - "modifiers": [], - "name": "", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 97, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 87, - "name": "threshold", - "nodeType": "VariableDeclaration", - "scope": 161, - "src": "1373:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 86, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1373:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 90, - "name": "validators", - "nodeType": "VariableDeclaration", - "scope": 161, - "src": "1389:27:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 88, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1389:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 89, - "length": null, - "nodeType": "ArrayTypeName", - "src": "1389:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 92, - "name": "_tokenContract", - "nodeType": "VariableDeclaration", - "scope": 161, - "src": "1418:22:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 91, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1418:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 96, - "name": "limits", - "nodeType": "VariableDeclaration", - "scope": 161, - "src": "1442:21:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_memory_ptr", - "typeString": "uint256[2]" - }, - "typeName": { - "baseType": { - "id": 93, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1442:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 95, - "length": { - "argumentTypes": null, - "hexValue": "32", - "id": 94, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1447:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "nodeType": "ArrayTypeName", - "src": "1442:7:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_storage_ptr", - "typeString": "uint256[2]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1372:92:0" - }, - "returnParameters": { - "id": 98, - "nodeType": "ParameterList", - "parameters": [], - "src": "1472:0:0" - }, - "scope": 1138, - "src": "1361:482:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "constant": false, - "id": 163, - "name": "tokenContract", - "nodeType": "VariableDeclaration", - "scope": 1138, - "src": "1849:27:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$9773", - "typeString": "contract IERC20" - }, - "typeName": { - "contractScope": null, - "id": 162, - "name": "IERC20", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 9773, - "src": "1849:6:0", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$9773", - "typeString": "contract IERC20" - } - }, - "value": null, - "visibility": "public" - }, - { - "body": { - "id": 174, - "nodeType": "Block", - "src": "1898:81:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - }, - "id": 169, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 166, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "1916:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 167, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 45, - "src": "1926:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$45_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 168, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "READY", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1926:12:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "src": "1916:22:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4e6f7420696e207265616479207374617465", - "id": 170, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1940:20:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_965c39c15b78dbcd8a954511641ca86e15fc1ae6d6c30a67536872ccde75b679", - "typeString": "literal_string \"Not in ready state\"" - }, - "value": "Not in ready state" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_965c39c15b78dbcd8a954511641ca86e15fc1ae6d6c30a67536872ccde75b679", - "typeString": "literal_string \"Not in ready state\"" - } - ], - "id": 165, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 12832, - 12833 - ], - "referencedDeclaration": 12833, - "src": "1908:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 171, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1908:53:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 172, - "nodeType": "ExpressionStatement", - "src": "1908:53:0" - }, - { - "id": 173, - "nodeType": "PlaceholderStatement", - "src": "1971:1:0" - } - ] - }, - "documentation": null, - "id": 175, - "name": "ready", - "nodeType": "ModifierDefinition", - "parameters": { - "id": 164, - "nodeType": "ParameterList", - "parameters": [], - "src": "1898:0:0" - }, - "src": "1883:96:0", - "visibility": "internal" - }, - { - "body": { - "id": 191, - "nodeType": "Block", - "src": "2008:118:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 186, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - }, - "id": 181, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 178, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "2026:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 179, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 45, - "src": "2036:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$45_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 180, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "READY", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2036:12:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "src": "2026:22:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "||", - "rightExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - }, - "id": 185, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 182, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "2052:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 183, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 45, - "src": "2062:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$45_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 184, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "VOTING", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2062:13:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "src": "2052:23:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "2026:49:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4e6f7420696e207265616479206f7220766f74696e67207374617465", - "id": 187, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2077:30:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_7e3f7359baa731593d4e3921720b92600c22ed1d950d208e0c826ad2eddebe96", - "typeString": "literal_string \"Not in ready or voting state\"" - }, - "value": "Not in ready or voting state" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_7e3f7359baa731593d4e3921720b92600c22ed1d950d208e0c826ad2eddebe96", - "typeString": "literal_string \"Not in ready or voting state\"" - } - ], - "id": 177, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 12832, - 12833 - ], - "referencedDeclaration": 12833, - "src": "2018:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 188, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2018:90:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 189, - "nodeType": "ExpressionStatement", - "src": "2018:90:0" - }, - { - "id": 190, - "nodeType": "PlaceholderStatement", - "src": "2118:1:0" - } - ] - }, - "documentation": null, - "id": 192, - "name": "readyOrVoting", - "nodeType": "ModifierDefinition", - "parameters": { - "id": 176, - "nodeType": "ParameterList", - "parameters": [], - "src": "2008:0:0" - }, - "src": "1985:141:0", - "visibility": "internal" - }, - { - "body": { - "id": 203, - "nodeType": "Block", - "src": "2148:83:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - }, - "id": 198, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 195, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "2166:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 196, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 45, - "src": "2176:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$45_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 197, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "VOTING", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2176:13:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "src": "2166:23:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4e6f7420696e20766f74696e67207374617465", - "id": 199, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2191:21:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_0cbee9834b110b21e0730bf5c3d2972fb9867ff221df239e7ae60883592f05d1", - "typeString": "literal_string \"Not in voting state\"" - }, - "value": "Not in voting state" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_0cbee9834b110b21e0730bf5c3d2972fb9867ff221df239e7ae60883592f05d1", - "typeString": "literal_string \"Not in voting state\"" - } - ], - "id": 194, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 12832, - 12833 - ], - "referencedDeclaration": 12833, - "src": "2158:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 200, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2158:55:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 201, - "nodeType": "ExpressionStatement", - "src": "2158:55:0" - }, - { - "id": 202, - "nodeType": "PlaceholderStatement", - "src": "2223:1:0" - } - ] - }, - "documentation": null, - "id": 204, - "name": "voting", - "nodeType": "ModifierDefinition", - "parameters": { - "id": 193, - "nodeType": "ParameterList", - "parameters": [], - "src": "2148:0:0" - }, - "src": "2132:99:0", - "visibility": "internal" - }, - { - "body": { - "id": 215, - "nodeType": "Block", - "src": "2253:83:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - }, - "id": 210, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 207, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "2271:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 208, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 45, - "src": "2281:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$45_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 209, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "KEYGEN", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2281:13:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "src": "2271:23:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4e6f7420696e206b657967656e207374617465", - "id": 211, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2296:21:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_ed0fee6382e0651a224348a21558d03a4a439c3bd5edc24945894a3417c14010", - "typeString": "literal_string \"Not in keygen state\"" - }, - "value": "Not in keygen state" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_ed0fee6382e0651a224348a21558d03a4a439c3bd5edc24945894a3417c14010", - "typeString": "literal_string \"Not in keygen state\"" - } - ], - "id": 206, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 12832, - 12833 - ], - "referencedDeclaration": 12833, - "src": "2263:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 212, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2263:55:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 213, - "nodeType": "ExpressionStatement", - "src": "2263:55:0" - }, - { - "id": 214, - "nodeType": "PlaceholderStatement", - "src": "2328:1:0" - } - ] - }, - "documentation": null, - "id": 216, - "name": "keygen", - "nodeType": "ModifierDefinition", - "parameters": { - "id": 205, - "nodeType": "ParameterList", - "parameters": [], - "src": "2253:0:0" - }, - "src": "2237:99:0", - "visibility": "internal" - }, - { - "body": { - "id": 227, - "nodeType": "Block", - "src": "2365:99:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - }, - "id": 222, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 219, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "2383:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 220, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 45, - "src": "2393:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$45_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 221, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "FUNDS_TRANSFER", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2393:21:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "src": "2383:31:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4e6f7420696e2066756e6473207472616e73666572207374617465", - "id": 223, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2416:29:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_6347c9fecd6f58520ad10dfd1347ce3dc42cc0eed7a4182ca64dd11c69fc3008", - "typeString": "literal_string \"Not in funds transfer state\"" - }, - "value": "Not in funds transfer state" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_6347c9fecd6f58520ad10dfd1347ce3dc42cc0eed7a4182ca64dd11c69fc3008", - "typeString": "literal_string \"Not in funds transfer state\"" - } - ], - "id": 218, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 12832, - 12833 - ], - "referencedDeclaration": 12833, - "src": "2375:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 224, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2375:71:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 225, - "nodeType": "ExpressionStatement", - "src": "2375:71:0" - }, - { - "id": 226, - "nodeType": "PlaceholderStatement", - "src": "2456:1:0" - } - ] - }, - "documentation": null, - "id": 228, - "name": "fundsTransfer", - "nodeType": "ModifierDefinition", - "parameters": { - "id": 217, - "nodeType": "ParameterList", - "parameters": [], - "src": "2365:0:0" - }, - "src": "2342:122:0", - "visibility": "internal" - }, - { - "body": { - "id": 239, - "nodeType": "Block", - "src": "2496:81:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 234, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 231, - "name": "getPartyId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 552, - "src": "2514:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 232, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2514:12:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 233, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2530:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "2514:17:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4e6f7420612063757272656e742076616c696461746f72", - "id": 235, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2533:25:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_8dc18d5bb1361900b9758b388df331056e31071cae84b276c0f03794c4dc634a", - "typeString": "literal_string \"Not a current validator\"" - }, - "value": "Not a current validator" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_8dc18d5bb1361900b9758b388df331056e31071cae84b276c0f03794c4dc634a", - "typeString": "literal_string \"Not a current validator\"" - } - ], - "id": 230, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 12832, - 12833 - ], - "referencedDeclaration": 12833, - "src": "2506:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 236, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2506:53:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 237, - "nodeType": "ExpressionStatement", - "src": "2506:53:0" - }, - { - "id": 238, - "nodeType": "PlaceholderStatement", - "src": "2569:1:0" - } - ] - }, - "documentation": null, - "id": 240, - "name": "currentValidator", - "nodeType": "ModifierDefinition", - "parameters": { - "id": 229, - "nodeType": "ParameterList", - "parameters": [], - "src": "2496:0:0" - }, - "src": "2470:107:0", - "visibility": "internal" - }, - { - "body": { - "id": 278, - "nodeType": "Block", - "src": "2626:197:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 260, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 256, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 250, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 248, - "name": "value", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 242, - "src": "2644:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">=", - "rightExpression": { - "argumentTypes": null, - "id": 249, - "name": "minTxLimit", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 83, - "src": "2653:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2644:19:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "&&", - "rightExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 255, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 251, - "name": "value", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 242, - "src": "2667:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">=", - "rightExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_rational_10000000000_by_1", - "typeString": "int_const 10000000000" - }, - "id": 254, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "hexValue": "3130", - "id": 252, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2676:2:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_10_by_1", - "typeString": "int_const 10" - }, - "value": "10" - }, - "nodeType": "BinaryOperation", - "operator": "**", - "rightExpression": { - "argumentTypes": null, - "hexValue": "3130", - "id": 253, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2682:2:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_10_by_1", - "typeString": "int_const 10" - }, - "value": "10" - }, - "src": "2676:8:0", - "typeDescriptions": { - "typeIdentifier": "t_rational_10000000000_by_1", - "typeString": "int_const 10000000000" - } - }, - "src": "2667:17:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "2644:40:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "&&", - "rightExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 259, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 257, - "name": "value", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 242, - "src": "2688:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<=", - "rightExpression": { - "argumentTypes": null, - "id": 258, - "name": "maxTxLimit", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 85, - "src": "2697:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2688:19:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "2644:63:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 247, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 12832, - 12833 - ], - "referencedDeclaration": 12832, - "src": "2636:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 261, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2636:72:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 262, - "nodeType": "ExpressionStatement", - "src": "2636:72:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 266, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12829, - "src": "2746:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 267, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2746:10:0", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 269, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12845, - "src": "2766:4:0", - "typeDescriptions": { - "typeIdentifier": "t_contract$_Bridge_$1138", - "typeString": "contract Bridge" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_Bridge_$1138", - "typeString": "contract Bridge" - } - ], - "id": 268, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "2758:7:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 270, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2758:13:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 271, - "name": "value", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 242, - "src": "2773:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 263, - "name": "tokenContract", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 163, - "src": "2719:13:0", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$9773", - "typeString": "contract IERC20" - } - }, - "id": 265, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "transferFrom", - "nodeType": "MemberAccess", - "referencedDeclaration": 9756, - "src": "2719:26:0", - "typeDescriptions": { - "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$_t_bool_$", - "typeString": "function (address,address,uint256) external returns (bool)" - } - }, - "id": 272, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2719:60:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 273, - "nodeType": "ExpressionStatement", - "src": "2719:60:0" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 275, - "name": "value", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 242, - "src": "2810:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 274, - "name": "ExchangeRequest", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6, - "src": "2794:15:0", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$returns$__$", - "typeString": "function (uint256)" - } - }, - "id": 276, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2794:22:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 277, - "nodeType": "EmitStatement", - "src": "2789:27:0" - } - ] - }, - "documentation": null, - "id": 279, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 245, - "modifierName": { - "argumentTypes": null, - "id": 244, - "name": "ready", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 175, - "src": "2620:5:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "2620:5:0" - } - ], - "name": "exchange", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 243, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 242, - "name": "value", - "nodeType": "VariableDeclaration", - "scope": 279, - "src": "2601:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 241, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "2601:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2600:12:0" - }, - "returnParameters": { - "id": 246, - "nodeType": "ParameterList", - "parameters": [], - "src": "2626:0:0" - }, - "scope": 1138, - "src": "2583:240:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 308, - "nodeType": "Block", - "src": "2923:119:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 293, - "name": "Vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 55, - "src": "2945:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Vote_$55_$", - "typeString": "type(enum Bridge.Vote)" - } - }, - "id": 294, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "TRANSFER", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2945:13:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 295, - "name": "hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 281, - "src": "2960:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "id": 296, - "name": "to", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 283, - "src": "2966:2:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 297, - "name": "value", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 285, - "src": "2970:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 292, - "name": "tryVote", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 882, - 907, - 932, - 962 - ], - "referencedDeclaration": 962, - "src": "2937:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$55_$_t_bytes32_$_t_address_$_t_uint256_$returns$_t_bool_$", - "typeString": "function (enum Bridge.Vote,bytes32,address,uint256) returns (bool)" - } - }, - "id": 298, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2937:39:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 307, - "nodeType": "IfStatement", - "src": "2933:103:0", - "trueBody": { - "id": 306, - "nodeType": "Block", - "src": "2978:58:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 302, - "name": "to", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 283, - "src": "3015:2:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 303, - "name": "value", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 285, - "src": "3019:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 299, - "name": "tokenContract", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 163, - "src": "2992:13:0", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$9773", - "typeString": "contract IERC20" - } - }, - "id": 301, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "transfer", - "nodeType": "MemberAccess", - "referencedDeclaration": 9727, - "src": "2992:22:0", - "typeDescriptions": { - "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$_t_bool_$", - "typeString": "function (address,uint256) external returns (bool)" - } - }, - "id": 304, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2992:33:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 305, - "nodeType": "ExpressionStatement", - "src": "2992:33:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 309, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 288, - "modifierName": { - "argumentTypes": null, - "id": 287, - "name": "readyOrVoting", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 192, - "src": "2892:13:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "2892:13:0" - }, - { - "arguments": null, - "id": 290, - "modifierName": { - "argumentTypes": null, - "id": 289, - "name": "currentValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 240, - "src": "2906:16:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "2906:16:0" - } - ], - "name": "transfer", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 286, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 281, - "name": "hash", - "nodeType": "VariableDeclaration", - "scope": 309, - "src": "2847:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 280, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "2847:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 283, - "name": "to", - "nodeType": "VariableDeclaration", - "scope": 309, - "src": "2861:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 282, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2861:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 285, - "name": "value", - "nodeType": "VariableDeclaration", - "scope": 309, - "src": "2873:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 284, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "2873:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2846:38:0" - }, - "returnParameters": { - "id": 291, - "nodeType": "ParameterList", - "parameters": [], - "src": "2923:0:0" - }, - "scope": 1138, - "src": "2829:213:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 381, - "nodeType": "Block", - "src": "3101:525:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 324, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 320, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12829, - "src": "3134:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 321, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3134:10:0", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - ], - "id": 319, - "name": "getNextPartyId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 592, - "src": "3119:14:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_uint256_$", - "typeString": "function (address) view returns (uint256)" - } - }, - "id": 322, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3119:26:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 323, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3149:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "3119:31:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4e6f742061206e6578742076616c696461746f72", - "id": 325, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3152:22:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_44981c92ce908443b2fa5f878c54791e1a0c95d4cc04ea4f4d9224b3ec030922", - "typeString": "literal_string \"Not a next validator\"" - }, - "value": "Not a next validator" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_44981c92ce908443b2fa5f878c54791e1a0c95d4cc04ea4f4d9224b3ec030922", - "typeString": "literal_string \"Not a next validator\"" - } - ], - "id": 318, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 12832, - 12833 - ], - "referencedDeclaration": 12833, - "src": "3111:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 326, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3111:64:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 327, - "nodeType": "ExpressionStatement", - "src": "3111:64:0" - }, - { - "condition": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 329, - "name": "Vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 55, - "src": "3201:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Vote_$55_$", - "typeString": "type(enum Bridge.Vote)" - } - }, - "id": 330, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "CONFIRM_KEYGEN", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3201:19:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 331, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 311, - "src": "3222:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 332, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 313, - "src": "3225:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 328, - "name": "tryConfirm", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 984, - 1012 - ], - "referencedDeclaration": 1012, - "src": "3190:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$55_$_t_uint256_$_t_uint256_$returns$_t_bool_$", - "typeString": "function (enum Bridge.Vote,uint256,uint256) returns (bool)" - } - }, - "id": 333, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3190:37:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 380, - "nodeType": "IfStatement", - "src": "3186:434:0", - "trueBody": { - "id": 379, - "nodeType": "Block", - "src": "3229:391:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 339, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 334, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 59, - "src": "3243:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$40_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 336, - "indexExpression": { - "argumentTypes": null, - "id": 335, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 81, - "src": "3250:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3243:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$40_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 337, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "x", - "nodeType": "MemberAccess", - "referencedDeclaration": 37, - "src": "3243:19:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 338, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 311, - "src": "3265:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3243:23:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 340, - "nodeType": "ExpressionStatement", - "src": "3243:23:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 346, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 341, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 59, - "src": "3280:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$40_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 343, - "indexExpression": { - "argumentTypes": null, - "id": 342, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 81, - "src": "3287:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3280:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$40_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 344, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "y", - "nodeType": "MemberAccess", - "referencedDeclaration": 39, - "src": "3280:19:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 345, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 313, - "src": "3302:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3280:23:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 347, - "nodeType": "ExpressionStatement", - "src": "3280:23:0" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 350, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 348, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 81, - "src": "3321:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 349, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3334:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "3321:14:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "id": 377, - "nodeType": "Block", - "src": "3490:120:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 370, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 367, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "3508:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 368, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 45, - "src": "3517:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$45_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 369, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "FUNDS_TRANSFER", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3517:21:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "src": "3508:30:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "id": 371, - "nodeType": "ExpressionStatement", - "src": "3508:30:0" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 373, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 79, - "src": "3578:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 374, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 81, - "src": "3585:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 372, - "name": "NewFundsTransfer", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 22, - "src": "3561:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$returns$__$", - "typeString": "function (uint256,uint256)" - } - }, - "id": 375, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3561:34:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 376, - "nodeType": "EmitStatement", - "src": "3556:39:0" - } - ] - }, - "id": 378, - "nodeType": "IfStatement", - "src": "3317:293:0", - "trueBody": { - "id": 366, - "nodeType": "Block", - "src": "3337:135:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 354, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 351, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "3355:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 352, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 45, - "src": "3364:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$45_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 353, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "READY", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3364:12:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "src": "3355:21:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "id": 355, - "nodeType": "ExpressionStatement", - "src": "3355:21:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 358, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 356, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 79, - "src": "3394:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 357, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 81, - "src": "3402:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3394:17:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 359, - "nodeType": "ExpressionStatement", - "src": "3394:17:0" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 361, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 79, - "src": "3445:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 362, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 311, - "src": "3452:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 363, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 313, - "src": "3455:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 360, - "name": "EpochStart", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 30, - "src": "3434:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$_t_uint256_$returns$__$", - "typeString": "function (uint256,uint256,uint256)" - } - }, - "id": 364, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3434:23:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 365, - "nodeType": "EmitStatement", - "src": "3429:28:0" - } - ] - } - } - ] - } - } - ] - }, - "documentation": null, - "id": 382, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 316, - "modifierName": { - "argumentTypes": null, - "id": 315, - "name": "keygen", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 216, - "src": "3094:6:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "3094:6:0" - } - ], - "name": "confirmKeygen", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 314, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 311, - "name": "x", - "nodeType": "VariableDeclaration", - "scope": 382, - "src": "3071:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 310, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "3071:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 313, - "name": "y", - "nodeType": "VariableDeclaration", - "scope": 382, - "src": "3079:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 312, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "3079:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "3070:16:0" - }, - "returnParameters": { - "id": 317, - "nodeType": "ParameterList", - "parameters": [], - "src": "3101:0:0" - }, - "scope": 1138, - "src": "3048:578:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 423, - "nodeType": "Block", - "src": "3702:281:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 392, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 390, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 79, - "src": "3720:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 391, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3728:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "3720:9:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "46697273742065706f636820646f6573206e6f74206e6565642066756e6473207472616e73666572", - "id": 393, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3731:42:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_8ddae2cc9da30ed8c59c39c6a950ef823ea484ac89ff6f37abb0317fb5f679a1", - "typeString": "literal_string \"First epoch does not need funds transfer\"" - }, - "value": "First epoch does not need funds transfer" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_8ddae2cc9da30ed8c59c39c6a950ef823ea484ac89ff6f37abb0317fb5f679a1", - "typeString": "literal_string \"First epoch does not need funds transfer\"" - } - ], - "id": 389, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 12832, - 12833 - ], - "referencedDeclaration": 12833, - "src": "3712:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 394, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3712:62:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 395, - "nodeType": "ExpressionStatement", - "src": "3712:62:0" - }, - { - "condition": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 397, - "name": "Vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 55, - "src": "3800:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Vote_$55_$", - "typeString": "type(enum Bridge.Vote)" - } - }, - "id": 398, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "CONFIRM_FUNDS_TRANSFER", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3800:27:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - } - ], - "id": 396, - "name": "tryConfirm", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 984, - 1012 - ], - "referencedDeclaration": 984, - "src": "3789:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$55_$returns$_t_bool_$", - "typeString": "function (enum Bridge.Vote) returns (bool)" - } - }, - "id": 399, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3789:39:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 422, - "nodeType": "IfStatement", - "src": "3785:192:0", - "trueBody": { - "id": 421, - "nodeType": "Block", - "src": "3830:147:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 403, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 400, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "3844:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 401, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 45, - "src": "3853:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$45_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 402, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "READY", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3853:12:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "src": "3844:21:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "id": 404, - "nodeType": "ExpressionStatement", - "src": "3844:21:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 407, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 405, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 79, - "src": "3879:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 406, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 81, - "src": "3887:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3879:17:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 408, - "nodeType": "ExpressionStatement", - "src": "3879:17:0" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 410, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 79, - "src": "3926:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 411, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 59, - "src": "3933:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$40_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 413, - "indexExpression": { - "argumentTypes": null, - "id": 412, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 79, - "src": "3940:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3933:13:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$40_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 414, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "x", - "nodeType": "MemberAccess", - "referencedDeclaration": 37, - "src": "3933:15:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 415, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 59, - "src": "3950:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$40_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 417, - "indexExpression": { - "argumentTypes": null, - "id": 416, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 79, - "src": "3957:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3950:13:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$40_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 418, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "y", - "nodeType": "MemberAccess", - "referencedDeclaration": 39, - "src": "3950:15:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 409, - "name": "EpochStart", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 30, - "src": "3915:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$_t_uint256_$returns$__$", - "typeString": "function (uint256,uint256,uint256)" - } - }, - "id": 419, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3915:51:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 420, - "nodeType": "EmitStatement", - "src": "3910:56:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 424, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 385, - "modifierName": { - "argumentTypes": null, - "id": 384, - "name": "fundsTransfer", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 228, - "src": "3671:13:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "3671:13:0" - }, - { - "arguments": null, - "id": 387, - "modifierName": { - "argumentTypes": null, - "id": 386, - "name": "currentValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 240, - "src": "3685:16:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "3685:16:0" - } - ], - "name": "confirmFundsTransfer", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 383, - "nodeType": "ParameterList", - "parameters": [], - "src": "3661:2:0" - }, - "returnParameters": { - "id": 388, - "nodeType": "ParameterList", - "parameters": [], - "src": "3702:0:0" - }, - "scope": 1138, - "src": "3632:351:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 433, - "nodeType": "Block", - "src": "4038:41:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 430, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 79, - "src": "4066:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 429, - "name": "getParties", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 434, - 458 - ], - "referencedDeclaration": 458, - "src": "4055:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256) view returns (uint256)" - } - }, - "id": 431, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4055:17:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 428, - "id": 432, - "nodeType": "Return", - "src": "4048:24:0" - } - ] - }, - "documentation": null, - "id": 434, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getParties", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 425, - "nodeType": "ParameterList", - "parameters": [], - "src": "4008:2:0" - }, - "returnParameters": { - "id": 428, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 427, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 434, - "src": "4032:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 426, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "4032:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4031:6:0" - }, - "scope": 1138, - "src": "3989:90:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 443, - "nodeType": "Block", - "src": "4138:45:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 440, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 81, - "src": "4166:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 439, - "name": "getParties", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 434, - 458 - ], - "referencedDeclaration": 458, - "src": "4155:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256) view returns (uint256)" - } - }, - "id": 441, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4155:21:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 438, - "id": 442, - "nodeType": "Return", - "src": "4148:28:0" - } - ] - }, - "documentation": null, - "id": 444, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getNextParties", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 435, - "nodeType": "ParameterList", - "parameters": [], - "src": "4108:2:0" - }, - "returnParameters": { - "id": 438, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 437, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 444, - "src": "4132:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 436, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "4132:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4131:6:0" - }, - "scope": 1138, - "src": "4085:98:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 457, - "nodeType": "Block", - "src": "4249:56:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 451, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 59, - "src": "4266:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$40_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 453, - "indexExpression": { - "argumentTypes": null, - "id": 452, - "name": "_epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 446, - "src": "4273:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4266:14:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$40_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 454, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "validators", - "nodeType": "MemberAccess", - "referencedDeclaration": 33, - "src": "4266:25:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 455, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4266:32:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 450, - "id": 456, - "nodeType": "Return", - "src": "4259:39:0" - } - ] - }, - "documentation": null, - "id": 458, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getParties", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 447, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 446, - "name": "_epoch", - "nodeType": "VariableDeclaration", - "scope": 458, - "src": "4209:11:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 445, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "4209:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4208:13:0" - }, - "returnParameters": { - "id": 450, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 449, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 458, - "src": "4243:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 448, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "4243:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4242:6:0" - }, - "scope": 1138, - "src": "4189:116:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 467, - "nodeType": "Block", - "src": "4362:43:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 464, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 79, - "src": "4392:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 463, - "name": "getThreshold", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 468, - 491 - ], - "referencedDeclaration": 491, - "src": "4379:12:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256) view returns (uint256)" - } - }, - "id": 465, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4379:19:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 462, - "id": 466, - "nodeType": "Return", - "src": "4372:26:0" - } - ] - }, - "documentation": null, - "id": 468, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getThreshold", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 459, - "nodeType": "ParameterList", - "parameters": [], - "src": "4332:2:0" - }, - "returnParameters": { - "id": 462, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 461, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 468, - "src": "4356:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 460, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "4356:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4355:6:0" - }, - "scope": 1138, - "src": "4311:94:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 477, - "nodeType": "Block", - "src": "4466:47:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 474, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 81, - "src": "4496:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 473, - "name": "getThreshold", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 468, - 491 - ], - "referencedDeclaration": 491, - "src": "4483:12:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256) view returns (uint256)" - } - }, - "id": 475, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4483:23:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 472, - "id": 476, - "nodeType": "Return", - "src": "4476:30:0" - } - ] - }, - "documentation": null, - "id": 478, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getNextThreshold", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 469, - "nodeType": "ParameterList", - "parameters": [], - "src": "4436:2:0" - }, - "returnParameters": { - "id": 472, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 471, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 478, - "src": "4460:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 470, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "4460:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4459:6:0" - }, - "scope": 1138, - "src": "4411:102:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 490, - "nodeType": "Block", - "src": "4581:48:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 485, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 59, - "src": "4598:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$40_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 487, - "indexExpression": { - "argumentTypes": null, - "id": 486, - "name": "_epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 480, - "src": "4605:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4598:14:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$40_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 488, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "threshold", - "nodeType": "MemberAccess", - "referencedDeclaration": 35, - "src": "4598:24:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 484, - "id": 489, - "nodeType": "Return", - "src": "4591:31:0" - } - ] - }, - "documentation": null, - "id": 491, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getThreshold", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 481, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 480, - "name": "_epoch", - "nodeType": "VariableDeclaration", - "scope": 491, - "src": "4541:11:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 479, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "4541:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4540:13:0" - }, - "returnParameters": { - "id": 484, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 483, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 491, - "src": "4575:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 482, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "4575:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4574:6:0" - }, - "scope": 1138, - "src": "4519:110:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 501, - "nodeType": "Block", - "src": "4678:39:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 496, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 59, - "src": "4695:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$40_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 498, - "indexExpression": { - "argumentTypes": null, - "id": 497, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 79, - "src": "4702:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4695:13:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$40_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 499, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "x", - "nodeType": "MemberAccess", - "referencedDeclaration": 37, - "src": "4695:15:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 495, - "id": 500, - "nodeType": "Return", - "src": "4688:22:0" - } - ] - }, - "documentation": null, - "id": 502, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getX", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 492, - "nodeType": "ParameterList", - "parameters": [], - "src": "4648:2:0" - }, - "returnParameters": { - "id": 495, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 494, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 502, - "src": "4672:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 493, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "4672:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4671:6:0" - }, - "scope": 1138, - "src": "4635:82:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 512, - "nodeType": "Block", - "src": "4766:39:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 507, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 59, - "src": "4783:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$40_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 509, - "indexExpression": { - "argumentTypes": null, - "id": 508, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 79, - "src": "4790:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4783:13:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$40_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 510, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "y", - "nodeType": "MemberAccess", - "referencedDeclaration": 39, - "src": "4783:15:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 506, - "id": 511, - "nodeType": "Return", - "src": "4776:22:0" - } - ] - }, - "documentation": null, - "id": 513, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getY", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 503, - "nodeType": "ParameterList", - "parameters": [], - "src": "4736:2:0" - }, - "returnParameters": { - "id": 506, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 505, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 513, - "src": "4760:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 504, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "4760:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4759:6:0" - }, - "scope": 1138, - "src": "4723:82:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 551, - "nodeType": "Block", - "src": "4860:215:0", - "statements": [ - { - "assignments": [ - 521 - ], - "declarations": [ - { - "constant": false, - "id": 521, - "name": "validators", - "nodeType": "VariableDeclaration", - "scope": 551, - "src": "4870:27:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 519, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "4870:7:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 520, - "length": null, - "nodeType": "ArrayTypeName", - "src": "4870:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 524, - "initialValue": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 522, - "name": "getValidators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 604, - "src": "4900:13:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_array$_t_address_$dyn_memory_ptr_$", - "typeString": "function () view returns (address[] memory)" - } - }, - "id": 523, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4900:15:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "4870:45:0" - }, - { - "body": { - "id": 547, - "nodeType": "Block", - "src": "4965:86:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 541, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 536, - "name": "validators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 521, - "src": "4983:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 538, - "indexExpression": { - "argumentTypes": null, - "id": 537, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 526, - "src": "4994:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4983:13:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 539, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12829, - "src": "5000:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 540, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "5000:10:0", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "src": "4983:27:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 546, - "nodeType": "IfStatement", - "src": "4979:61:0", - "trueBody": { - "expression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 544, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 542, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 526, - "src": "5035:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 543, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "5039:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "5035:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 517, - "id": 545, - "nodeType": "Return", - "src": "5028:12:0" - } - } - ] - }, - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 532, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 529, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 526, - "src": "4942:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 530, - "name": "getParties", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 434, - 458 - ], - "referencedDeclaration": 434, - "src": "4946:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 531, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4946:12:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4942:16:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 548, - "initializationExpression": { - "assignments": [ - 526 - ], - "declarations": [ - { - "constant": false, - "id": 526, - "name": "i", - "nodeType": "VariableDeclaration", - "scope": 548, - "src": "4930:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 525, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "4930:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 528, - "initialValue": { - "argumentTypes": null, - "hexValue": "30", - "id": 527, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4939:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "4930:10:0" - }, - "loopExpression": { - "expression": { - "argumentTypes": null, - "id": 534, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "4960:3:0", - "subExpression": { - "argumentTypes": null, - "id": 533, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 526, - "src": "4960:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 535, - "nodeType": "ExpressionStatement", - "src": "4960:3:0" - }, - "nodeType": "ForStatement", - "src": "4925:126:0" - }, - { - "expression": { - "argumentTypes": null, - "hexValue": "30", - "id": 549, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "5067:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "functionReturnParameters": 517, - "id": 550, - "nodeType": "Return", - "src": "5060:8:0" - } - ] - }, - "documentation": null, - "id": 552, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getPartyId", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 514, - "nodeType": "ParameterList", - "parameters": [], - "src": "4830:2:0" - }, - "returnParameters": { - "id": 517, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 516, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 552, - "src": "4854:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 515, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "4854:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4853:6:0" - }, - "scope": 1138, - "src": "4811:264:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 591, - "nodeType": "Block", - "src": "5143:214:0", - "statements": [ - { - "assignments": [ - 562 - ], - "declarations": [ - { - "constant": false, - "id": 562, - "name": "validators", - "nodeType": "VariableDeclaration", - "scope": 591, - "src": "5153:27:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 560, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "5153:7:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 561, - "length": null, - "nodeType": "ArrayTypeName", - "src": "5153:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 565, - "initialValue": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 563, - "name": "getNextValidators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 616, - "src": "5183:17:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_array$_t_address_$dyn_memory_ptr_$", - "typeString": "function () view returns (address[] memory)" - } - }, - "id": 564, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5183:19:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "5153:49:0" - }, - { - "body": { - "id": 587, - "nodeType": "Block", - "src": "5256:77:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 581, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 577, - "name": "validators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 562, - "src": "5274:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 579, - "indexExpression": { - "argumentTypes": null, - "id": 578, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 567, - "src": "5285:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "5274:13:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "id": 580, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 554, - "src": "5291:1:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "5274:18:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 586, - "nodeType": "IfStatement", - "src": "5270:52:0", - "trueBody": { - "expression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 584, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 582, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 567, - "src": "5317:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 583, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "5321:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "5317:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 558, - "id": 585, - "nodeType": "Return", - "src": "5310:12:0" - } - } - ] - }, - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 573, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 570, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 567, - "src": "5229:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 571, - "name": "getNextParties", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 444, - "src": "5233:14:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 572, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5233:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "5229:20:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 588, - "initializationExpression": { - "assignments": [ - 567 - ], - "declarations": [ - { - "constant": false, - "id": 567, - "name": "i", - "nodeType": "VariableDeclaration", - "scope": 588, - "src": "5217:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 566, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5217:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 569, - "initialValue": { - "argumentTypes": null, - "hexValue": "30", - "id": 568, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "5226:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "5217:10:0" - }, - "loopExpression": { - "expression": { - "argumentTypes": null, - "id": 575, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "5251:3:0", - "subExpression": { - "argumentTypes": null, - "id": 574, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 567, - "src": "5251:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 576, - "nodeType": "ExpressionStatement", - "src": "5251:3:0" - }, - "nodeType": "ForStatement", - "src": "5212:121:0" - }, - { - "expression": { - "argumentTypes": null, - "hexValue": "30", - "id": 589, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "5349:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "functionReturnParameters": 558, - "id": 590, - "nodeType": "Return", - "src": "5342:8:0" - } - ] - }, - "documentation": null, - "id": 592, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getNextPartyId", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 555, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 554, - "name": "a", - "nodeType": "VariableDeclaration", - "scope": 592, - "src": "5105:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 553, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "5105:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5104:11:0" - }, - "returnParameters": { - "id": 558, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 557, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 592, - "src": "5137:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 556, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5137:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5136:6:0" - }, - "scope": 1138, - "src": "5081:276:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 603, - "nodeType": "Block", - "src": "5427:48:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 598, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 59, - "src": "5444:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$40_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 600, - "indexExpression": { - "argumentTypes": null, - "id": 599, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 79, - "src": "5451:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "5444:13:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$40_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 601, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "validators", - "nodeType": "MemberAccess", - "referencedDeclaration": 33, - "src": "5444:24:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "functionReturnParameters": 597, - "id": 602, - "nodeType": "Return", - "src": "5437:31:0" - } - ] - }, - "documentation": null, - "id": 604, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getValidators", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 593, - "nodeType": "ParameterList", - "parameters": [], - "src": "5385:2:0" - }, - "returnParameters": { - "id": 597, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 596, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 604, - "src": "5409:16:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 594, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "5409:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 595, - "length": null, - "nodeType": "ArrayTypeName", - "src": "5409:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5408:18:0" - }, - "scope": 1138, - "src": "5363:112:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 615, - "nodeType": "Block", - "src": "5549:52:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 610, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 59, - "src": "5566:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$40_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 612, - "indexExpression": { - "argumentTypes": null, - "id": 611, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 81, - "src": "5573:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "5566:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$40_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 613, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "validators", - "nodeType": "MemberAccess", - "referencedDeclaration": 33, - "src": "5566:28:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "functionReturnParameters": 609, - "id": 614, - "nodeType": "Return", - "src": "5559:35:0" - } - ] - }, - "documentation": null, - "id": 616, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getNextValidators", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 605, - "nodeType": "ParameterList", - "parameters": [], - "src": "5507:2:0" - }, - "returnParameters": { - "id": 609, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 608, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 616, - "src": "5531:16:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 606, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "5531:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 607, - "length": null, - "nodeType": "ArrayTypeName", - "src": "5531:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5530:18:0" - }, - "scope": 1138, - "src": "5481:120:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 657, - "nodeType": "Block", - "src": "5668:256:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 624, - "name": "Vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 55, - "src": "5690:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Vote_$55_$", - "typeString": "type(enum Bridge.Vote)" - } - }, - "id": 625, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "START_VOTING", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "5690:17:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - } - ], - "id": 623, - "name": "tryVote", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 882, - 907, - 932, - 962 - ], - "referencedDeclaration": 882, - "src": "5682:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$55_$returns$_t_bool_$", - "typeString": "function (enum Bridge.Vote) returns (bool)" - } - }, - "id": 626, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5682:26:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 656, - "nodeType": "IfStatement", - "src": "5678:240:0", - "trueBody": { - "id": 655, - "nodeType": "Block", - "src": "5710:208:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 628, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "5724:11:0", - "subExpression": { - "argumentTypes": null, - "id": 627, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 81, - "src": "5724:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 629, - "nodeType": "ExpressionStatement", - "src": "5724:11:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 633, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 630, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "5749:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 631, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 45, - "src": "5758:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$45_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 632, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "VOTING", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "5758:13:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "src": "5749:22:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "id": 634, - "nodeType": "ExpressionStatement", - "src": "5749:22:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 643, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 635, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 59, - "src": "5785:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$40_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 637, - "indexExpression": { - "argumentTypes": null, - "id": 636, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 81, - "src": "5792:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "5785:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$40_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 638, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "threshold", - "nodeType": "MemberAccess", - "referencedDeclaration": 35, - "src": "5785:27:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 639, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 59, - "src": "5815:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$40_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 641, - "indexExpression": { - "argumentTypes": null, - "id": 640, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 79, - "src": "5822:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "5815:13:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$40_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 642, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "threshold", - "nodeType": "MemberAccess", - "referencedDeclaration": 35, - "src": "5815:23:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "5785:53:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 644, - "nodeType": "ExpressionStatement", - "src": "5785:53:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 653, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 645, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 59, - "src": "5852:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$40_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 647, - "indexExpression": { - "argumentTypes": null, - "id": 646, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 81, - "src": "5859:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "5852:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$40_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 648, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "validators", - "nodeType": "MemberAccess", - "referencedDeclaration": 33, - "src": "5852:28:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 649, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 59, - "src": "5883:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$40_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 651, - "indexExpression": { - "argumentTypes": null, - "id": 650, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 79, - "src": "5890:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "5883:13:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$40_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 652, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "validators", - "nodeType": "MemberAccess", - "referencedDeclaration": 33, - "src": "5883:24:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "src": "5852:55:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 654, - "nodeType": "ExpressionStatement", - "src": "5852:55:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 658, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 619, - "modifierName": { - "argumentTypes": null, - "id": 618, - "name": "readyOrVoting", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 192, - "src": "5637:13:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "5637:13:0" - }, - { - "arguments": null, - "id": 621, - "modifierName": { - "argumentTypes": null, - "id": 620, - "name": "currentValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 240, - "src": "5651:16:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "5651:16:0" - } - ], - "name": "startVoting", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 617, - "nodeType": "ParameterList", - "parameters": [], - "src": "5627:2:0" - }, - "returnParameters": { - "id": 622, - "nodeType": "ParameterList", - "parameters": [], - "src": "5668:0:0" - }, - "scope": 1138, - "src": "5607:317:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 691, - "nodeType": "Block", - "src": "6006:202:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 672, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 669, - "name": "validator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 660, - "src": "6039:9:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 668, - "name": "getNextPartyId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 592, - "src": "6024:14:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_uint256_$", - "typeString": "function (address) view returns (uint256)" - } - }, - "id": 670, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6024:25:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 671, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6053:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "6024:30:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "416c726561647920612076616c696461746f72", - "id": 673, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6056:21:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_aeb0fe100da2796aa6136a3b1c66282f002b435141be331237dfa7127e6df6ff", - "typeString": "literal_string \"Already a validator\"" - }, - "value": "Already a validator" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_aeb0fe100da2796aa6136a3b1c66282f002b435141be331237dfa7127e6df6ff", - "typeString": "literal_string \"Already a validator\"" - } - ], - "id": 667, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 12832, - 12833 - ], - "referencedDeclaration": 12833, - "src": "6016:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 674, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6016:62:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 675, - "nodeType": "ExpressionStatement", - "src": "6016:62:0" - }, - { - "condition": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 677, - "name": "Vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 55, - "src": "6101:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Vote_$55_$", - "typeString": "type(enum Bridge.Vote)" - } - }, - "id": 678, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "ADD_VALIDATOR", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "6101:18:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 679, - "name": "validator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 660, - "src": "6121:9:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 676, - "name": "tryVote", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 882, - 907, - 932, - 962 - ], - "referencedDeclaration": 907, - "src": "6093:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$55_$_t_address_$returns$_t_bool_$", - "typeString": "function (enum Bridge.Vote,address) returns (bool)" - } - }, - "id": 680, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6093:38:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 690, - "nodeType": "IfStatement", - "src": "6089:113:0", - "trueBody": { - "id": 689, - "nodeType": "Block", - "src": "6133:69:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 686, - "name": "validator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 660, - "src": "6181:9:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 681, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 59, - "src": "6147:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$40_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 683, - "indexExpression": { - "argumentTypes": null, - "id": 682, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 81, - "src": "6154:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6147:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$40_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 684, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "validators", - "nodeType": "MemberAccess", - "referencedDeclaration": 33, - "src": "6147:28:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 685, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "push", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "6147:33:0", - "typeDescriptions": { - "typeIdentifier": "t_function_arraypush_nonpayable$_t_address_$returns$_t_uint256_$", - "typeString": "function (address) returns (uint256)" - } - }, - "id": 687, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6147:44:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 688, - "nodeType": "ExpressionStatement", - "src": "6147:44:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 692, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 663, - "modifierName": { - "argumentTypes": null, - "id": 662, - "name": "voting", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 204, - "src": "5982:6:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "5982:6:0" - }, - { - "arguments": null, - "id": 665, - "modifierName": { - "argumentTypes": null, - "id": 664, - "name": "currentValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 240, - "src": "5989:16:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "5989:16:0" - } - ], - "name": "voteAddValidator", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 661, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 660, - "name": "validator", - "nodeType": "VariableDeclaration", - "scope": 692, - "src": "5956:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 659, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "5956:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5955:19:0" - }, - "returnParameters": { - "id": 666, - "nodeType": "ParameterList", - "parameters": [], - "src": "6006:0:0" - }, - "scope": 1138, - "src": "5930:278:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 721, - "nodeType": "Block", - "src": "6293:192:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 706, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 703, - "name": "validator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 694, - "src": "6326:9:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 702, - "name": "getNextPartyId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 592, - "src": "6311:14:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_uint256_$", - "typeString": "function (address) view returns (uint256)" - } - }, - "id": 704, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6311:25:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 705, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6340:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "6311:30:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "416c7265616479206e6f7420612076616c696461746f72", - "id": 707, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6343:25:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_2332ed568e8af3d64f1f2b0b098c504cab97ba4128fb9f08cfa3f851ced05961", - "typeString": "literal_string \"Already not a validator\"" - }, - "value": "Already not a validator" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_2332ed568e8af3d64f1f2b0b098c504cab97ba4128fb9f08cfa3f851ced05961", - "typeString": "literal_string \"Already not a validator\"" - } - ], - "id": 701, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 12832, - 12833 - ], - "referencedDeclaration": 12833, - "src": "6303:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 708, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6303:66:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 709, - "nodeType": "ExpressionStatement", - "src": "6303:66:0" - }, - { - "condition": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 711, - "name": "Vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 55, - "src": "6392:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Vote_$55_$", - "typeString": "type(enum Bridge.Vote)" - } - }, - "id": 712, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "REMOVE_VALIDATOR", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "6392:21:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 713, - "name": "validator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 694, - "src": "6415:9:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 710, - "name": "tryVote", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 882, - 907, - 932, - 962 - ], - "referencedDeclaration": 907, - "src": "6384:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$55_$_t_address_$returns$_t_bool_$", - "typeString": "function (enum Bridge.Vote,address) returns (bool)" - } - }, - "id": 714, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6384:41:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 720, - "nodeType": "IfStatement", - "src": "6380:99:0", - "trueBody": { - "id": 719, - "nodeType": "Block", - "src": "6427:52:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 716, - "name": "validator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 694, - "src": "6458:9:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 715, - "name": "_removeValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 789, - "src": "6441:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$", - "typeString": "function (address)" - } - }, - "id": 717, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6441:27:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 718, - "nodeType": "ExpressionStatement", - "src": "6441:27:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 722, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 697, - "modifierName": { - "argumentTypes": null, - "id": 696, - "name": "voting", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 204, - "src": "6269:6:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "6269:6:0" - }, - { - "arguments": null, - "id": 699, - "modifierName": { - "argumentTypes": null, - "id": 698, - "name": "currentValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 240, - "src": "6276:16:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "6276:16:0" - } - ], - "name": "voteRemoveValidator", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 695, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 694, - "name": "validator", - "nodeType": "VariableDeclaration", - "scope": 722, - "src": "6243:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 693, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "6243:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "6242:19:0" - }, - "returnParameters": { - "id": 700, - "nodeType": "ParameterList", - "parameters": [], - "src": "6293:0:0" - }, - "scope": 1138, - "src": "6214:271:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 788, - "nodeType": "Block", - "src": "6544:392:0", - "statements": [ - { - "body": { - "id": 768, - "nodeType": "Block", - "src": "6602:214:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 747, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 740, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 59, - "src": "6620:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$40_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 742, - "indexExpression": { - "argumentTypes": null, - "id": 741, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 81, - "src": "6627:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6620:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$40_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 743, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "validators", - "nodeType": "MemberAccess", - "referencedDeclaration": 33, - "src": "6620:28:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 745, - "indexExpression": { - "argumentTypes": null, - "id": 744, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 728, - "src": "6649:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6620:31:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "id": 746, - "name": "validator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 724, - "src": "6655:9:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "6620:44:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 767, - "nodeType": "IfStatement", - "src": "6616:190:0", - "trueBody": { - "id": 766, - "nodeType": "Block", - "src": "6666:140:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 763, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 748, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 59, - "src": "6684:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$40_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 750, - "indexExpression": { - "argumentTypes": null, - "id": 749, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 81, - "src": "6691:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6684:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$40_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 751, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "validators", - "nodeType": "MemberAccess", - "referencedDeclaration": 33, - "src": "6684:28:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 753, - "indexExpression": { - "argumentTypes": null, - "id": 752, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 728, - "src": "6713:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "6684:31:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 754, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 59, - "src": "6718:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$40_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 756, - "indexExpression": { - "argumentTypes": null, - "id": 755, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 81, - "src": "6725:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6718:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$40_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 757, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "validators", - "nodeType": "MemberAccess", - "referencedDeclaration": 33, - "src": "6718:28:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 762, - "indexExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 761, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 758, - "name": "getNextParties", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 444, - "src": "6747:14:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 759, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6747:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 760, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6766:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "6747:20:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6718:50:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "6684:84:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 764, - "nodeType": "ExpressionStatement", - "src": "6684:84:0" - }, - { - "id": 765, - "nodeType": "Break", - "src": "6786:5:0" - } - ] - } - } - ] - }, - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 736, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 731, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 728, - "src": "6571:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 735, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 732, - "name": "getNextParties", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 444, - "src": "6575:14:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 733, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6575:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 734, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6594:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "6575:20:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "6571:24:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 769, - "initializationExpression": { - "assignments": [ - 728 - ], - "declarations": [ - { - "constant": false, - "id": 728, - "name": "i", - "nodeType": "VariableDeclaration", - "scope": 769, - "src": "6559:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 727, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "6559:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 730, - "initialValue": { - "argumentTypes": null, - "hexValue": "30", - "id": 729, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6568:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "6559:10:0" - }, - "loopExpression": { - "expression": { - "argumentTypes": null, - "id": 738, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "6597:3:0", - "subExpression": { - "argumentTypes": null, - "id": 737, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 728, - "src": "6597:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 739, - "nodeType": "ExpressionStatement", - "src": "6597:3:0" - }, - "nodeType": "ForStatement", - "src": "6554:262:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 779, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "delete", - "prefix": true, - "src": "6825:57:0", - "subExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 770, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 59, - "src": "6832:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$40_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 772, - "indexExpression": { - "argumentTypes": null, - "id": 771, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 81, - "src": "6839:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6832:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$40_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 773, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "validators", - "nodeType": "MemberAccess", - "referencedDeclaration": 33, - "src": "6832:28:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 778, - "indexExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 777, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 774, - "name": "getNextParties", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 444, - "src": "6861:14:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 775, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6861:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 776, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6880:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "6861:20:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "6832:50:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 780, - "nodeType": "ExpressionStatement", - "src": "6825:57:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 786, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "--", - "prefix": false, - "src": "6892:37:0", - "subExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 781, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 59, - "src": "6892:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$40_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 783, - "indexExpression": { - "argumentTypes": null, - "id": 782, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 81, - "src": "6899:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6892:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$40_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 784, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "validators", - "nodeType": "MemberAccess", - "referencedDeclaration": 33, - "src": "6892:28:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 785, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "6892:35:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 787, - "nodeType": "ExpressionStatement", - "src": "6892:37:0" - } - ] - }, - "documentation": null, - "id": 789, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "_removeValidator", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 725, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 724, - "name": "validator", - "nodeType": "VariableDeclaration", - "scope": 789, - "src": "6517:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 723, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "6517:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "6516:19:0" - }, - "returnParameters": { - "id": 726, - "nodeType": "ParameterList", - "parameters": [], - "src": "6544:0:0" - }, - "scope": 1138, - "src": "6491:445:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "private" - }, - { - "body": { - "id": 812, - "nodeType": "Block", - "src": "7018:127:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 799, - "name": "Vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 55, - "src": "7040:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Vote_$55_$", - "typeString": "type(enum Bridge.Vote)" - } - }, - "id": 800, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "CHANGE_THRESHOLD", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "7040:21:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 801, - "name": "threshold", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 791, - "src": "7063:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 798, - "name": "tryVote", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 882, - 907, - 932, - 962 - ], - "referencedDeclaration": 932, - "src": "7032:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$55_$_t_uint256_$returns$_t_bool_$", - "typeString": "function (enum Bridge.Vote,uint256) returns (bool)" - } - }, - "id": 802, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7032:41:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 811, - "nodeType": "IfStatement", - "src": "7028:111:0", - "trueBody": { - "id": 810, - "nodeType": "Block", - "src": "7075:64:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 808, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 803, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 59, - "src": "7089:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$40_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 805, - "indexExpression": { - "argumentTypes": null, - "id": 804, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 81, - "src": "7096:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "7089:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$40_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 806, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "threshold", - "nodeType": "MemberAccess", - "referencedDeclaration": 35, - "src": "7089:27:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 807, - "name": "threshold", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 791, - "src": "7119:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "7089:39:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 809, - "nodeType": "ExpressionStatement", - "src": "7089:39:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 813, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 794, - "modifierName": { - "argumentTypes": null, - "id": 793, - "name": "voting", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 204, - "src": "6994:6:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "6994:6:0" - }, - { - "arguments": null, - "id": 796, - "modifierName": { - "argumentTypes": null, - "id": 795, - "name": "currentValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 240, - "src": "7001:16:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "7001:16:0" - } - ], - "name": "voteChangeThreshold", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 792, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 791, - "name": "threshold", - "nodeType": "VariableDeclaration", - "scope": 813, - "src": "6971:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 790, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "6971:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "6970:16:0" - }, - "returnParameters": { - "id": 797, - "nodeType": "ParameterList", - "parameters": [], - "src": "7018:0:0" - }, - "scope": 1138, - "src": "6942:203:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 836, - "nodeType": "Block", - "src": "7209:141:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 821, - "name": "Vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 55, - "src": "7231:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Vote_$55_$", - "typeString": "type(enum Bridge.Vote)" - } - }, - "id": 822, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "START_KEYGEN", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "7231:17:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - } - ], - "id": 820, - "name": "tryVote", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 882, - 907, - 932, - 962 - ], - "referencedDeclaration": 882, - "src": "7223:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$55_$returns$_t_bool_$", - "typeString": "function (enum Bridge.Vote) returns (bool)" - } - }, - "id": 823, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7223:26:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 835, - "nodeType": "IfStatement", - "src": "7219:125:0", - "trueBody": { - "id": 834, - "nodeType": "Block", - "src": "7251:93:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 827, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 824, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "7265:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 825, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 45, - "src": "7274:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$45_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 826, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "KEYGEN", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "7274:13:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "src": "7265:22:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "id": 828, - "nodeType": "ExpressionStatement", - "src": "7265:22:0" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 830, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 79, - "src": "7316:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 831, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 81, - "src": "7323:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 829, - "name": "NewEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12, - "src": "7307:8:0", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$returns$__$", - "typeString": "function (uint256,uint256)" - } - }, - "id": 832, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7307:26:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 833, - "nodeType": "EmitStatement", - "src": "7302:31:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 837, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 816, - "modifierName": { - "argumentTypes": null, - "id": 815, - "name": "voting", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 204, - "src": "7185:6:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "7185:6:0" - }, - { - "arguments": null, - "id": 818, - "modifierName": { - "argumentTypes": null, - "id": 817, - "name": "currentValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 240, - "src": "7192:16:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "7192:16:0" - } - ], - "name": "voteStartKeygen", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 814, - "nodeType": "ParameterList", - "parameters": [], - "src": "7175:2:0" - }, - "returnParameters": { - "id": 819, - "nodeType": "ParameterList", - "parameters": [], - "src": "7209:0:0" - }, - "scope": 1138, - "src": "7151:199:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 859, - "nodeType": "Block", - "src": "7415:144:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 845, - "name": "Vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 55, - "src": "7437:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Vote_$55_$", - "typeString": "type(enum Bridge.Vote)" - } - }, - "id": 846, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "CANCEL_KEYGEN", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "7437:18:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - } - ], - "id": 844, - "name": "tryVote", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 882, - 907, - 932, - 962 - ], - "referencedDeclaration": 882, - "src": "7429:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$55_$returns$_t_bool_$", - "typeString": "function (enum Bridge.Vote) returns (bool)" - } - }, - "id": 847, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7429:27:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 858, - "nodeType": "IfStatement", - "src": "7425:128:0", - "trueBody": { - "id": 857, - "nodeType": "Block", - "src": "7458:95:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 851, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 848, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "7472:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 849, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 45, - "src": "7481:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$45_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 850, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "VOTING", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "7481:13:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "src": "7472:22:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "id": 852, - "nodeType": "ExpressionStatement", - "src": "7472:22:0" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 854, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 81, - "src": "7532:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 853, - "name": "NewEpochCancelled", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 16, - "src": "7514:17:0", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$returns$__$", - "typeString": "function (uint256)" - } - }, - "id": 855, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7514:28:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 856, - "nodeType": "EmitStatement", - "src": "7509:33:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 860, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 840, - "modifierName": { - "argumentTypes": null, - "id": 839, - "name": "keygen", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 216, - "src": "7391:6:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "7391:6:0" - }, - { - "arguments": null, - "id": 842, - "modifierName": { - "argumentTypes": null, - "id": 841, - "name": "currentValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 240, - "src": "7398:16:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "7398:16:0" - } - ], - "name": "voteCancelKeygen", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 838, - "nodeType": "ParameterList", - "parameters": [], - "src": "7381:2:0" - }, - "returnParameters": { - "id": 843, - "nodeType": "ParameterList", - "parameters": [], - "src": "7415:0:0" - }, - "scope": 1138, - "src": "7356:203:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 881, - "nodeType": "Block", - "src": "7620:110:0", - "statements": [ - { - "assignments": [ - 868 - ], - "declarations": [ - { - "constant": false, - "id": 868, - "name": "vote", - "nodeType": "VariableDeclaration", - "scope": 881, - "src": "7630:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 867, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "7630:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 876, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 872, - "name": "voteType", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 862, - "src": "7672:8:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 873, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 81, - "src": "7682:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 870, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12816, - "src": "7655:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 871, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "7655:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 874, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7655:37:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 869, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12823, - "src": "7645:9:0", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 875, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7645:48:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "7630:63:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 878, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 868, - "src": "7718:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "id": 877, - "name": "putVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1066, - "src": "7710:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$_t_bool_$", - "typeString": "function (bytes32) returns (bool)" - } - }, - "id": 879, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7710:13:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "functionReturnParameters": 866, - "id": 880, - "nodeType": "Return", - "src": "7703:20:0" - } - ] - }, - "documentation": null, - "id": 882, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "tryVote", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 863, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 862, - "name": "voteType", - "nodeType": "VariableDeclaration", - "scope": 882, - "src": "7582:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - }, - "typeName": { - "contractScope": null, - "id": 861, - "name": "Vote", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 55, - "src": "7582:4:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "7581:15:0" - }, - "returnParameters": { - "id": 866, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 865, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 882, - "src": "7614:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 864, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "7614:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "7613:6:0" - }, - "scope": 1138, - "src": "7565:165:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "private" - }, - { - "body": { - "id": 906, - "nodeType": "Block", - "src": "7805:116:0", - "statements": [ - { - "assignments": [ - 892 - ], - "declarations": [ - { - "constant": false, - "id": 892, - "name": "vote", - "nodeType": "VariableDeclaration", - "scope": 906, - "src": "7815:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 891, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "7815:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 901, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 896, - "name": "voteType", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 884, - "src": "7857:8:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 897, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 81, - "src": "7867:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 898, - "name": "addr", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 886, - "src": "7878:4:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "expression": { - "argumentTypes": null, - "id": 894, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12816, - "src": "7840:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 895, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "7840:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 899, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7840:43:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 893, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12823, - "src": "7830:9:0", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 900, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7830:54:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "7815:69:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 903, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 892, - "src": "7909:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "id": 902, - "name": "putVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1066, - "src": "7901:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$_t_bool_$", - "typeString": "function (bytes32) returns (bool)" - } - }, - "id": 904, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7901:13:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "functionReturnParameters": 890, - "id": 905, - "nodeType": "Return", - "src": "7894:20:0" - } - ] - }, - "documentation": null, - "id": 907, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "tryVote", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 887, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 884, - "name": "voteType", - "nodeType": "VariableDeclaration", - "scope": 907, - "src": "7753:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - }, - "typeName": { - "contractScope": null, - "id": 883, - "name": "Vote", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 55, - "src": "7753:4:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 886, - "name": "addr", - "nodeType": "VariableDeclaration", - "scope": 907, - "src": "7768:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 885, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "7768:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "7752:29:0" - }, - "returnParameters": { - "id": 890, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 889, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 907, - "src": "7799:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 888, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "7799:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "7798:6:0" - }, - "scope": 1138, - "src": "7736:185:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "private" - }, - { - "body": { - "id": 931, - "nodeType": "Block", - "src": "7992:115:0", - "statements": [ - { - "assignments": [ - 917 - ], - "declarations": [ - { - "constant": false, - "id": 917, - "name": "vote", - "nodeType": "VariableDeclaration", - "scope": 931, - "src": "8002:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 916, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "8002:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 926, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 921, - "name": "voteType", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 909, - "src": "8044:8:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 922, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 81, - "src": "8054:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 923, - "name": "num", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 911, - "src": "8065:3:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 919, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12816, - "src": "8027:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 920, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "8027:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 924, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8027:42:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 918, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12823, - "src": "8017:9:0", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 925, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8017:53:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "8002:68:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 928, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 917, - "src": "8095:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "id": 927, - "name": "putVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1066, - "src": "8087:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$_t_bool_$", - "typeString": "function (bytes32) returns (bool)" - } - }, - "id": 929, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8087:13:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "functionReturnParameters": 915, - "id": 930, - "nodeType": "Return", - "src": "8080:20:0" - } - ] - }, - "documentation": null, - "id": 932, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "tryVote", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 912, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 909, - "name": "voteType", - "nodeType": "VariableDeclaration", - "scope": 932, - "src": "7944:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - }, - "typeName": { - "contractScope": null, - "id": 908, - "name": "Vote", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 55, - "src": "7944:4:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 911, - "name": "num", - "nodeType": "VariableDeclaration", - "scope": 932, - "src": "7959:8:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 910, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "7959:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "7943:25:0" - }, - "returnParameters": { - "id": 915, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 914, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 932, - "src": "7986:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 913, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "7986:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "7985:6:0" - }, - "scope": 1138, - "src": "7927:180:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "private" - }, - { - "body": { - "id": 961, - "nodeType": "Block", - "src": "8206:116:0", - "statements": [ - { - "assignments": [ - 946 - ], - "declarations": [ - { - "constant": false, - "id": 946, - "name": "vote", - "nodeType": "VariableDeclaration", - "scope": 961, - "src": "8216:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 945, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "8216:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 956, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 950, - "name": "voteType", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 934, - "src": "8258:8:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 951, - "name": "hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 936, - "src": "8268:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "id": 952, - "name": "to", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 938, - "src": "8274:2:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 953, - "name": "value", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 940, - "src": "8278:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 948, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12816, - "src": "8241:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 949, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "8241:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 954, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8241:43:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 947, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12823, - "src": "8231:9:0", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 955, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8231:54:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "8216:69:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 958, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 946, - "src": "8310:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "id": 957, - "name": "putVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1066, - "src": "8302:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$_t_bool_$", - "typeString": "function (bytes32) returns (bool)" - } - }, - "id": 959, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8302:13:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "functionReturnParameters": 944, - "id": 960, - "nodeType": "Return", - "src": "8295:20:0" - } - ] - }, - "documentation": null, - "id": 962, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "tryVote", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 941, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 934, - "name": "voteType", - "nodeType": "VariableDeclaration", - "scope": 962, - "src": "8130:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - }, - "typeName": { - "contractScope": null, - "id": 933, - "name": "Vote", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 55, - "src": "8130:4:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 936, - "name": "hash", - "nodeType": "VariableDeclaration", - "scope": 962, - "src": "8145:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 935, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "8145:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 938, - "name": "to", - "nodeType": "VariableDeclaration", - "scope": 962, - "src": "8159:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 937, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "8159:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 940, - "name": "value", - "nodeType": "VariableDeclaration", - "scope": 962, - "src": "8171:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 939, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "8171:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "8129:53:0" - }, - "returnParameters": { - "id": 944, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 943, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 962, - "src": "8200:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 942, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "8200:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "8199:6:0" - }, - "scope": 1138, - "src": "8113:209:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "private" - }, - { - "body": { - "id": 983, - "nodeType": "Block", - "src": "8386:113:0", - "statements": [ - { - "assignments": [ - 970 - ], - "declarations": [ - { - "constant": false, - "id": 970, - "name": "vote", - "nodeType": "VariableDeclaration", - "scope": 983, - "src": "8396:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 969, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "8396:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 978, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 974, - "name": "voteType", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 964, - "src": "8438:8:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 975, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 81, - "src": "8448:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 972, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12816, - "src": "8421:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 973, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "8421:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 976, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8421:37:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 971, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12823, - "src": "8411:9:0", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 977, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8411:48:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "8396:63:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 980, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 970, - "src": "8487:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "id": 979, - "name": "putConfirm", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1120, - "src": "8476:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$_t_bool_$", - "typeString": "function (bytes32) returns (bool)" - } - }, - "id": 981, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8476:16:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "functionReturnParameters": 968, - "id": 982, - "nodeType": "Return", - "src": "8469:23:0" - } - ] - }, - "documentation": null, - "id": 984, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "tryConfirm", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 965, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 964, - "name": "voteType", - "nodeType": "VariableDeclaration", - "scope": 984, - "src": "8348:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - }, - "typeName": { - "contractScope": null, - "id": 963, - "name": "Vote", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 55, - "src": "8348:4:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "8347:15:0" - }, - "returnParameters": { - "id": 968, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 967, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 984, - "src": "8380:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 966, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "8380:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "8379:6:0" - }, - "scope": 1138, - "src": "8328:171:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "private" - }, - { - "body": { - "id": 1011, - "nodeType": "Block", - "src": "8579:119:0", - "statements": [ - { - "assignments": [ - 996 - ], - "declarations": [ - { - "constant": false, - "id": 996, - "name": "vote", - "nodeType": "VariableDeclaration", - "scope": 1011, - "src": "8589:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 995, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "8589:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 1006, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1000, - "name": "voteType", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 986, - "src": "8631:8:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 1001, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 81, - "src": "8641:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 1002, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 988, - "src": "8652:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 1003, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 990, - "src": "8655:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 998, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12816, - "src": "8614:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 999, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "8614:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 1004, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8614:43:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 997, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12823, - "src": "8604:9:0", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 1005, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8604:54:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "8589:69:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1008, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 996, - "src": "8686:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "id": 1007, - "name": "putConfirm", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1120, - "src": "8675:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$_t_bool_$", - "typeString": "function (bytes32) returns (bool)" - } - }, - "id": 1009, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8675:16:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "functionReturnParameters": 994, - "id": 1010, - "nodeType": "Return", - "src": "8668:23:0" - } - ] - }, - "documentation": null, - "id": 1012, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "tryConfirm", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 991, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 986, - "name": "voteType", - "nodeType": "VariableDeclaration", - "scope": 1012, - "src": "8525:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - }, - "typeName": { - "contractScope": null, - "id": 985, - "name": "Vote", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 55, - "src": "8525:4:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 988, - "name": "x", - "nodeType": "VariableDeclaration", - "scope": 1012, - "src": "8540:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 987, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "8540:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 990, - "name": "y", - "nodeType": "VariableDeclaration", - "scope": 1012, - "src": "8548:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 989, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "8548:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "8524:31:0" - }, - "returnParameters": { - "id": 994, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 993, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 1012, - "src": "8573:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 992, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "8573:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "8572:6:0" - }, - "scope": 1138, - "src": "8505:193:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "private" - }, - { - "body": { - "id": 1065, - "nodeType": "Block", - "src": "8758:355:0", - "statements": [ - { - "assignments": [ - 1020 - ], - "declarations": [ - { - "constant": false, - "id": 1020, - "name": "personalVote", - "nodeType": "VariableDeclaration", - "scope": 1065, - "src": "8768:20:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1019, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "8768:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 1024, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1022, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1014, - "src": "8807:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "id": 1021, - "name": "personalizeVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1137, - "src": "8791:15:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_bytes32_$", - "typeString": "function (bytes32) view returns (bytes32)" - } - }, - "id": 1023, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8791:21:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "8768:44:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1029, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "!", - "prefix": true, - "src": "8830:20:0", - "subExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1026, - "name": "votes", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 75, - "src": "8831:5:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - } - }, - "id": 1028, - "indexExpression": { - "argumentTypes": null, - "id": 1027, - "name": "personalVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1020, - "src": "8837:12:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8831:19:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "566f74656420616c7265616479", - "id": 1030, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8852:15:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_230c30109b60c15b21799291aaf5c571045da3dc3f224d8bbd2f2e688c149a47", - "typeString": "literal_string \"Voted already\"" - }, - "value": "Voted already" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_230c30109b60c15b21799291aaf5c571045da3dc3f224d8bbd2f2e688c149a47", - "typeString": "literal_string \"Voted already\"" - } - ], - "id": 1025, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 12832, - 12833 - ], - "referencedDeclaration": 12833, - "src": "8822:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 1031, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8822:46:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 1032, - "nodeType": "ExpressionStatement", - "src": "8822:46:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 1037, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1033, - "name": "votes", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 75, - "src": "8879:5:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - } - }, - "id": 1035, - "indexExpression": { - "argumentTypes": null, - "id": 1034, - "name": "personalVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1020, - "src": "8885:12:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "8879:19:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 1036, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8901:4:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "src": "8879:26:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 1038, - "nodeType": "ExpressionStatement", - "src": "8879:26:0" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 1044, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1039, - "name": "votesCount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 71, - "src": "8919:10:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - } - }, - "id": 1041, - "indexExpression": { - "argumentTypes": null, - "id": 1040, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1014, - "src": "8930:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8919:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 1042, - "name": "getThreshold", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 468, - 491 - ], - "referencedDeclaration": 468, - "src": "8939:12:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 1043, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8939:14:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "8919:34:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "id": 1063, - "nodeType": "Block", - "src": "9038:69:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 1059, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "9052:18:0", - "subExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1056, - "name": "votesCount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 71, - "src": "9052:10:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - } - }, - "id": 1058, - "indexExpression": { - "argumentTypes": null, - "id": 1057, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1014, - "src": "9063:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "9052:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 1060, - "nodeType": "ExpressionStatement", - "src": "9052:18:0" - }, - { - "expression": { - "argumentTypes": null, - "hexValue": "66616c7365", - "id": 1061, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "9091:5:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "false" - }, - "functionReturnParameters": 1018, - "id": 1062, - "nodeType": "Return", - "src": "9084:12:0" - } - ] - }, - "id": 1064, - "nodeType": "IfStatement", - "src": "8915:192:0", - "trueBody": { - "id": 1055, - "nodeType": "Block", - "src": "8955:77:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 1051, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1045, - "name": "votesCount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 71, - "src": "8969:10:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - } - }, - "id": 1047, - "indexExpression": { - "argumentTypes": null, - "id": 1046, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1014, - "src": "8980:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "8969:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_rational_57896044618658097711785492504343953926634992332820282019728792003956564819968_by_1", - "typeString": "int_const 5789...(69 digits omitted)...9968" - }, - "id": 1050, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "hexValue": "32", - "id": 1048, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8988:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "nodeType": "BinaryOperation", - "operator": "**", - "rightExpression": { - "argumentTypes": null, - "hexValue": "323535", - "id": 1049, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8993:3:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_255_by_1", - "typeString": "int_const 255" - }, - "value": "255" - }, - "src": "8988:8:0", - "typeDescriptions": { - "typeIdentifier": "t_rational_57896044618658097711785492504343953926634992332820282019728792003956564819968_by_1", - "typeString": "int_const 5789...(69 digits omitted)...9968" - } - }, - "src": "8969:27:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 1052, - "nodeType": "ExpressionStatement", - "src": "8969:27:0" - }, - { - "expression": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 1053, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "9017:4:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "functionReturnParameters": 1018, - "id": 1054, - "nodeType": "Return", - "src": "9010:11:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 1066, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "putVote", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1015, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1014, - "name": "vote", - "nodeType": "VariableDeclaration", - "scope": 1066, - "src": "8721:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1013, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "8721:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "8720:14:0" - }, - "returnParameters": { - "id": 1018, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1017, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 1066, - "src": "8752:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 1016, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "8752:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "8751:6:0" - }, - "scope": 1138, - "src": "8704:409:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "private" - }, - { - "body": { - "id": 1119, - "nodeType": "Block", - "src": "9176:363:0", - "statements": [ - { - "assignments": [ - 1074 - ], - "declarations": [ - { - "constant": false, - "id": 1074, - "name": "personalVote", - "nodeType": "VariableDeclaration", - "scope": 1119, - "src": "9186:20:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1073, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "9186:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 1078, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1076, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1068, - "src": "9225:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "id": 1075, - "name": "personalizeVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1137, - "src": "9209:15:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_bytes32_$", - "typeString": "function (bytes32) view returns (bytes32)" - } - }, - "id": 1077, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9209:21:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "9186:44:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1083, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "!", - "prefix": true, - "src": "9248:20:0", - "subExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1080, - "name": "votes", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 75, - "src": "9249:5:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - } - }, - "id": 1082, - "indexExpression": { - "argumentTypes": null, - "id": 1081, - "name": "personalVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1074, - "src": "9255:12:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "9249:19:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "436f6e6669726d656420616c7265616479", - "id": 1084, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "9270:19:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_762a97ce67d271844ad9c09d89a5271fde7fe7537af208da055a904cd67ac7bc", - "typeString": "literal_string \"Confirmed already\"" - }, - "value": "Confirmed already" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_762a97ce67d271844ad9c09d89a5271fde7fe7537af208da055a904cd67ac7bc", - "typeString": "literal_string \"Confirmed already\"" - } - ], - "id": 1079, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 12832, - 12833 - ], - "referencedDeclaration": 12833, - "src": "9240:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 1085, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9240:50:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 1086, - "nodeType": "ExpressionStatement", - "src": "9240:50:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 1091, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1087, - "name": "votes", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 75, - "src": "9301:5:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - } - }, - "id": 1089, - "indexExpression": { - "argumentTypes": null, - "id": 1088, - "name": "personalVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1074, - "src": "9307:12:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "9301:19:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 1090, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "9323:4:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "src": "9301:26:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 1092, - "nodeType": "ExpressionStatement", - "src": "9301:26:0" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 1098, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1093, - "name": "votesCount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 71, - "src": "9341:10:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - } - }, - "id": 1095, - "indexExpression": { - "argumentTypes": null, - "id": 1094, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1068, - "src": "9352:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "9341:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 1096, - "name": "getNextThreshold", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 478, - "src": "9361:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 1097, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9361:18:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "9341:38:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "id": 1117, - "nodeType": "Block", - "src": "9464:69:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 1113, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "9478:18:0", - "subExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1110, - "name": "votesCount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 71, - "src": "9478:10:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - } - }, - "id": 1112, - "indexExpression": { - "argumentTypes": null, - "id": 1111, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1068, - "src": "9489:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "9478:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 1114, - "nodeType": "ExpressionStatement", - "src": "9478:18:0" - }, - { - "expression": { - "argumentTypes": null, - "hexValue": "66616c7365", - "id": 1115, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "9517:5:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "false" - }, - "functionReturnParameters": 1072, - "id": 1116, - "nodeType": "Return", - "src": "9510:12:0" - } - ] - }, - "id": 1118, - "nodeType": "IfStatement", - "src": "9337:196:0", - "trueBody": { - "id": 1109, - "nodeType": "Block", - "src": "9381:77:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 1105, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1099, - "name": "votesCount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 71, - "src": "9395:10:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - } - }, - "id": 1101, - "indexExpression": { - "argumentTypes": null, - "id": 1100, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1068, - "src": "9406:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "9395:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_rational_57896044618658097711785492504343953926634992332820282019728792003956564819968_by_1", - "typeString": "int_const 5789...(69 digits omitted)...9968" - }, - "id": 1104, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "hexValue": "32", - "id": 1102, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "9414:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "nodeType": "BinaryOperation", - "operator": "**", - "rightExpression": { - "argumentTypes": null, - "hexValue": "323535", - "id": 1103, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "9419:3:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_255_by_1", - "typeString": "int_const 255" - }, - "value": "255" - }, - "src": "9414:8:0", - "typeDescriptions": { - "typeIdentifier": "t_rational_57896044618658097711785492504343953926634992332820282019728792003956564819968_by_1", - "typeString": "int_const 5789...(69 digits omitted)...9968" - } - }, - "src": "9395:27:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 1106, - "nodeType": "ExpressionStatement", - "src": "9395:27:0" - }, - { - "expression": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 1107, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "9443:4:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "functionReturnParameters": 1072, - "id": 1108, - "nodeType": "Return", - "src": "9436:11:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 1120, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "putConfirm", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1069, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1068, - "name": "vote", - "nodeType": "VariableDeclaration", - "scope": 1120, - "src": "9139:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1067, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "9139:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "9138:14:0" - }, - "returnParameters": { - "id": 1072, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1071, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 1120, - "src": "9170:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 1070, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "9170:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "9169:6:0" - }, - "scope": 1138, - "src": "9119:420:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "private" - }, - { - "body": { - "id": 1136, - "nodeType": "Block", - "src": "9615:69:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1130, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1122, - "src": "9659:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1131, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12829, - "src": "9665:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 1132, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "9665:10:0", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - ], - "expression": { - "argumentTypes": null, - "id": 1128, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12816, - "src": "9642:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 1129, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "9642:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 1133, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9642:34:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 1127, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12823, - "src": "9632:9:0", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 1134, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9632:45:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "functionReturnParameters": 1126, - "id": 1135, - "nodeType": "Return", - "src": "9625:52:0" - } - ] - }, - "documentation": null, - "id": 1137, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "personalizeVote", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1123, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1122, - "name": "vote", - "nodeType": "VariableDeclaration", - "scope": 1137, - "src": "9570:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1121, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "9570:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "9569:14:0" - }, - "returnParameters": { - "id": 1126, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1125, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 1137, - "src": "9606:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1124, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "9606:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "9605:9:0" - }, - "scope": 1138, - "src": "9545:139:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "private" - } - ], - "scope": 1139, - "src": "93:9593:0" - } - ], - "src": "0:9687:0" - }, - "legacyAST": { - "absolutePath": "/Users/kirillfedoseev/Innopolis/My own projects/bridge/bridge/src/deploy/deploy-home/contracts/Bridge.sol", - "exportedSymbols": { - "Bridge": [ - 1138 - ] - }, - "id": 1139, - "nodeType": "SourceUnit", - "nodes": [ - { - "id": 1, - "literals": [ - "solidity", - "^", - "0.5", - ".0" - ], - "nodeType": "PragmaDirective", - "src": "0:23:0" - }, - { - "absolutePath": "/Users/kirillfedoseev/Innopolis/My own projects/bridge/bridge/src/deploy/deploy-home/contracts/openzeppelin-solidity/contracts/token/ERC20/IERC20.sol", - "file": "./openzeppelin-solidity/contracts/token/ERC20/IERC20.sol", - "id": 2, - "nodeType": "ImportDirective", - "scope": 1139, - "sourceUnit": 9774, - "src": "25:66:0", - "symbolAliases": [], - "unitAlias": "" - }, - { - "baseContracts": [], - "contractDependencies": [], - "contractKind": "contract", - "documentation": null, - "fullyImplemented": true, - "id": 1138, - "linearizedBaseContracts": [ - 1138 - ], - "name": "Bridge", - "nodeType": "ContractDefinition", - "nodes": [ - { - "anonymous": false, - "documentation": null, - "id": 6, - "name": "ExchangeRequest", - "nodeType": "EventDefinition", - "parameters": { - "id": 5, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4, - "indexed": false, - "name": "value", - "nodeType": "VariableDeclaration", - "scope": 6, - "src": "137:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 3, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "137:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "136:12:0" - }, - "src": "115:34:0" - }, - { - "anonymous": false, - "documentation": null, - "id": 12, - "name": "NewEpoch", - "nodeType": "EventDefinition", - "parameters": { - "id": 11, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 8, - "indexed": true, - "name": "oldEpoch", - "nodeType": "VariableDeclaration", - "scope": 12, - "src": "169:21:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 7, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "169:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 10, - "indexed": true, - "name": "newEpoch", - "nodeType": "VariableDeclaration", - "scope": 12, - "src": "192:21:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 9, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "192:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "168:46:0" - }, - "src": "154:61:0" - }, - { - "anonymous": false, - "documentation": null, - "id": 16, - "name": "NewEpochCancelled", - "nodeType": "EventDefinition", - "parameters": { - "id": 15, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 14, - "indexed": true, - "name": "epoch", - "nodeType": "VariableDeclaration", - "scope": 16, - "src": "244:18:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 13, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "244:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "243:20:0" - }, - "src": "220:44:0" - }, - { - "anonymous": false, - "documentation": null, - "id": 22, - "name": "NewFundsTransfer", - "nodeType": "EventDefinition", - "parameters": { - "id": 21, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 18, - "indexed": true, - "name": "oldEpoch", - "nodeType": "VariableDeclaration", - "scope": 22, - "src": "292:21:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 17, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "292:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 20, - "indexed": true, - "name": "newEpoch", - "nodeType": "VariableDeclaration", - "scope": 22, - "src": "315:21:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 19, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "315:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "291:46:0" - }, - "src": "269:69:0" - }, - { - "anonymous": false, - "documentation": null, - "id": 30, - "name": "EpochStart", - "nodeType": "EventDefinition", - "parameters": { - "id": 29, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 24, - "indexed": true, - "name": "epoch", - "nodeType": "VariableDeclaration", - "scope": 30, - "src": "360:18:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 23, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "360:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 26, - "indexed": false, - "name": "x", - "nodeType": "VariableDeclaration", - "scope": 30, - "src": "380:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 25, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "380:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 28, - "indexed": false, - "name": "y", - "nodeType": "VariableDeclaration", - "scope": 30, - "src": "388:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 27, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "388:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "359:36:0" - }, - "src": "343:53:0" - }, - { - "canonicalName": "Bridge.State", - "id": 40, - "members": [ - { - "constant": false, - "id": 33, - "name": "validators", - "nodeType": "VariableDeclaration", - "scope": 40, - "src": "425:20:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 31, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "425:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 32, - "length": null, - "nodeType": "ArrayTypeName", - "src": "425:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 35, - "name": "threshold", - "nodeType": "VariableDeclaration", - "scope": 40, - "src": "455:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 34, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "455:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 37, - "name": "x", - "nodeType": "VariableDeclaration", - "scope": 40, - "src": "479:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 36, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "479:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 39, - "name": "y", - "nodeType": "VariableDeclaration", - "scope": 40, - "src": "495:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 38, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "495:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "name": "State", - "nodeType": "StructDefinition", - "scope": 1138, - "src": "402:106:0", - "visibility": "public" - }, - { - "canonicalName": "Bridge.Status", - "id": 45, - "members": [ - { - "id": 41, - "name": "READY", - "nodeType": "EnumValue", - "src": "536:5:0" - }, - { - "id": 42, - "name": "VOTING", - "nodeType": "EnumValue", - "src": "595:6:0" - }, - { - "id": 43, - "name": "KEYGEN", - "nodeType": "EnumValue", - "src": "665:6:0" - }, - { - "id": 44, - "name": "FUNDS_TRANSFER", - "nodeType": "EnumValue", - "src": "708:14:0" - } - ], - "name": "Status", - "nodeType": "EnumDefinition", - "src": "514:253:0" - }, - { - "canonicalName": "Bridge.Vote", - "id": 55, - "members": [ - { - "id": 46, - "name": "CONFIRM_KEYGEN", - "nodeType": "EnumValue", - "src": "793:14:0" - }, - { - "id": 47, - "name": "CONFIRM_FUNDS_TRANSFER", - "nodeType": "EnumValue", - "src": "817:22:0" - }, - { - "id": 48, - "name": "START_VOTING", - "nodeType": "EnumValue", - "src": "849:12:0" - }, - { - "id": 49, - "name": "ADD_VALIDATOR", - "nodeType": "EnumValue", - "src": "871:13:0" - }, - { - "id": 50, - "name": "REMOVE_VALIDATOR", - "nodeType": "EnumValue", - "src": "894:16:0" - }, - { - "id": 51, - "name": "CHANGE_THRESHOLD", - "nodeType": "EnumValue", - "src": "920:16:0" - }, - { - "id": 52, - "name": "START_KEYGEN", - "nodeType": "EnumValue", - "src": "946:12:0" - }, - { - "id": 53, - "name": "CANCEL_KEYGEN", - "nodeType": "EnumValue", - "src": "968:13:0" - }, - { - "id": 54, - "name": "TRANSFER", - "nodeType": "EnumValue", - "src": "991:8:0" - } - ], - "name": "Vote", - "nodeType": "EnumDefinition", - "src": "773:232:0" - }, - { - "constant": false, - "id": 59, - "name": "states", - "nodeType": "VariableDeclaration", - "scope": 1138, - "src": "1011:29:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$40_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State)" - }, - "typeName": { - "id": 58, - "keyType": { - "id": 56, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1019:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Mapping", - "src": "1011:22:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$40_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State)" - }, - "valueType": { - "contractScope": null, - "id": 57, - "name": "State", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 40, - "src": "1027:5:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$40_storage_ptr", - "typeString": "struct Bridge.State" - } - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 63, - "name": "dbTransferCount", - "nodeType": "VariableDeclaration", - "scope": 1138, - "src": "1047:47:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - }, - "typeName": { - "id": 62, - "keyType": { - "id": 60, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1055:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Mapping", - "src": "1047:24:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - }, - "valueType": { - "id": 61, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1066:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 67, - "name": "dbTransfer", - "nodeType": "VariableDeclaration", - "scope": 1138, - "src": "1100:42:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - }, - "typeName": { - "id": 66, - "keyType": { - "id": 64, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1108:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Mapping", - "src": "1100:24:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - }, - "valueType": { - "id": 65, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "1119:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 71, - "name": "votesCount", - "nodeType": "VariableDeclaration", - "scope": 1138, - "src": "1148:42:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - }, - "typeName": { - "id": 70, - "keyType": { - "id": 68, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1156:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Mapping", - "src": "1148:24:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - }, - "valueType": { - "id": 69, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1167:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 75, - "name": "votes", - "nodeType": "VariableDeclaration", - "scope": 1138, - "src": "1196:37:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - }, - "typeName": { - "id": 74, - "keyType": { - "id": 72, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1204:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Mapping", - "src": "1196:24:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - }, - "valueType": { - "id": 73, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "1215:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 77, - "name": "status", - "nodeType": "VariableDeclaration", - "scope": 1138, - "src": "1240:20:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - }, - "typeName": { - "contractScope": null, - "id": 76, - "name": "Status", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 45, - "src": "1240:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 79, - "name": "epoch", - "nodeType": "VariableDeclaration", - "scope": 1138, - "src": "1267:17:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 78, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1267:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 81, - "name": "nextEpoch", - "nodeType": "VariableDeclaration", - "scope": 1138, - "src": "1290:21:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 80, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1290:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 83, - "name": "minTxLimit", - "nodeType": "VariableDeclaration", - "scope": 1138, - "src": "1318:15:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 82, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1318:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 85, - "name": "maxTxLimit", - "nodeType": "VariableDeclaration", - "scope": 1138, - "src": "1339:15:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 84, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1339:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "body": { - "id": 160, - "nodeType": "Block", - "src": "1472:371:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 103, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 100, - "name": "validators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 90, - "src": "1490:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 101, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1490:17:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 102, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1510:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "1490:21:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 99, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 12832, - 12833 - ], - "referencedDeclaration": 12832, - "src": "1482:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 104, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1482:30:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 105, - "nodeType": "ExpressionStatement", - "src": "1482:30:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 110, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 107, - "name": "threshold", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 87, - "src": "1530:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 108, - "name": "validators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 90, - "src": "1542:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 109, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1542:17:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1530:29:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 106, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 12832, - 12833 - ], - "referencedDeclaration": 12832, - "src": "1522:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 111, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1522:38:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 112, - "nodeType": "ExpressionStatement", - "src": "1522:38:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 117, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 113, - "name": "tokenContract", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 163, - "src": "1571:13:0", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$9773", - "typeString": "contract IERC20" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 115, - "name": "_tokenContract", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "1594:14:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 114, - "name": "IERC20", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 9773, - "src": "1587:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_IERC20_$9773_$", - "typeString": "type(contract IERC20)" - } - }, - "id": 116, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1587:22:0", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$9773", - "typeString": "contract IERC20" - } - }, - "src": "1571:38:0", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$9773", - "typeString": "contract IERC20" - } - }, - "id": 118, - "nodeType": "ExpressionStatement", - "src": "1571:38:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 121, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 119, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 79, - "src": "1620:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "30", - "id": 120, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1628:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "1620:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 122, - "nodeType": "ExpressionStatement", - "src": "1620:9:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 126, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 123, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "1639:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 124, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 45, - "src": "1648:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$45_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 125, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "KEYGEN", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1648:13:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "src": "1639:22:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "id": 127, - "nodeType": "ExpressionStatement", - "src": "1639:22:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 130, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 128, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 81, - "src": "1671:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "31", - "id": 129, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1683:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "1671:13:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 131, - "nodeType": "ExpressionStatement", - "src": "1671:13:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 141, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 132, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 59, - "src": "1695:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$40_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 134, - "indexExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 133, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1702:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "1695:9:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$40_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 136, - "name": "validators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 90, - "src": "1713:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - { - "argumentTypes": null, - "id": 137, - "name": "threshold", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 87, - "src": "1725:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "hexValue": "30", - "id": 138, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1736:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - { - "argumentTypes": null, - "hexValue": "30", - "id": 139, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1739:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - } - ], - "id": 135, - "name": "State", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 40, - "src": "1707:5:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_struct$_State_$40_storage_ptr_$", - "typeString": "type(struct Bridge.State storage pointer)" - } - }, - "id": 140, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "structConstructorCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1707:34:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$40_memory", - "typeString": "struct Bridge.State memory" - } - }, - "src": "1695:46:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$40_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 142, - "nodeType": "ExpressionStatement", - "src": "1695:46:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 147, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 143, - "name": "minTxLimit", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 83, - "src": "1752:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 144, - "name": "limits", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 96, - "src": "1765:6:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_memory_ptr", - "typeString": "uint256[2] memory" - } - }, - "id": 146, - "indexExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 145, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1772:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "1765:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1752:22:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 148, - "nodeType": "ExpressionStatement", - "src": "1752:22:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 153, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 149, - "name": "maxTxLimit", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 85, - "src": "1784:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 150, - "name": "limits", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 96, - "src": "1797:6:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_memory_ptr", - "typeString": "uint256[2] memory" - } - }, - "id": 152, - "indexExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 151, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1804:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "1797:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1784:22:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 154, - "nodeType": "ExpressionStatement", - "src": "1784:22:0" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "hexValue": "30", - "id": 156, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1831:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - { - "argumentTypes": null, - "hexValue": "31", - "id": 157, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1834:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - } - ], - "id": 155, - "name": "NewEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12, - "src": "1822:8:0", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$returns$__$", - "typeString": "function (uint256,uint256)" - } - }, - "id": 158, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1822:14:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 159, - "nodeType": "EmitStatement", - "src": "1817:19:0" - } - ] - }, - "documentation": null, - "id": 161, - "implemented": true, - "kind": "constructor", - "modifiers": [], - "name": "", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 97, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 87, - "name": "threshold", - "nodeType": "VariableDeclaration", - "scope": 161, - "src": "1373:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 86, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1373:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 90, - "name": "validators", - "nodeType": "VariableDeclaration", - "scope": 161, - "src": "1389:27:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 88, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1389:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 89, - "length": null, - "nodeType": "ArrayTypeName", - "src": "1389:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 92, - "name": "_tokenContract", - "nodeType": "VariableDeclaration", - "scope": 161, - "src": "1418:22:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 91, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1418:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 96, - "name": "limits", - "nodeType": "VariableDeclaration", - "scope": 161, - "src": "1442:21:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_memory_ptr", - "typeString": "uint256[2]" - }, - "typeName": { - "baseType": { - "id": 93, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1442:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 95, - "length": { - "argumentTypes": null, - "hexValue": "32", - "id": 94, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1447:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "nodeType": "ArrayTypeName", - "src": "1442:7:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_storage_ptr", - "typeString": "uint256[2]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1372:92:0" - }, - "returnParameters": { - "id": 98, - "nodeType": "ParameterList", - "parameters": [], - "src": "1472:0:0" - }, - "scope": 1138, - "src": "1361:482:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "constant": false, - "id": 163, - "name": "tokenContract", - "nodeType": "VariableDeclaration", - "scope": 1138, - "src": "1849:27:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$9773", - "typeString": "contract IERC20" - }, - "typeName": { - "contractScope": null, - "id": 162, - "name": "IERC20", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 9773, - "src": "1849:6:0", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$9773", - "typeString": "contract IERC20" - } - }, - "value": null, - "visibility": "public" - }, - { - "body": { - "id": 174, - "nodeType": "Block", - "src": "1898:81:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - }, - "id": 169, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 166, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "1916:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 167, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 45, - "src": "1926:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$45_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 168, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "READY", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1926:12:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "src": "1916:22:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4e6f7420696e207265616479207374617465", - "id": 170, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1940:20:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_965c39c15b78dbcd8a954511641ca86e15fc1ae6d6c30a67536872ccde75b679", - "typeString": "literal_string \"Not in ready state\"" - }, - "value": "Not in ready state" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_965c39c15b78dbcd8a954511641ca86e15fc1ae6d6c30a67536872ccde75b679", - "typeString": "literal_string \"Not in ready state\"" - } - ], - "id": 165, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 12832, - 12833 - ], - "referencedDeclaration": 12833, - "src": "1908:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 171, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1908:53:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 172, - "nodeType": "ExpressionStatement", - "src": "1908:53:0" - }, - { - "id": 173, - "nodeType": "PlaceholderStatement", - "src": "1971:1:0" - } - ] - }, - "documentation": null, - "id": 175, - "name": "ready", - "nodeType": "ModifierDefinition", - "parameters": { - "id": 164, - "nodeType": "ParameterList", - "parameters": [], - "src": "1898:0:0" - }, - "src": "1883:96:0", - "visibility": "internal" - }, - { - "body": { - "id": 191, - "nodeType": "Block", - "src": "2008:118:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 186, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - }, - "id": 181, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 178, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "2026:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 179, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 45, - "src": "2036:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$45_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 180, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "READY", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2036:12:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "src": "2026:22:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "||", - "rightExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - }, - "id": 185, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 182, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "2052:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 183, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 45, - "src": "2062:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$45_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 184, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "VOTING", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2062:13:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "src": "2052:23:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "2026:49:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4e6f7420696e207265616479206f7220766f74696e67207374617465", - "id": 187, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2077:30:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_7e3f7359baa731593d4e3921720b92600c22ed1d950d208e0c826ad2eddebe96", - "typeString": "literal_string \"Not in ready or voting state\"" - }, - "value": "Not in ready or voting state" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_7e3f7359baa731593d4e3921720b92600c22ed1d950d208e0c826ad2eddebe96", - "typeString": "literal_string \"Not in ready or voting state\"" - } - ], - "id": 177, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 12832, - 12833 - ], - "referencedDeclaration": 12833, - "src": "2018:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 188, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2018:90:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 189, - "nodeType": "ExpressionStatement", - "src": "2018:90:0" - }, - { - "id": 190, - "nodeType": "PlaceholderStatement", - "src": "2118:1:0" - } - ] - }, - "documentation": null, - "id": 192, - "name": "readyOrVoting", - "nodeType": "ModifierDefinition", - "parameters": { - "id": 176, - "nodeType": "ParameterList", - "parameters": [], - "src": "2008:0:0" - }, - "src": "1985:141:0", - "visibility": "internal" - }, - { - "body": { - "id": 203, - "nodeType": "Block", - "src": "2148:83:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - }, - "id": 198, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 195, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "2166:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 196, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 45, - "src": "2176:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$45_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 197, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "VOTING", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2176:13:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "src": "2166:23:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4e6f7420696e20766f74696e67207374617465", - "id": 199, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2191:21:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_0cbee9834b110b21e0730bf5c3d2972fb9867ff221df239e7ae60883592f05d1", - "typeString": "literal_string \"Not in voting state\"" - }, - "value": "Not in voting state" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_0cbee9834b110b21e0730bf5c3d2972fb9867ff221df239e7ae60883592f05d1", - "typeString": "literal_string \"Not in voting state\"" - } - ], - "id": 194, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 12832, - 12833 - ], - "referencedDeclaration": 12833, - "src": "2158:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 200, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2158:55:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 201, - "nodeType": "ExpressionStatement", - "src": "2158:55:0" - }, - { - "id": 202, - "nodeType": "PlaceholderStatement", - "src": "2223:1:0" - } - ] - }, - "documentation": null, - "id": 204, - "name": "voting", - "nodeType": "ModifierDefinition", - "parameters": { - "id": 193, - "nodeType": "ParameterList", - "parameters": [], - "src": "2148:0:0" - }, - "src": "2132:99:0", - "visibility": "internal" - }, - { - "body": { - "id": 215, - "nodeType": "Block", - "src": "2253:83:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - }, - "id": 210, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 207, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "2271:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 208, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 45, - "src": "2281:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$45_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 209, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "KEYGEN", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2281:13:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "src": "2271:23:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4e6f7420696e206b657967656e207374617465", - "id": 211, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2296:21:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_ed0fee6382e0651a224348a21558d03a4a439c3bd5edc24945894a3417c14010", - "typeString": "literal_string \"Not in keygen state\"" - }, - "value": "Not in keygen state" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_ed0fee6382e0651a224348a21558d03a4a439c3bd5edc24945894a3417c14010", - "typeString": "literal_string \"Not in keygen state\"" - } - ], - "id": 206, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 12832, - 12833 - ], - "referencedDeclaration": 12833, - "src": "2263:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 212, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2263:55:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 213, - "nodeType": "ExpressionStatement", - "src": "2263:55:0" - }, - { - "id": 214, - "nodeType": "PlaceholderStatement", - "src": "2328:1:0" - } - ] - }, - "documentation": null, - "id": 216, - "name": "keygen", - "nodeType": "ModifierDefinition", - "parameters": { - "id": 205, - "nodeType": "ParameterList", - "parameters": [], - "src": "2253:0:0" - }, - "src": "2237:99:0", - "visibility": "internal" - }, - { - "body": { - "id": 227, - "nodeType": "Block", - "src": "2365:99:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - }, - "id": 222, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 219, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "2383:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 220, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 45, - "src": "2393:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$45_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 221, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "FUNDS_TRANSFER", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2393:21:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "src": "2383:31:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4e6f7420696e2066756e6473207472616e73666572207374617465", - "id": 223, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2416:29:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_6347c9fecd6f58520ad10dfd1347ce3dc42cc0eed7a4182ca64dd11c69fc3008", - "typeString": "literal_string \"Not in funds transfer state\"" - }, - "value": "Not in funds transfer state" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_6347c9fecd6f58520ad10dfd1347ce3dc42cc0eed7a4182ca64dd11c69fc3008", - "typeString": "literal_string \"Not in funds transfer state\"" - } - ], - "id": 218, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 12832, - 12833 - ], - "referencedDeclaration": 12833, - "src": "2375:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 224, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2375:71:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 225, - "nodeType": "ExpressionStatement", - "src": "2375:71:0" - }, - { - "id": 226, - "nodeType": "PlaceholderStatement", - "src": "2456:1:0" - } - ] - }, - "documentation": null, - "id": 228, - "name": "fundsTransfer", - "nodeType": "ModifierDefinition", - "parameters": { - "id": 217, - "nodeType": "ParameterList", - "parameters": [], - "src": "2365:0:0" - }, - "src": "2342:122:0", - "visibility": "internal" - }, - { - "body": { - "id": 239, - "nodeType": "Block", - "src": "2496:81:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 234, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 231, - "name": "getPartyId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 552, - "src": "2514:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 232, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2514:12:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 233, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2530:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "2514:17:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4e6f7420612063757272656e742076616c696461746f72", - "id": 235, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2533:25:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_8dc18d5bb1361900b9758b388df331056e31071cae84b276c0f03794c4dc634a", - "typeString": "literal_string \"Not a current validator\"" - }, - "value": "Not a current validator" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_8dc18d5bb1361900b9758b388df331056e31071cae84b276c0f03794c4dc634a", - "typeString": "literal_string \"Not a current validator\"" - } - ], - "id": 230, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 12832, - 12833 - ], - "referencedDeclaration": 12833, - "src": "2506:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 236, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2506:53:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 237, - "nodeType": "ExpressionStatement", - "src": "2506:53:0" - }, - { - "id": 238, - "nodeType": "PlaceholderStatement", - "src": "2569:1:0" - } - ] - }, - "documentation": null, - "id": 240, - "name": "currentValidator", - "nodeType": "ModifierDefinition", - "parameters": { - "id": 229, - "nodeType": "ParameterList", - "parameters": [], - "src": "2496:0:0" - }, - "src": "2470:107:0", - "visibility": "internal" - }, - { - "body": { - "id": 278, - "nodeType": "Block", - "src": "2626:197:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 260, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 256, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 250, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 248, - "name": "value", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 242, - "src": "2644:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">=", - "rightExpression": { - "argumentTypes": null, - "id": 249, - "name": "minTxLimit", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 83, - "src": "2653:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2644:19:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "&&", - "rightExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 255, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 251, - "name": "value", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 242, - "src": "2667:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">=", - "rightExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_rational_10000000000_by_1", - "typeString": "int_const 10000000000" - }, - "id": 254, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "hexValue": "3130", - "id": 252, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2676:2:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_10_by_1", - "typeString": "int_const 10" - }, - "value": "10" - }, - "nodeType": "BinaryOperation", - "operator": "**", - "rightExpression": { - "argumentTypes": null, - "hexValue": "3130", - "id": 253, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2682:2:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_10_by_1", - "typeString": "int_const 10" - }, - "value": "10" - }, - "src": "2676:8:0", - "typeDescriptions": { - "typeIdentifier": "t_rational_10000000000_by_1", - "typeString": "int_const 10000000000" - } - }, - "src": "2667:17:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "2644:40:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "&&", - "rightExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 259, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 257, - "name": "value", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 242, - "src": "2688:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<=", - "rightExpression": { - "argumentTypes": null, - "id": 258, - "name": "maxTxLimit", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 85, - "src": "2697:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2688:19:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "2644:63:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 247, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 12832, - 12833 - ], - "referencedDeclaration": 12832, - "src": "2636:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 261, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2636:72:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 262, - "nodeType": "ExpressionStatement", - "src": "2636:72:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 266, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12829, - "src": "2746:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 267, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2746:10:0", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 269, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12845, - "src": "2766:4:0", - "typeDescriptions": { - "typeIdentifier": "t_contract$_Bridge_$1138", - "typeString": "contract Bridge" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_Bridge_$1138", - "typeString": "contract Bridge" - } - ], - "id": 268, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "2758:7:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 270, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2758:13:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 271, - "name": "value", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 242, - "src": "2773:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 263, - "name": "tokenContract", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 163, - "src": "2719:13:0", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$9773", - "typeString": "contract IERC20" - } - }, - "id": 265, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "transferFrom", - "nodeType": "MemberAccess", - "referencedDeclaration": 9756, - "src": "2719:26:0", - "typeDescriptions": { - "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$_t_bool_$", - "typeString": "function (address,address,uint256) external returns (bool)" - } - }, - "id": 272, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2719:60:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 273, - "nodeType": "ExpressionStatement", - "src": "2719:60:0" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 275, - "name": "value", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 242, - "src": "2810:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 274, - "name": "ExchangeRequest", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6, - "src": "2794:15:0", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$returns$__$", - "typeString": "function (uint256)" - } - }, - "id": 276, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2794:22:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 277, - "nodeType": "EmitStatement", - "src": "2789:27:0" - } - ] - }, - "documentation": null, - "id": 279, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 245, - "modifierName": { - "argumentTypes": null, - "id": 244, - "name": "ready", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 175, - "src": "2620:5:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "2620:5:0" - } - ], - "name": "exchange", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 243, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 242, - "name": "value", - "nodeType": "VariableDeclaration", - "scope": 279, - "src": "2601:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 241, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "2601:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2600:12:0" - }, - "returnParameters": { - "id": 246, - "nodeType": "ParameterList", - "parameters": [], - "src": "2626:0:0" - }, - "scope": 1138, - "src": "2583:240:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 308, - "nodeType": "Block", - "src": "2923:119:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 293, - "name": "Vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 55, - "src": "2945:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Vote_$55_$", - "typeString": "type(enum Bridge.Vote)" - } - }, - "id": 294, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "TRANSFER", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2945:13:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 295, - "name": "hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 281, - "src": "2960:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "id": 296, - "name": "to", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 283, - "src": "2966:2:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 297, - "name": "value", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 285, - "src": "2970:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 292, - "name": "tryVote", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 882, - 907, - 932, - 962 - ], - "referencedDeclaration": 962, - "src": "2937:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$55_$_t_bytes32_$_t_address_$_t_uint256_$returns$_t_bool_$", - "typeString": "function (enum Bridge.Vote,bytes32,address,uint256) returns (bool)" - } - }, - "id": 298, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2937:39:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 307, - "nodeType": "IfStatement", - "src": "2933:103:0", - "trueBody": { - "id": 306, - "nodeType": "Block", - "src": "2978:58:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 302, - "name": "to", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 283, - "src": "3015:2:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 303, - "name": "value", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 285, - "src": "3019:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 299, - "name": "tokenContract", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 163, - "src": "2992:13:0", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$9773", - "typeString": "contract IERC20" - } - }, - "id": 301, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "transfer", - "nodeType": "MemberAccess", - "referencedDeclaration": 9727, - "src": "2992:22:0", - "typeDescriptions": { - "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$_t_bool_$", - "typeString": "function (address,uint256) external returns (bool)" - } - }, - "id": 304, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2992:33:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 305, - "nodeType": "ExpressionStatement", - "src": "2992:33:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 309, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 288, - "modifierName": { - "argumentTypes": null, - "id": 287, - "name": "readyOrVoting", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 192, - "src": "2892:13:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "2892:13:0" - }, - { - "arguments": null, - "id": 290, - "modifierName": { - "argumentTypes": null, - "id": 289, - "name": "currentValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 240, - "src": "2906:16:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "2906:16:0" - } - ], - "name": "transfer", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 286, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 281, - "name": "hash", - "nodeType": "VariableDeclaration", - "scope": 309, - "src": "2847:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 280, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "2847:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 283, - "name": "to", - "nodeType": "VariableDeclaration", - "scope": 309, - "src": "2861:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 282, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2861:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 285, - "name": "value", - "nodeType": "VariableDeclaration", - "scope": 309, - "src": "2873:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 284, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "2873:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2846:38:0" - }, - "returnParameters": { - "id": 291, - "nodeType": "ParameterList", - "parameters": [], - "src": "2923:0:0" - }, - "scope": 1138, - "src": "2829:213:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 381, - "nodeType": "Block", - "src": "3101:525:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 324, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 320, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12829, - "src": "3134:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 321, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3134:10:0", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - ], - "id": 319, - "name": "getNextPartyId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 592, - "src": "3119:14:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_uint256_$", - "typeString": "function (address) view returns (uint256)" - } - }, - "id": 322, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3119:26:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 323, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3149:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "3119:31:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4e6f742061206e6578742076616c696461746f72", - "id": 325, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3152:22:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_44981c92ce908443b2fa5f878c54791e1a0c95d4cc04ea4f4d9224b3ec030922", - "typeString": "literal_string \"Not a next validator\"" - }, - "value": "Not a next validator" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_44981c92ce908443b2fa5f878c54791e1a0c95d4cc04ea4f4d9224b3ec030922", - "typeString": "literal_string \"Not a next validator\"" - } - ], - "id": 318, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 12832, - 12833 - ], - "referencedDeclaration": 12833, - "src": "3111:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 326, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3111:64:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 327, - "nodeType": "ExpressionStatement", - "src": "3111:64:0" - }, - { - "condition": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 329, - "name": "Vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 55, - "src": "3201:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Vote_$55_$", - "typeString": "type(enum Bridge.Vote)" - } - }, - "id": 330, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "CONFIRM_KEYGEN", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3201:19:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 331, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 311, - "src": "3222:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 332, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 313, - "src": "3225:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 328, - "name": "tryConfirm", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 984, - 1012 - ], - "referencedDeclaration": 1012, - "src": "3190:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$55_$_t_uint256_$_t_uint256_$returns$_t_bool_$", - "typeString": "function (enum Bridge.Vote,uint256,uint256) returns (bool)" - } - }, - "id": 333, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3190:37:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 380, - "nodeType": "IfStatement", - "src": "3186:434:0", - "trueBody": { - "id": 379, - "nodeType": "Block", - "src": "3229:391:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 339, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 334, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 59, - "src": "3243:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$40_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 336, - "indexExpression": { - "argumentTypes": null, - "id": 335, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 81, - "src": "3250:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3243:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$40_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 337, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "x", - "nodeType": "MemberAccess", - "referencedDeclaration": 37, - "src": "3243:19:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 338, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 311, - "src": "3265:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3243:23:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 340, - "nodeType": "ExpressionStatement", - "src": "3243:23:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 346, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 341, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 59, - "src": "3280:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$40_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 343, - "indexExpression": { - "argumentTypes": null, - "id": 342, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 81, - "src": "3287:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3280:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$40_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 344, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "y", - "nodeType": "MemberAccess", - "referencedDeclaration": 39, - "src": "3280:19:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 345, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 313, - "src": "3302:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3280:23:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 347, - "nodeType": "ExpressionStatement", - "src": "3280:23:0" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 350, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 348, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 81, - "src": "3321:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 349, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3334:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "3321:14:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "id": 377, - "nodeType": "Block", - "src": "3490:120:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 370, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 367, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "3508:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 368, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 45, - "src": "3517:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$45_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 369, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "FUNDS_TRANSFER", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3517:21:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "src": "3508:30:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "id": 371, - "nodeType": "ExpressionStatement", - "src": "3508:30:0" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 373, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 79, - "src": "3578:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 374, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 81, - "src": "3585:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 372, - "name": "NewFundsTransfer", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 22, - "src": "3561:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$returns$__$", - "typeString": "function (uint256,uint256)" - } - }, - "id": 375, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3561:34:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 376, - "nodeType": "EmitStatement", - "src": "3556:39:0" - } - ] - }, - "id": 378, - "nodeType": "IfStatement", - "src": "3317:293:0", - "trueBody": { - "id": 366, - "nodeType": "Block", - "src": "3337:135:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 354, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 351, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "3355:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 352, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 45, - "src": "3364:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$45_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 353, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "READY", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3364:12:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "src": "3355:21:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "id": 355, - "nodeType": "ExpressionStatement", - "src": "3355:21:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 358, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 356, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 79, - "src": "3394:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 357, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 81, - "src": "3402:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3394:17:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 359, - "nodeType": "ExpressionStatement", - "src": "3394:17:0" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 361, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 79, - "src": "3445:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 362, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 311, - "src": "3452:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 363, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 313, - "src": "3455:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 360, - "name": "EpochStart", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 30, - "src": "3434:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$_t_uint256_$returns$__$", - "typeString": "function (uint256,uint256,uint256)" - } - }, - "id": 364, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3434:23:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 365, - "nodeType": "EmitStatement", - "src": "3429:28:0" - } - ] - } - } - ] - } - } - ] - }, - "documentation": null, - "id": 382, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 316, - "modifierName": { - "argumentTypes": null, - "id": 315, - "name": "keygen", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 216, - "src": "3094:6:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "3094:6:0" - } - ], - "name": "confirmKeygen", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 314, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 311, - "name": "x", - "nodeType": "VariableDeclaration", - "scope": 382, - "src": "3071:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 310, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "3071:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 313, - "name": "y", - "nodeType": "VariableDeclaration", - "scope": 382, - "src": "3079:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 312, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "3079:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "3070:16:0" - }, - "returnParameters": { - "id": 317, - "nodeType": "ParameterList", - "parameters": [], - "src": "3101:0:0" - }, - "scope": 1138, - "src": "3048:578:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 423, - "nodeType": "Block", - "src": "3702:281:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 392, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 390, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 79, - "src": "3720:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 391, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3728:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "3720:9:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "46697273742065706f636820646f6573206e6f74206e6565642066756e6473207472616e73666572", - "id": 393, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3731:42:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_8ddae2cc9da30ed8c59c39c6a950ef823ea484ac89ff6f37abb0317fb5f679a1", - "typeString": "literal_string \"First epoch does not need funds transfer\"" - }, - "value": "First epoch does not need funds transfer" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_8ddae2cc9da30ed8c59c39c6a950ef823ea484ac89ff6f37abb0317fb5f679a1", - "typeString": "literal_string \"First epoch does not need funds transfer\"" - } - ], - "id": 389, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 12832, - 12833 - ], - "referencedDeclaration": 12833, - "src": "3712:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 394, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3712:62:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 395, - "nodeType": "ExpressionStatement", - "src": "3712:62:0" - }, - { - "condition": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 397, - "name": "Vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 55, - "src": "3800:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Vote_$55_$", - "typeString": "type(enum Bridge.Vote)" - } - }, - "id": 398, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "CONFIRM_FUNDS_TRANSFER", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3800:27:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - } - ], - "id": 396, - "name": "tryConfirm", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 984, - 1012 - ], - "referencedDeclaration": 984, - "src": "3789:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$55_$returns$_t_bool_$", - "typeString": "function (enum Bridge.Vote) returns (bool)" - } - }, - "id": 399, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3789:39:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 422, - "nodeType": "IfStatement", - "src": "3785:192:0", - "trueBody": { - "id": 421, - "nodeType": "Block", - "src": "3830:147:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 403, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 400, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "3844:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 401, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 45, - "src": "3853:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$45_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 402, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "READY", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3853:12:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "src": "3844:21:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "id": 404, - "nodeType": "ExpressionStatement", - "src": "3844:21:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 407, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 405, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 79, - "src": "3879:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 406, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 81, - "src": "3887:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3879:17:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 408, - "nodeType": "ExpressionStatement", - "src": "3879:17:0" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 410, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 79, - "src": "3926:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 411, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 59, - "src": "3933:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$40_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 413, - "indexExpression": { - "argumentTypes": null, - "id": 412, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 79, - "src": "3940:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3933:13:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$40_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 414, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "x", - "nodeType": "MemberAccess", - "referencedDeclaration": 37, - "src": "3933:15:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 415, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 59, - "src": "3950:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$40_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 417, - "indexExpression": { - "argumentTypes": null, - "id": 416, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 79, - "src": "3957:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3950:13:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$40_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 418, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "y", - "nodeType": "MemberAccess", - "referencedDeclaration": 39, - "src": "3950:15:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 409, - "name": "EpochStart", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 30, - "src": "3915:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$_t_uint256_$returns$__$", - "typeString": "function (uint256,uint256,uint256)" - } - }, - "id": 419, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3915:51:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 420, - "nodeType": "EmitStatement", - "src": "3910:56:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 424, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 385, - "modifierName": { - "argumentTypes": null, - "id": 384, - "name": "fundsTransfer", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 228, - "src": "3671:13:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "3671:13:0" - }, - { - "arguments": null, - "id": 387, - "modifierName": { - "argumentTypes": null, - "id": 386, - "name": "currentValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 240, - "src": "3685:16:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "3685:16:0" - } - ], - "name": "confirmFundsTransfer", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 383, - "nodeType": "ParameterList", - "parameters": [], - "src": "3661:2:0" - }, - "returnParameters": { - "id": 388, - "nodeType": "ParameterList", - "parameters": [], - "src": "3702:0:0" - }, - "scope": 1138, - "src": "3632:351:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 433, - "nodeType": "Block", - "src": "4038:41:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 430, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 79, - "src": "4066:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 429, - "name": "getParties", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 434, - 458 - ], - "referencedDeclaration": 458, - "src": "4055:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256) view returns (uint256)" - } - }, - "id": 431, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4055:17:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 428, - "id": 432, - "nodeType": "Return", - "src": "4048:24:0" - } - ] - }, - "documentation": null, - "id": 434, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getParties", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 425, - "nodeType": "ParameterList", - "parameters": [], - "src": "4008:2:0" - }, - "returnParameters": { - "id": 428, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 427, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 434, - "src": "4032:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 426, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "4032:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4031:6:0" - }, - "scope": 1138, - "src": "3989:90:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 443, - "nodeType": "Block", - "src": "4138:45:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 440, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 81, - "src": "4166:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 439, - "name": "getParties", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 434, - 458 - ], - "referencedDeclaration": 458, - "src": "4155:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256) view returns (uint256)" - } - }, - "id": 441, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4155:21:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 438, - "id": 442, - "nodeType": "Return", - "src": "4148:28:0" - } - ] - }, - "documentation": null, - "id": 444, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getNextParties", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 435, - "nodeType": "ParameterList", - "parameters": [], - "src": "4108:2:0" - }, - "returnParameters": { - "id": 438, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 437, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 444, - "src": "4132:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 436, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "4132:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4131:6:0" - }, - "scope": 1138, - "src": "4085:98:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 457, - "nodeType": "Block", - "src": "4249:56:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 451, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 59, - "src": "4266:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$40_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 453, - "indexExpression": { - "argumentTypes": null, - "id": 452, - "name": "_epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 446, - "src": "4273:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4266:14:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$40_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 454, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "validators", - "nodeType": "MemberAccess", - "referencedDeclaration": 33, - "src": "4266:25:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 455, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4266:32:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 450, - "id": 456, - "nodeType": "Return", - "src": "4259:39:0" - } - ] - }, - "documentation": null, - "id": 458, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getParties", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 447, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 446, - "name": "_epoch", - "nodeType": "VariableDeclaration", - "scope": 458, - "src": "4209:11:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 445, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "4209:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4208:13:0" - }, - "returnParameters": { - "id": 450, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 449, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 458, - "src": "4243:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 448, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "4243:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4242:6:0" - }, - "scope": 1138, - "src": "4189:116:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 467, - "nodeType": "Block", - "src": "4362:43:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 464, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 79, - "src": "4392:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 463, - "name": "getThreshold", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 468, - 491 - ], - "referencedDeclaration": 491, - "src": "4379:12:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256) view returns (uint256)" - } - }, - "id": 465, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4379:19:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 462, - "id": 466, - "nodeType": "Return", - "src": "4372:26:0" - } - ] - }, - "documentation": null, - "id": 468, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getThreshold", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 459, - "nodeType": "ParameterList", - "parameters": [], - "src": "4332:2:0" - }, - "returnParameters": { - "id": 462, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 461, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 468, - "src": "4356:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 460, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "4356:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4355:6:0" - }, - "scope": 1138, - "src": "4311:94:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 477, - "nodeType": "Block", - "src": "4466:47:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 474, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 81, - "src": "4496:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 473, - "name": "getThreshold", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 468, - 491 - ], - "referencedDeclaration": 491, - "src": "4483:12:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256) view returns (uint256)" - } - }, - "id": 475, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4483:23:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 472, - "id": 476, - "nodeType": "Return", - "src": "4476:30:0" - } - ] - }, - "documentation": null, - "id": 478, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getNextThreshold", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 469, - "nodeType": "ParameterList", - "parameters": [], - "src": "4436:2:0" - }, - "returnParameters": { - "id": 472, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 471, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 478, - "src": "4460:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 470, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "4460:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4459:6:0" - }, - "scope": 1138, - "src": "4411:102:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 490, - "nodeType": "Block", - "src": "4581:48:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 485, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 59, - "src": "4598:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$40_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 487, - "indexExpression": { - "argumentTypes": null, - "id": 486, - "name": "_epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 480, - "src": "4605:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4598:14:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$40_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 488, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "threshold", - "nodeType": "MemberAccess", - "referencedDeclaration": 35, - "src": "4598:24:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 484, - "id": 489, - "nodeType": "Return", - "src": "4591:31:0" - } - ] - }, - "documentation": null, - "id": 491, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getThreshold", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 481, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 480, - "name": "_epoch", - "nodeType": "VariableDeclaration", - "scope": 491, - "src": "4541:11:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 479, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "4541:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4540:13:0" - }, - "returnParameters": { - "id": 484, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 483, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 491, - "src": "4575:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 482, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "4575:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4574:6:0" - }, - "scope": 1138, - "src": "4519:110:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 501, - "nodeType": "Block", - "src": "4678:39:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 496, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 59, - "src": "4695:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$40_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 498, - "indexExpression": { - "argumentTypes": null, - "id": 497, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 79, - "src": "4702:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4695:13:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$40_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 499, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "x", - "nodeType": "MemberAccess", - "referencedDeclaration": 37, - "src": "4695:15:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 495, - "id": 500, - "nodeType": "Return", - "src": "4688:22:0" - } - ] - }, - "documentation": null, - "id": 502, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getX", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 492, - "nodeType": "ParameterList", - "parameters": [], - "src": "4648:2:0" - }, - "returnParameters": { - "id": 495, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 494, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 502, - "src": "4672:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 493, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "4672:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4671:6:0" - }, - "scope": 1138, - "src": "4635:82:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 512, - "nodeType": "Block", - "src": "4766:39:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 507, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 59, - "src": "4783:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$40_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 509, - "indexExpression": { - "argumentTypes": null, - "id": 508, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 79, - "src": "4790:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4783:13:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$40_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 510, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "y", - "nodeType": "MemberAccess", - "referencedDeclaration": 39, - "src": "4783:15:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 506, - "id": 511, - "nodeType": "Return", - "src": "4776:22:0" - } - ] - }, - "documentation": null, - "id": 513, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getY", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 503, - "nodeType": "ParameterList", - "parameters": [], - "src": "4736:2:0" - }, - "returnParameters": { - "id": 506, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 505, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 513, - "src": "4760:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 504, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "4760:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4759:6:0" - }, - "scope": 1138, - "src": "4723:82:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 551, - "nodeType": "Block", - "src": "4860:215:0", - "statements": [ - { - "assignments": [ - 521 - ], - "declarations": [ - { - "constant": false, - "id": 521, - "name": "validators", - "nodeType": "VariableDeclaration", - "scope": 551, - "src": "4870:27:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 519, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "4870:7:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 520, - "length": null, - "nodeType": "ArrayTypeName", - "src": "4870:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 524, - "initialValue": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 522, - "name": "getValidators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 604, - "src": "4900:13:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_array$_t_address_$dyn_memory_ptr_$", - "typeString": "function () view returns (address[] memory)" - } - }, - "id": 523, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4900:15:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "4870:45:0" - }, - { - "body": { - "id": 547, - "nodeType": "Block", - "src": "4965:86:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 541, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 536, - "name": "validators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 521, - "src": "4983:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 538, - "indexExpression": { - "argumentTypes": null, - "id": 537, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 526, - "src": "4994:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4983:13:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 539, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12829, - "src": "5000:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 540, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "5000:10:0", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "src": "4983:27:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 546, - "nodeType": "IfStatement", - "src": "4979:61:0", - "trueBody": { - "expression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 544, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 542, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 526, - "src": "5035:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 543, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "5039:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "5035:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 517, - "id": 545, - "nodeType": "Return", - "src": "5028:12:0" - } - } - ] - }, - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 532, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 529, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 526, - "src": "4942:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 530, - "name": "getParties", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 434, - 458 - ], - "referencedDeclaration": 434, - "src": "4946:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 531, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4946:12:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4942:16:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 548, - "initializationExpression": { - "assignments": [ - 526 - ], - "declarations": [ - { - "constant": false, - "id": 526, - "name": "i", - "nodeType": "VariableDeclaration", - "scope": 548, - "src": "4930:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 525, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "4930:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 528, - "initialValue": { - "argumentTypes": null, - "hexValue": "30", - "id": 527, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4939:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "4930:10:0" - }, - "loopExpression": { - "expression": { - "argumentTypes": null, - "id": 534, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "4960:3:0", - "subExpression": { - "argumentTypes": null, - "id": 533, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 526, - "src": "4960:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 535, - "nodeType": "ExpressionStatement", - "src": "4960:3:0" - }, - "nodeType": "ForStatement", - "src": "4925:126:0" - }, - { - "expression": { - "argumentTypes": null, - "hexValue": "30", - "id": 549, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "5067:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "functionReturnParameters": 517, - "id": 550, - "nodeType": "Return", - "src": "5060:8:0" - } - ] - }, - "documentation": null, - "id": 552, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getPartyId", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 514, - "nodeType": "ParameterList", - "parameters": [], - "src": "4830:2:0" - }, - "returnParameters": { - "id": 517, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 516, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 552, - "src": "4854:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 515, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "4854:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4853:6:0" - }, - "scope": 1138, - "src": "4811:264:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 591, - "nodeType": "Block", - "src": "5143:214:0", - "statements": [ - { - "assignments": [ - 562 - ], - "declarations": [ - { - "constant": false, - "id": 562, - "name": "validators", - "nodeType": "VariableDeclaration", - "scope": 591, - "src": "5153:27:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 560, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "5153:7:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 561, - "length": null, - "nodeType": "ArrayTypeName", - "src": "5153:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 565, - "initialValue": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 563, - "name": "getNextValidators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 616, - "src": "5183:17:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_array$_t_address_$dyn_memory_ptr_$", - "typeString": "function () view returns (address[] memory)" - } - }, - "id": 564, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5183:19:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "5153:49:0" - }, - { - "body": { - "id": 587, - "nodeType": "Block", - "src": "5256:77:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 581, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 577, - "name": "validators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 562, - "src": "5274:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 579, - "indexExpression": { - "argumentTypes": null, - "id": 578, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 567, - "src": "5285:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "5274:13:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "id": 580, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 554, - "src": "5291:1:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "5274:18:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 586, - "nodeType": "IfStatement", - "src": "5270:52:0", - "trueBody": { - "expression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 584, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 582, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 567, - "src": "5317:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 583, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "5321:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "5317:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 558, - "id": 585, - "nodeType": "Return", - "src": "5310:12:0" - } - } - ] - }, - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 573, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 570, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 567, - "src": "5229:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 571, - "name": "getNextParties", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 444, - "src": "5233:14:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 572, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5233:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "5229:20:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 588, - "initializationExpression": { - "assignments": [ - 567 - ], - "declarations": [ - { - "constant": false, - "id": 567, - "name": "i", - "nodeType": "VariableDeclaration", - "scope": 588, - "src": "5217:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 566, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5217:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 569, - "initialValue": { - "argumentTypes": null, - "hexValue": "30", - "id": 568, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "5226:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "5217:10:0" - }, - "loopExpression": { - "expression": { - "argumentTypes": null, - "id": 575, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "5251:3:0", - "subExpression": { - "argumentTypes": null, - "id": 574, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 567, - "src": "5251:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 576, - "nodeType": "ExpressionStatement", - "src": "5251:3:0" - }, - "nodeType": "ForStatement", - "src": "5212:121:0" - }, - { - "expression": { - "argumentTypes": null, - "hexValue": "30", - "id": 589, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "5349:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "functionReturnParameters": 558, - "id": 590, - "nodeType": "Return", - "src": "5342:8:0" - } - ] - }, - "documentation": null, - "id": 592, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getNextPartyId", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 555, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 554, - "name": "a", - "nodeType": "VariableDeclaration", - "scope": 592, - "src": "5105:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 553, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "5105:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5104:11:0" - }, - "returnParameters": { - "id": 558, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 557, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 592, - "src": "5137:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 556, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5137:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5136:6:0" - }, - "scope": 1138, - "src": "5081:276:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 603, - "nodeType": "Block", - "src": "5427:48:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 598, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 59, - "src": "5444:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$40_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 600, - "indexExpression": { - "argumentTypes": null, - "id": 599, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 79, - "src": "5451:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "5444:13:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$40_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 601, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "validators", - "nodeType": "MemberAccess", - "referencedDeclaration": 33, - "src": "5444:24:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "functionReturnParameters": 597, - "id": 602, - "nodeType": "Return", - "src": "5437:31:0" - } - ] - }, - "documentation": null, - "id": 604, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getValidators", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 593, - "nodeType": "ParameterList", - "parameters": [], - "src": "5385:2:0" - }, - "returnParameters": { - "id": 597, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 596, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 604, - "src": "5409:16:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 594, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "5409:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 595, - "length": null, - "nodeType": "ArrayTypeName", - "src": "5409:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5408:18:0" - }, - "scope": 1138, - "src": "5363:112:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 615, - "nodeType": "Block", - "src": "5549:52:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 610, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 59, - "src": "5566:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$40_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 612, - "indexExpression": { - "argumentTypes": null, - "id": 611, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 81, - "src": "5573:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "5566:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$40_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 613, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "validators", - "nodeType": "MemberAccess", - "referencedDeclaration": 33, - "src": "5566:28:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "functionReturnParameters": 609, - "id": 614, - "nodeType": "Return", - "src": "5559:35:0" - } - ] - }, - "documentation": null, - "id": 616, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getNextValidators", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 605, - "nodeType": "ParameterList", - "parameters": [], - "src": "5507:2:0" - }, - "returnParameters": { - "id": 609, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 608, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 616, - "src": "5531:16:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 606, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "5531:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 607, - "length": null, - "nodeType": "ArrayTypeName", - "src": "5531:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5530:18:0" - }, - "scope": 1138, - "src": "5481:120:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 657, - "nodeType": "Block", - "src": "5668:256:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 624, - "name": "Vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 55, - "src": "5690:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Vote_$55_$", - "typeString": "type(enum Bridge.Vote)" - } - }, - "id": 625, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "START_VOTING", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "5690:17:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - } - ], - "id": 623, - "name": "tryVote", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 882, - 907, - 932, - 962 - ], - "referencedDeclaration": 882, - "src": "5682:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$55_$returns$_t_bool_$", - "typeString": "function (enum Bridge.Vote) returns (bool)" - } - }, - "id": 626, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5682:26:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 656, - "nodeType": "IfStatement", - "src": "5678:240:0", - "trueBody": { - "id": 655, - "nodeType": "Block", - "src": "5710:208:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 628, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "5724:11:0", - "subExpression": { - "argumentTypes": null, - "id": 627, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 81, - "src": "5724:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 629, - "nodeType": "ExpressionStatement", - "src": "5724:11:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 633, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 630, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "5749:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 631, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 45, - "src": "5758:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$45_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 632, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "VOTING", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "5758:13:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "src": "5749:22:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "id": 634, - "nodeType": "ExpressionStatement", - "src": "5749:22:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 643, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 635, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 59, - "src": "5785:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$40_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 637, - "indexExpression": { - "argumentTypes": null, - "id": 636, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 81, - "src": "5792:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "5785:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$40_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 638, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "threshold", - "nodeType": "MemberAccess", - "referencedDeclaration": 35, - "src": "5785:27:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 639, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 59, - "src": "5815:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$40_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 641, - "indexExpression": { - "argumentTypes": null, - "id": 640, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 79, - "src": "5822:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "5815:13:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$40_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 642, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "threshold", - "nodeType": "MemberAccess", - "referencedDeclaration": 35, - "src": "5815:23:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "5785:53:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 644, - "nodeType": "ExpressionStatement", - "src": "5785:53:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 653, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 645, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 59, - "src": "5852:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$40_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 647, - "indexExpression": { - "argumentTypes": null, - "id": 646, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 81, - "src": "5859:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "5852:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$40_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 648, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "validators", - "nodeType": "MemberAccess", - "referencedDeclaration": 33, - "src": "5852:28:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 649, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 59, - "src": "5883:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$40_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 651, - "indexExpression": { - "argumentTypes": null, - "id": 650, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 79, - "src": "5890:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "5883:13:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$40_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 652, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "validators", - "nodeType": "MemberAccess", - "referencedDeclaration": 33, - "src": "5883:24:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "src": "5852:55:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 654, - "nodeType": "ExpressionStatement", - "src": "5852:55:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 658, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 619, - "modifierName": { - "argumentTypes": null, - "id": 618, - "name": "readyOrVoting", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 192, - "src": "5637:13:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "5637:13:0" - }, - { - "arguments": null, - "id": 621, - "modifierName": { - "argumentTypes": null, - "id": 620, - "name": "currentValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 240, - "src": "5651:16:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "5651:16:0" - } - ], - "name": "startVoting", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 617, - "nodeType": "ParameterList", - "parameters": [], - "src": "5627:2:0" - }, - "returnParameters": { - "id": 622, - "nodeType": "ParameterList", - "parameters": [], - "src": "5668:0:0" - }, - "scope": 1138, - "src": "5607:317:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 691, - "nodeType": "Block", - "src": "6006:202:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 672, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 669, - "name": "validator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 660, - "src": "6039:9:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 668, - "name": "getNextPartyId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 592, - "src": "6024:14:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_uint256_$", - "typeString": "function (address) view returns (uint256)" - } - }, - "id": 670, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6024:25:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 671, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6053:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "6024:30:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "416c726561647920612076616c696461746f72", - "id": 673, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6056:21:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_aeb0fe100da2796aa6136a3b1c66282f002b435141be331237dfa7127e6df6ff", - "typeString": "literal_string \"Already a validator\"" - }, - "value": "Already a validator" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_aeb0fe100da2796aa6136a3b1c66282f002b435141be331237dfa7127e6df6ff", - "typeString": "literal_string \"Already a validator\"" - } - ], - "id": 667, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 12832, - 12833 - ], - "referencedDeclaration": 12833, - "src": "6016:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 674, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6016:62:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 675, - "nodeType": "ExpressionStatement", - "src": "6016:62:0" - }, - { - "condition": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 677, - "name": "Vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 55, - "src": "6101:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Vote_$55_$", - "typeString": "type(enum Bridge.Vote)" - } - }, - "id": 678, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "ADD_VALIDATOR", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "6101:18:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 679, - "name": "validator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 660, - "src": "6121:9:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 676, - "name": "tryVote", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 882, - 907, - 932, - 962 - ], - "referencedDeclaration": 907, - "src": "6093:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$55_$_t_address_$returns$_t_bool_$", - "typeString": "function (enum Bridge.Vote,address) returns (bool)" - } - }, - "id": 680, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6093:38:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 690, - "nodeType": "IfStatement", - "src": "6089:113:0", - "trueBody": { - "id": 689, - "nodeType": "Block", - "src": "6133:69:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 686, - "name": "validator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 660, - "src": "6181:9:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 681, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 59, - "src": "6147:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$40_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 683, - "indexExpression": { - "argumentTypes": null, - "id": 682, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 81, - "src": "6154:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6147:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$40_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 684, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "validators", - "nodeType": "MemberAccess", - "referencedDeclaration": 33, - "src": "6147:28:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 685, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "push", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "6147:33:0", - "typeDescriptions": { - "typeIdentifier": "t_function_arraypush_nonpayable$_t_address_$returns$_t_uint256_$", - "typeString": "function (address) returns (uint256)" - } - }, - "id": 687, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6147:44:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 688, - "nodeType": "ExpressionStatement", - "src": "6147:44:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 692, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 663, - "modifierName": { - "argumentTypes": null, - "id": 662, - "name": "voting", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 204, - "src": "5982:6:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "5982:6:0" - }, - { - "arguments": null, - "id": 665, - "modifierName": { - "argumentTypes": null, - "id": 664, - "name": "currentValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 240, - "src": "5989:16:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "5989:16:0" - } - ], - "name": "voteAddValidator", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 661, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 660, - "name": "validator", - "nodeType": "VariableDeclaration", - "scope": 692, - "src": "5956:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 659, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "5956:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5955:19:0" - }, - "returnParameters": { - "id": 666, - "nodeType": "ParameterList", - "parameters": [], - "src": "6006:0:0" - }, - "scope": 1138, - "src": "5930:278:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 721, - "nodeType": "Block", - "src": "6293:192:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 706, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 703, - "name": "validator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 694, - "src": "6326:9:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 702, - "name": "getNextPartyId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 592, - "src": "6311:14:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_uint256_$", - "typeString": "function (address) view returns (uint256)" - } - }, - "id": 704, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6311:25:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 705, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6340:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "6311:30:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "416c7265616479206e6f7420612076616c696461746f72", - "id": 707, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6343:25:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_2332ed568e8af3d64f1f2b0b098c504cab97ba4128fb9f08cfa3f851ced05961", - "typeString": "literal_string \"Already not a validator\"" - }, - "value": "Already not a validator" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_2332ed568e8af3d64f1f2b0b098c504cab97ba4128fb9f08cfa3f851ced05961", - "typeString": "literal_string \"Already not a validator\"" - } - ], - "id": 701, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 12832, - 12833 - ], - "referencedDeclaration": 12833, - "src": "6303:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 708, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6303:66:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 709, - "nodeType": "ExpressionStatement", - "src": "6303:66:0" - }, - { - "condition": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 711, - "name": "Vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 55, - "src": "6392:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Vote_$55_$", - "typeString": "type(enum Bridge.Vote)" - } - }, - "id": 712, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "REMOVE_VALIDATOR", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "6392:21:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 713, - "name": "validator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 694, - "src": "6415:9:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 710, - "name": "tryVote", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 882, - 907, - 932, - 962 - ], - "referencedDeclaration": 907, - "src": "6384:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$55_$_t_address_$returns$_t_bool_$", - "typeString": "function (enum Bridge.Vote,address) returns (bool)" - } - }, - "id": 714, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6384:41:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 720, - "nodeType": "IfStatement", - "src": "6380:99:0", - "trueBody": { - "id": 719, - "nodeType": "Block", - "src": "6427:52:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 716, - "name": "validator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 694, - "src": "6458:9:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 715, - "name": "_removeValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 789, - "src": "6441:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$", - "typeString": "function (address)" - } - }, - "id": 717, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6441:27:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 718, - "nodeType": "ExpressionStatement", - "src": "6441:27:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 722, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 697, - "modifierName": { - "argumentTypes": null, - "id": 696, - "name": "voting", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 204, - "src": "6269:6:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "6269:6:0" - }, - { - "arguments": null, - "id": 699, - "modifierName": { - "argumentTypes": null, - "id": 698, - "name": "currentValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 240, - "src": "6276:16:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "6276:16:0" - } - ], - "name": "voteRemoveValidator", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 695, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 694, - "name": "validator", - "nodeType": "VariableDeclaration", - "scope": 722, - "src": "6243:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 693, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "6243:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "6242:19:0" - }, - "returnParameters": { - "id": 700, - "nodeType": "ParameterList", - "parameters": [], - "src": "6293:0:0" - }, - "scope": 1138, - "src": "6214:271:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 788, - "nodeType": "Block", - "src": "6544:392:0", - "statements": [ - { - "body": { - "id": 768, - "nodeType": "Block", - "src": "6602:214:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 747, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 740, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 59, - "src": "6620:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$40_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 742, - "indexExpression": { - "argumentTypes": null, - "id": 741, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 81, - "src": "6627:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6620:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$40_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 743, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "validators", - "nodeType": "MemberAccess", - "referencedDeclaration": 33, - "src": "6620:28:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 745, - "indexExpression": { - "argumentTypes": null, - "id": 744, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 728, - "src": "6649:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6620:31:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "id": 746, - "name": "validator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 724, - "src": "6655:9:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "6620:44:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 767, - "nodeType": "IfStatement", - "src": "6616:190:0", - "trueBody": { - "id": 766, - "nodeType": "Block", - "src": "6666:140:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 763, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 748, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 59, - "src": "6684:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$40_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 750, - "indexExpression": { - "argumentTypes": null, - "id": 749, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 81, - "src": "6691:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6684:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$40_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 751, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "validators", - "nodeType": "MemberAccess", - "referencedDeclaration": 33, - "src": "6684:28:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 753, - "indexExpression": { - "argumentTypes": null, - "id": 752, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 728, - "src": "6713:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "6684:31:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 754, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 59, - "src": "6718:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$40_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 756, - "indexExpression": { - "argumentTypes": null, - "id": 755, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 81, - "src": "6725:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6718:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$40_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 757, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "validators", - "nodeType": "MemberAccess", - "referencedDeclaration": 33, - "src": "6718:28:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 762, - "indexExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 761, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 758, - "name": "getNextParties", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 444, - "src": "6747:14:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 759, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6747:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 760, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6766:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "6747:20:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6718:50:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "6684:84:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 764, - "nodeType": "ExpressionStatement", - "src": "6684:84:0" - }, - { - "id": 765, - "nodeType": "Break", - "src": "6786:5:0" - } - ] - } - } - ] - }, - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 736, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 731, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 728, - "src": "6571:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 735, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 732, - "name": "getNextParties", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 444, - "src": "6575:14:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 733, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6575:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 734, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6594:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "6575:20:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "6571:24:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 769, - "initializationExpression": { - "assignments": [ - 728 - ], - "declarations": [ - { - "constant": false, - "id": 728, - "name": "i", - "nodeType": "VariableDeclaration", - "scope": 769, - "src": "6559:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 727, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "6559:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 730, - "initialValue": { - "argumentTypes": null, - "hexValue": "30", - "id": 729, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6568:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "6559:10:0" - }, - "loopExpression": { - "expression": { - "argumentTypes": null, - "id": 738, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "6597:3:0", - "subExpression": { - "argumentTypes": null, - "id": 737, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 728, - "src": "6597:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 739, - "nodeType": "ExpressionStatement", - "src": "6597:3:0" - }, - "nodeType": "ForStatement", - "src": "6554:262:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 779, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "delete", - "prefix": true, - "src": "6825:57:0", - "subExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 770, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 59, - "src": "6832:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$40_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 772, - "indexExpression": { - "argumentTypes": null, - "id": 771, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 81, - "src": "6839:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6832:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$40_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 773, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "validators", - "nodeType": "MemberAccess", - "referencedDeclaration": 33, - "src": "6832:28:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 778, - "indexExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 777, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 774, - "name": "getNextParties", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 444, - "src": "6861:14:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 775, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6861:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 776, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6880:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "6861:20:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "6832:50:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 780, - "nodeType": "ExpressionStatement", - "src": "6825:57:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 786, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "--", - "prefix": false, - "src": "6892:37:0", - "subExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 781, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 59, - "src": "6892:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$40_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 783, - "indexExpression": { - "argumentTypes": null, - "id": 782, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 81, - "src": "6899:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6892:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$40_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 784, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "validators", - "nodeType": "MemberAccess", - "referencedDeclaration": 33, - "src": "6892:28:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 785, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "6892:35:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 787, - "nodeType": "ExpressionStatement", - "src": "6892:37:0" - } - ] - }, - "documentation": null, - "id": 789, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "_removeValidator", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 725, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 724, - "name": "validator", - "nodeType": "VariableDeclaration", - "scope": 789, - "src": "6517:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 723, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "6517:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "6516:19:0" - }, - "returnParameters": { - "id": 726, - "nodeType": "ParameterList", - "parameters": [], - "src": "6544:0:0" - }, - "scope": 1138, - "src": "6491:445:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "private" - }, - { - "body": { - "id": 812, - "nodeType": "Block", - "src": "7018:127:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 799, - "name": "Vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 55, - "src": "7040:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Vote_$55_$", - "typeString": "type(enum Bridge.Vote)" - } - }, - "id": 800, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "CHANGE_THRESHOLD", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "7040:21:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 801, - "name": "threshold", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 791, - "src": "7063:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 798, - "name": "tryVote", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 882, - 907, - 932, - 962 - ], - "referencedDeclaration": 932, - "src": "7032:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$55_$_t_uint256_$returns$_t_bool_$", - "typeString": "function (enum Bridge.Vote,uint256) returns (bool)" - } - }, - "id": 802, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7032:41:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 811, - "nodeType": "IfStatement", - "src": "7028:111:0", - "trueBody": { - "id": 810, - "nodeType": "Block", - "src": "7075:64:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 808, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 803, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 59, - "src": "7089:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$40_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 805, - "indexExpression": { - "argumentTypes": null, - "id": 804, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 81, - "src": "7096:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "7089:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$40_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 806, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "threshold", - "nodeType": "MemberAccess", - "referencedDeclaration": 35, - "src": "7089:27:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 807, - "name": "threshold", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 791, - "src": "7119:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "7089:39:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 809, - "nodeType": "ExpressionStatement", - "src": "7089:39:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 813, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 794, - "modifierName": { - "argumentTypes": null, - "id": 793, - "name": "voting", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 204, - "src": "6994:6:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "6994:6:0" - }, - { - "arguments": null, - "id": 796, - "modifierName": { - "argumentTypes": null, - "id": 795, - "name": "currentValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 240, - "src": "7001:16:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "7001:16:0" - } - ], - "name": "voteChangeThreshold", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 792, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 791, - "name": "threshold", - "nodeType": "VariableDeclaration", - "scope": 813, - "src": "6971:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 790, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "6971:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "6970:16:0" - }, - "returnParameters": { - "id": 797, - "nodeType": "ParameterList", - "parameters": [], - "src": "7018:0:0" - }, - "scope": 1138, - "src": "6942:203:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 836, - "nodeType": "Block", - "src": "7209:141:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 821, - "name": "Vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 55, - "src": "7231:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Vote_$55_$", - "typeString": "type(enum Bridge.Vote)" - } - }, - "id": 822, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "START_KEYGEN", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "7231:17:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - } - ], - "id": 820, - "name": "tryVote", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 882, - 907, - 932, - 962 - ], - "referencedDeclaration": 882, - "src": "7223:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$55_$returns$_t_bool_$", - "typeString": "function (enum Bridge.Vote) returns (bool)" - } - }, - "id": 823, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7223:26:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 835, - "nodeType": "IfStatement", - "src": "7219:125:0", - "trueBody": { - "id": 834, - "nodeType": "Block", - "src": "7251:93:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 827, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 824, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "7265:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 825, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 45, - "src": "7274:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$45_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 826, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "KEYGEN", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "7274:13:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "src": "7265:22:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "id": 828, - "nodeType": "ExpressionStatement", - "src": "7265:22:0" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 830, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 79, - "src": "7316:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 831, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 81, - "src": "7323:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 829, - "name": "NewEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12, - "src": "7307:8:0", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$returns$__$", - "typeString": "function (uint256,uint256)" - } - }, - "id": 832, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7307:26:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 833, - "nodeType": "EmitStatement", - "src": "7302:31:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 837, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 816, - "modifierName": { - "argumentTypes": null, - "id": 815, - "name": "voting", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 204, - "src": "7185:6:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "7185:6:0" - }, - { - "arguments": null, - "id": 818, - "modifierName": { - "argumentTypes": null, - "id": 817, - "name": "currentValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 240, - "src": "7192:16:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "7192:16:0" - } - ], - "name": "voteStartKeygen", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 814, - "nodeType": "ParameterList", - "parameters": [], - "src": "7175:2:0" - }, - "returnParameters": { - "id": 819, - "nodeType": "ParameterList", - "parameters": [], - "src": "7209:0:0" - }, - "scope": 1138, - "src": "7151:199:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 859, - "nodeType": "Block", - "src": "7415:144:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 845, - "name": "Vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 55, - "src": "7437:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Vote_$55_$", - "typeString": "type(enum Bridge.Vote)" - } - }, - "id": 846, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "CANCEL_KEYGEN", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "7437:18:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - } - ], - "id": 844, - "name": "tryVote", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 882, - 907, - 932, - 962 - ], - "referencedDeclaration": 882, - "src": "7429:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$55_$returns$_t_bool_$", - "typeString": "function (enum Bridge.Vote) returns (bool)" - } - }, - "id": 847, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7429:27:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 858, - "nodeType": "IfStatement", - "src": "7425:128:0", - "trueBody": { - "id": 857, - "nodeType": "Block", - "src": "7458:95:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 851, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 848, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "7472:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 849, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 45, - "src": "7481:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$45_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 850, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "VOTING", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "7481:13:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "src": "7472:22:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$45", - "typeString": "enum Bridge.Status" - } - }, - "id": 852, - "nodeType": "ExpressionStatement", - "src": "7472:22:0" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 854, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 81, - "src": "7532:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 853, - "name": "NewEpochCancelled", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 16, - "src": "7514:17:0", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$returns$__$", - "typeString": "function (uint256)" - } - }, - "id": 855, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7514:28:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 856, - "nodeType": "EmitStatement", - "src": "7509:33:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 860, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 840, - "modifierName": { - "argumentTypes": null, - "id": 839, - "name": "keygen", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 216, - "src": "7391:6:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "7391:6:0" - }, - { - "arguments": null, - "id": 842, - "modifierName": { - "argumentTypes": null, - "id": 841, - "name": "currentValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 240, - "src": "7398:16:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "7398:16:0" - } - ], - "name": "voteCancelKeygen", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 838, - "nodeType": "ParameterList", - "parameters": [], - "src": "7381:2:0" - }, - "returnParameters": { - "id": 843, - "nodeType": "ParameterList", - "parameters": [], - "src": "7415:0:0" - }, - "scope": 1138, - "src": "7356:203:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 881, - "nodeType": "Block", - "src": "7620:110:0", - "statements": [ - { - "assignments": [ - 868 - ], - "declarations": [ - { - "constant": false, - "id": 868, - "name": "vote", - "nodeType": "VariableDeclaration", - "scope": 881, - "src": "7630:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 867, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "7630:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 876, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 872, - "name": "voteType", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 862, - "src": "7672:8:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 873, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 81, - "src": "7682:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 870, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12816, - "src": "7655:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 871, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "7655:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 874, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7655:37:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 869, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12823, - "src": "7645:9:0", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 875, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7645:48:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "7630:63:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 878, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 868, - "src": "7718:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "id": 877, - "name": "putVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1066, - "src": "7710:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$_t_bool_$", - "typeString": "function (bytes32) returns (bool)" - } - }, - "id": 879, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7710:13:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "functionReturnParameters": 866, - "id": 880, - "nodeType": "Return", - "src": "7703:20:0" - } - ] - }, - "documentation": null, - "id": 882, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "tryVote", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 863, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 862, - "name": "voteType", - "nodeType": "VariableDeclaration", - "scope": 882, - "src": "7582:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - }, - "typeName": { - "contractScope": null, - "id": 861, - "name": "Vote", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 55, - "src": "7582:4:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "7581:15:0" - }, - "returnParameters": { - "id": 866, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 865, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 882, - "src": "7614:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 864, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "7614:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "7613:6:0" - }, - "scope": 1138, - "src": "7565:165:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "private" - }, - { - "body": { - "id": 906, - "nodeType": "Block", - "src": "7805:116:0", - "statements": [ - { - "assignments": [ - 892 - ], - "declarations": [ - { - "constant": false, - "id": 892, - "name": "vote", - "nodeType": "VariableDeclaration", - "scope": 906, - "src": "7815:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 891, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "7815:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 901, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 896, - "name": "voteType", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 884, - "src": "7857:8:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 897, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 81, - "src": "7867:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 898, - "name": "addr", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 886, - "src": "7878:4:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "expression": { - "argumentTypes": null, - "id": 894, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12816, - "src": "7840:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 895, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "7840:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 899, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7840:43:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 893, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12823, - "src": "7830:9:0", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 900, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7830:54:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "7815:69:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 903, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 892, - "src": "7909:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "id": 902, - "name": "putVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1066, - "src": "7901:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$_t_bool_$", - "typeString": "function (bytes32) returns (bool)" - } - }, - "id": 904, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7901:13:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "functionReturnParameters": 890, - "id": 905, - "nodeType": "Return", - "src": "7894:20:0" - } - ] - }, - "documentation": null, - "id": 907, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "tryVote", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 887, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 884, - "name": "voteType", - "nodeType": "VariableDeclaration", - "scope": 907, - "src": "7753:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - }, - "typeName": { - "contractScope": null, - "id": 883, - "name": "Vote", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 55, - "src": "7753:4:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 886, - "name": "addr", - "nodeType": "VariableDeclaration", - "scope": 907, - "src": "7768:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 885, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "7768:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "7752:29:0" - }, - "returnParameters": { - "id": 890, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 889, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 907, - "src": "7799:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 888, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "7799:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "7798:6:0" - }, - "scope": 1138, - "src": "7736:185:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "private" - }, - { - "body": { - "id": 931, - "nodeType": "Block", - "src": "7992:115:0", - "statements": [ - { - "assignments": [ - 917 - ], - "declarations": [ - { - "constant": false, - "id": 917, - "name": "vote", - "nodeType": "VariableDeclaration", - "scope": 931, - "src": "8002:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 916, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "8002:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 926, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 921, - "name": "voteType", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 909, - "src": "8044:8:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 922, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 81, - "src": "8054:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 923, - "name": "num", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 911, - "src": "8065:3:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 919, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12816, - "src": "8027:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 920, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "8027:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 924, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8027:42:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 918, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12823, - "src": "8017:9:0", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 925, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8017:53:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "8002:68:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 928, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 917, - "src": "8095:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "id": 927, - "name": "putVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1066, - "src": "8087:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$_t_bool_$", - "typeString": "function (bytes32) returns (bool)" - } - }, - "id": 929, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8087:13:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "functionReturnParameters": 915, - "id": 930, - "nodeType": "Return", - "src": "8080:20:0" - } - ] - }, - "documentation": null, - "id": 932, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "tryVote", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 912, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 909, - "name": "voteType", - "nodeType": "VariableDeclaration", - "scope": 932, - "src": "7944:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - }, - "typeName": { - "contractScope": null, - "id": 908, - "name": "Vote", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 55, - "src": "7944:4:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 911, - "name": "num", - "nodeType": "VariableDeclaration", - "scope": 932, - "src": "7959:8:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 910, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "7959:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "7943:25:0" - }, - "returnParameters": { - "id": 915, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 914, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 932, - "src": "7986:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 913, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "7986:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "7985:6:0" - }, - "scope": 1138, - "src": "7927:180:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "private" - }, - { - "body": { - "id": 961, - "nodeType": "Block", - "src": "8206:116:0", - "statements": [ - { - "assignments": [ - 946 - ], - "declarations": [ - { - "constant": false, - "id": 946, - "name": "vote", - "nodeType": "VariableDeclaration", - "scope": 961, - "src": "8216:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 945, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "8216:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 956, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 950, - "name": "voteType", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 934, - "src": "8258:8:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 951, - "name": "hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 936, - "src": "8268:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "id": 952, - "name": "to", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 938, - "src": "8274:2:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 953, - "name": "value", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 940, - "src": "8278:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 948, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12816, - "src": "8241:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 949, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "8241:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 954, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8241:43:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 947, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12823, - "src": "8231:9:0", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 955, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8231:54:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "8216:69:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 958, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 946, - "src": "8310:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "id": 957, - "name": "putVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1066, - "src": "8302:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$_t_bool_$", - "typeString": "function (bytes32) returns (bool)" - } - }, - "id": 959, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8302:13:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "functionReturnParameters": 944, - "id": 960, - "nodeType": "Return", - "src": "8295:20:0" - } - ] - }, - "documentation": null, - "id": 962, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "tryVote", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 941, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 934, - "name": "voteType", - "nodeType": "VariableDeclaration", - "scope": 962, - "src": "8130:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - }, - "typeName": { - "contractScope": null, - "id": 933, - "name": "Vote", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 55, - "src": "8130:4:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 936, - "name": "hash", - "nodeType": "VariableDeclaration", - "scope": 962, - "src": "8145:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 935, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "8145:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 938, - "name": "to", - "nodeType": "VariableDeclaration", - "scope": 962, - "src": "8159:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 937, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "8159:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 940, - "name": "value", - "nodeType": "VariableDeclaration", - "scope": 962, - "src": "8171:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 939, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "8171:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "8129:53:0" - }, - "returnParameters": { - "id": 944, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 943, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 962, - "src": "8200:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 942, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "8200:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "8199:6:0" - }, - "scope": 1138, - "src": "8113:209:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "private" - }, - { - "body": { - "id": 983, - "nodeType": "Block", - "src": "8386:113:0", - "statements": [ - { - "assignments": [ - 970 - ], - "declarations": [ - { - "constant": false, - "id": 970, - "name": "vote", - "nodeType": "VariableDeclaration", - "scope": 983, - "src": "8396:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 969, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "8396:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 978, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 974, - "name": "voteType", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 964, - "src": "8438:8:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 975, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 81, - "src": "8448:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 972, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12816, - "src": "8421:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 973, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "8421:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 976, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8421:37:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 971, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12823, - "src": "8411:9:0", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 977, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8411:48:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "8396:63:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 980, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 970, - "src": "8487:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "id": 979, - "name": "putConfirm", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1120, - "src": "8476:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$_t_bool_$", - "typeString": "function (bytes32) returns (bool)" - } - }, - "id": 981, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8476:16:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "functionReturnParameters": 968, - "id": 982, - "nodeType": "Return", - "src": "8469:23:0" - } - ] - }, - "documentation": null, - "id": 984, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "tryConfirm", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 965, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 964, - "name": "voteType", - "nodeType": "VariableDeclaration", - "scope": 984, - "src": "8348:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - }, - "typeName": { - "contractScope": null, - "id": 963, - "name": "Vote", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 55, - "src": "8348:4:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "8347:15:0" - }, - "returnParameters": { - "id": 968, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 967, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 984, - "src": "8380:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 966, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "8380:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "8379:6:0" - }, - "scope": 1138, - "src": "8328:171:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "private" - }, - { - "body": { - "id": 1011, - "nodeType": "Block", - "src": "8579:119:0", - "statements": [ - { - "assignments": [ - 996 - ], - "declarations": [ - { - "constant": false, - "id": 996, - "name": "vote", - "nodeType": "VariableDeclaration", - "scope": 1011, - "src": "8589:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 995, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "8589:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 1006, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1000, - "name": "voteType", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 986, - "src": "8631:8:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 1001, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 81, - "src": "8641:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 1002, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 988, - "src": "8652:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 1003, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 990, - "src": "8655:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 998, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12816, - "src": "8614:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 999, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "8614:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 1004, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8614:43:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 997, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12823, - "src": "8604:9:0", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 1005, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8604:54:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "8589:69:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1008, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 996, - "src": "8686:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "id": 1007, - "name": "putConfirm", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1120, - "src": "8675:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$_t_bool_$", - "typeString": "function (bytes32) returns (bool)" - } - }, - "id": 1009, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8675:16:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "functionReturnParameters": 994, - "id": 1010, - "nodeType": "Return", - "src": "8668:23:0" - } - ] - }, - "documentation": null, - "id": 1012, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "tryConfirm", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 991, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 986, - "name": "voteType", - "nodeType": "VariableDeclaration", - "scope": 1012, - "src": "8525:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - }, - "typeName": { - "contractScope": null, - "id": 985, - "name": "Vote", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 55, - "src": "8525:4:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$55", - "typeString": "enum Bridge.Vote" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 988, - "name": "x", - "nodeType": "VariableDeclaration", - "scope": 1012, - "src": "8540:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 987, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "8540:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 990, - "name": "y", - "nodeType": "VariableDeclaration", - "scope": 1012, - "src": "8548:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 989, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "8548:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "8524:31:0" - }, - "returnParameters": { - "id": 994, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 993, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 1012, - "src": "8573:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 992, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "8573:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "8572:6:0" - }, - "scope": 1138, - "src": "8505:193:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "private" - }, - { - "body": { - "id": 1065, - "nodeType": "Block", - "src": "8758:355:0", - "statements": [ - { - "assignments": [ - 1020 - ], - "declarations": [ - { - "constant": false, - "id": 1020, - "name": "personalVote", - "nodeType": "VariableDeclaration", - "scope": 1065, - "src": "8768:20:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1019, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "8768:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 1024, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1022, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1014, - "src": "8807:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "id": 1021, - "name": "personalizeVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1137, - "src": "8791:15:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_bytes32_$", - "typeString": "function (bytes32) view returns (bytes32)" - } - }, - "id": 1023, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8791:21:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "8768:44:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1029, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "!", - "prefix": true, - "src": "8830:20:0", - "subExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1026, - "name": "votes", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 75, - "src": "8831:5:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - } - }, - "id": 1028, - "indexExpression": { - "argumentTypes": null, - "id": 1027, - "name": "personalVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1020, - "src": "8837:12:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8831:19:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "566f74656420616c7265616479", - "id": 1030, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8852:15:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_230c30109b60c15b21799291aaf5c571045da3dc3f224d8bbd2f2e688c149a47", - "typeString": "literal_string \"Voted already\"" - }, - "value": "Voted already" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_230c30109b60c15b21799291aaf5c571045da3dc3f224d8bbd2f2e688c149a47", - "typeString": "literal_string \"Voted already\"" - } - ], - "id": 1025, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 12832, - 12833 - ], - "referencedDeclaration": 12833, - "src": "8822:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 1031, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8822:46:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 1032, - "nodeType": "ExpressionStatement", - "src": "8822:46:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 1037, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1033, - "name": "votes", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 75, - "src": "8879:5:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - } - }, - "id": 1035, - "indexExpression": { - "argumentTypes": null, - "id": 1034, - "name": "personalVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1020, - "src": "8885:12:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "8879:19:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 1036, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8901:4:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "src": "8879:26:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 1038, - "nodeType": "ExpressionStatement", - "src": "8879:26:0" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 1044, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1039, - "name": "votesCount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 71, - "src": "8919:10:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - } - }, - "id": 1041, - "indexExpression": { - "argumentTypes": null, - "id": 1040, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1014, - "src": "8930:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8919:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 1042, - "name": "getThreshold", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 468, - 491 - ], - "referencedDeclaration": 468, - "src": "8939:12:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 1043, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8939:14:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "8919:34:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "id": 1063, - "nodeType": "Block", - "src": "9038:69:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 1059, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "9052:18:0", - "subExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1056, - "name": "votesCount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 71, - "src": "9052:10:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - } - }, - "id": 1058, - "indexExpression": { - "argumentTypes": null, - "id": 1057, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1014, - "src": "9063:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "9052:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 1060, - "nodeType": "ExpressionStatement", - "src": "9052:18:0" - }, - { - "expression": { - "argumentTypes": null, - "hexValue": "66616c7365", - "id": 1061, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "9091:5:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "false" - }, - "functionReturnParameters": 1018, - "id": 1062, - "nodeType": "Return", - "src": "9084:12:0" - } - ] - }, - "id": 1064, - "nodeType": "IfStatement", - "src": "8915:192:0", - "trueBody": { - "id": 1055, - "nodeType": "Block", - "src": "8955:77:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 1051, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1045, - "name": "votesCount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 71, - "src": "8969:10:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - } - }, - "id": 1047, - "indexExpression": { - "argumentTypes": null, - "id": 1046, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1014, - "src": "8980:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "8969:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_rational_57896044618658097711785492504343953926634992332820282019728792003956564819968_by_1", - "typeString": "int_const 5789...(69 digits omitted)...9968" - }, - "id": 1050, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "hexValue": "32", - "id": 1048, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8988:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "nodeType": "BinaryOperation", - "operator": "**", - "rightExpression": { - "argumentTypes": null, - "hexValue": "323535", - "id": 1049, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8993:3:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_255_by_1", - "typeString": "int_const 255" - }, - "value": "255" - }, - "src": "8988:8:0", - "typeDescriptions": { - "typeIdentifier": "t_rational_57896044618658097711785492504343953926634992332820282019728792003956564819968_by_1", - "typeString": "int_const 5789...(69 digits omitted)...9968" - } - }, - "src": "8969:27:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 1052, - "nodeType": "ExpressionStatement", - "src": "8969:27:0" - }, - { - "expression": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 1053, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "9017:4:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "functionReturnParameters": 1018, - "id": 1054, - "nodeType": "Return", - "src": "9010:11:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 1066, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "putVote", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1015, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1014, - "name": "vote", - "nodeType": "VariableDeclaration", - "scope": 1066, - "src": "8721:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1013, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "8721:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "8720:14:0" - }, - "returnParameters": { - "id": 1018, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1017, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 1066, - "src": "8752:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 1016, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "8752:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "8751:6:0" - }, - "scope": 1138, - "src": "8704:409:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "private" - }, - { - "body": { - "id": 1119, - "nodeType": "Block", - "src": "9176:363:0", - "statements": [ - { - "assignments": [ - 1074 - ], - "declarations": [ - { - "constant": false, - "id": 1074, - "name": "personalVote", - "nodeType": "VariableDeclaration", - "scope": 1119, - "src": "9186:20:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1073, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "9186:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 1078, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1076, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1068, - "src": "9225:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "id": 1075, - "name": "personalizeVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1137, - "src": "9209:15:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_bytes32_$", - "typeString": "function (bytes32) view returns (bytes32)" - } - }, - "id": 1077, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9209:21:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "9186:44:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1083, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "!", - "prefix": true, - "src": "9248:20:0", - "subExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1080, - "name": "votes", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 75, - "src": "9249:5:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - } - }, - "id": 1082, - "indexExpression": { - "argumentTypes": null, - "id": 1081, - "name": "personalVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1074, - "src": "9255:12:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "9249:19:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "436f6e6669726d656420616c7265616479", - "id": 1084, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "9270:19:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_762a97ce67d271844ad9c09d89a5271fde7fe7537af208da055a904cd67ac7bc", - "typeString": "literal_string \"Confirmed already\"" - }, - "value": "Confirmed already" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_762a97ce67d271844ad9c09d89a5271fde7fe7537af208da055a904cd67ac7bc", - "typeString": "literal_string \"Confirmed already\"" - } - ], - "id": 1079, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 12832, - 12833 - ], - "referencedDeclaration": 12833, - "src": "9240:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 1085, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9240:50:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 1086, - "nodeType": "ExpressionStatement", - "src": "9240:50:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 1091, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1087, - "name": "votes", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 75, - "src": "9301:5:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - } - }, - "id": 1089, - "indexExpression": { - "argumentTypes": null, - "id": 1088, - "name": "personalVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1074, - "src": "9307:12:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "9301:19:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 1090, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "9323:4:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "src": "9301:26:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 1092, - "nodeType": "ExpressionStatement", - "src": "9301:26:0" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 1098, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1093, - "name": "votesCount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 71, - "src": "9341:10:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - } - }, - "id": 1095, - "indexExpression": { - "argumentTypes": null, - "id": 1094, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1068, - "src": "9352:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "9341:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 1096, - "name": "getNextThreshold", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 478, - "src": "9361:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 1097, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9361:18:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "9341:38:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "id": 1117, - "nodeType": "Block", - "src": "9464:69:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 1113, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "9478:18:0", - "subExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1110, - "name": "votesCount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 71, - "src": "9478:10:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - } - }, - "id": 1112, - "indexExpression": { - "argumentTypes": null, - "id": 1111, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1068, - "src": "9489:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "9478:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 1114, - "nodeType": "ExpressionStatement", - "src": "9478:18:0" - }, - { - "expression": { - "argumentTypes": null, - "hexValue": "66616c7365", - "id": 1115, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "9517:5:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "false" - }, - "functionReturnParameters": 1072, - "id": 1116, - "nodeType": "Return", - "src": "9510:12:0" - } - ] - }, - "id": 1118, - "nodeType": "IfStatement", - "src": "9337:196:0", - "trueBody": { - "id": 1109, - "nodeType": "Block", - "src": "9381:77:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 1105, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1099, - "name": "votesCount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 71, - "src": "9395:10:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - } - }, - "id": 1101, - "indexExpression": { - "argumentTypes": null, - "id": 1100, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1068, - "src": "9406:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "9395:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_rational_57896044618658097711785492504343953926634992332820282019728792003956564819968_by_1", - "typeString": "int_const 5789...(69 digits omitted)...9968" - }, - "id": 1104, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "hexValue": "32", - "id": 1102, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "9414:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "nodeType": "BinaryOperation", - "operator": "**", - "rightExpression": { - "argumentTypes": null, - "hexValue": "323535", - "id": 1103, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "9419:3:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_255_by_1", - "typeString": "int_const 255" - }, - "value": "255" - }, - "src": "9414:8:0", - "typeDescriptions": { - "typeIdentifier": "t_rational_57896044618658097711785492504343953926634992332820282019728792003956564819968_by_1", - "typeString": "int_const 5789...(69 digits omitted)...9968" - } - }, - "src": "9395:27:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 1106, - "nodeType": "ExpressionStatement", - "src": "9395:27:0" - }, - { - "expression": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 1107, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "9443:4:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "functionReturnParameters": 1072, - "id": 1108, - "nodeType": "Return", - "src": "9436:11:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 1120, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "putConfirm", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1069, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1068, - "name": "vote", - "nodeType": "VariableDeclaration", - "scope": 1120, - "src": "9139:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1067, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "9139:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "9138:14:0" - }, - "returnParameters": { - "id": 1072, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1071, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 1120, - "src": "9170:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 1070, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "9170:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "9169:6:0" - }, - "scope": 1138, - "src": "9119:420:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "private" - }, - { - "body": { - "id": 1136, - "nodeType": "Block", - "src": "9615:69:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1130, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1122, - "src": "9659:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1131, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12829, - "src": "9665:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 1132, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "9665:10:0", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - ], - "expression": { - "argumentTypes": null, - "id": 1128, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12816, - "src": "9642:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 1129, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "9642:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 1133, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9642:34:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 1127, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12823, - "src": "9632:9:0", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 1134, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9632:45:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "functionReturnParameters": 1126, - "id": 1135, - "nodeType": "Return", - "src": "9625:52:0" - } - ] - }, - "documentation": null, - "id": 1137, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "personalizeVote", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1123, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1122, - "name": "vote", - "nodeType": "VariableDeclaration", - "scope": 1137, - "src": "9570:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1121, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "9570:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "9569:14:0" - }, - "returnParameters": { - "id": 1126, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1125, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 1137, - "src": "9606:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1124, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "9606:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "9605:9:0" - }, - "scope": 1138, - "src": "9545:139:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "private" - } - ], - "scope": 1139, - "src": "93:9593:0" - } - ], - "src": "0:9687:0" - }, - "compiler": { - "name": "solc", - "version": "0.5.9+commit.e560f70d.Emscripten.clang" - }, - "networks": { - "44": { - "events": { - "0x3ef85928df9ae51bdb3eb4c00ec73b92b82307f319ac1b029de14796a0972609": { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "oldEpoch", - "type": "uint256" - }, - { - "indexed": true, - "name": "newEpoch", - "type": "uint256" - } - ], - "name": "NewEpoch", - "type": "event", - "signature": "0x3ef85928df9ae51bdb3eb4c00ec73b92b82307f319ac1b029de14796a0972609" - }, - "0xddbb65cfe1ae4aec03cef0f9667c6d7ba3740927d0c60f4dd4d7104cc31d180a": { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "epoch", - "type": "uint256" - } - ], - "name": "NewEpochCancelled", - "type": "event", - "signature": "0xddbb65cfe1ae4aec03cef0f9667c6d7ba3740927d0c60f4dd4d7104cc31d180a" - }, - "0xf4735b85cc98f9a712832825ecab4cfb1649d658f9a73c57a00ea7dde735c79b": { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "oldEpoch", - "type": "uint256" - }, - { - "indexed": true, - "name": "newEpoch", - "type": "uint256" - } - ], - "name": "NewFundsTransfer", - "type": "event", - "signature": "0xf4735b85cc98f9a712832825ecab4cfb1649d658f9a73c57a00ea7dde735c79b" - }, - "0xc33272939f066c227e913a4b3434d860794f185c551685c29451a3a38b9b259c": { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "epoch", - "type": "uint256" - }, - { - "indexed": false, - "name": "x", - "type": "uint256" - }, - { - "indexed": false, - "name": "y", - "type": "uint256" - } - ], - "name": "EpochStart", - "type": "event", - "signature": "0xc33272939f066c227e913a4b3434d860794f185c551685c29451a3a38b9b259c" - }, - "0x62e1f484b3909b2c013673bad76a9f14b010600ba983f11ad26e83082883570e": { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "name": "value", - "type": "uint256" - } - ], - "name": "ExchangeRequest", - "type": "event", - "signature": "0x62e1f484b3909b2c013673bad76a9f14b010600ba983f11ad26e83082883570e" - } - }, - "links": {}, - "address": "0x44c158FE850821ae69DaF37AADF5c539e9d0025B", - "transactionHash": "0x6235a54e4ed6f582e79b17c216471dba7a35d27b2ee4f2c3e4ce2326b5d5c8c5" - } - }, - "schemaVersion": "3.0.16", - "updatedAt": "2019-10-09T13:30:27.734Z", - "devdoc": { - "methods": {} - }, - "userdoc": { - "methods": {} - } -} \ No newline at end of file diff --git a/src/test-services/ethereumSend/Dockerfile b/src/test-services/ethereumSend/Dockerfile index 80808a1..15d2e34 100644 --- a/src/test-services/ethereumSend/Dockerfile +++ b/src/test-services/ethereumSend/Dockerfile @@ -6,6 +6,6 @@ COPY package.json /test/ RUN npm install -COPY testEthereumSend.js IERC20.json Bridge.json /test/ +COPY testEthereumSend.js /test/ ENTRYPOINT ["node", "testEthereumSend.js"] diff --git a/src/test-services/ethereumSend/IERC20.json b/src/test-services/ethereumSend/IERC20.json deleted file mode 100644 index 066d309..0000000 --- a/src/test-services/ethereumSend/IERC20.json +++ /dev/null @@ -1,1884 +0,0 @@ -{ - "contractName": "IERC20", - "abi": [ - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "from", - "type": "address" - }, - { - "indexed": true, - "name": "to", - "type": "address" - }, - { - "indexed": false, - "name": "value", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "name": "value", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "constant": true, - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "account", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "recipient", - "type": "address" - }, - { - "name": "amount", - "type": "uint256" - } - ], - "name": "transfer", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "owner", - "type": "address" - }, - { - "name": "spender", - "type": "address" - } - ], - "name": "allowance", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "spender", - "type": "address" - }, - { - "name": "amount", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "sender", - "type": "address" - }, - { - "name": "recipient", - "type": "address" - }, - { - "name": "amount", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - } - ], - "metadata": "{\"compiler\":{\"version\":\"0.5.9+commit.e560f70d\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":false,\"inputs\":[{\"name\":\"spender\",\"type\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"sender\",\"type\":\"address\"},{\"name\":\"recipient\",\"type\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"recipient\",\"type\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"owner\",\"type\":\"address\"},{\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"}],\"devdoc\":{\"details\":\"Interface of the ERC20 standard as defined in the EIP. Does not include the optional functions; to access them see `ERC20Detailed`.\",\"methods\":{\"allowance(address,address)\":{\"details\":\"Returns the remaining number of tokens that `spender` will be allowed to spend on behalf of `owner` through `transferFrom`. This is zero by default. * This value changes when `approve` or `transferFrom` are called.\"},\"approve(address,uint256)\":{\"details\":\"Sets `amount` as the allowance of `spender` over the caller's tokens. * Returns a boolean value indicating whether the operation succeeded. * > Beware that changing an allowance with this method brings the risk that someone may use both the old and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * Emits an `Approval` event.\"},\"balanceOf(address)\":{\"details\":\"Returns the amount of tokens owned by `account`.\"},\"totalSupply()\":{\"details\":\"Returns the amount of tokens in existence.\"},\"transfer(address,uint256)\":{\"details\":\"Moves `amount` tokens from the caller's account to `recipient`. * Returns a boolean value indicating whether the operation succeeded. * Emits a `Transfer` event.\"},\"transferFrom(address,address,uint256)\":{\"details\":\"Moves `amount` tokens from `sender` to `recipient` using the allowance mechanism. `amount` is then deducted from the caller's allowance. * Returns a boolean value indicating whether the operation succeeded. * Emits a `Transfer` event.\"}}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/build/contracts/openzeppelin-solidity/contracts/token/ERC20/IERC20.sol\":\"IERC20\"},\"evmVersion\":\"petersburg\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":3},\"remappings\":[]},\"sources\":{\"/build/contracts/openzeppelin-solidity/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0x90e8c2521653bbb1768b05889c5760031e688d9cd361f167489b89215e201b95\",\"urls\":[\"bzzr://aa8b45b57edafc3d67bc5d916327ea16807fae33f753ca163ae0c4061b789766\",\"dweb:/ipfs/QmP5NaEwZthQeM2ESz4WTT3osrP7jhbvu7ocbttBi2JAw6\"]}},\"version\":1}", - "bytecode": "0x", - "deployedBytecode": "0x", - "sourceMap": "", - "deployedSourceMap": "", - "source": "pragma solidity ^0.5.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP. Does not include\n * the optional functions; to access them see `ERC20Detailed`.\n */\ninterface IERC20 {\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a `Transfer` event.\n */\n function transfer(address recipient, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through `transferFrom`. This is\n * zero by default.\n *\n * This value changes when `approve` or `transferFrom` are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * > Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an `Approval` event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a `Transfer` event.\n */\n function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);\n\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to `approve`. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n}\n", - "sourcePath": "/build/contracts/openzeppelin-solidity/contracts/token/ERC20/IERC20.sol", - "ast": { - "absolutePath": "/build/contracts/openzeppelin-solidity/contracts/token/ERC20/IERC20.sol", - "exportedSymbols": { - "IERC20": [ - 9841 - ] - }, - "id": 9842, - "nodeType": "SourceUnit", - "nodes": [ - { - "id": 9774, - "literals": [ - "solidity", - "^", - "0.5", - ".0" - ], - "nodeType": "PragmaDirective", - "src": "0:23:114" - }, - { - "baseContracts": [], - "contractDependencies": [], - "contractKind": "interface", - "documentation": "@dev Interface of the ERC20 standard as defined in the EIP. Does not include\nthe optional functions; to access them see `ERC20Detailed`.", - "fullyImplemented": false, - "id": 9841, - "linearizedBaseContracts": [ - 9841 - ], - "name": "IERC20", - "nodeType": "ContractDefinition", - "nodes": [ - { - "body": null, - "documentation": "@dev Returns the amount of tokens in existence.", - "id": 9779, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "totalSupply", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 9775, - "nodeType": "ParameterList", - "parameters": [], - "src": "290:2:114" - }, - "returnParameters": { - "id": 9778, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 9777, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 9779, - "src": "316:7:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 9776, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "316:7:114", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "315:9:114" - }, - "scope": 9841, - "src": "270:55:114", - "stateMutability": "view", - "superFunction": 12575, - "visibility": "external" - }, - { - "body": null, - "documentation": "@dev Returns the amount of tokens owned by `account`.", - "id": 9786, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "balanceOf", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 9782, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 9781, - "name": "account", - "nodeType": "VariableDeclaration", - "scope": 9786, - "src": "427:15:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 9780, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "427:7:114", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "426:17:114" - }, - "returnParameters": { - "id": 9785, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 9784, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 9786, - "src": "467:7:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 9783, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "467:7:114", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "466:9:114" - }, - "scope": 9841, - "src": "408:68:114", - "stateMutability": "view", - "superFunction": 12582, - "visibility": "external" - }, - { - "body": null, - "documentation": "@dev Moves `amount` tokens from the caller's account to `recipient`.\n * Returns a boolean value indicating whether the operation succeeded.\n * Emits a `Transfer` event.", - "id": 9795, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "transfer", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 9791, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 9788, - "name": "recipient", - "nodeType": "VariableDeclaration", - "scope": 9795, - "src": "714:17:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 9787, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "714:7:114", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 9790, - "name": "amount", - "nodeType": "VariableDeclaration", - "scope": 9795, - "src": "733:14:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 9789, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "733:7:114", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "713:35:114" - }, - "returnParameters": { - "id": 9794, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 9793, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 9795, - "src": "767:4:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 9792, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "767:4:114", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "766:6:114" - }, - "scope": 9841, - "src": "696:77:114", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "external" - }, - { - "body": null, - "documentation": "@dev Returns the remaining number of tokens that `spender` will be\nallowed to spend on behalf of `owner` through `transferFrom`. This is\nzero by default.\n * This value changes when `approve` or `transferFrom` are called.", - "id": 9804, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "allowance", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 9800, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 9797, - "name": "owner", - "nodeType": "VariableDeclaration", - "scope": 9804, - "src": "1067:13:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 9796, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1067:7:114", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 9799, - "name": "spender", - "nodeType": "VariableDeclaration", - "scope": 9804, - "src": "1082:15:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 9798, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1082:7:114", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1066:32:114" - }, - "returnParameters": { - "id": 9803, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 9802, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 9804, - "src": "1122:7:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 9801, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1122:7:114", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1121:9:114" - }, - "scope": 9841, - "src": "1048:83:114", - "stateMutability": "view", - "superFunction": null, - "visibility": "external" - }, - { - "body": null, - "documentation": "@dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n * Returns a boolean value indicating whether the operation succeeded.\n * > Beware that changing an allowance with this method brings the risk\nthat someone may use both the old and the new allowance by unfortunate\ntransaction ordering. One possible solution to mitigate this race\ncondition is to first reduce the spender's allowance to 0 and set the\ndesired value afterwards:\nhttps://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n * Emits an `Approval` event.", - "id": 9813, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "approve", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 9809, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 9806, - "name": "spender", - "nodeType": "VariableDeclaration", - "scope": 9813, - "src": "1792:15:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 9805, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1792:7:114", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 9808, - "name": "amount", - "nodeType": "VariableDeclaration", - "scope": 9813, - "src": "1809:14:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 9807, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1809:7:114", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1791:33:114" - }, - "returnParameters": { - "id": 9812, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 9811, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 9813, - "src": "1843:4:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 9810, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "1843:4:114", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1842:6:114" - }, - "scope": 9841, - "src": "1775:74:114", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "external" - }, - { - "body": null, - "documentation": "@dev Moves `amount` tokens from `sender` to `recipient` using the\nallowance mechanism. `amount` is then deducted from the caller's\nallowance.\n * Returns a boolean value indicating whether the operation succeeded.\n * Emits a `Transfer` event.", - "id": 9824, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "transferFrom", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 9820, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 9815, - "name": "sender", - "nodeType": "VariableDeclaration", - "scope": 9824, - "src": "2178:14:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 9814, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2178:7:114", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 9817, - "name": "recipient", - "nodeType": "VariableDeclaration", - "scope": 9824, - "src": "2194:17:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 9816, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2194:7:114", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 9819, - "name": "amount", - "nodeType": "VariableDeclaration", - "scope": 9824, - "src": "2213:14:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 9818, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2213:7:114", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2177:51:114" - }, - "returnParameters": { - "id": 9823, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 9822, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 9824, - "src": "2247:4:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 9821, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "2247:4:114", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2246:6:114" - }, - "scope": 9841, - "src": "2156:97:114", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "external" - }, - { - "anonymous": false, - "documentation": "@dev Emitted when `value` tokens are moved from one account (`from`) to\nanother (`to`).\n * Note that `value` may be zero.", - "id": 9832, - "name": "Transfer", - "nodeType": "EventDefinition", - "parameters": { - "id": 9831, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 9826, - "indexed": true, - "name": "from", - "nodeType": "VariableDeclaration", - "scope": 9832, - "src": "2437:20:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 9825, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2437:7:114", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 9828, - "indexed": true, - "name": "to", - "nodeType": "VariableDeclaration", - "scope": 9832, - "src": "2459:18:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 9827, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2459:7:114", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 9830, - "indexed": false, - "name": "value", - "nodeType": "VariableDeclaration", - "scope": 9832, - "src": "2479:13:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 9829, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2479:7:114", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2436:57:114" - }, - "src": "2422:72:114" - }, - { - "anonymous": false, - "documentation": "@dev Emitted when the allowance of a `spender` for an `owner` is set by\na call to `approve`. `value` is the new allowance.", - "id": 9840, - "name": "Approval", - "nodeType": "EventDefinition", - "parameters": { - "id": 9839, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 9834, - "indexed": true, - "name": "owner", - "nodeType": "VariableDeclaration", - "scope": 9840, - "src": "2668:21:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 9833, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2668:7:114", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 9836, - "indexed": true, - "name": "spender", - "nodeType": "VariableDeclaration", - "scope": 9840, - "src": "2691:23:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 9835, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2691:7:114", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 9838, - "indexed": false, - "name": "value", - "nodeType": "VariableDeclaration", - "scope": 9840, - "src": "2716:13:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 9837, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2716:7:114", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2667:63:114" - }, - "src": "2653:78:114" - } - ], - "scope": 9842, - "src": "176:2557:114" - } - ], - "src": "0:2734:114" - }, - "legacyAST": { - "absolutePath": "/build/contracts/openzeppelin-solidity/contracts/token/ERC20/IERC20.sol", - "exportedSymbols": { - "IERC20": [ - 9841 - ] - }, - "id": 9842, - "nodeType": "SourceUnit", - "nodes": [ - { - "id": 9774, - "literals": [ - "solidity", - "^", - "0.5", - ".0" - ], - "nodeType": "PragmaDirective", - "src": "0:23:114" - }, - { - "baseContracts": [], - "contractDependencies": [], - "contractKind": "interface", - "documentation": "@dev Interface of the ERC20 standard as defined in the EIP. Does not include\nthe optional functions; to access them see `ERC20Detailed`.", - "fullyImplemented": false, - "id": 9841, - "linearizedBaseContracts": [ - 9841 - ], - "name": "IERC20", - "nodeType": "ContractDefinition", - "nodes": [ - { - "body": null, - "documentation": "@dev Returns the amount of tokens in existence.", - "id": 9779, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "totalSupply", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 9775, - "nodeType": "ParameterList", - "parameters": [], - "src": "290:2:114" - }, - "returnParameters": { - "id": 9778, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 9777, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 9779, - "src": "316:7:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 9776, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "316:7:114", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "315:9:114" - }, - "scope": 9841, - "src": "270:55:114", - "stateMutability": "view", - "superFunction": 12575, - "visibility": "external" - }, - { - "body": null, - "documentation": "@dev Returns the amount of tokens owned by `account`.", - "id": 9786, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "balanceOf", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 9782, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 9781, - "name": "account", - "nodeType": "VariableDeclaration", - "scope": 9786, - "src": "427:15:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 9780, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "427:7:114", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "426:17:114" - }, - "returnParameters": { - "id": 9785, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 9784, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 9786, - "src": "467:7:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 9783, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "467:7:114", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "466:9:114" - }, - "scope": 9841, - "src": "408:68:114", - "stateMutability": "view", - "superFunction": 12582, - "visibility": "external" - }, - { - "body": null, - "documentation": "@dev Moves `amount` tokens from the caller's account to `recipient`.\n * Returns a boolean value indicating whether the operation succeeded.\n * Emits a `Transfer` event.", - "id": 9795, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "transfer", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 9791, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 9788, - "name": "recipient", - "nodeType": "VariableDeclaration", - "scope": 9795, - "src": "714:17:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 9787, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "714:7:114", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 9790, - "name": "amount", - "nodeType": "VariableDeclaration", - "scope": 9795, - "src": "733:14:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 9789, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "733:7:114", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "713:35:114" - }, - "returnParameters": { - "id": 9794, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 9793, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 9795, - "src": "767:4:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 9792, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "767:4:114", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "766:6:114" - }, - "scope": 9841, - "src": "696:77:114", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "external" - }, - { - "body": null, - "documentation": "@dev Returns the remaining number of tokens that `spender` will be\nallowed to spend on behalf of `owner` through `transferFrom`. This is\nzero by default.\n * This value changes when `approve` or `transferFrom` are called.", - "id": 9804, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "allowance", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 9800, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 9797, - "name": "owner", - "nodeType": "VariableDeclaration", - "scope": 9804, - "src": "1067:13:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 9796, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1067:7:114", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 9799, - "name": "spender", - "nodeType": "VariableDeclaration", - "scope": 9804, - "src": "1082:15:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 9798, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1082:7:114", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1066:32:114" - }, - "returnParameters": { - "id": 9803, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 9802, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 9804, - "src": "1122:7:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 9801, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1122:7:114", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1121:9:114" - }, - "scope": 9841, - "src": "1048:83:114", - "stateMutability": "view", - "superFunction": null, - "visibility": "external" - }, - { - "body": null, - "documentation": "@dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n * Returns a boolean value indicating whether the operation succeeded.\n * > Beware that changing an allowance with this method brings the risk\nthat someone may use both the old and the new allowance by unfortunate\ntransaction ordering. One possible solution to mitigate this race\ncondition is to first reduce the spender's allowance to 0 and set the\ndesired value afterwards:\nhttps://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n * Emits an `Approval` event.", - "id": 9813, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "approve", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 9809, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 9806, - "name": "spender", - "nodeType": "VariableDeclaration", - "scope": 9813, - "src": "1792:15:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 9805, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1792:7:114", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 9808, - "name": "amount", - "nodeType": "VariableDeclaration", - "scope": 9813, - "src": "1809:14:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 9807, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1809:7:114", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1791:33:114" - }, - "returnParameters": { - "id": 9812, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 9811, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 9813, - "src": "1843:4:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 9810, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "1843:4:114", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1842:6:114" - }, - "scope": 9841, - "src": "1775:74:114", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "external" - }, - { - "body": null, - "documentation": "@dev Moves `amount` tokens from `sender` to `recipient` using the\nallowance mechanism. `amount` is then deducted from the caller's\nallowance.\n * Returns a boolean value indicating whether the operation succeeded.\n * Emits a `Transfer` event.", - "id": 9824, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "transferFrom", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 9820, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 9815, - "name": "sender", - "nodeType": "VariableDeclaration", - "scope": 9824, - "src": "2178:14:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 9814, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2178:7:114", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 9817, - "name": "recipient", - "nodeType": "VariableDeclaration", - "scope": 9824, - "src": "2194:17:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 9816, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2194:7:114", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 9819, - "name": "amount", - "nodeType": "VariableDeclaration", - "scope": 9824, - "src": "2213:14:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 9818, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2213:7:114", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2177:51:114" - }, - "returnParameters": { - "id": 9823, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 9822, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 9824, - "src": "2247:4:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 9821, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "2247:4:114", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2246:6:114" - }, - "scope": 9841, - "src": "2156:97:114", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "external" - }, - { - "anonymous": false, - "documentation": "@dev Emitted when `value` tokens are moved from one account (`from`) to\nanother (`to`).\n * Note that `value` may be zero.", - "id": 9832, - "name": "Transfer", - "nodeType": "EventDefinition", - "parameters": { - "id": 9831, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 9826, - "indexed": true, - "name": "from", - "nodeType": "VariableDeclaration", - "scope": 9832, - "src": "2437:20:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 9825, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2437:7:114", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 9828, - "indexed": true, - "name": "to", - "nodeType": "VariableDeclaration", - "scope": 9832, - "src": "2459:18:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 9827, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2459:7:114", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 9830, - "indexed": false, - "name": "value", - "nodeType": "VariableDeclaration", - "scope": 9832, - "src": "2479:13:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 9829, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2479:7:114", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2436:57:114" - }, - "src": "2422:72:114" - }, - { - "anonymous": false, - "documentation": "@dev Emitted when the allowance of a `spender` for an `owner` is set by\na call to `approve`. `value` is the new allowance.", - "id": 9840, - "name": "Approval", - "nodeType": "EventDefinition", - "parameters": { - "id": 9839, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 9834, - "indexed": true, - "name": "owner", - "nodeType": "VariableDeclaration", - "scope": 9840, - "src": "2668:21:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 9833, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2668:7:114", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 9836, - "indexed": true, - "name": "spender", - "nodeType": "VariableDeclaration", - "scope": 9840, - "src": "2691:23:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 9835, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2691:7:114", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 9838, - "indexed": false, - "name": "value", - "nodeType": "VariableDeclaration", - "scope": 9840, - "src": "2716:13:114", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 9837, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2716:7:114", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2667:63:114" - }, - "src": "2653:78:114" - } - ], - "scope": 9842, - "src": "176:2557:114" - } - ], - "src": "0:2734:114" - }, - "compiler": { - "name": "solc", - "version": "0.5.9+commit.e560f70d.Emscripten.clang" - }, - "networks": {}, - "schemaVersion": "3.0.11", - "updatedAt": "2019-07-17T07:17:15.653Z", - "devdoc": { - "details": "Interface of the ERC20 standard as defined in the EIP. Does not include the optional functions; to access them see `ERC20Detailed`.", - "methods": { - "allowance(address,address)": { - "details": "Returns the remaining number of tokens that `spender` will be allowed to spend on behalf of `owner` through `transferFrom`. This is zero by default. * This value changes when `approve` or `transferFrom` are called." - }, - "approve(address,uint256)": { - "details": "Sets `amount` as the allowance of `spender` over the caller's tokens. * Returns a boolean value indicating whether the operation succeeded. * > Beware that changing an allowance with this method brings the risk that someone may use both the old and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * Emits an `Approval` event." - }, - "balanceOf(address)": { - "details": "Returns the amount of tokens owned by `account`." - }, - "totalSupply()": { - "details": "Returns the amount of tokens in existence." - }, - "transfer(address,uint256)": { - "details": "Moves `amount` tokens from the caller's account to `recipient`. * Returns a boolean value indicating whether the operation succeeded. * Emits a `Transfer` event." - }, - "transferFrom(address,address,uint256)": { - "details": "Moves `amount` tokens from `sender` to `recipient` using the allowance mechanism. `amount` is then deducted from the caller's allowance. * Returns a boolean value indicating whether the operation succeeded. * Emits a `Transfer` event." - } - } - }, - "userdoc": { - "methods": {} - } -} \ No newline at end of file diff --git a/src/test-services/ethereumSend/package.json b/src/test-services/ethereumSend/package.json index db04192..3786f63 100644 --- a/src/test-services/ethereumSend/package.json +++ b/src/test-services/ethereumSend/package.json @@ -2,7 +2,6 @@ "name": "ethereum-send", "version": "0.0.1", "dependencies": { - "bignumber.js": "9.0.0", - "web3": "1.0.0-beta.55" + "ethers": "4.0.39" } } diff --git a/src/test-services/ethereumSend/testEthereumSend.js b/src/test-services/ethereumSend/testEthereumSend.js index 03ee123..4c3caa5 100644 --- a/src/test-services/ethereumSend/testEthereumSend.js +++ b/src/test-services/ethereumSend/testEthereumSend.js @@ -1,104 +1,59 @@ -const Web3 = require('web3') -const BN = require('bignumber.js') +const ethers = require('ethers') const { HOME_RPC_URL, HOME_BRIDGE_ADDRESS, HOME_PRIVATE_KEY, HOME_TOKEN_ADDRESS } = process.env -const abiToken = require('./IERC20').abi -const abiBridge = require('./Bridge').abi +const tokenAbi = [ + 'function transfer(address to, uint256 value)', + 'function approve(address to, uint256 value)' +] +const bridgeAbi = [ + 'function exchange(uint value)' +] const PRIVATE_KEY = process.env.PRIVATE_KEY || HOME_PRIVATE_KEY -const web3 = new Web3(HOME_RPC_URL, null, { transactionConfirmationBlocks: 1 }) -const token = new web3.eth.Contract(abiToken, HOME_TOKEN_ADDRESS) -const bridge = new web3.eth.Contract(abiBridge, HOME_BRIDGE_ADDRESS) +const provider = new ethers.providers.JsonRpcProvider(HOME_RPC_URL) +const wallet = new ethers.Wallet(PRIVATE_KEY, provider) +const token = new ethers.Contract(HOME_TOKEN_ADDRESS, tokenAbi, wallet) +const bridge = new ethers.Contract(HOME_BRIDGE_ADDRESS, bridgeAbi, wallet) -const sender = web3.eth.accounts.privateKeyToAccount(`0x${PRIVATE_KEY}`).address +const sender = wallet.address async function main() { - const HOME_CHAIN_ID = await web3.eth.net.getId() - const blockGasLimit = (await web3.eth.getBlock('latest', false)).gasLimit - const to = process.argv[2] - const amount = parseInt(process.argv[3], 10) - let coins = process.argv[4] + const amount = process.argv[3] + let native = process.argv[4] - const txCount = await web3.eth.getTransactionCount(sender) - - if (to === 'bridge' && amount !== 0) { + if (to === 'bridge' && amount !== '0') { console.log(`Transfer from ${sender} to ${HOME_BRIDGE_ADDRESS}, ${amount} tokens`) - const queryApprove = token.methods.approve(HOME_BRIDGE_ADDRESS, `0x${new BN(amount).multipliedBy(10 ** 18) - .toString(16)}`) - const txApprove = { - data: queryApprove.encodeABI(), - from: sender, - to: HOME_TOKEN_ADDRESS, - nonce: txCount, - chainId: HOME_CHAIN_ID - } - txApprove.gas = Math.min(Math.ceil(await queryApprove.estimateGas({ - from: sender - }) * 1.5), blockGasLimit) - const signedTxApprove = await web3.eth.accounts.signTransaction(txApprove, PRIVATE_KEY) - - const receiptApprove = await web3.eth.sendSignedTransaction(signedTxApprove.rawTransaction) + const txApprove = await token.approve(HOME_BRIDGE_ADDRESS, ethers.utils.parseEther(amount)) + const receiptApprove = await txApprove.wait() console.log(`txHash approve: ${receiptApprove.transactionHash}`) - const queryExchange = bridge.methods.exchange(`0x${new BN(amount).multipliedBy(10 ** 18) - .toString(16)}`) - const txExchange = { - data: queryExchange.encodeABI(), - from: sender, - to: HOME_BRIDGE_ADDRESS, - nonce: txCount + 1, - chainId: HOME_CHAIN_ID - } - txExchange.gas = Math.min(Math.ceil(await queryExchange.estimateGas({ - from: sender - }) * 1.5), blockGasLimit) - const signedTxExchange = await web3.eth.accounts.signTransaction(txExchange, PRIVATE_KEY) - - const receiptExchange = await web3.eth.sendSignedTransaction(signedTxExchange.rawTransaction) + const txExchange = await bridge.exchange(ethers.utils.parseEther(amount)) + const receiptExchange = await txExchange.wait() console.log(`txHash exchange: ${receiptExchange.transactionHash}`) - } else if (amount !== 0) { + } else if (amount !== '0') { console.log(`Transfer from ${sender} to ${to}, ${amount} tokens`) - const query = token.methods.transfer(to, `0x${new BN(amount).multipliedBy(10 ** 18) - .toString(16)}`) - const tx = { - data: query.encodeABI(), - from: sender, - to: HOME_TOKEN_ADDRESS, - nonce: txCount, - chainId: HOME_CHAIN_ID - } - tx.gas = Math.min(Math.ceil(await query.estimateGas({ - from: sender - }) * 1.5), blockGasLimit) - const signedTx = await web3.eth.accounts.signTransaction(tx, PRIVATE_KEY) - const receipt = await web3.eth.sendSignedTransaction(signedTx.rawTransaction) + const tx = await token.transfer(to, ethers.utils.parseEther(amount)) + const receipt = await tx.wait() console.log(`txHash transfer: ${receipt.transactionHash}`) } - if (coins) { - coins = parseFloat(coins) - console.log(`Transfer from ${sender} to ${to}, ${coins} coins`) + if (native) { + console.log(`Transfer from ${sender} to ${to}, ${native} coins`) - const tx = { - data: '0x', - from: sender, + const tx = await wallet.sendTransaction({ to, - nonce: await web3.eth.getTransactionCount(sender), - chainId: HOME_CHAIN_ID, - value: web3.utils.toWei(new BN(coins).toString(), 'ether'), - gas: 21000 - } - const signedTx = await web3.eth.accounts.signTransaction(tx, PRIVATE_KEY) + value: ethers.utils.parseEther(native) + }) - const receipt = await web3.eth.sendSignedTransaction(signedTx.rawTransaction) + const receipt = await tx.wait() console.log(`txHash: ${receipt.transactionHash}`) } } diff --git a/src/test-services/sidePrefund/Dockerfile b/src/test-services/sidePrefund/Dockerfile index 15d2e34..fd40822 100644 --- a/src/test-services/sidePrefund/Dockerfile +++ b/src/test-services/sidePrefund/Dockerfile @@ -6,6 +6,6 @@ COPY package.json /test/ RUN npm install -COPY testEthereumSend.js /test/ +COPY testSidePrefund.js /test/ -ENTRYPOINT ["node", "testEthereumSend.js"] +ENTRYPOINT ["node", "testSidePrefund.js"] diff --git a/src/test-services/sidePrefund/package.json b/src/test-services/sidePrefund/package.json index d115535..68cbe40 100644 --- a/src/test-services/sidePrefund/package.json +++ b/src/test-services/sidePrefund/package.json @@ -2,7 +2,6 @@ "name": "side-prefund", "version": "0.0.1", "dependencies": { - "bignumber.js": "9.0.0", - "web3": "1.0.0-beta.55" + "ethers": "4.0.39" } } diff --git a/src/test-services/sidePrefund/testEthereumSend.js b/src/test-services/sidePrefund/testEthereumSend.js deleted file mode 100644 index 9289e30..0000000 --- a/src/test-services/sidePrefund/testEthereumSend.js +++ /dev/null @@ -1,33 +0,0 @@ -const Web3 = require('web3') -const BN = require('bignumber.js') - -const { SIDE_RPC_URL, SIDE_PRIVATE_KEY } = process.env - -const web3 = new Web3(SIDE_RPC_URL, null, { transactionConfirmationBlocks: 1 }) - -const sender = web3.eth.accounts.privateKeyToAccount(`0x${SIDE_PRIVATE_KEY}`).address - -async function main() { - const SIDE_CHAIN_ID = await web3.eth.net.getId() - - const to = process.argv[2] - const amount = parseFloat(process.argv[3]) - - console.log(`Transfer from ${sender} to ${to}, ${amount} eth`) - - const txCoins = { - data: '0x', - from: sender, - to, - nonce: await web3.eth.getTransactionCount(sender), - chainId: SIDE_CHAIN_ID, - value: web3.utils.toWei(new BN(amount).toString(), 'ether'), - gas: 21000 - } - const signedTx = await web3.eth.accounts.signTransaction(txCoins, SIDE_PRIVATE_KEY) - - const receipt = await web3.eth.sendSignedTransaction(signedTx.rawTransaction) - console.log(`txHash: ${receipt.transactionHash}`) -} - -main() diff --git a/src/test-services/sidePrefund/testSidePrefund.js b/src/test-services/sidePrefund/testSidePrefund.js new file mode 100644 index 0000000..0d5c50b --- /dev/null +++ b/src/test-services/sidePrefund/testSidePrefund.js @@ -0,0 +1,26 @@ +const ethers = require('ethers') + +const { SIDE_RPC_URL, SIDE_PRIVATE_KEY } = process.env + +const provider = new ethers.providers.JsonRpcProvider(SIDE_RPC_URL) +const wallet = new ethers.Wallet(SIDE_PRIVATE_KEY, provider) + +const sender = wallet.address + +async function main() { + const to = process.argv[2] + const amount = process.argv[3] + + console.log(`Transfer from ${sender} to ${to}, ${amount} eth`) + + const txCoins = { + to, + value: ethers.utils.parseEther(amount) + } + + const tx = await wallet.sendTransaction(txCoins) + const receipt = await tx.wait() + console.log(`txHash: ${receipt.transactionHash}`) +} + +main() From a36b0435ae05bef41af461746d1cfabb01fb9872 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Mon, 4 Nov 2019 18:07:35 +0300 Subject: [PATCH 061/129] Specified node versions in package.json's --- src/test-services/binanceBalance/package.json | 3 +++ src/test-services/binanceSend/package.json | 3 +++ src/test-services/ethereumBalance/package.json | 3 +++ src/test-services/ethereumSend/package.json | 3 +++ src/test-services/ethereumSend/testEthereumSend.js | 2 +- src/test-services/getAddresses/package.json | 3 +++ src/test-services/sidePrefund/package.json | 3 +++ 7 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/test-services/binanceBalance/package.json b/src/test-services/binanceBalance/package.json index 993e8f9..c1bf42e 100644 --- a/src/test-services/binanceBalance/package.json +++ b/src/test-services/binanceBalance/package.json @@ -3,5 +3,8 @@ "version": "0.0.1", "dependencies": { "axios": "0.19.0" + }, + "engines": { + "node": ">=10.6.0" } } diff --git a/src/test-services/binanceSend/package.json b/src/test-services/binanceSend/package.json index a7d38dd..c09151a 100644 --- a/src/test-services/binanceSend/package.json +++ b/src/test-services/binanceSend/package.json @@ -3,5 +3,8 @@ "version": "0.0.1", "dependencies": { "@binance-chain/javascript-sdk": "2.14.4" + }, + "engines": { + "node": ">=10.6.0" } } diff --git a/src/test-services/ethereumBalance/package.json b/src/test-services/ethereumBalance/package.json index f593cf6..6865e58 100644 --- a/src/test-services/ethereumBalance/package.json +++ b/src/test-services/ethereumBalance/package.json @@ -4,5 +4,8 @@ "dependencies": { "ethers": "4.0.39", "bignumber.js": "9.0.0" + }, + "engines": { + "node": ">=10.6.0" } } diff --git a/src/test-services/ethereumSend/package.json b/src/test-services/ethereumSend/package.json index 3786f63..55e8eb7 100644 --- a/src/test-services/ethereumSend/package.json +++ b/src/test-services/ethereumSend/package.json @@ -3,5 +3,8 @@ "version": "0.0.1", "dependencies": { "ethers": "4.0.39" + }, + "engines": { + "node": ">=10.6.0" } } diff --git a/src/test-services/ethereumSend/testEthereumSend.js b/src/test-services/ethereumSend/testEthereumSend.js index 4c3caa5..76f0468 100644 --- a/src/test-services/ethereumSend/testEthereumSend.js +++ b/src/test-services/ethereumSend/testEthereumSend.js @@ -25,7 +25,7 @@ async function main() { const to = process.argv[2] const amount = process.argv[3] - let native = process.argv[4] + const native = process.argv[4] if (to === 'bridge' && amount !== '0') { console.log(`Transfer from ${sender} to ${HOME_BRIDGE_ADDRESS}, ${amount} tokens`) diff --git a/src/test-services/getAddresses/package.json b/src/test-services/getAddresses/package.json index de27143..edcb0cf 100644 --- a/src/test-services/getAddresses/package.json +++ b/src/test-services/getAddresses/package.json @@ -4,5 +4,8 @@ "dependencies": { "ethers": "4.0.37", "bech32": "1.1.3" + }, + "engines": { + "node": ">=10.6.0" } } diff --git a/src/test-services/sidePrefund/package.json b/src/test-services/sidePrefund/package.json index 68cbe40..371f08f 100644 --- a/src/test-services/sidePrefund/package.json +++ b/src/test-services/sidePrefund/package.json @@ -3,5 +3,8 @@ "version": "0.0.1", "dependencies": { "ethers": "4.0.39" + }, + "engines": { + "node": ">=10.6.0" } } From 19e42d90ce0b60b1471161fb35be94195d692982 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Mon, 4 Nov 2019 20:54:02 +0300 Subject: [PATCH 062/129] Moved proxy totally on ethers js --- src/oracle/proxy/Bridge.json | 35243 ------------------------------- src/oracle/proxy/Dockerfile | 1 - src/oracle/proxy/IERC20.json | 1884 -- src/oracle/proxy/SharedDB.json | 6274 ------ src/oracle/proxy/index.js | 173 +- src/oracle/proxy/package.json | 1 - src/oracle/proxy/sendTx.js | 30 +- 7 files changed, 116 insertions(+), 43490 deletions(-) delete mode 100644 src/oracle/proxy/Bridge.json delete mode 100644 src/oracle/proxy/IERC20.json delete mode 100644 src/oracle/proxy/SharedDB.json diff --git a/src/oracle/proxy/Bridge.json b/src/oracle/proxy/Bridge.json deleted file mode 100644 index 9eba79e..0000000 --- a/src/oracle/proxy/Bridge.json +++ /dev/null @@ -1,35243 +0,0 @@ -{ - "contractName": "Bridge", - "abi": [ - { - "constant": true, - "inputs": [], - "name": "status", - "outputs": [ - { - "name": "", - "type": "uint8" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "", - "type": "bytes32" - } - ], - "name": "usedRange", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "", - "type": "bytes32" - } - ], - "name": "votes", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "", - "type": "bytes32" - } - ], - "name": "dbTransfer", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "tokenContract", - "outputs": [ - { - "name": "", - "type": "address" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "epoch", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "", - "type": "bytes32" - } - ], - "name": "votesCount", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "nextEpoch", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "", - "type": "bytes32" - } - ], - "name": "dbTransferCount", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "name": "threshold", - "type": "uint256" - }, - { - "name": "validators", - "type": "address[]" - }, - { - "name": "_tokenContract", - "type": "address" - }, - { - "name": "limits", - "type": "uint256[2]" - }, - { - "name": "rangeSize", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "name": "value", - "type": "uint256" - }, - { - "indexed": false, - "name": "nonce", - "type": "uint256" - } - ], - "name": "ExchangeRequest", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "oldEpoch", - "type": "uint256" - }, - { - "indexed": true, - "name": "newEpoch", - "type": "uint256" - } - ], - "name": "NewEpoch", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "epoch", - "type": "uint256" - } - ], - "name": "NewEpochCancelled", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "oldEpoch", - "type": "uint256" - }, - { - "indexed": true, - "name": "newEpoch", - "type": "uint256" - } - ], - "name": "NewFundsTransfer", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "epoch", - "type": "uint256" - }, - { - "indexed": false, - "name": "x", - "type": "uint256" - }, - { - "indexed": false, - "name": "y", - "type": "uint256" - } - ], - "name": "EpochStart", - "type": "event" - }, - { - "constant": false, - "inputs": [ - { - "name": "value", - "type": "uint256" - } - ], - "name": "exchange", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "hash", - "type": "bytes32" - }, - { - "name": "to", - "type": "address" - }, - { - "name": "value", - "type": "uint256" - } - ], - "name": "transfer", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "x", - "type": "uint256" - }, - { - "name": "y", - "type": "uint256" - } - ], - "name": "confirmKeygen", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [], - "name": "confirmFundsTransfer", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "getNextParties", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "getParties", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "_epoch", - "type": "uint256" - } - ], - "name": "getParties", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "getNextThreshold", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "getThreshold", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "_epoch", - "type": "uint256" - } - ], - "name": "getThreshold", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "getStartBlock", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "_epoch", - "type": "uint256" - } - ], - "name": "getStartBlock", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "getNextRangeSize", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "_epoch", - "type": "uint256" - } - ], - "name": "getRangeSize", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "getRangeSize", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "_epoch", - "type": "uint256" - } - ], - "name": "getNonce", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "getNonce", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "getX", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "getY", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "getPartyId", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "a", - "type": "address" - } - ], - "name": "getNextPartyId", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "getValidators", - "outputs": [ - { - "name": "", - "type": "address[]" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "getNextValidators", - "outputs": [ - { - "name": "", - "type": "address[]" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [], - "name": "startVoting", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "validator", - "type": "address" - } - ], - "name": "voteAddValidator", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "validator", - "type": "address" - } - ], - "name": "voteRemoveValidator", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "threshold", - "type": "uint256" - } - ], - "name": "voteChangeThreshold", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "rangeSize", - "type": "uint256" - } - ], - "name": "voteChangeRangeSize", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [], - "name": "voteStartKeygen", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [], - "name": "voteCancelKeygen", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - } - ], - "metadata": "{\"compiler\":{\"version\":\"0.5.9+commit.e560f70d\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":true,\"inputs\":[{\"name\":\"_epoch\",\"type\":\"uint256\"}],\"name\":\"getStartBlock\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getNextParties\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getY\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"a\",\"type\":\"address\"}],\"name\":\"getNextPartyId\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"startVoting\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"status\",\"outputs\":[{\"name\":\"\",\"type\":\"uint8\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"rangeSize\",\"type\":\"uint256\"}],\"name\":\"voteChangeRangeSize\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"usedRange\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getRangeSize\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"votes\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getPartyId\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"voteCancelKeygen\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_epoch\",\"type\":\"uint256\"}],\"name\":\"getNonce\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"hash\",\"type\":\"bytes32\"},{\"name\":\"to\",\"type\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getNextValidators\",\"outputs\":[{\"name\":\"\",\"type\":\"address[]\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_epoch\",\"type\":\"uint256\"}],\"name\":\"getParties\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_epoch\",\"type\":\"uint256\"}],\"name\":\"getThreshold\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"dbTransfer\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getX\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"exchange\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"tokenContract\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"validator\",\"type\":\"address\"}],\"name\":\"voteAddValidator\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getNextThreshold\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"epoch\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"voteStartKeygen\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"validator\",\"type\":\"address\"}],\"name\":\"voteRemoveValidator\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getStartBlock\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"x\",\"type\":\"uint256\"},{\"name\":\"y\",\"type\":\"uint256\"}],\"name\":\"confirmKeygen\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getParties\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"votesCount\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"nextEpoch\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getValidators\",\"outputs\":[{\"name\":\"\",\"type\":\"address[]\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getNextRangeSize\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_epoch\",\"type\":\"uint256\"}],\"name\":\"getRangeSize\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"threshold\",\"type\":\"uint256\"}],\"name\":\"voteChangeThreshold\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getNonce\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"dbTransferCount\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"confirmFundsTransfer\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getThreshold\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"threshold\",\"type\":\"uint256\"},{\"name\":\"validators\",\"type\":\"address[]\"},{\"name\":\"_tokenContract\",\"type\":\"address\"},{\"name\":\"limits\",\"type\":\"uint256[2]\"},{\"name\":\"rangeSize\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"value\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"ExchangeRequest\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"oldEpoch\",\"type\":\"uint256\"},{\"indexed\":true,\"name\":\"newEpoch\",\"type\":\"uint256\"}],\"name\":\"NewEpoch\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"epoch\",\"type\":\"uint256\"}],\"name\":\"NewEpochCancelled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"oldEpoch\",\"type\":\"uint256\"},{\"indexed\":true,\"name\":\"newEpoch\",\"type\":\"uint256\"}],\"name\":\"NewFundsTransfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"epoch\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"x\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"y\",\"type\":\"uint256\"}],\"name\":\"EpochStart\",\"type\":\"event\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/build/contracts/Bridge.sol\":\"Bridge\"},\"evmVersion\":\"petersburg\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":3},\"remappings\":[]},\"sources\":{\"/build/contracts/Bridge.sol\":{\"keccak256\":\"0xedcf62b24f2b47b0e83af55ca6471e82e301f8287aa78e7c41bbca2d3ddc4155\",\"urls\":[\"bzzr://84b325be5714e21d85966ce976f9996d2f7d2305b467c191d37f6e91bb1901fb\",\"dweb:/ipfs/QmY1RVRv3H9E9T2VwmSdyKxAfQFMd7t9yYjcVFVpox9Lf8\"]},\"/build/contracts/openzeppelin-solidity/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0x90e8c2521653bbb1768b05889c5760031e688d9cd361f167489b89215e201b95\",\"urls\":[\"bzzr://aa8b45b57edafc3d67bc5d916327ea16807fae33f753ca163ae0c4061b789766\",\"dweb:/ipfs/QmP5NaEwZthQeM2ESz4WTT3osrP7jhbvu7ocbttBi2JAw6\"]}},\"version\":1}", - "bytecode": "0x60806040523480156200001157600080fd5b5060405162001f4838038062001f48833981810160405260c08110156200003757600080fd5b8151602083018051919392830192916401000000008111156200005957600080fd5b820160208101848111156200006d57600080fd5b81518560208202830111640100000000821117156200008b57600080fd5b505060208201516080830151825192955090935060409092019190620000b057600080fd5b83518510620000be57600080fd5b600b80546001600160a01b0385166001600160a01b0319909116179055600060078190556006805460ff19166002179055600160088190556040805160e08101825287815260208082018a905291810185905260608101849052600019608082015260a0810184905260c081018490529183529182528051805191927fada5013122d395ba3c54772283fb069b10426056ef8ca54750cb9bb552a59e7d926200016b9284920190620001f9565b506020820151600182015560408201516002820155606082015160038201556080820151600482015560a0820151600582015560c09091015160069091015581600060200201516009558160016020020151600a556040516001906000907f3ef85928df9ae51bdb3eb4c00ec73b92b82307f319ac1b029de14796a0972609908290a350505050506200028d565b82805482825590600052602060002090810192821562000251579160200282015b828111156200025157825182546001600160a01b0319166001600160a01b039091161782556020909201916001909101906200021a565b506200025f92915062000263565b5090565b6200028a91905b808211156200025f5780546001600160a01b03191681556001016200026a565b90565b611cab806200029d6000396000f3fe608060405234801561001057600080fd5b50600436106101cd5760003560e01c806301b2320e146101d2578063073ce82d146102015780630b7f166514610209578063197d6ca4146102115780631ec6b60a14610237578063200d2ed2146102415780632493b9fc1461026d5780632a2acafa1461028a5780632a4b93af146102bb5780632b38cd96146102c35780632fb0fc6f146102e057806339f0ebb1146102e85780633d46b819146102f05780633feb1bd81461030d57806340cddab31461033f578063447fe289146103975780634615d5e9146103b457806349f92f63146103d15780635197c7aa146103ee57806353556559146103f657806355a373d61461041357806357456f22146104375780638199d3fd1461045d578063900cf0cf14610465578063915eb0e71461046d5780639bf6a74a14610475578063a5f18c011461049b578063a7699d02146104a3578063a8311aa8146104c6578063aae46bab146104ce578063aea0e78b146104eb578063b7ab4db5146104f3578063c2668caf146104fb578063c3e3a45c14610503578063cc8ee06514610520578063d087d2881461053d578063d09fc00414610545578063df78523014610562578063e75235b81461056a575b600080fd5b6101ef600480360360208110156101e857600080fd5b5035610572565b60408051918252519081900360200190f35b6101ef61058a565b6101ef61059d565b6101ef6004803603602081101561022757600080fd5b50356001600160a01b03166105b5565b61023f610620565b005b610249610778565b6040518082600381111561025957fe5b60ff16815260200191505060405180910390f35b61023f6004803603602081101561028357600080fd5b5035610781565b6102a7600480360360208110156102a057600080fd5b5035610846565b604080519115158252519081900360200190f35b6101ef61085b565b6102a7600480360360208110156102d957600080fd5b5035610868565b6101ef61087d565b61023f6108e7565b6101ef6004803603602081101561030657600080fd5b50356109d3565b61023f6004803603606081101561032357600080fd5b508035906001600160a01b0360208201351690604001356109e8565b610347610b48565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561038357818101518382015260200161036b565b505050509050019250505060405180910390f35b6101ef600480360360208110156103ad57600080fd5b5035610bb3565b6101ef600480360360208110156103ca57600080fd5b5035610bc5565b6102a7600480360360208110156103e757600080fd5b5035610bda565b6101ef610bef565b61023f6004803603602081101561040c57600080fd5b5035610c07565b61041b610e1c565b604080516001600160a01b039092168252519081900360200190f35b61023f6004803603602081101561044d57600080fd5b50356001600160a01b0316610e2b565b6101ef610f63565b6101ef610f70565b61023f610f76565b61023f6004803603602081101561048b57600080fd5b50356001600160a01b031661105d565b6101ef611164565b61023f600480360360408110156104b957600080fd5b5080359060200135611171565b6101ef611304565b6101ef600480360360208110156104e457600080fd5b5035611311565b6101ef611323565b610347611329565b6101ef611392565b6101ef6004803603602081101561051957600080fd5b503561139b565b61023f6004803603602081101561053657600080fd5b50356113b0565b6101ef611471565b6101ef6004803603602081101561055b57600080fd5b503561147e565b61023f611490565b6101ef6115fc565b6000818152602081905260409020600301545b919050565b6000610597600854610bb3565b90505b90565b60075460009081526020819052604090206006015490565b600060606105c1610b48565b905060005b6105ce61058a565b81101561061657836001600160a01b03168282815181106105eb57fe5b60200260200101516001600160a01b0316141561060e5760010191506105859050565b6001016105c6565b5060009392505050565b600060065460ff16600381111561063357fe5b148061064f5750600160065460ff16600381111561064d57fe5b145b61069f576040805162461bcd60e51b815260206004820152601c60248201527b4e6f7420696e207265616479206f7220766f74696e6720737461746560201b604482015290519081900360640190fd5b6106a761087d565b6106e6576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b6106f06002611609565b15610776576008805460019081019091556006805460ff191690911790556107166115fc565b600854600090815260208190526040902060010155610733611329565b60085460009081526020818152604090912082516107579391929190910190611b27565b5061076061085b565b6008546000908152602081905260409020600201555b565b60065460ff1681565b600160065460ff16600381111561079457fe5b146107d4576040805162461bcd60e51b81526020600482015260136024820152600080516020611c0f833981519152604482015290519081900360640190fd5b6107dc61087d565b61081b576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b610826600682611660565b156108435760085460009081526020819052604090206002018190555b50565b60056020526000908152604090205460ff1681565b600061059760075461139b565b60046020526000908152604090205460ff1681565b60006060610889611329565b905060005b610896611304565b8110156108de57336001600160a01b03168282815181106108b357fe5b60200260200101516001600160a01b031614156108d657600101915061059a9050565b60010161088e565b50600091505090565b600260065460ff1660038111156108fa57fe5b14610942576040805162461bcd60e51b81526020600482015260136024820152724e6f7420696e206b657967656e20737461746560681b604482015290519081900360640190fd5b61094a61087d565b610989576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b6109936008611609565b15610776576006805460ff191660011790556008546040517fddbb65cfe1ae4aec03cef0f9667c6d7ba3740927d0c60f4dd4d7104cc31d180a90600090a2565b60009081526020819052604090206004015490565b600060065460ff1660038111156109fb57fe5b1480610a175750600160065460ff166003811115610a1557fe5b145b610a67576040805162461bcd60e51b815260206004820152601c60248201527b4e6f7420696e207265616479206f7220766f74696e6720737461746560201b604482015290519081900360640190fd5b610a6f61087d565b610aae576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b610abb60098484846116c0565b15610b4357600b546040805163a9059cbb60e01b81526001600160a01b038581166004830152602482018590529151919092169163a9059cbb9160448083019260209291908290030181600087803b158015610b1657600080fd5b505af1158015610b2a573d6000803e3d6000fd5b505050506040513d6020811015610b4057600080fd5b50505b505050565b60085460009081526020818152604091829020805483518184028101840190945280845260609392830182828015610ba957602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610b8b575b5050505050905090565b60009081526020819052604090205490565b60009081526020819052604090206001015490565b60026020526000908152604090205460ff1681565b60075460009081526020819052604090206005015490565b600060065460ff166003811115610c1a57fe5b14610c61576040805162461bcd60e51b81526020600482015260126024820152714e6f7420696e20726561647920737461746560701b604482015290519081900360640190fd5b6009548110158015610c7857506402540be4008110155b8015610c865750600a548111155b610c8f57600080fd5b6000610c9961085b565b610ca1611164565b430381610caa57fe5b60075460408051939092046020808501829052848401929092528251808503840181526060909401835283519382019390932060009081526005909152205490915060ff16610d4f57600780546040805160208082018690528183019390935281518082038301815260609091018252805190830120600090815260058352818120805460ff1916600190811790915593548152918290529020600401805490910190555b600b54604080516323b872dd60e01b81523360048201523060248201526044810185905290516001600160a01b03909216916323b872dd916064808201926020929091908290030181600087803b158015610da957600080fd5b505af1158015610dbd573d6000803e3d6000fd5b505050506040513d6020811015610dd357600080fd5b507f9273b6f22cee1ef3d7cdc2a9c031936003526bae368886259511f7dd40044b02905082610e00611471565b6040805192835260208301919091528051918290030190a15050565b600b546001600160a01b031681565b600160065460ff166003811115610e3e57fe5b14610e7e576040805162461bcd60e51b81526020600482015260136024820152600080516020611c0f833981519152604482015290519081900360640190fd5b610e8661087d565b610ec5576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b610ece816105b5565b15610f16576040805162461bcd60e51b815260206004820152601360248201527220b63932b0b23c9030903b30b634b230ba37b960691b604482015290519081900360640190fd5b610f2160038261173d565b15610843576008546000908152602081815260408220805460018101825590835291200180546001600160a01b0383166001600160a01b031990911617905550565b6000610597600854610bc5565b60075481565b600160065460ff166003811115610f8957fe5b14610fc9576040805162461bcd60e51b81526020600482015260136024820152600080516020611c0f833981519152604482015290519081900360640190fd5b610fd161087d565b611010576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b61101a6007611609565b15610776576006805460ff191660021790556008546007546040517f3ef85928df9ae51bdb3eb4c00ec73b92b82307f319ac1b029de14796a097260990600090a3565b600160065460ff16600381111561107057fe5b146110b0576040805162461bcd60e51b81526020600482015260136024820152600080516020611c0f833981519152604482015290519081900360640190fd5b6110b861087d565b6110f7576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b611100816105b5565b61114b576040805162461bcd60e51b815260206004820152601760248201527620b63932b0b23c903737ba1030903b30b634b230ba37b960491b604482015290519081900360640190fd5b61115660048261173d565b1561084357610843816117aa565b6000610597600754610572565b600260065460ff16600381111561118457fe5b146111cc576040805162461bcd60e51b81526020600482015260136024820152724e6f7420696e206b657967656e20737461746560681b604482015290519081900360640190fd5b6111d5336105b5565b61121d576040805162461bcd60e51b81526020600482015260146024820152732737ba1030903732bc3a103b30b634b230ba37b960611b604482015290519081900360640190fd5b611229600083836118e4565b15611300576008805460009081526020819052604080822060050185905582548252902060060182905554600114156112c3576006805460ff191690556008805460009081526020818152604080832043600390910155835483529182902060001960049091015591546007819055815185815292830184905281519092600080516020611bef83398151915292908290030190a2611300565b6006805460ff191660031790556008546007546040517ff4735b85cc98f9a712832825ecab4cfb1649d658f9a73c57a00ea7dde735c79b90600090a35b5050565b6000610597600754610bb3565b60036020526000908152604090205481565b60085481565b60075460009081526020818152604091829020805483518184028101840190945280845260609392830182828015610ba9576020028201919060005260206000209081546001600160a01b03168152600190910190602001808311610b8b575050505050905090565b60006105976008545b60009081526020819052604090206002015490565b600160065460ff1660038111156113c357fe5b14611403576040805162461bcd60e51b81526020600482015260136024820152600080516020611c0f833981519152604482015290519081900360640190fd5b61140b61087d565b61144a576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b611455600582611660565b1561084357600854600090815260208190526040902060010155565b60006105976007546109d3565b60016020526000908152604090205481565b600360065460ff1660038111156114a357fe5b146114f3576040805162461bcd60e51b815260206004820152601b60248201527a4e6f7420696e2066756e6473207472616e7366657220737461746560281b604482015290519081900360640190fd5b6114fb61087d565b61153a576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b60006007541161157b5760405162461bcd60e51b8152600401808060200182810382526028815260200180611c2f6028913960400191505060405180910390fd5b611585600161194d565b15610776576006805460ff191690556008805460009081526020819052604080822043600390910155825482529020600019600490910155546007819055600080516020611bef8339815191526115da610bef565b6115e261059d565b6040805192835260208301919091528051918290030190a2565b6000610597600754610bc5565b600080826008546040516020018083600981111561162357fe5b60ff1660f81b8152600101828152602001925050506040516020818303038152906040528051906020012090506116598161199d565b9392505050565b60008083600854846040516020018084600981111561167b57fe5b60ff1660f81b815260010183815260200182815260200193505050506040516020818303038152906040528051906020012090506116b88161199d565b949350505050565b60008085858585604051602001808560098111156116da57fe5b60ff1660f81b8152600101848152602001836001600160a01b03166001600160a01b031660601b81526014018281526020019450505050506040516020818303038152906040528051906020012090506117338161199d565b9695505050505050565b60008083600854846040516020018084600981111561175857fe5b60ff1660f81b8152600101838152602001826001600160a01b03166001600160a01b031660601b815260140193505050506040516020818303038152906040528051906020012090506116b88161199d565b60005b60016117b761058a565b0381101561188557600854600090815260208190526040902080546001600160a01b0384169190839081106117e857fe5b6000918252602090912001546001600160a01b0316141561187d5761180b610b48565b600161181561058a565b038151811061182057fe5b60200260200101516000806008548152602001908152602001600020600001828154811061184a57fe5b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550611885565b6001016117ad565b50600854600090815260208190526040902060016118a161058a565b03815481106118ac57fe5b6000918252602080832090910180546001600160a01b0319169055600854825281905260409020805490611300906000198301611b8c565b6000808460085485856040516020018085600981111561190057fe5b60ff1660f81b815260010184815260200183815260200182815260200194505050505060405160208183030381529060405280519060200120905061194481611a70565b95945050505050565b600080826008546040516020018083600981111561196757fe5b60ff1660f81b81526001018281526020019250505060405160208183030381529060405280519060200120905061165981611a70565b6000806119a983611af8565b60008181526004602052604090205490915060ff1615611a00576040805162461bcd60e51b815260206004820152600d60248201526c566f74656420616c726561647960981b604482015290519081900360640190fd5b6000818152600460205260409020805460ff19166001179055611a216115fc565b6000848152600360205260409020541415611a545750506000818152600360205260409020600160ff1b90556001610585565b5050600081815260036020526040812080546001019055610585565b600080611a7c83611af8565b60008181526004602052604090205490915060ff1615611ad7576040805162461bcd60e51b8152602060048201526011602482015270436f6e6669726d656420616c726561647960781b604482015290519081900360640190fd5b6000818152600460205260409020805460ff19166001179055611a21610f63565b604080516020808201939093523360601b81830152815180820360340181526054909101909152805191012090565b828054828255906000526020600020908101928215611b7c579160200282015b82811115611b7c57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190611b47565b50611b88929150611bb0565b5090565b815481835581811115610b4357600083815260209020610b43918101908301611bd4565b61059a91905b80821115611b885780546001600160a01b0319168155600101611bb6565b61059a91905b80821115611b885760008155600101611bda56fec33272939f066c227e913a4b3434d860794f185c551685c29451a3a38b9b259c4e6f7420696e20766f74696e672073746174650000000000000000000000000046697273742065706f636820646f6573206e6f74206e6565642066756e6473207472616e736665724e6f7420612063757272656e742076616c696461746f72000000000000000000a265627a7a72305820dfb70a1c283919f9128aabe00d30be35942e7ded3ecf2eb30af4168b8b02e15a64736f6c63430005090032", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101cd5760003560e01c806301b2320e146101d2578063073ce82d146102015780630b7f166514610209578063197d6ca4146102115780631ec6b60a14610237578063200d2ed2146102415780632493b9fc1461026d5780632a2acafa1461028a5780632a4b93af146102bb5780632b38cd96146102c35780632fb0fc6f146102e057806339f0ebb1146102e85780633d46b819146102f05780633feb1bd81461030d57806340cddab31461033f578063447fe289146103975780634615d5e9146103b457806349f92f63146103d15780635197c7aa146103ee57806353556559146103f657806355a373d61461041357806357456f22146104375780638199d3fd1461045d578063900cf0cf14610465578063915eb0e71461046d5780639bf6a74a14610475578063a5f18c011461049b578063a7699d02146104a3578063a8311aa8146104c6578063aae46bab146104ce578063aea0e78b146104eb578063b7ab4db5146104f3578063c2668caf146104fb578063c3e3a45c14610503578063cc8ee06514610520578063d087d2881461053d578063d09fc00414610545578063df78523014610562578063e75235b81461056a575b600080fd5b6101ef600480360360208110156101e857600080fd5b5035610572565b60408051918252519081900360200190f35b6101ef61058a565b6101ef61059d565b6101ef6004803603602081101561022757600080fd5b50356001600160a01b03166105b5565b61023f610620565b005b610249610778565b6040518082600381111561025957fe5b60ff16815260200191505060405180910390f35b61023f6004803603602081101561028357600080fd5b5035610781565b6102a7600480360360208110156102a057600080fd5b5035610846565b604080519115158252519081900360200190f35b6101ef61085b565b6102a7600480360360208110156102d957600080fd5b5035610868565b6101ef61087d565b61023f6108e7565b6101ef6004803603602081101561030657600080fd5b50356109d3565b61023f6004803603606081101561032357600080fd5b508035906001600160a01b0360208201351690604001356109e8565b610347610b48565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561038357818101518382015260200161036b565b505050509050019250505060405180910390f35b6101ef600480360360208110156103ad57600080fd5b5035610bb3565b6101ef600480360360208110156103ca57600080fd5b5035610bc5565b6102a7600480360360208110156103e757600080fd5b5035610bda565b6101ef610bef565b61023f6004803603602081101561040c57600080fd5b5035610c07565b61041b610e1c565b604080516001600160a01b039092168252519081900360200190f35b61023f6004803603602081101561044d57600080fd5b50356001600160a01b0316610e2b565b6101ef610f63565b6101ef610f70565b61023f610f76565b61023f6004803603602081101561048b57600080fd5b50356001600160a01b031661105d565b6101ef611164565b61023f600480360360408110156104b957600080fd5b5080359060200135611171565b6101ef611304565b6101ef600480360360208110156104e457600080fd5b5035611311565b6101ef611323565b610347611329565b6101ef611392565b6101ef6004803603602081101561051957600080fd5b503561139b565b61023f6004803603602081101561053657600080fd5b50356113b0565b6101ef611471565b6101ef6004803603602081101561055b57600080fd5b503561147e565b61023f611490565b6101ef6115fc565b6000818152602081905260409020600301545b919050565b6000610597600854610bb3565b90505b90565b60075460009081526020819052604090206006015490565b600060606105c1610b48565b905060005b6105ce61058a565b81101561061657836001600160a01b03168282815181106105eb57fe5b60200260200101516001600160a01b0316141561060e5760010191506105859050565b6001016105c6565b5060009392505050565b600060065460ff16600381111561063357fe5b148061064f5750600160065460ff16600381111561064d57fe5b145b61069f576040805162461bcd60e51b815260206004820152601c60248201527b4e6f7420696e207265616479206f7220766f74696e6720737461746560201b604482015290519081900360640190fd5b6106a761087d565b6106e6576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b6106f06002611609565b15610776576008805460019081019091556006805460ff191690911790556107166115fc565b600854600090815260208190526040902060010155610733611329565b60085460009081526020818152604090912082516107579391929190910190611b27565b5061076061085b565b6008546000908152602081905260409020600201555b565b60065460ff1681565b600160065460ff16600381111561079457fe5b146107d4576040805162461bcd60e51b81526020600482015260136024820152600080516020611c0f833981519152604482015290519081900360640190fd5b6107dc61087d565b61081b576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b610826600682611660565b156108435760085460009081526020819052604090206002018190555b50565b60056020526000908152604090205460ff1681565b600061059760075461139b565b60046020526000908152604090205460ff1681565b60006060610889611329565b905060005b610896611304565b8110156108de57336001600160a01b03168282815181106108b357fe5b60200260200101516001600160a01b031614156108d657600101915061059a9050565b60010161088e565b50600091505090565b600260065460ff1660038111156108fa57fe5b14610942576040805162461bcd60e51b81526020600482015260136024820152724e6f7420696e206b657967656e20737461746560681b604482015290519081900360640190fd5b61094a61087d565b610989576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b6109936008611609565b15610776576006805460ff191660011790556008546040517fddbb65cfe1ae4aec03cef0f9667c6d7ba3740927d0c60f4dd4d7104cc31d180a90600090a2565b60009081526020819052604090206004015490565b600060065460ff1660038111156109fb57fe5b1480610a175750600160065460ff166003811115610a1557fe5b145b610a67576040805162461bcd60e51b815260206004820152601c60248201527b4e6f7420696e207265616479206f7220766f74696e6720737461746560201b604482015290519081900360640190fd5b610a6f61087d565b610aae576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b610abb60098484846116c0565b15610b4357600b546040805163a9059cbb60e01b81526001600160a01b038581166004830152602482018590529151919092169163a9059cbb9160448083019260209291908290030181600087803b158015610b1657600080fd5b505af1158015610b2a573d6000803e3d6000fd5b505050506040513d6020811015610b4057600080fd5b50505b505050565b60085460009081526020818152604091829020805483518184028101840190945280845260609392830182828015610ba957602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610b8b575b5050505050905090565b60009081526020819052604090205490565b60009081526020819052604090206001015490565b60026020526000908152604090205460ff1681565b60075460009081526020819052604090206005015490565b600060065460ff166003811115610c1a57fe5b14610c61576040805162461bcd60e51b81526020600482015260126024820152714e6f7420696e20726561647920737461746560701b604482015290519081900360640190fd5b6009548110158015610c7857506402540be4008110155b8015610c865750600a548111155b610c8f57600080fd5b6000610c9961085b565b610ca1611164565b430381610caa57fe5b60075460408051939092046020808501829052848401929092528251808503840181526060909401835283519382019390932060009081526005909152205490915060ff16610d4f57600780546040805160208082018690528183019390935281518082038301815260609091018252805190830120600090815260058352818120805460ff1916600190811790915593548152918290529020600401805490910190555b600b54604080516323b872dd60e01b81523360048201523060248201526044810185905290516001600160a01b03909216916323b872dd916064808201926020929091908290030181600087803b158015610da957600080fd5b505af1158015610dbd573d6000803e3d6000fd5b505050506040513d6020811015610dd357600080fd5b507f9273b6f22cee1ef3d7cdc2a9c031936003526bae368886259511f7dd40044b02905082610e00611471565b6040805192835260208301919091528051918290030190a15050565b600b546001600160a01b031681565b600160065460ff166003811115610e3e57fe5b14610e7e576040805162461bcd60e51b81526020600482015260136024820152600080516020611c0f833981519152604482015290519081900360640190fd5b610e8661087d565b610ec5576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b610ece816105b5565b15610f16576040805162461bcd60e51b815260206004820152601360248201527220b63932b0b23c9030903b30b634b230ba37b960691b604482015290519081900360640190fd5b610f2160038261173d565b15610843576008546000908152602081815260408220805460018101825590835291200180546001600160a01b0383166001600160a01b031990911617905550565b6000610597600854610bc5565b60075481565b600160065460ff166003811115610f8957fe5b14610fc9576040805162461bcd60e51b81526020600482015260136024820152600080516020611c0f833981519152604482015290519081900360640190fd5b610fd161087d565b611010576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b61101a6007611609565b15610776576006805460ff191660021790556008546007546040517f3ef85928df9ae51bdb3eb4c00ec73b92b82307f319ac1b029de14796a097260990600090a3565b600160065460ff16600381111561107057fe5b146110b0576040805162461bcd60e51b81526020600482015260136024820152600080516020611c0f833981519152604482015290519081900360640190fd5b6110b861087d565b6110f7576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b611100816105b5565b61114b576040805162461bcd60e51b815260206004820152601760248201527620b63932b0b23c903737ba1030903b30b634b230ba37b960491b604482015290519081900360640190fd5b61115660048261173d565b1561084357610843816117aa565b6000610597600754610572565b600260065460ff16600381111561118457fe5b146111cc576040805162461bcd60e51b81526020600482015260136024820152724e6f7420696e206b657967656e20737461746560681b604482015290519081900360640190fd5b6111d5336105b5565b61121d576040805162461bcd60e51b81526020600482015260146024820152732737ba1030903732bc3a103b30b634b230ba37b960611b604482015290519081900360640190fd5b611229600083836118e4565b15611300576008805460009081526020819052604080822060050185905582548252902060060182905554600114156112c3576006805460ff191690556008805460009081526020818152604080832043600390910155835483529182902060001960049091015591546007819055815185815292830184905281519092600080516020611bef83398151915292908290030190a2611300565b6006805460ff191660031790556008546007546040517ff4735b85cc98f9a712832825ecab4cfb1649d658f9a73c57a00ea7dde735c79b90600090a35b5050565b6000610597600754610bb3565b60036020526000908152604090205481565b60085481565b60075460009081526020818152604091829020805483518184028101840190945280845260609392830182828015610ba9576020028201919060005260206000209081546001600160a01b03168152600190910190602001808311610b8b575050505050905090565b60006105976008545b60009081526020819052604090206002015490565b600160065460ff1660038111156113c357fe5b14611403576040805162461bcd60e51b81526020600482015260136024820152600080516020611c0f833981519152604482015290519081900360640190fd5b61140b61087d565b61144a576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b611455600582611660565b1561084357600854600090815260208190526040902060010155565b60006105976007546109d3565b60016020526000908152604090205481565b600360065460ff1660038111156114a357fe5b146114f3576040805162461bcd60e51b815260206004820152601b60248201527a4e6f7420696e2066756e6473207472616e7366657220737461746560281b604482015290519081900360640190fd5b6114fb61087d565b61153a576040805162461bcd60e51b81526020600482015260176024820152600080516020611c57833981519152604482015290519081900360640190fd5b60006007541161157b5760405162461bcd60e51b8152600401808060200182810382526028815260200180611c2f6028913960400191505060405180910390fd5b611585600161194d565b15610776576006805460ff191690556008805460009081526020819052604080822043600390910155825482529020600019600490910155546007819055600080516020611bef8339815191526115da610bef565b6115e261059d565b6040805192835260208301919091528051918290030190a2565b6000610597600754610bc5565b600080826008546040516020018083600981111561162357fe5b60ff1660f81b8152600101828152602001925050506040516020818303038152906040528051906020012090506116598161199d565b9392505050565b60008083600854846040516020018084600981111561167b57fe5b60ff1660f81b815260010183815260200182815260200193505050506040516020818303038152906040528051906020012090506116b88161199d565b949350505050565b60008085858585604051602001808560098111156116da57fe5b60ff1660f81b8152600101848152602001836001600160a01b03166001600160a01b031660601b81526014018281526020019450505050506040516020818303038152906040528051906020012090506117338161199d565b9695505050505050565b60008083600854846040516020018084600981111561175857fe5b60ff1660f81b8152600101838152602001826001600160a01b03166001600160a01b031660601b815260140193505050506040516020818303038152906040528051906020012090506116b88161199d565b60005b60016117b761058a565b0381101561188557600854600090815260208190526040902080546001600160a01b0384169190839081106117e857fe5b6000918252602090912001546001600160a01b0316141561187d5761180b610b48565b600161181561058a565b038151811061182057fe5b60200260200101516000806008548152602001908152602001600020600001828154811061184a57fe5b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550611885565b6001016117ad565b50600854600090815260208190526040902060016118a161058a565b03815481106118ac57fe5b6000918252602080832090910180546001600160a01b0319169055600854825281905260409020805490611300906000198301611b8c565b6000808460085485856040516020018085600981111561190057fe5b60ff1660f81b815260010184815260200183815260200182815260200194505050505060405160208183030381529060405280519060200120905061194481611a70565b95945050505050565b600080826008546040516020018083600981111561196757fe5b60ff1660f81b81526001018281526020019250505060405160208183030381529060405280519060200120905061165981611a70565b6000806119a983611af8565b60008181526004602052604090205490915060ff1615611a00576040805162461bcd60e51b815260206004820152600d60248201526c566f74656420616c726561647960981b604482015290519081900360640190fd5b6000818152600460205260409020805460ff19166001179055611a216115fc565b6000848152600360205260409020541415611a545750506000818152600360205260409020600160ff1b90556001610585565b5050600081815260036020526040812080546001019055610585565b600080611a7c83611af8565b60008181526004602052604090205490915060ff1615611ad7576040805162461bcd60e51b8152602060048201526011602482015270436f6e6669726d656420616c726561647960781b604482015290519081900360640190fd5b6000818152600460205260409020805460ff19166001179055611a21610f63565b604080516020808201939093523360601b81830152815180820360340181526054909101909152805191012090565b828054828255906000526020600020908101928215611b7c579160200282015b82811115611b7c57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190611b47565b50611b88929150611bb0565b5090565b815481835581811115610b4357600083815260209020610b43918101908301611bd4565b61059a91905b80821115611b885780546001600160a01b0319168155600101611bb6565b61059a91905b80821115611b885760008155600101611bda56fec33272939f066c227e913a4b3434d860794f185c551685c29451a3a38b9b259c4e6f7420696e20766f74696e672073746174650000000000000000000000000046697273742065706f636820646f6573206e6f74206e6565642066756e6473207472616e736665724e6f7420612063757272656e742076616c696461746f72000000000000000000a265627a7a72305820dfb70a1c283919f9128aabe00d30be35942e7ded3ecf2eb30af4168b8b02e15a64736f6c63430005090032", - "sourceMap": "93:11259:0:-;;;1516:530;8:9:-1;5:2;;;30:1;27;20:12;5:2;1516:530:0;;;;;;;;;;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;1516:530:0;;;;;;;;;;;;;;19:11:-1;11:20;;8:2;;;44:1;41;34:12;8:2;62:21;;123:4;114:14;;138:31;;;135:2;;;182:1;179;172:12;135:2;219:3;213:10;331:9;325:2;311:12;307:21;289:16;285:44;282:59;261:11;247:12;244:29;233:116;230:2;;;362:1;359;352:12;230:2;-1:-1;;1516:530:0;;;;;;;;1661:17;;1516:530;;-1:-1:-1;1516:530:0;;-1:-1:-1;1516:530:0;;;;;;1653:30;;;;;;1713:10;:17;1701:9;:29;1693:38;;;;;;1742:13;:38;;-1:-1:-1;;;;;1742:38:0;;-1:-1:-1;;;;;;1742:38:0;;;;;;-1:-1:-1;1791:5:0;:9;;;1810:6;:22;;-1:-1:-1;;1810:22:0;1819:13;1810:22;;;-1:-1:-1;1842:9:0;:13;;;1886:58;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;1886:58:0;;;;;;;;;;;;;;;;1866:17;;;;;;:78;;;;1886:58;;1866:17;;:78;;:17;;:78;;;:::i;:::-;-1:-1:-1;1866:78:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1968:6;-1:-1:-1;1968:9:0;;;;1955:10;:22;2000:6;2007:1;2000:9;;;;1987:10;:22;2025:14;;2037:1;;2034;;2025:14;;2034:1;;2025:14;1516:530;;;;;93:11259;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;93:11259:0;-1:-1:-1;;;;;93:11259:0;;;;;;;;;;;-1:-1:-1;93:11259:0;;;;;;;-1:-1:-1;93:11259:0;;;-1:-1:-1;93:11259:0;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;-1:-1:-1;;;;;;93:11259:0;;;;;;;;;:::o;:::-;;;;;;;", - "deployedSourceMap": "93:11259:0:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;93:11259:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5418:112;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;5418:112:0;;:::i;:::-;;;;;;;;;;;;;;;;4766:98;;;:::i;6148:82::-;;;:::i;6506:276::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;6506:276:0;-1:-1:-1;;;;;6506:276:0;;:::i;7032:357::-;;;:::i;:::-;;1395:20;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8607:204;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;8607:204:0;;:::i;1347:41::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1347:41:0;;:::i;:::-;;;;;;;;;;;;;;;;;;5536:94;;;:::i;1304:37::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1304:37:0;;:::i;6236:264::-;;;:::i;9022:203::-;;;:::i;5952:102::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;5952:102:0;;:::i;3310:213::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;3310:213:0;;;-1:-1:-1;;;;;3310:213:0;;;;;;;;;;:::i;6906:120::-;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:100:-1;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;6906:120:0;;;;;;;;;;;;;;;;;4870:116;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;4870:116:0;;:::i;5200:110::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;5200:110:0;;:::i;1208:42::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1208:42:0;;:::i;6060:82::-;;;:::i;2786:518::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;2786:518:0;;:::i;2052:27::-;;;:::i;:::-;;;;-1:-1:-1;;;;;2052:27:0;;;;;;;;;;;;;;7395:278;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;7395:278:0;-1:-1:-1;;;;;7395:278:0;;:::i;5092:102::-;;;:::i;1422:17::-;;;:::i;8817:199::-;;;:::i;7679:271::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;7679:271:0;-1:-1:-1;;;;;7679:271:0;;:::i;5316:96::-;;;:::i;3529:691::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;3529:691:0;;;;;;;:::i;4670:90::-;;;:::i;1256:42::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1256:42:0;;:::i;1445:21::-;;;:::i;6788:112::-;;;:::i;5636:102::-;;;:::i;5744:110::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;5744:110:0;;:::i;8398:203::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;8398:203:0;;:::i;5860:86::-;;;:::i;1155:47::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1155:47:0;;:::i;4226:438::-;;;:::i;4992:94::-;;;:::i;5418:112::-;5475:4;5498:14;;;;;;;;;;:25;;;5418:112;;;;:::o;4766:98::-;4813:4;4836:21;4847:9;;4836:10;:21::i;:::-;4829:28;;4766:98;;:::o;6148:82::-;6215:5;;6185:4;6208:13;;;;;;;;;;:15;;;6148:82;:::o;6506:276::-;6562:4;6578:27;6608:19;:17;:19::i;:::-;6578:49;-1:-1:-1;6642:6:0;6637:121;6658:16;:14;:16::i;:::-;6654:1;:20;6637:121;;;6716:1;-1:-1:-1;;;;;6699:18:0;:10;6710:1;6699:13;;;;;;;;;;;;;;-1:-1:-1;;;;;6699:18:0;;6695:52;;;6746:1;6742:5;;-1:-1:-1;6735:12:0;;-1:-1:-1;6735:12:0;6695:52;6676:3;;6637:121;;;-1:-1:-1;6774:1:0;;6506:276;-1:-1:-1;;;6506:276:0:o;7032:357::-;2239:12;2229:6;;;;:22;;;;;;;;;:49;;;-1:-1:-1;2265:13:0;2255:6;;;;:23;;;;;;;;;2229:49;2221:90;;;;;-1:-1:-1;;;2221:90:0;;;;;;;;;;;;-1:-1:-1;;;2221:90:0;;;;;;;;;;;;;;;2717:12;:10;:12::i;:::-;2709:53;;;;;-1:-1:-1;;;2709:53:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2709:53:0;;;;;;;;;;;;;;;7107:26;7115:17;7107:7;:26::i;:::-;7103:280;;;7149:9;:11;;;;;;;;;7174:6;:22;;-1:-1:-1;;7174:22:0;;;;;;7240:14;:12;:14::i;:::-;7217:9;;7210:6;:17;;;;;;;;;;:27;;:44;7299:15;:13;:15::i;:::-;7275:9;;7268:6;:17;;;;;;;;;;;:46;;;;:17;;:46;;;;;;:::i;:::-;;7358:14;:12;:14::i;:::-;7335:9;;7328:6;:17;;;;;;;;;;:27;;:44;7103:280;7032:357::o;1395:20::-;;;;;;:::o;8607:204::-;2379:13;2369:6;;;;:23;;;;;;;;;2361:55;;;;;-1:-1:-1;;;2361:55:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2361:55:0;;;;;;;;;;;;;;;2717:12;:10;:12::i;:::-;2709:53;;;;;-1:-1:-1;;;2709:53:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2709:53:0;;;;;;;;;;;;;;;8697:42;8705:22;8729:9;8697:7;:42::i;:::-;8693:112;;;8762:9;;8755:6;:17;;;;;;;;;;:27;;:39;;;8693:112;8607:204;:::o;1347:41::-;;;;;;;;;;;;;;;:::o;5536:94::-;5581:4;5604:19;5617:5;;5604:12;:19::i;1304:37::-;;;;;;;;;;;;;;;:::o;6236:264::-;6279:4;6295:27;6325:15;:13;:15::i;:::-;6295:45;-1:-1:-1;6355:6:0;6350:126;6371:12;:10;:12::i;:::-;6367:1;:16;6350:126;;;6425:10;-1:-1:-1;;;;;6408:27:0;:10;6419:1;6408:13;;;;;;;;;;;;;;-1:-1:-1;;;;;6408:27:0;;6404:61;;;6464:1;6460:5;;-1:-1:-1;6453:12:0;;-1:-1:-1;6453:12:0;6404:61;6385:3;;6350:126;;;;6492:1;6485:8;;;6236:264;:::o;9022:203::-;2484:13;2474:6;;;;:23;;;;;;;;;2466:55;;;;;-1:-1:-1;;;2466:55:0;;;;;;;;;;;;-1:-1:-1;;;2466:55:0;;;;;;;;;;;;;;;2717:12;:10;:12::i;:::-;2709:53;;;;;-1:-1:-1;;;2709:53:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2709:53:0;;;;;;;;;;;;;;;9095:27;9103:18;9095:7;:27::i;:::-;9091:128;;;9138:6;:22;;-1:-1:-1;;9138:22:0;9147:13;9138:22;;;9198:9;;9180:28;;;;-1:-1:-1;;9180:28:0;9022:203::o;5952:102::-;6004:4;6027:14;;;;;;;;;;:20;;;;5952:102::o;3310:213::-;2239:12;2229:6;;;;:22;;;;;;;;;:49;;;-1:-1:-1;2265:13:0;2255:6;;;;:23;;;;;;;;;2229:49;2221:90;;;;;-1:-1:-1;;;2221:90:0;;;;;;;;;;;;-1:-1:-1;;;2221:90:0;;;;;;;;;;;;;;;2717:12;:10;:12::i;:::-;2709:53;;;;;-1:-1:-1;;;2709:53:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2709:53:0;;;;;;;;;;;;;;;3418:39;3426:13;3441:4;3447:2;3451:5;3418:7;:39::i;:::-;3414:103;;;3473:13;;:33;;;-1:-1:-1;;;3473:33:0;;-1:-1:-1;;;;;3473:33:0;;;;;;;;;;;;;;;:13;;;;;:22;;:33;;;;;;;;;;;;;;:13;;:33;;;5:2:-1;;;;30:1;27;20:12;5:2;3473:33:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3473:33:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;3414:103:0;3310:213;;;:::o;6906:120::-;6998:9;;6991:6;:17;;;;;;;;;;;;6984:35;;;;;;;;;;;;;;;;;6956:16;;6984:35;;;6991:17;6984:35;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;6984:35:0;;;;;;;;;;;;;;;;;;;;;;;6906:120;:::o;4870:116::-;4924:4;4947:14;;;;;;;;;;:32;;4870:116::o;5200:110::-;5256:4;5279:14;;;;;;;;;;:24;;;;5200:110::o;1208:42::-;;;;;;;;;;;;;;;:::o;6060:82::-;6127:5;;6097:4;6120:13;;;;;;;;;;:15;;;6060:82;:::o;2786:518::-;2129:12;2119:6;;;;:22;;;;;;;;;2111:53;;;;;-1:-1:-1;;;2111:53:0;;;;;;;;;;;;-1:-1:-1;;;2111:53:0;;;;;;;;;;;;;;;2856:10;;2847:5;:19;;:40;;;;;2879:8;2870:5;:17;;2847:40;:63;;;;;2900:10;;2891:5;:19;;2847:63;2839:72;;;;;;2922:12;2972:14;:12;:14::i;:::-;2953:15;:13;:15::i;:::-;2938:12;:30;2937:49;;;;;3047:5;;3021:32;;;2937:49;;;;3021:32;;;;;;;;;;;;;;;;26:21:-1;;;22:32;;6:49;;3021:32:0;;;;;;3011:43;;;;;;;;;3001:54;;;;:9;:54;;;;;2937:49;;-1:-1:-1;3001:54:0;;2996:182;;3117:5;;;3091:32;;;;;;;;;;;;;;;;;;;26:21:-1;;;22:32;;6:49;;3091:32:0;;;;;;3081:43;;;;;;3071:54;;;;:9;:54;;;;;:61;;-1:-1:-1;;3071:61:0;3128:4;3071:61;;;;;;3153:5;;3146:13;;;;;;;;:19;;:21;;;;;;;2996:182;3188:13;;:60;;;-1:-1:-1;;;3188:60:0;;3215:10;3188:60;;;;3235:4;3188:60;;;;;;;;;;;;-1:-1:-1;;;;;3188:13:0;;;;:26;;:60;;;;;;;;;;;;;;;:13;;:60;;;5:2:-1;;;;30:1;27;20:12;5:2;3188:60:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3188:60:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;3263:34:0;;-1:-1:-1;3279:5:0;3286:10;:8;:10::i;:::-;3263:34;;;;;;;;;;;;;;;;;;;;;;2174:1;2786:518;:::o;2052:27::-;;;-1:-1:-1;;;;;2052:27:0;;:::o;7395:278::-;2379:13;2369:6;;;;:23;;;;;;;;;2361:55;;;;;-1:-1:-1;;;2361:55:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2361:55:0;;;;;;;;;;;;;;;2717:12;:10;:12::i;:::-;2709:53;;;;;-1:-1:-1;;;2709:53:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2709:53:0;;;;;;;;;;;;;;;7489:25;7504:9;7489:14;:25::i;:::-;:30;7481:62;;;;;-1:-1:-1;;;7481:62:0;;;;;;;;;;;;-1:-1:-1;;;7481:62:0;;;;;;;;;;;;;;;7558:38;7566:18;7586:9;7558:7;:38::i;:::-;7554:113;;;7619:9;;7612:6;:17;;;;;;;;;;27:10:-1;;39:1;23:18;;45:23;;7612:44:0;;;;;;;;-1:-1:-1;;;;;7612:44:0;;-1:-1:-1;;;;;;7612:44:0;;;;;;7395:278;:::o;5092:102::-;5141:4;5164:23;5177:9;;5164:12;:23::i;1422:17::-;;;;:::o;8817:199::-;2379:13;2369:6;;;;:23;;;;;;;;;2361:55;;;;;-1:-1:-1;;;2361:55:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2361:55:0;;;;;;;;;;;;;;;2717:12;:10;:12::i;:::-;2709:53;;;;;-1:-1:-1;;;2709:53:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2709:53:0;;;;;;;;;;;;;;;8889:26;8897:17;8889:7;:26::i;:::-;8885:125;;;8931:6;:22;;-1:-1:-1;;8931:22:0;8940:13;8931:22;;;8989:9;;8982:5;;8973:26;;;;-1:-1:-1;;8973:26:0;8817:199::o;7679:271::-;2379:13;2369:6;;;;:23;;;;;;;;;2361:55;;;;;-1:-1:-1;;;2361:55:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2361:55:0;;;;;;;;;;;;;;;2717:12;:10;:12::i;:::-;2709:53;;;;;-1:-1:-1;;;2709:53:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2709:53:0;;;;;;;;;;;;;;;7776:25;7791:9;7776:14;:25::i;:::-;7768:66;;;;;-1:-1:-1;;;7768:66:0;;;;;;;;;;;;-1:-1:-1;;;7768:66:0;;;;;;;;;;;;;;;7849:41;7857:21;7880:9;7849:7;:41::i;:::-;7845:99;;;7906:27;7923:9;7906:16;:27::i;5316:96::-;5362:4;5385:20;5399:5;;5385:13;:20::i;3529:691::-;2484:13;2474:6;;;;:23;;;;;;;;;2466:55;;;;;-1:-1:-1;;;2466:55:0;;;;;;;;;;;;-1:-1:-1;;;2466:55:0;;;;;;;;;;;;;;;3600:26;3615:10;3600:14;:26::i;:::-;3592:64;;;;;-1:-1:-1;;;3592:64:0;;;;;;;;;;;;-1:-1:-1;;;3592:64:0;;;;;;;;;;;;;;;3671:37;3682:19;3703:1;3706;3671:10;:37::i;:::-;3667:547;;;3731:9;;;3724:6;:17;;;;;;;;;;;:19;;:23;;;3768:9;;3761:17;;;;:19;;:23;;;3802:9;3815:1;3802:14;3798:406;;;3836:6;:21;;-1:-1:-1;;3836:21:0;;;3882:9;;;3845:12;3875:17;;;;;;;;;;;3906:12;3875:28;;;;:43;3943:9;;3936:17;;;;;;-1:-1:-1;;3936:23:0;;;;:34;3996:9;;3988:5;:17;;;4028:23;;;;;;;;;;;;;3996:9;;-1:-1:-1;;;;;;;;;;;4028:23:0;;;;;;;;3798:406;;;4102:6;:30;;-1:-1:-1;;4102:30:0;4111:21;4102:30;;;4179:9;;4172:5;;4155:34;;;;-1:-1:-1;;4155:34:0;3798:406;3529:691;;:::o;4670:90::-;4713:4;4736:17;4747:5;;4736:10;:17::i;1256:42::-;;;;;;;;;;;;;:::o;1445:21::-;;;;:::o;6788:112::-;6876:5;;6869:6;:13;;;;;;;;;;;;6862:31;;;;;;;;;;;;;;;;;6834:16;;6862:31;;;6869:13;6862:31;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;6862:31:0;;;;;;;;;;;;;;;;;;;;;;6788:112;:::o;5636:102::-;5685:4;5708:23;5721:9;;5744:110;5800:4;5823:14;;;;;;;;;;:24;;;;5744:110::o;8398:203::-;2379:13;2369:6;;;;:23;;;;;;;;;2361:55;;;;;-1:-1:-1;;;2361:55:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2361:55:0;;;;;;;;;;;;;;;2717:12;:10;:12::i;:::-;2709:53;;;;;-1:-1:-1;;;2709:53:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2709:53:0;;;;;;;;;;;;;;;8488:41;8496:21;8519:9;8488:7;:41::i;:::-;8484:111;;;8552:9;;8545:6;:17;;;;;;;;;;:27;;:39;8398:203::o;5860:86::-;5901:4;5924:15;5933:5;;5924:8;:15::i;1155:47::-;;;;;;;;;;;;;:::o;4226:438::-;2596:21;2586:6;;;;:31;;;;;;;;;2578:71;;;;;-1:-1:-1;;;2578:71:0;;;;;;;;;;;;-1:-1:-1;;;2578:71:0;;;;;;;;;;;;;;;2717:12;:10;:12::i;:::-;2709:53;;;;;-1:-1:-1;;;2709:53:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2709:53:0;;;;;;;;;;;;;;;4322:1;4314:5;;:9;4306:62;;;;-1:-1:-1;;;4306:62:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4383:39;4394:27;4383:10;:39::i;:::-;4379:279;;;4438:6;:21;;-1:-1:-1;;4438:21:0;;;4480:9;;;4447:12;4473:17;;;;;;;;;;;4504:12;4473:28;;;;:43;4537:9;;4530:17;;;;-1:-1:-1;;4530:23:0;;;;:34;4586:9;4578:5;:17;;;-1:-1:-1;;;;;;;;;;;4632:6:0;:4;:6::i;:::-;4640;:4;:6::i;:::-;4614:33;;;;;;;;;;;;;;;;;;;;;;4226:438::o;4992:94::-;5037:4;5060:19;5073:5;;5060:12;:19::i;9231:165::-;9280:4;9296:12;9338:8;9348:9;;9321:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;9321:37:0;;;9311:48;;;;;;9296:63;;9376:13;9384:4;9376:7;:13::i;:::-;9369:20;9231:165;-1:-1:-1;;;9231:165:0:o;9593:180::-;9652:4;9668:12;9710:8;9720:9;;9731:3;9693:42;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;9693:42:0;;;9683:53;;;;;;9668:68;;9753:13;9761:4;9753:7;:13::i;:::-;9746:20;9593:180;-1:-1:-1;;;;9593:180:0:o;9779:209::-;9866:4;9882:12;9924:8;9934:4;9940:2;9944:5;9907:43;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;9907:43:0;-1:-1:-1;;;;;9907:43:0;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;9907:43:0;;;9897:54;;;;;;9882:69;;9968:13;9976:4;9968:7;:13::i;:::-;9961:20;9779:209;-1:-1:-1;;;;;;9779:209:0:o;9402:185::-;9465:4;9481:12;9523:8;9533:9;;9544:4;9506:43;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;9506:43:0;-1:-1:-1;;;;;9506:43:0;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;9506:43:0;;;9496:54;;;;;;9481:69;;9567:13;9575:4;9567:7;:13::i;7956:436::-;8024:6;8019:253;8059:1;8040:16;:14;:16::i;:::-;:20;8036:1;:24;8019:253;;;8092:9;;8085:6;:17;;;;;;;;;;:31;;-1:-1:-1;;;;;8085:44:0;;;:17;8114:1;;8085:31;;;;;;;;;;;;;;;;-1:-1:-1;;;;;8085:31:0;:44;8081:181;;;8183:19;:17;:19::i;:::-;8222:1;8203:16;:14;:16::i;:::-;:20;8183:41;;;;;;;;;;;;;;8149:6;:17;8156:9;;8149:17;;;;;;;;;;;:28;;8178:1;8149:31;;;;;;;;;;;;;;;;:75;;;;;-1:-1:-1;;;;;8149:75:0;;;;;-1:-1:-1;;;;;8149:75:0;;;;;;8242:5;;8081:181;8062:3;;8019:253;;;-1:-1:-1;8295:9:0;;8288:6;:17;;;;;;;;;;8336:1;8317:16;:14;:16::i;:::-;:20;8288:50;;;;;;;;;;;;;;;;;;;8281:57;;-1:-1:-1;;;;;;8281:57:0;;;8355:9;;8348:17;;;;;;;;:37;;;;;-1:-1:-1;;8348:37:0;;;:::i;10171:193::-;10239:4;10255:12;10297:8;10307:9;;10318:1;10321;10280:43;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;10280:43:0;;;10270:54;;;;;;10255:69;;10341:16;10352:4;10341:10;:16::i;:::-;10334:23;10171:193;-1:-1:-1;;;;;10171:193:0:o;9994:171::-;10046:4;10062:12;10104:8;10114:9;;10087:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;10087:37:0;;;10077:48;;;;;;10062:63;;10142:16;10153:4;10142:10;:16::i;10370:409::-;10418:4;10434:20;10457:21;10473:4;10457:15;:21::i;:::-;10497:19;;;;:5;:19;;;;;;10434:44;;-1:-1:-1;10497:19:0;;10496:20;10488:46;;;;;-1:-1:-1;;;10488:46:0;;;;;;;;;;;;-1:-1:-1;;;10488:46:0;;;;;;;;;;;;;;;10545:19;;;;:5;:19;;;;;:26;;-1:-1:-1;;10545:26:0;10567:4;10545:26;;;10605:14;:12;:14::i;:::-;10585:16;;;;:10;:16;;;;;;:34;10581:192;;;-1:-1:-1;;10635:16:0;;;;:10;:16;;;;;-1:-1:-1;;;10635:27:0;;10683:4;10676:11;;10581:192;-1:-1:-1;;10718:16:0;;;;:10;:16;;;;;:18;;;;;;10750:12;;10785:420;10836:4;10852:20;10875:21;10891:4;10875:15;:21::i;:::-;10915:19;;;;:5;:19;;;;;;10852:44;;-1:-1:-1;10915:19:0;;10914:20;10906:50;;;;;-1:-1:-1;;;10906:50:0;;;;;;;;;;;;-1:-1:-1;;;10906:50:0;;;;;;;;;;;;;;;10967:19;;;;:5;:19;;;;;:26;;-1:-1:-1;;10967:26:0;10989:4;10967:26;;;11027:18;:16;:18::i;11211:139::-;11308:34;;;;;;;;;;;11331:10;11308:34;;;;;;;;26:21:-1;;;22:32;;6:49;;11308:34:0;;;;;;;11298:45;;;;;;11211:139::o;93:11259::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;93:11259:0;-1:-1:-1;;;;;93:11259:0;;;;;;;;;;;-1:-1:-1;93:11259:0;;;;;;;-1:-1:-1;93:11259:0;;;-1:-1:-1;93:11259:0;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;-1:-1:-1;;;;;;93:11259:0;;;;;;;;;;;;;;;;;;;;;;;;", - "source": "pragma solidity ^0.5.0;\n\nimport './openzeppelin-solidity/contracts/token/ERC20/IERC20.sol';\n\ncontract Bridge {\n event ExchangeRequest(uint value, uint nonce);\n event NewEpoch(uint indexed oldEpoch, uint indexed newEpoch);\n event NewEpochCancelled(uint indexed epoch);\n event NewFundsTransfer(uint indexed oldEpoch, uint indexed newEpoch);\n event EpochStart(uint indexed epoch, uint x, uint y);\n\n struct State {\n address[] validators;\n uint threshold;\n uint rangeSize;\n uint startBlock;\n uint nonce;\n uint x;\n uint y;\n }\n\n enum Status {\n READY, // bridge is in ready to perform operations\n VOTING, // voting for changing in next epoch, but still ready\n KEYGEN, //keygen, can be cancelled\n FUNDS_TRANSFER // funds transfer, cannot be cancelled\n }\n\n enum Vote {\n CONFIRM_KEYGEN,\n CONFIRM_FUNDS_TRANSFER,\n START_VOTING,\n ADD_VALIDATOR,\n REMOVE_VALIDATOR,\n CHANGE_THRESHOLD,\n CHANGE_RANGE_SIZE,\n START_KEYGEN,\n CANCEL_KEYGEN,\n TRANSFER\n }\n\n mapping(uint => State) states;\n\n mapping(bytes32 => uint) public dbTransferCount;\n mapping(bytes32 => bool) public dbTransfer;\n mapping(bytes32 => uint) public votesCount;\n mapping(bytes32 => bool) public votes;\n mapping(bytes32 => bool) public usedRange;\n\n Status public status;\n\n uint public epoch;\n uint public nextEpoch;\n\n uint minTxLimit;\n uint maxTxLimit;\n\n constructor(uint threshold, address[] memory validators, address _tokenContract, uint[2] memory limits, uint rangeSize) public {\n require(validators.length > 0);\n require(threshold < validators.length);\n\n tokenContract = IERC20(_tokenContract);\n\n epoch = 0;\n status = Status.KEYGEN;\n nextEpoch = 1;\n\n states[nextEpoch] = State(validators, threshold, rangeSize, 0, uint(-1), 0, 0);\n\n minTxLimit = limits[0];\n maxTxLimit = limits[1];\n\n emit NewEpoch(0, 1);\n }\n\n IERC20 public tokenContract;\n\n modifier ready {\n require(status == Status.READY, \"Not in ready state\");\n _;\n }\n\n modifier readyOrVoting {\n require(status == Status.READY || status == Status.VOTING, \"Not in ready or voting state\");\n _;\n }\n\n modifier voting {\n require(status == Status.VOTING, \"Not in voting state\");\n _;\n }\n\n modifier keygen {\n require(status == Status.KEYGEN, \"Not in keygen state\");\n _;\n }\n\n modifier fundsTransfer {\n require(status == Status.FUNDS_TRANSFER, \"Not in funds transfer state\");\n _;\n }\n\n modifier currentValidator {\n require(getPartyId() != 0, \"Not a current validator\");\n _;\n }\n\n function exchange(uint value) public ready {\n require(value >= minTxLimit && value >= 10 ** 10 && value <= maxTxLimit);\n\n uint txRange = (block.number - getStartBlock()) / getRangeSize();\n if (!usedRange[keccak256(abi.encodePacked(txRange, epoch))]) {\n usedRange[keccak256(abi.encodePacked(txRange, epoch))] = true;\n states[epoch].nonce++;\n }\n\n tokenContract.transferFrom(msg.sender, address(this), value);\n emit ExchangeRequest(value, getNonce());\n }\n\n function transfer(bytes32 hash, address to, uint value) public readyOrVoting currentValidator {\n if (tryVote(Vote.TRANSFER, hash, to, value)) {\n tokenContract.transfer(to, value);\n }\n }\n\n function confirmKeygen(uint x, uint y) public keygen {\n require(getNextPartyId(msg.sender) != 0, \"Not a next validator\");\n\n if (tryConfirm(Vote.CONFIRM_KEYGEN, x, y)) {\n states[nextEpoch].x = x;\n states[nextEpoch].y = y;\n if (nextEpoch == 1) {\n status = Status.READY;\n states[nextEpoch].startBlock = block.number;\n states[nextEpoch].nonce = uint(-1);\n epoch = nextEpoch;\n emit EpochStart(epoch, x, y);\n }\n else {\n status = Status.FUNDS_TRANSFER;\n emit NewFundsTransfer(epoch, nextEpoch);\n }\n }\n }\n\n function confirmFundsTransfer() public fundsTransfer currentValidator {\n require(epoch > 0, \"First epoch does not need funds transfer\");\n\n if (tryConfirm(Vote.CONFIRM_FUNDS_TRANSFER)) {\n status = Status.READY;\n states[nextEpoch].startBlock = block.number;\n states[nextEpoch].nonce = uint(-1);\n epoch = nextEpoch;\n emit EpochStart(epoch, getX(), getY());\n }\n }\n\n function getParties() view public returns (uint) {\n return getParties(epoch);\n }\n\n function getNextParties() view public returns (uint) {\n return getParties(nextEpoch);\n }\n\n function getParties(uint _epoch) view public returns (uint) {\n return states[_epoch].validators.length;\n }\n\n function getThreshold() view public returns (uint) {\n return getThreshold(epoch);\n }\n\n function getNextThreshold() view public returns (uint) {\n return getThreshold(nextEpoch);\n }\n\n function getThreshold(uint _epoch) view public returns (uint) {\n return states[_epoch].threshold;\n }\n\n function getStartBlock() view public returns (uint) {\n return getStartBlock(epoch);\n }\n\n function getStartBlock(uint _epoch) view public returns (uint) {\n return states[_epoch].startBlock;\n }\n\n function getRangeSize() view public returns (uint) {\n return getRangeSize(epoch);\n }\n\n function getNextRangeSize() view public returns (uint) {\n return getRangeSize(nextEpoch);\n }\n\n function getRangeSize(uint _epoch) view public returns (uint) {\n return states[_epoch].rangeSize;\n }\n\n function getNonce() view public returns (uint) {\n return getNonce(epoch);\n }\n\n function getNonce(uint _epoch) view public returns (uint) {\n return states[_epoch].nonce;\n }\n\n function getX() view public returns (uint) {\n return states[epoch].x;\n }\n\n function getY() view public returns (uint) {\n return states[epoch].y;\n }\n\n function getPartyId() view public returns (uint) {\n address[] memory validators = getValidators();\n for (uint i = 0; i < getParties(); i++) {\n if (validators[i] == msg.sender)\n return i + 1;\n }\n return 0;\n }\n\n function getNextPartyId(address a) view public returns (uint) {\n address[] memory validators = getNextValidators();\n for (uint i = 0; i < getNextParties(); i++) {\n if (validators[i] == a)\n return i + 1;\n }\n return 0;\n }\n\n function getValidators() view public returns (address[] memory) {\n return states[epoch].validators;\n }\n\n function getNextValidators() view public returns (address[] memory) {\n return states[nextEpoch].validators;\n }\n\n function startVoting() public readyOrVoting currentValidator {\n if (tryVote(Vote.START_VOTING)) {\n nextEpoch++;\n status = Status.VOTING;\n states[nextEpoch].threshold = getThreshold();\n states[nextEpoch].validators = getValidators();\n states[nextEpoch].rangeSize = getRangeSize();\n }\n }\n\n function voteAddValidator(address validator) public voting currentValidator {\n require(getNextPartyId(validator) == 0, \"Already a validator\");\n\n if (tryVote(Vote.ADD_VALIDATOR, validator)) {\n states[nextEpoch].validators.push(validator);\n }\n }\n\n function voteRemoveValidator(address validator) public voting currentValidator {\n require(getNextPartyId(validator) != 0, \"Already not a validator\");\n\n if (tryVote(Vote.REMOVE_VALIDATOR, validator)) {\n _removeValidator(validator);\n }\n }\n\n function _removeValidator(address validator) private {\n for (uint i = 0; i < getNextParties() - 1; i++) {\n if (states[nextEpoch].validators[i] == validator) {\n states[nextEpoch].validators[i] = getNextValidators()[getNextParties() - 1];\n break;\n }\n }\n delete states[nextEpoch].validators[getNextParties() - 1];\n states[nextEpoch].validators.length--;\n }\n\n function voteChangeThreshold(uint threshold) public voting currentValidator {\n if (tryVote(Vote.CHANGE_THRESHOLD, threshold)) {\n states[nextEpoch].threshold = threshold;\n }\n }\n\n function voteChangeRangeSize(uint rangeSize) public voting currentValidator {\n if (tryVote(Vote.CHANGE_RANGE_SIZE, rangeSize)) {\n states[nextEpoch].rangeSize = rangeSize;\n }\n }\n\n function voteStartKeygen() public voting currentValidator {\n if (tryVote(Vote.START_KEYGEN)) {\n status = Status.KEYGEN;\n\n emit NewEpoch(epoch, nextEpoch);\n }\n }\n\n function voteCancelKeygen() public keygen currentValidator {\n if (tryVote(Vote.CANCEL_KEYGEN)) {\n status = Status.VOTING;\n\n emit NewEpochCancelled(nextEpoch);\n }\n }\n\n function tryVote(Vote voteType) private returns (bool) {\n bytes32 vote = keccak256(abi.encodePacked(voteType, nextEpoch));\n return putVote(vote);\n }\n\n function tryVote(Vote voteType, address addr) private returns (bool) {\n bytes32 vote = keccak256(abi.encodePacked(voteType, nextEpoch, addr));\n return putVote(vote);\n }\n\n function tryVote(Vote voteType, uint num) private returns (bool) {\n bytes32 vote = keccak256(abi.encodePacked(voteType, nextEpoch, num));\n return putVote(vote);\n }\n\n function tryVote(Vote voteType, bytes32 hash, address to, uint value) private returns (bool) {\n bytes32 vote = keccak256(abi.encodePacked(voteType, hash, to, value));\n return putVote(vote);\n }\n\n function tryConfirm(Vote voteType) private returns (bool) {\n bytes32 vote = keccak256(abi.encodePacked(voteType, nextEpoch));\n return putConfirm(vote);\n }\n\n function tryConfirm(Vote voteType, uint x, uint y) private returns (bool) {\n bytes32 vote = keccak256(abi.encodePacked(voteType, nextEpoch, x, y));\n return putConfirm(vote);\n }\n\n function putVote(bytes32 vote) private returns (bool) {\n bytes32 personalVote = personalizeVote(vote);\n require(!votes[personalVote], \"Voted already\");\n\n votes[personalVote] = true;\n if (votesCount[vote] == getThreshold()) {\n votesCount[vote] = 2 ** 255;\n return true;\n } else {\n votesCount[vote]++;\n return false;\n }\n }\n\n function putConfirm(bytes32 vote) private returns (bool) {\n bytes32 personalVote = personalizeVote(vote);\n require(!votes[personalVote], \"Confirmed already\");\n\n votes[personalVote] = true;\n if (votesCount[vote] == getNextThreshold()) {\n votesCount[vote] = 2 ** 255;\n return true;\n } else {\n votesCount[vote]++;\n return false;\n }\n }\n\n function personalizeVote(bytes32 vote) private view returns (bytes32) {\n return keccak256(abi.encodePacked(vote, msg.sender));\n }\n}\n", - "sourcePath": "/build/contracts/Bridge.sol", - "ast": { - "absolutePath": "/build/contracts/Bridge.sol", - "exportedSymbols": { - "Bridge": [ - 1340 - ] - }, - "id": 1341, - "nodeType": "SourceUnit", - "nodes": [ - { - "id": 1, - "literals": [ - "solidity", - "^", - "0.5", - ".0" - ], - "nodeType": "PragmaDirective", - "src": "0:23:0" - }, - { - "absolutePath": "/build/contracts/openzeppelin-solidity/contracts/token/ERC20/IERC20.sol", - "file": "./openzeppelin-solidity/contracts/token/ERC20/IERC20.sol", - "id": 2, - "nodeType": "ImportDirective", - "scope": 1341, - "sourceUnit": 10033, - "src": "25:66:0", - "symbolAliases": [], - "unitAlias": "" - }, - { - "baseContracts": [], - "contractDependencies": [], - "contractKind": "contract", - "documentation": null, - "fullyImplemented": true, - "id": 1340, - "linearizedBaseContracts": [ - 1340 - ], - "name": "Bridge", - "nodeType": "ContractDefinition", - "nodes": [ - { - "anonymous": false, - "documentation": null, - "id": 8, - "name": "ExchangeRequest", - "nodeType": "EventDefinition", - "parameters": { - "id": 7, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4, - "indexed": false, - "name": "value", - "nodeType": "VariableDeclaration", - "scope": 8, - "src": "137:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 3, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "137:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 6, - "indexed": false, - "name": "nonce", - "nodeType": "VariableDeclaration", - "scope": 8, - "src": "149:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 5, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "149:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "136:24:0" - }, - "src": "115:46:0" - }, - { - "anonymous": false, - "documentation": null, - "id": 14, - "name": "NewEpoch", - "nodeType": "EventDefinition", - "parameters": { - "id": 13, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 10, - "indexed": true, - "name": "oldEpoch", - "nodeType": "VariableDeclaration", - "scope": 14, - "src": "181:21:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 9, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "181:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 12, - "indexed": true, - "name": "newEpoch", - "nodeType": "VariableDeclaration", - "scope": 14, - "src": "204:21:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 11, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "204:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "180:46:0" - }, - "src": "166:61:0" - }, - { - "anonymous": false, - "documentation": null, - "id": 18, - "name": "NewEpochCancelled", - "nodeType": "EventDefinition", - "parameters": { - "id": 17, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 16, - "indexed": true, - "name": "epoch", - "nodeType": "VariableDeclaration", - "scope": 18, - "src": "256:18:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 15, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "256:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "255:20:0" - }, - "src": "232:44:0" - }, - { - "anonymous": false, - "documentation": null, - "id": 24, - "name": "NewFundsTransfer", - "nodeType": "EventDefinition", - "parameters": { - "id": 23, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 20, - "indexed": true, - "name": "oldEpoch", - "nodeType": "VariableDeclaration", - "scope": 24, - "src": "304:21:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 19, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "304:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 22, - "indexed": true, - "name": "newEpoch", - "nodeType": "VariableDeclaration", - "scope": 24, - "src": "327:21:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 21, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "327:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "303:46:0" - }, - "src": "281:69:0" - }, - { - "anonymous": false, - "documentation": null, - "id": 32, - "name": "EpochStart", - "nodeType": "EventDefinition", - "parameters": { - "id": 31, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 26, - "indexed": true, - "name": "epoch", - "nodeType": "VariableDeclaration", - "scope": 32, - "src": "372:18:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 25, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "372:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 28, - "indexed": false, - "name": "x", - "nodeType": "VariableDeclaration", - "scope": 32, - "src": "392:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 27, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "392:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 30, - "indexed": false, - "name": "y", - "nodeType": "VariableDeclaration", - "scope": 32, - "src": "400:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 29, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "400:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "371:36:0" - }, - "src": "355:53:0" - }, - { - "canonicalName": "Bridge.State", - "id": 48, - "members": [ - { - "constant": false, - "id": 35, - "name": "validators", - "nodeType": "VariableDeclaration", - "scope": 48, - "src": "437:20:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 33, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "437:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 34, - "length": null, - "nodeType": "ArrayTypeName", - "src": "437:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 37, - "name": "threshold", - "nodeType": "VariableDeclaration", - "scope": 48, - "src": "467:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 36, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "467:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 39, - "name": "rangeSize", - "nodeType": "VariableDeclaration", - "scope": 48, - "src": "491:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 38, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "491:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 41, - "name": "startBlock", - "nodeType": "VariableDeclaration", - "scope": 48, - "src": "515:15:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 40, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "515:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 43, - "name": "nonce", - "nodeType": "VariableDeclaration", - "scope": 48, - "src": "540:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 42, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "540:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 45, - "name": "x", - "nodeType": "VariableDeclaration", - "scope": 48, - "src": "560:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 44, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "560:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 47, - "name": "y", - "nodeType": "VariableDeclaration", - "scope": 48, - "src": "576:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 46, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "576:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "name": "State", - "nodeType": "StructDefinition", - "scope": 1340, - "src": "414:175:0", - "visibility": "public" - }, - { - "canonicalName": "Bridge.Status", - "id": 53, - "members": [ - { - "id": 49, - "name": "READY", - "nodeType": "EnumValue", - "src": "617:5:0" - }, - { - "id": 50, - "name": "VOTING", - "nodeType": "EnumValue", - "src": "676:6:0" - }, - { - "id": 51, - "name": "KEYGEN", - "nodeType": "EnumValue", - "src": "746:6:0" - }, - { - "id": 52, - "name": "FUNDS_TRANSFER", - "nodeType": "EnumValue", - "src": "789:14:0" - } - ], - "name": "Status", - "nodeType": "EnumDefinition", - "src": "595:253:0" - }, - { - "canonicalName": "Bridge.Vote", - "id": 64, - "members": [ - { - "id": 54, - "name": "CONFIRM_KEYGEN", - "nodeType": "EnumValue", - "src": "874:14:0" - }, - { - "id": 55, - "name": "CONFIRM_FUNDS_TRANSFER", - "nodeType": "EnumValue", - "src": "898:22:0" - }, - { - "id": 56, - "name": "START_VOTING", - "nodeType": "EnumValue", - "src": "930:12:0" - }, - { - "id": 57, - "name": "ADD_VALIDATOR", - "nodeType": "EnumValue", - "src": "952:13:0" - }, - { - "id": 58, - "name": "REMOVE_VALIDATOR", - "nodeType": "EnumValue", - "src": "975:16:0" - }, - { - "id": 59, - "name": "CHANGE_THRESHOLD", - "nodeType": "EnumValue", - "src": "1001:16:0" - }, - { - "id": 60, - "name": "CHANGE_RANGE_SIZE", - "nodeType": "EnumValue", - "src": "1027:17:0" - }, - { - "id": 61, - "name": "START_KEYGEN", - "nodeType": "EnumValue", - "src": "1054:12:0" - }, - { - "id": 62, - "name": "CANCEL_KEYGEN", - "nodeType": "EnumValue", - "src": "1076:13:0" - }, - { - "id": 63, - "name": "TRANSFER", - "nodeType": "EnumValue", - "src": "1099:8:0" - } - ], - "name": "Vote", - "nodeType": "EnumDefinition", - "src": "854:259:0" - }, - { - "constant": false, - "id": 68, - "name": "states", - "nodeType": "VariableDeclaration", - "scope": 1340, - "src": "1119:29:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State)" - }, - "typeName": { - "id": 67, - "keyType": { - "id": 65, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1127:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Mapping", - "src": "1119:22:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State)" - }, - "valueType": { - "contractScope": null, - "id": 66, - "name": "State", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 48, - "src": "1135:5:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage_ptr", - "typeString": "struct Bridge.State" - } - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 72, - "name": "dbTransferCount", - "nodeType": "VariableDeclaration", - "scope": 1340, - "src": "1155:47:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - }, - "typeName": { - "id": 71, - "keyType": { - "id": 69, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1163:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Mapping", - "src": "1155:24:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - }, - "valueType": { - "id": 70, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1174:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 76, - "name": "dbTransfer", - "nodeType": "VariableDeclaration", - "scope": 1340, - "src": "1208:42:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - }, - "typeName": { - "id": 75, - "keyType": { - "id": 73, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1216:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Mapping", - "src": "1208:24:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - }, - "valueType": { - "id": 74, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "1227:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 80, - "name": "votesCount", - "nodeType": "VariableDeclaration", - "scope": 1340, - "src": "1256:42:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - }, - "typeName": { - "id": 79, - "keyType": { - "id": 77, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1264:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Mapping", - "src": "1256:24:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - }, - "valueType": { - "id": 78, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1275:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 84, - "name": "votes", - "nodeType": "VariableDeclaration", - "scope": 1340, - "src": "1304:37:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - }, - "typeName": { - "id": 83, - "keyType": { - "id": 81, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1312:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Mapping", - "src": "1304:24:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - }, - "valueType": { - "id": 82, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "1323:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 88, - "name": "usedRange", - "nodeType": "VariableDeclaration", - "scope": 1340, - "src": "1347:41:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - }, - "typeName": { - "id": 87, - "keyType": { - "id": 85, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1355:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Mapping", - "src": "1347:24:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - }, - "valueType": { - "id": 86, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "1366:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 90, - "name": "status", - "nodeType": "VariableDeclaration", - "scope": 1340, - "src": "1395:20:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - }, - "typeName": { - "contractScope": null, - "id": 89, - "name": "Status", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 53, - "src": "1395:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 92, - "name": "epoch", - "nodeType": "VariableDeclaration", - "scope": 1340, - "src": "1422:17:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 91, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1422:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 94, - "name": "nextEpoch", - "nodeType": "VariableDeclaration", - "scope": 1340, - "src": "1445:21:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 93, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1445:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 96, - "name": "minTxLimit", - "nodeType": "VariableDeclaration", - "scope": 1340, - "src": "1473:15:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 95, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1473:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 98, - "name": "maxTxLimit", - "nodeType": "VariableDeclaration", - "scope": 1340, - "src": "1494:15:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 97, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1494:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "body": { - "id": 181, - "nodeType": "Block", - "src": "1643:403:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 118, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 115, - "name": "validators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 103, - "src": "1661:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 116, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1661:17:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 117, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1681:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "1661:21:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 114, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 13091, - 13092 - ], - "referencedDeclaration": 13091, - "src": "1653:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 119, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1653:30:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 120, - "nodeType": "ExpressionStatement", - "src": "1653:30:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 125, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 122, - "name": "threshold", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 100, - "src": "1701:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 123, - "name": "validators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 103, - "src": "1713:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 124, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1713:17:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1701:29:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 121, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 13091, - 13092 - ], - "referencedDeclaration": 13091, - "src": "1693:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 126, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1693:38:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 127, - "nodeType": "ExpressionStatement", - "src": "1693:38:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 132, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 128, - "name": "tokenContract", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 184, - "src": "1742:13:0", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$10032", - "typeString": "contract IERC20" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 130, - "name": "_tokenContract", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 105, - "src": "1765:14:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 129, - "name": "IERC20", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 10032, - "src": "1758:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_IERC20_$10032_$", - "typeString": "type(contract IERC20)" - } - }, - "id": 131, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1758:22:0", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$10032", - "typeString": "contract IERC20" - } - }, - "src": "1742:38:0", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$10032", - "typeString": "contract IERC20" - } - }, - "id": 133, - "nodeType": "ExpressionStatement", - "src": "1742:38:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 136, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 134, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "1791:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "30", - "id": 135, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1799:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "1791:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 137, - "nodeType": "ExpressionStatement", - "src": "1791:9:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 141, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 138, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 90, - "src": "1810:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 139, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 53, - "src": "1819:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$53_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 140, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "KEYGEN", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1819:13:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "src": "1810:22:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "id": 142, - "nodeType": "ExpressionStatement", - "src": "1810:22:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 145, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 143, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "1842:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "31", - "id": 144, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1854:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "1842:13:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 146, - "nodeType": "ExpressionStatement", - "src": "1842:13:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 162, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 147, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "1866:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 149, - "indexExpression": { - "argumentTypes": null, - "id": 148, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "1873:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "1866:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 151, - "name": "validators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 103, - "src": "1892:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - { - "argumentTypes": null, - "id": 152, - "name": "threshold", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 100, - "src": "1904:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 153, - "name": "rangeSize", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 111, - "src": "1915:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "hexValue": "30", - "id": 154, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1926:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 157, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "-", - "prefix": true, - "src": "1934:2:0", - "subExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 156, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1935:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "typeDescriptions": { - "typeIdentifier": "t_rational_minus_1_by_1", - "typeString": "int_const -1" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_rational_minus_1_by_1", - "typeString": "int_const -1" - } - ], - "id": 155, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "1929:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_uint256_$", - "typeString": "type(uint256)" - }, - "typeName": "uint" - }, - "id": 158, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1929:8:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "hexValue": "30", - "id": 159, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1939:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - { - "argumentTypes": null, - "hexValue": "30", - "id": 160, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1942:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - } - ], - "id": 150, - "name": "State", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 48, - "src": "1886:5:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_struct$_State_$48_storage_ptr_$", - "typeString": "type(struct Bridge.State storage pointer)" - } - }, - "id": 161, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "structConstructorCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1886:58:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_memory", - "typeString": "struct Bridge.State memory" - } - }, - "src": "1866:78:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 163, - "nodeType": "ExpressionStatement", - "src": "1866:78:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 168, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 164, - "name": "minTxLimit", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 96, - "src": "1955:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 165, - "name": "limits", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 109, - "src": "1968:6:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_memory_ptr", - "typeString": "uint256[2] memory" - } - }, - "id": 167, - "indexExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 166, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1975:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "1968:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1955:22:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 169, - "nodeType": "ExpressionStatement", - "src": "1955:22:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 174, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 170, - "name": "maxTxLimit", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 98, - "src": "1987:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 171, - "name": "limits", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 109, - "src": "2000:6:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_memory_ptr", - "typeString": "uint256[2] memory" - } - }, - "id": 173, - "indexExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 172, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2007:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "2000:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1987:22:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 175, - "nodeType": "ExpressionStatement", - "src": "1987:22:0" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "hexValue": "30", - "id": 177, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2034:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - { - "argumentTypes": null, - "hexValue": "31", - "id": 178, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2037:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - } - ], - "id": 176, - "name": "NewEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 14, - "src": "2025:8:0", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$returns$__$", - "typeString": "function (uint256,uint256)" - } - }, - "id": 179, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2025:14:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 180, - "nodeType": "EmitStatement", - "src": "2020:19:0" - } - ] - }, - "documentation": null, - "id": 182, - "implemented": true, - "kind": "constructor", - "modifiers": [], - "name": "", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 112, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 100, - "name": "threshold", - "nodeType": "VariableDeclaration", - "scope": 182, - "src": "1528:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 99, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1528:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 103, - "name": "validators", - "nodeType": "VariableDeclaration", - "scope": 182, - "src": "1544:27:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 101, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1544:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 102, - "length": null, - "nodeType": "ArrayTypeName", - "src": "1544:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 105, - "name": "_tokenContract", - "nodeType": "VariableDeclaration", - "scope": 182, - "src": "1573:22:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 104, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1573:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 109, - "name": "limits", - "nodeType": "VariableDeclaration", - "scope": 182, - "src": "1597:21:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_memory_ptr", - "typeString": "uint256[2]" - }, - "typeName": { - "baseType": { - "id": 106, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1597:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 108, - "length": { - "argumentTypes": null, - "hexValue": "32", - "id": 107, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1602:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "nodeType": "ArrayTypeName", - "src": "1597:7:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_storage_ptr", - "typeString": "uint256[2]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 111, - "name": "rangeSize", - "nodeType": "VariableDeclaration", - "scope": 182, - "src": "1620:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 110, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1620:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1527:108:0" - }, - "returnParameters": { - "id": 113, - "nodeType": "ParameterList", - "parameters": [], - "src": "1643:0:0" - }, - "scope": 1340, - "src": "1516:530:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "constant": false, - "id": 184, - "name": "tokenContract", - "nodeType": "VariableDeclaration", - "scope": 1340, - "src": "2052:27:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$10032", - "typeString": "contract IERC20" - }, - "typeName": { - "contractScope": null, - "id": 183, - "name": "IERC20", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 10032, - "src": "2052:6:0", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$10032", - "typeString": "contract IERC20" - } - }, - "value": null, - "visibility": "public" - }, - { - "body": { - "id": 195, - "nodeType": "Block", - "src": "2101:81:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - }, - "id": 190, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 187, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 90, - "src": "2119:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 188, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 53, - "src": "2129:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$53_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 189, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "READY", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2129:12:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "src": "2119:22:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4e6f7420696e207265616479207374617465", - "id": 191, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2143:20:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_965c39c15b78dbcd8a954511641ca86e15fc1ae6d6c30a67536872ccde75b679", - "typeString": "literal_string \"Not in ready state\"" - }, - "value": "Not in ready state" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_965c39c15b78dbcd8a954511641ca86e15fc1ae6d6c30a67536872ccde75b679", - "typeString": "literal_string \"Not in ready state\"" - } - ], - "id": 186, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 13091, - 13092 - ], - "referencedDeclaration": 13092, - "src": "2111:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 192, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2111:53:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 193, - "nodeType": "ExpressionStatement", - "src": "2111:53:0" - }, - { - "id": 194, - "nodeType": "PlaceholderStatement", - "src": "2174:1:0" - } - ] - }, - "documentation": null, - "id": 196, - "name": "ready", - "nodeType": "ModifierDefinition", - "parameters": { - "id": 185, - "nodeType": "ParameterList", - "parameters": [], - "src": "2101:0:0" - }, - "src": "2086:96:0", - "visibility": "internal" - }, - { - "body": { - "id": 212, - "nodeType": "Block", - "src": "2211:118:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 207, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - }, - "id": 202, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 199, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 90, - "src": "2229:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 200, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 53, - "src": "2239:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$53_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 201, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "READY", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2239:12:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "src": "2229:22:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "||", - "rightExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - }, - "id": 206, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 203, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 90, - "src": "2255:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 204, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 53, - "src": "2265:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$53_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 205, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "VOTING", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2265:13:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "src": "2255:23:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "2229:49:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4e6f7420696e207265616479206f7220766f74696e67207374617465", - "id": 208, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2280:30:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_7e3f7359baa731593d4e3921720b92600c22ed1d950d208e0c826ad2eddebe96", - "typeString": "literal_string \"Not in ready or voting state\"" - }, - "value": "Not in ready or voting state" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_7e3f7359baa731593d4e3921720b92600c22ed1d950d208e0c826ad2eddebe96", - "typeString": "literal_string \"Not in ready or voting state\"" - } - ], - "id": 198, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 13091, - 13092 - ], - "referencedDeclaration": 13092, - "src": "2221:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 209, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2221:90:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 210, - "nodeType": "ExpressionStatement", - "src": "2221:90:0" - }, - { - "id": 211, - "nodeType": "PlaceholderStatement", - "src": "2321:1:0" - } - ] - }, - "documentation": null, - "id": 213, - "name": "readyOrVoting", - "nodeType": "ModifierDefinition", - "parameters": { - "id": 197, - "nodeType": "ParameterList", - "parameters": [], - "src": "2211:0:0" - }, - "src": "2188:141:0", - "visibility": "internal" - }, - { - "body": { - "id": 224, - "nodeType": "Block", - "src": "2351:83:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - }, - "id": 219, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 216, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 90, - "src": "2369:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 217, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 53, - "src": "2379:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$53_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 218, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "VOTING", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2379:13:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "src": "2369:23:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4e6f7420696e20766f74696e67207374617465", - "id": 220, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2394:21:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_0cbee9834b110b21e0730bf5c3d2972fb9867ff221df239e7ae60883592f05d1", - "typeString": "literal_string \"Not in voting state\"" - }, - "value": "Not in voting state" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_0cbee9834b110b21e0730bf5c3d2972fb9867ff221df239e7ae60883592f05d1", - "typeString": "literal_string \"Not in voting state\"" - } - ], - "id": 215, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 13091, - 13092 - ], - "referencedDeclaration": 13092, - "src": "2361:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 221, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2361:55:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 222, - "nodeType": "ExpressionStatement", - "src": "2361:55:0" - }, - { - "id": 223, - "nodeType": "PlaceholderStatement", - "src": "2426:1:0" - } - ] - }, - "documentation": null, - "id": 225, - "name": "voting", - "nodeType": "ModifierDefinition", - "parameters": { - "id": 214, - "nodeType": "ParameterList", - "parameters": [], - "src": "2351:0:0" - }, - "src": "2335:99:0", - "visibility": "internal" - }, - { - "body": { - "id": 236, - "nodeType": "Block", - "src": "2456:83:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - }, - "id": 231, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 228, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 90, - "src": "2474:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 229, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 53, - "src": "2484:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$53_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 230, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "KEYGEN", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2484:13:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "src": "2474:23:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4e6f7420696e206b657967656e207374617465", - "id": 232, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2499:21:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_ed0fee6382e0651a224348a21558d03a4a439c3bd5edc24945894a3417c14010", - "typeString": "literal_string \"Not in keygen state\"" - }, - "value": "Not in keygen state" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_ed0fee6382e0651a224348a21558d03a4a439c3bd5edc24945894a3417c14010", - "typeString": "literal_string \"Not in keygen state\"" - } - ], - "id": 227, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 13091, - 13092 - ], - "referencedDeclaration": 13092, - "src": "2466:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 233, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2466:55:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 234, - "nodeType": "ExpressionStatement", - "src": "2466:55:0" - }, - { - "id": 235, - "nodeType": "PlaceholderStatement", - "src": "2531:1:0" - } - ] - }, - "documentation": null, - "id": 237, - "name": "keygen", - "nodeType": "ModifierDefinition", - "parameters": { - "id": 226, - "nodeType": "ParameterList", - "parameters": [], - "src": "2456:0:0" - }, - "src": "2440:99:0", - "visibility": "internal" - }, - { - "body": { - "id": 248, - "nodeType": "Block", - "src": "2568:99:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - }, - "id": 243, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 240, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 90, - "src": "2586:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 241, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 53, - "src": "2596:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$53_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 242, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "FUNDS_TRANSFER", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2596:21:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "src": "2586:31:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4e6f7420696e2066756e6473207472616e73666572207374617465", - "id": 244, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2619:29:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_6347c9fecd6f58520ad10dfd1347ce3dc42cc0eed7a4182ca64dd11c69fc3008", - "typeString": "literal_string \"Not in funds transfer state\"" - }, - "value": "Not in funds transfer state" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_6347c9fecd6f58520ad10dfd1347ce3dc42cc0eed7a4182ca64dd11c69fc3008", - "typeString": "literal_string \"Not in funds transfer state\"" - } - ], - "id": 239, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 13091, - 13092 - ], - "referencedDeclaration": 13092, - "src": "2578:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 245, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2578:71:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 246, - "nodeType": "ExpressionStatement", - "src": "2578:71:0" - }, - { - "id": 247, - "nodeType": "PlaceholderStatement", - "src": "2659:1:0" - } - ] - }, - "documentation": null, - "id": 249, - "name": "fundsTransfer", - "nodeType": "ModifierDefinition", - "parameters": { - "id": 238, - "nodeType": "ParameterList", - "parameters": [], - "src": "2568:0:0" - }, - "src": "2545:122:0", - "visibility": "internal" - }, - { - "body": { - "id": 260, - "nodeType": "Block", - "src": "2699:81:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 255, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 252, - "name": "getPartyId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 728, - "src": "2717:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 253, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2717:12:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 254, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2733:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "2717:17:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4e6f7420612063757272656e742076616c696461746f72", - "id": 256, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2736:25:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_8dc18d5bb1361900b9758b388df331056e31071cae84b276c0f03794c4dc634a", - "typeString": "literal_string \"Not a current validator\"" - }, - "value": "Not a current validator" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_8dc18d5bb1361900b9758b388df331056e31071cae84b276c0f03794c4dc634a", - "typeString": "literal_string \"Not a current validator\"" - } - ], - "id": 251, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 13091, - 13092 - ], - "referencedDeclaration": 13092, - "src": "2709:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 257, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2709:53:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 258, - "nodeType": "ExpressionStatement", - "src": "2709:53:0" - }, - { - "id": 259, - "nodeType": "PlaceholderStatement", - "src": "2772:1:0" - } - ] - }, - "documentation": null, - "id": 261, - "name": "currentValidator", - "nodeType": "ModifierDefinition", - "parameters": { - "id": 250, - "nodeType": "ParameterList", - "parameters": [], - "src": "2699:0:0" - }, - "src": "2673:107:0", - "visibility": "internal" - }, - { - "body": { - "id": 343, - "nodeType": "Block", - "src": "2829:475:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 281, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 277, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 271, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 269, - "name": "value", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 263, - "src": "2847:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">=", - "rightExpression": { - "argumentTypes": null, - "id": 270, - "name": "minTxLimit", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 96, - "src": "2856:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2847:19:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "&&", - "rightExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 276, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 272, - "name": "value", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 263, - "src": "2870:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">=", - "rightExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_rational_10000000000_by_1", - "typeString": "int_const 10000000000" - }, - "id": 275, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "hexValue": "3130", - "id": 273, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2879:2:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_10_by_1", - "typeString": "int_const 10" - }, - "value": "10" - }, - "nodeType": "BinaryOperation", - "operator": "**", - "rightExpression": { - "argumentTypes": null, - "hexValue": "3130", - "id": 274, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2885:2:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_10_by_1", - "typeString": "int_const 10" - }, - "value": "10" - }, - "src": "2879:8:0", - "typeDescriptions": { - "typeIdentifier": "t_rational_10000000000_by_1", - "typeString": "int_const 10000000000" - } - }, - "src": "2870:17:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "2847:40:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "&&", - "rightExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 280, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 278, - "name": "value", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 263, - "src": "2891:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<=", - "rightExpression": { - "argumentTypes": null, - "id": 279, - "name": "maxTxLimit", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 98, - "src": "2900:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2891:19:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "2847:63:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 268, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 13091, - 13092 - ], - "referencedDeclaration": 13091, - "src": "2839:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 282, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2839:72:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 283, - "nodeType": "ExpressionStatement", - "src": "2839:72:0" - }, - { - "assignments": [ - 285 - ], - "declarations": [ - { - "constant": false, - "id": 285, - "name": "txRange", - "nodeType": "VariableDeclaration", - "scope": 343, - "src": "2922:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 284, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "2922:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 295, - "initialValue": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 294, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "components": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 290, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 286, - "name": "block", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13078, - "src": "2938:5:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_block", - "typeString": "block" - } - }, - "id": 287, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "number", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2938:12:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 288, - "name": "getStartBlock", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 598, - 611 - ], - "referencedDeclaration": 598, - "src": "2953:13:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 289, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2953:15:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2938:30:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "id": 291, - "isConstant": false, - "isInlineArray": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "TupleExpression", - "src": "2937:32:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "/", - "rightExpression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 292, - "name": "getRangeSize", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 621, - 644 - ], - "referencedDeclaration": 621, - "src": "2972:12:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 293, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2972:14:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2937:49:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "2922:64:0" - }, - { - "condition": { - "argumentTypes": null, - "id": 305, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "!", - "prefix": true, - "src": "3000:55:0", - "subExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 296, - "name": "usedRange", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 88, - "src": "3001:9:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - } - }, - "id": 304, - "indexExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 300, - "name": "txRange", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 285, - "src": "3038:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 301, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "3047:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 298, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13075, - "src": "3021:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 299, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3021:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 302, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3021:32:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 297, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13082, - "src": "3011:9:0", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 303, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3011:43:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3001:54:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 325, - "nodeType": "IfStatement", - "src": "2996:182:0", - "trueBody": { - "id": 324, - "nodeType": "Block", - "src": "3057:121:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 316, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 306, - "name": "usedRange", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 88, - "src": "3071:9:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - } - }, - "id": 314, - "indexExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 310, - "name": "txRange", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 285, - "src": "3108:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 311, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "3117:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 308, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13075, - "src": "3091:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 309, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3091:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 312, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3091:32:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 307, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13082, - "src": "3081:9:0", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 313, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3081:43:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "3071:54:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 315, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3128:4:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "src": "3071:61:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 317, - "nodeType": "ExpressionStatement", - "src": "3071:61:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 322, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "3146:21:0", - "subExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 318, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "3146:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 320, - "indexExpression": { - "argumentTypes": null, - "id": 319, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "3153:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3146:13:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 321, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "nonce", - "nodeType": "MemberAccess", - "referencedDeclaration": 43, - "src": "3146:19:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 323, - "nodeType": "ExpressionStatement", - "src": "3146:21:0" - } - ] - } - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 329, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13088, - "src": "3215:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 330, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3215:10:0", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 332, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13104, - "src": "3235:4:0", - "typeDescriptions": { - "typeIdentifier": "t_contract$_Bridge_$1340", - "typeString": "contract Bridge" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_Bridge_$1340", - "typeString": "contract Bridge" - } - ], - "id": 331, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "3227:7:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 333, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3227:13:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 334, - "name": "value", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 263, - "src": "3242:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 326, - "name": "tokenContract", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 184, - "src": "3188:13:0", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$10032", - "typeString": "contract IERC20" - } - }, - "id": 328, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "transferFrom", - "nodeType": "MemberAccess", - "referencedDeclaration": 10015, - "src": "3188:26:0", - "typeDescriptions": { - "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$_t_bool_$", - "typeString": "function (address,address,uint256) external returns (bool)" - } - }, - "id": 335, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3188:60:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 336, - "nodeType": "ExpressionStatement", - "src": "3188:60:0" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 338, - "name": "value", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 263, - "src": "3279:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 339, - "name": "getNonce", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 654, - 667 - ], - "referencedDeclaration": 654, - "src": "3286:8:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 340, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3286:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 337, - "name": "ExchangeRequest", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 8, - "src": "3263:15:0", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$returns$__$", - "typeString": "function (uint256,uint256)" - } - }, - "id": 341, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3263:34:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 342, - "nodeType": "EmitStatement", - "src": "3258:39:0" - } - ] - }, - "documentation": null, - "id": 344, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 266, - "modifierName": { - "argumentTypes": null, - "id": 265, - "name": "ready", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 196, - "src": "2823:5:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "2823:5:0" - } - ], - "name": "exchange", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 264, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 263, - "name": "value", - "nodeType": "VariableDeclaration", - "scope": 344, - "src": "2804:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 262, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "2804:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2803:12:0" - }, - "returnParameters": { - "id": 267, - "nodeType": "ParameterList", - "parameters": [], - "src": "2829:0:0" - }, - "scope": 1340, - "src": "2786:518:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 373, - "nodeType": "Block", - "src": "3404:119:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 358, - "name": "Vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 64, - "src": "3426:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", - "typeString": "type(enum Bridge.Vote)" - } - }, - "id": 359, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "TRANSFER", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3426:13:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 360, - "name": "hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 346, - "src": "3441:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "id": 361, - "name": "to", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 348, - "src": "3447:2:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 362, - "name": "value", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 350, - "src": "3451:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 357, - "name": "tryVote", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1084, - 1109, - 1134, - 1164 - ], - "referencedDeclaration": 1164, - "src": "3418:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$_t_bytes32_$_t_address_$_t_uint256_$returns$_t_bool_$", - "typeString": "function (enum Bridge.Vote,bytes32,address,uint256) returns (bool)" - } - }, - "id": 363, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3418:39:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 372, - "nodeType": "IfStatement", - "src": "3414:103:0", - "trueBody": { - "id": 371, - "nodeType": "Block", - "src": "3459:58:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 367, - "name": "to", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 348, - "src": "3496:2:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 368, - "name": "value", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 350, - "src": "3500:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 364, - "name": "tokenContract", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 184, - "src": "3473:13:0", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$10032", - "typeString": "contract IERC20" - } - }, - "id": 366, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "transfer", - "nodeType": "MemberAccess", - "referencedDeclaration": 9986, - "src": "3473:22:0", - "typeDescriptions": { - "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$_t_bool_$", - "typeString": "function (address,uint256) external returns (bool)" - } - }, - "id": 369, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3473:33:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 370, - "nodeType": "ExpressionStatement", - "src": "3473:33:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 374, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 353, - "modifierName": { - "argumentTypes": null, - "id": 352, - "name": "readyOrVoting", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 213, - "src": "3373:13:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "3373:13:0" - }, - { - "arguments": null, - "id": 355, - "modifierName": { - "argumentTypes": null, - "id": 354, - "name": "currentValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 261, - "src": "3387:16:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "3387:16:0" - } - ], - "name": "transfer", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 351, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 346, - "name": "hash", - "nodeType": "VariableDeclaration", - "scope": 374, - "src": "3328:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 345, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "3328:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 348, - "name": "to", - "nodeType": "VariableDeclaration", - "scope": 374, - "src": "3342:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 347, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "3342:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 350, - "name": "value", - "nodeType": "VariableDeclaration", - "scope": 374, - "src": "3354:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 349, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "3354:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "3327:38:0" - }, - "returnParameters": { - "id": 356, - "nodeType": "ParameterList", - "parameters": [], - "src": "3404:0:0" - }, - "scope": 1340, - "src": "3310:213:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 464, - "nodeType": "Block", - "src": "3582:638:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 389, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 385, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13088, - "src": "3615:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 386, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3615:10:0", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - ], - "id": 384, - "name": "getNextPartyId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 768, - "src": "3600:14:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_uint256_$", - "typeString": "function (address) view returns (uint256)" - } - }, - "id": 387, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3600:26:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 388, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3630:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "3600:31:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4e6f742061206e6578742076616c696461746f72", - "id": 390, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3633:22:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_44981c92ce908443b2fa5f878c54791e1a0c95d4cc04ea4f4d9224b3ec030922", - "typeString": "literal_string \"Not a next validator\"" - }, - "value": "Not a next validator" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_44981c92ce908443b2fa5f878c54791e1a0c95d4cc04ea4f4d9224b3ec030922", - "typeString": "literal_string \"Not a next validator\"" - } - ], - "id": 383, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 13091, - 13092 - ], - "referencedDeclaration": 13092, - "src": "3592:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 391, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3592:64:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 392, - "nodeType": "ExpressionStatement", - "src": "3592:64:0" - }, - { - "condition": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 394, - "name": "Vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 64, - "src": "3682:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", - "typeString": "type(enum Bridge.Vote)" - } - }, - "id": 395, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "CONFIRM_KEYGEN", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3682:19:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 396, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 376, - "src": "3703:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 397, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 378, - "src": "3706:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 393, - "name": "tryConfirm", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1186, - 1214 - ], - "referencedDeclaration": 1214, - "src": "3671:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$_t_uint256_$_t_uint256_$returns$_t_bool_$", - "typeString": "function (enum Bridge.Vote,uint256,uint256) returns (bool)" - } - }, - "id": 398, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3671:37:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 463, - "nodeType": "IfStatement", - "src": "3667:547:0", - "trueBody": { - "id": 462, - "nodeType": "Block", - "src": "3710:504:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 404, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 399, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "3724:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 401, - "indexExpression": { - "argumentTypes": null, - "id": 400, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "3731:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3724:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 402, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "x", - "nodeType": "MemberAccess", - "referencedDeclaration": 45, - "src": "3724:19:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 403, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 376, - "src": "3746:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3724:23:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 405, - "nodeType": "ExpressionStatement", - "src": "3724:23:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 411, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 406, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "3761:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 408, - "indexExpression": { - "argumentTypes": null, - "id": 407, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "3768:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3761:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 409, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "y", - "nodeType": "MemberAccess", - "referencedDeclaration": 47, - "src": "3761:19:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 410, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 378, - "src": "3783:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3761:23:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 412, - "nodeType": "ExpressionStatement", - "src": "3761:23:0" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 415, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 413, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "3802:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 414, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3815:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "3802:14:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "id": 460, - "nodeType": "Block", - "src": "4084:120:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 453, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 450, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 90, - "src": "4102:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 451, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 53, - "src": "4111:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$53_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 452, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "FUNDS_TRANSFER", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4111:21:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "src": "4102:30:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "id": 454, - "nodeType": "ExpressionStatement", - "src": "4102:30:0" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 456, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "4172:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 457, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "4179:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 455, - "name": "NewFundsTransfer", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 24, - "src": "4155:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$returns$__$", - "typeString": "function (uint256,uint256)" - } - }, - "id": 458, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4155:34:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 459, - "nodeType": "EmitStatement", - "src": "4150:39:0" - } - ] - }, - "id": 461, - "nodeType": "IfStatement", - "src": "3798:406:0", - "trueBody": { - "id": 449, - "nodeType": "Block", - "src": "3818:248:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 419, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 416, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 90, - "src": "3836:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 417, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 53, - "src": "3845:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$53_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 418, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "READY", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3845:12:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "src": "3836:21:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "id": 420, - "nodeType": "ExpressionStatement", - "src": "3836:21:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 427, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 421, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "3875:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 423, - "indexExpression": { - "argumentTypes": null, - "id": 422, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "3882:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3875:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 424, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "startBlock", - "nodeType": "MemberAccess", - "referencedDeclaration": 41, - "src": "3875:28:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 425, - "name": "block", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13078, - "src": "3906:5:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_block", - "typeString": "block" - } - }, - "id": 426, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "number", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3906:12:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3875:43:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 428, - "nodeType": "ExpressionStatement", - "src": "3875:43:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 437, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 429, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "3936:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 431, - "indexExpression": { - "argumentTypes": null, - "id": 430, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "3943:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3936:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 432, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "nonce", - "nodeType": "MemberAccess", - "referencedDeclaration": 43, - "src": "3936:23:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 435, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "-", - "prefix": true, - "src": "3967:2:0", - "subExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 434, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3968:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "typeDescriptions": { - "typeIdentifier": "t_rational_minus_1_by_1", - "typeString": "int_const -1" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_rational_minus_1_by_1", - "typeString": "int_const -1" - } - ], - "id": 433, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "3962:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_uint256_$", - "typeString": "type(uint256)" - }, - "typeName": "uint" - }, - "id": 436, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3962:8:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3936:34:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 438, - "nodeType": "ExpressionStatement", - "src": "3936:34:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 441, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 439, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "3988:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 440, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "3996:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3988:17:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 442, - "nodeType": "ExpressionStatement", - "src": "3988:17:0" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 444, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "4039:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 445, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 376, - "src": "4046:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 446, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 378, - "src": "4049:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 443, - "name": "EpochStart", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 32, - "src": "4028:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$_t_uint256_$returns$__$", - "typeString": "function (uint256,uint256,uint256)" - } - }, - "id": 447, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4028:23:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 448, - "nodeType": "EmitStatement", - "src": "4023:28:0" - } - ] - } - } - ] - } - } - ] - }, - "documentation": null, - "id": 465, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 381, - "modifierName": { - "argumentTypes": null, - "id": 380, - "name": "keygen", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 237, - "src": "3575:6:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "3575:6:0" - } - ], - "name": "confirmKeygen", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 379, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 376, - "name": "x", - "nodeType": "VariableDeclaration", - "scope": 465, - "src": "3552:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 375, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "3552:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 378, - "name": "y", - "nodeType": "VariableDeclaration", - "scope": 465, - "src": "3560:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 377, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "3560:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "3551:16:0" - }, - "returnParameters": { - "id": 382, - "nodeType": "ParameterList", - "parameters": [], - "src": "3582:0:0" - }, - "scope": 1340, - "src": "3529:691:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 520, - "nodeType": "Block", - "src": "4296:368:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 475, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 473, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "4314:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 474, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4322:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "4314:9:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "46697273742065706f636820646f6573206e6f74206e6565642066756e6473207472616e73666572", - "id": 476, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4325:42:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_8ddae2cc9da30ed8c59c39c6a950ef823ea484ac89ff6f37abb0317fb5f679a1", - "typeString": "literal_string \"First epoch does not need funds transfer\"" - }, - "value": "First epoch does not need funds transfer" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_8ddae2cc9da30ed8c59c39c6a950ef823ea484ac89ff6f37abb0317fb5f679a1", - "typeString": "literal_string \"First epoch does not need funds transfer\"" - } - ], - "id": 472, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 13091, - 13092 - ], - "referencedDeclaration": 13092, - "src": "4306:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 477, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4306:62:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 478, - "nodeType": "ExpressionStatement", - "src": "4306:62:0" - }, - { - "condition": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 480, - "name": "Vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 64, - "src": "4394:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", - "typeString": "type(enum Bridge.Vote)" - } - }, - "id": 481, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "CONFIRM_FUNDS_TRANSFER", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4394:27:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - ], - "id": 479, - "name": "tryConfirm", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1186, - 1214 - ], - "referencedDeclaration": 1186, - "src": "4383:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$returns$_t_bool_$", - "typeString": "function (enum Bridge.Vote) returns (bool)" - } - }, - "id": 482, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4383:39:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 519, - "nodeType": "IfStatement", - "src": "4379:279:0", - "trueBody": { - "id": 518, - "nodeType": "Block", - "src": "4424:234:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 486, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 483, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 90, - "src": "4438:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 484, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 53, - "src": "4447:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$53_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 485, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "READY", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4447:12:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "src": "4438:21:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "id": 487, - "nodeType": "ExpressionStatement", - "src": "4438:21:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 494, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 488, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "4473:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 490, - "indexExpression": { - "argumentTypes": null, - "id": 489, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "4480:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4473:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 491, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "startBlock", - "nodeType": "MemberAccess", - "referencedDeclaration": 41, - "src": "4473:28:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 492, - "name": "block", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13078, - "src": "4504:5:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_block", - "typeString": "block" - } - }, - "id": 493, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "number", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4504:12:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4473:43:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 495, - "nodeType": "ExpressionStatement", - "src": "4473:43:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 504, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 496, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "4530:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 498, - "indexExpression": { - "argumentTypes": null, - "id": 497, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "4537:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4530:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 499, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "nonce", - "nodeType": "MemberAccess", - "referencedDeclaration": 43, - "src": "4530:23:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 502, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "-", - "prefix": true, - "src": "4561:2:0", - "subExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 501, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4562:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "typeDescriptions": { - "typeIdentifier": "t_rational_minus_1_by_1", - "typeString": "int_const -1" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_rational_minus_1_by_1", - "typeString": "int_const -1" - } - ], - "id": 500, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "4556:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_uint256_$", - "typeString": "type(uint256)" - }, - "typeName": "uint" - }, - "id": 503, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4556:8:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4530:34:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 505, - "nodeType": "ExpressionStatement", - "src": "4530:34:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 508, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 506, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "4578:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 507, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "4586:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4578:17:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 509, - "nodeType": "ExpressionStatement", - "src": "4578:17:0" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 511, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "4625:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 512, - "name": "getX", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 678, - "src": "4632:4:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 513, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4632:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 514, - "name": "getY", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 689, - "src": "4640:4:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 515, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4640:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 510, - "name": "EpochStart", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 32, - "src": "4614:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$_t_uint256_$returns$__$", - "typeString": "function (uint256,uint256,uint256)" - } - }, - "id": 516, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4614:33:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 517, - "nodeType": "EmitStatement", - "src": "4609:38:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 521, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 468, - "modifierName": { - "argumentTypes": null, - "id": 467, - "name": "fundsTransfer", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 249, - "src": "4265:13:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "4265:13:0" - }, - { - "arguments": null, - "id": 470, - "modifierName": { - "argumentTypes": null, - "id": 469, - "name": "currentValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 261, - "src": "4279:16:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "4279:16:0" - } - ], - "name": "confirmFundsTransfer", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 466, - "nodeType": "ParameterList", - "parameters": [], - "src": "4255:2:0" - }, - "returnParameters": { - "id": 471, - "nodeType": "ParameterList", - "parameters": [], - "src": "4296:0:0" - }, - "scope": 1340, - "src": "4226:438:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 530, - "nodeType": "Block", - "src": "4719:41:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 527, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "4747:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 526, - "name": "getParties", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 531, - 555 - ], - "referencedDeclaration": 555, - "src": "4736:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256) view returns (uint256)" - } - }, - "id": 528, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4736:17:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 525, - "id": 529, - "nodeType": "Return", - "src": "4729:24:0" - } - ] - }, - "documentation": null, - "id": 531, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getParties", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 522, - "nodeType": "ParameterList", - "parameters": [], - "src": "4689:2:0" - }, - "returnParameters": { - "id": 525, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 524, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 531, - "src": "4713:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 523, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "4713:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4712:6:0" - }, - "scope": 1340, - "src": "4670:90:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 540, - "nodeType": "Block", - "src": "4819:45:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 537, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "4847:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 536, - "name": "getParties", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 531, - 555 - ], - "referencedDeclaration": 555, - "src": "4836:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256) view returns (uint256)" - } - }, - "id": 538, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4836:21:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 535, - "id": 539, - "nodeType": "Return", - "src": "4829:28:0" - } - ] - }, - "documentation": null, - "id": 541, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getNextParties", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 532, - "nodeType": "ParameterList", - "parameters": [], - "src": "4789:2:0" - }, - "returnParameters": { - "id": 535, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 534, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 541, - "src": "4813:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 533, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "4813:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4812:6:0" - }, - "scope": 1340, - "src": "4766:98:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 554, - "nodeType": "Block", - "src": "4930:56:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 548, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "4947:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 550, - "indexExpression": { - "argumentTypes": null, - "id": 549, - "name": "_epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 543, - "src": "4954:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4947:14:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 551, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "validators", - "nodeType": "MemberAccess", - "referencedDeclaration": 35, - "src": "4947:25:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 552, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4947:32:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 547, - "id": 553, - "nodeType": "Return", - "src": "4940:39:0" - } - ] - }, - "documentation": null, - "id": 555, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getParties", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 544, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 543, - "name": "_epoch", - "nodeType": "VariableDeclaration", - "scope": 555, - "src": "4890:11:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 542, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "4890:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4889:13:0" - }, - "returnParameters": { - "id": 547, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 546, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 555, - "src": "4924:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 545, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "4924:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4923:6:0" - }, - "scope": 1340, - "src": "4870:116:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 564, - "nodeType": "Block", - "src": "5043:43:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 561, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "5073:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 560, - "name": "getThreshold", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 565, - 588 - ], - "referencedDeclaration": 588, - "src": "5060:12:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256) view returns (uint256)" - } - }, - "id": 562, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5060:19:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 559, - "id": 563, - "nodeType": "Return", - "src": "5053:26:0" - } - ] - }, - "documentation": null, - "id": 565, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getThreshold", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 556, - "nodeType": "ParameterList", - "parameters": [], - "src": "5013:2:0" - }, - "returnParameters": { - "id": 559, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 558, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 565, - "src": "5037:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 557, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5037:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5036:6:0" - }, - "scope": 1340, - "src": "4992:94:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 574, - "nodeType": "Block", - "src": "5147:47:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 571, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "5177:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 570, - "name": "getThreshold", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 565, - 588 - ], - "referencedDeclaration": 588, - "src": "5164:12:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256) view returns (uint256)" - } - }, - "id": 572, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5164:23:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 569, - "id": 573, - "nodeType": "Return", - "src": "5157:30:0" - } - ] - }, - "documentation": null, - "id": 575, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getNextThreshold", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 566, - "nodeType": "ParameterList", - "parameters": [], - "src": "5117:2:0" - }, - "returnParameters": { - "id": 569, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 568, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 575, - "src": "5141:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 567, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5141:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5140:6:0" - }, - "scope": 1340, - "src": "5092:102:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 587, - "nodeType": "Block", - "src": "5262:48:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 582, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "5279:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 584, - "indexExpression": { - "argumentTypes": null, - "id": 583, - "name": "_epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 577, - "src": "5286:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "5279:14:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 585, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "threshold", - "nodeType": "MemberAccess", - "referencedDeclaration": 37, - "src": "5279:24:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 581, - "id": 586, - "nodeType": "Return", - "src": "5272:31:0" - } - ] - }, - "documentation": null, - "id": 588, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getThreshold", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 578, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 577, - "name": "_epoch", - "nodeType": "VariableDeclaration", - "scope": 588, - "src": "5222:11:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 576, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5222:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5221:13:0" - }, - "returnParameters": { - "id": 581, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 580, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 588, - "src": "5256:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 579, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5256:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5255:6:0" - }, - "scope": 1340, - "src": "5200:110:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 597, - "nodeType": "Block", - "src": "5368:44:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 594, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "5399:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 593, - "name": "getStartBlock", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 598, - 611 - ], - "referencedDeclaration": 611, - "src": "5385:13:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256) view returns (uint256)" - } - }, - "id": 595, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5385:20:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 592, - "id": 596, - "nodeType": "Return", - "src": "5378:27:0" - } - ] - }, - "documentation": null, - "id": 598, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getStartBlock", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 589, - "nodeType": "ParameterList", - "parameters": [], - "src": "5338:2:0" - }, - "returnParameters": { - "id": 592, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 591, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 598, - "src": "5362:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 590, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5362:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5361:6:0" - }, - "scope": 1340, - "src": "5316:96:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 610, - "nodeType": "Block", - "src": "5481:49:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 605, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "5498:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 607, - "indexExpression": { - "argumentTypes": null, - "id": 606, - "name": "_epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 600, - "src": "5505:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "5498:14:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 608, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "startBlock", - "nodeType": "MemberAccess", - "referencedDeclaration": 41, - "src": "5498:25:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 604, - "id": 609, - "nodeType": "Return", - "src": "5491:32:0" - } - ] - }, - "documentation": null, - "id": 611, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getStartBlock", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 601, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 600, - "name": "_epoch", - "nodeType": "VariableDeclaration", - "scope": 611, - "src": "5441:11:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 599, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5441:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5440:13:0" - }, - "returnParameters": { - "id": 604, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 603, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 611, - "src": "5475:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 602, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5475:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5474:6:0" - }, - "scope": 1340, - "src": "5418:112:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 620, - "nodeType": "Block", - "src": "5587:43:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 617, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "5617:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 616, - "name": "getRangeSize", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 621, - 644 - ], - "referencedDeclaration": 644, - "src": "5604:12:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256) view returns (uint256)" - } - }, - "id": 618, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5604:19:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 615, - "id": 619, - "nodeType": "Return", - "src": "5597:26:0" - } - ] - }, - "documentation": null, - "id": 621, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getRangeSize", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 612, - "nodeType": "ParameterList", - "parameters": [], - "src": "5557:2:0" - }, - "returnParameters": { - "id": 615, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 614, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 621, - "src": "5581:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 613, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5581:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5580:6:0" - }, - "scope": 1340, - "src": "5536:94:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 630, - "nodeType": "Block", - "src": "5691:47:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 627, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "5721:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 626, - "name": "getRangeSize", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 621, - 644 - ], - "referencedDeclaration": 644, - "src": "5708:12:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256) view returns (uint256)" - } - }, - "id": 628, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5708:23:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 625, - "id": 629, - "nodeType": "Return", - "src": "5701:30:0" - } - ] - }, - "documentation": null, - "id": 631, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getNextRangeSize", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 622, - "nodeType": "ParameterList", - "parameters": [], - "src": "5661:2:0" - }, - "returnParameters": { - "id": 625, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 624, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 631, - "src": "5685:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 623, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5685:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5684:6:0" - }, - "scope": 1340, - "src": "5636:102:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 643, - "nodeType": "Block", - "src": "5806:48:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 638, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "5823:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 640, - "indexExpression": { - "argumentTypes": null, - "id": 639, - "name": "_epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 633, - "src": "5830:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "5823:14:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 641, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "rangeSize", - "nodeType": "MemberAccess", - "referencedDeclaration": 39, - "src": "5823:24:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 637, - "id": 642, - "nodeType": "Return", - "src": "5816:31:0" - } - ] - }, - "documentation": null, - "id": 644, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getRangeSize", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 634, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 633, - "name": "_epoch", - "nodeType": "VariableDeclaration", - "scope": 644, - "src": "5766:11:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 632, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5766:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5765:13:0" - }, - "returnParameters": { - "id": 637, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 636, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 644, - "src": "5800:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 635, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5800:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5799:6:0" - }, - "scope": 1340, - "src": "5744:110:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 653, - "nodeType": "Block", - "src": "5907:39:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 650, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "5933:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 649, - "name": "getNonce", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 654, - 667 - ], - "referencedDeclaration": 667, - "src": "5924:8:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256) view returns (uint256)" - } - }, - "id": 651, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5924:15:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 648, - "id": 652, - "nodeType": "Return", - "src": "5917:22:0" - } - ] - }, - "documentation": null, - "id": 654, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getNonce", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 645, - "nodeType": "ParameterList", - "parameters": [], - "src": "5877:2:0" - }, - "returnParameters": { - "id": 648, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 647, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 654, - "src": "5901:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 646, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5901:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5900:6:0" - }, - "scope": 1340, - "src": "5860:86:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 666, - "nodeType": "Block", - "src": "6010:44:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 661, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "6027:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 663, - "indexExpression": { - "argumentTypes": null, - "id": 662, - "name": "_epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 656, - "src": "6034:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6027:14:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 664, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "nonce", - "nodeType": "MemberAccess", - "referencedDeclaration": 43, - "src": "6027:20:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 660, - "id": 665, - "nodeType": "Return", - "src": "6020:27:0" - } - ] - }, - "documentation": null, - "id": 667, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getNonce", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 657, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 656, - "name": "_epoch", - "nodeType": "VariableDeclaration", - "scope": 667, - "src": "5970:11:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 655, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5970:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5969:13:0" - }, - "returnParameters": { - "id": 660, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 659, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 667, - "src": "6004:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 658, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "6004:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "6003:6:0" - }, - "scope": 1340, - "src": "5952:102:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 677, - "nodeType": "Block", - "src": "6103:39:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 672, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "6120:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 674, - "indexExpression": { - "argumentTypes": null, - "id": 673, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "6127:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6120:13:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 675, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "x", - "nodeType": "MemberAccess", - "referencedDeclaration": 45, - "src": "6120:15:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 671, - "id": 676, - "nodeType": "Return", - "src": "6113:22:0" - } - ] - }, - "documentation": null, - "id": 678, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getX", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 668, - "nodeType": "ParameterList", - "parameters": [], - "src": "6073:2:0" - }, - "returnParameters": { - "id": 671, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 670, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 678, - "src": "6097:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 669, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "6097:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "6096:6:0" - }, - "scope": 1340, - "src": "6060:82:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 688, - "nodeType": "Block", - "src": "6191:39:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 683, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "6208:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 685, - "indexExpression": { - "argumentTypes": null, - "id": 684, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "6215:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6208:13:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 686, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "y", - "nodeType": "MemberAccess", - "referencedDeclaration": 47, - "src": "6208:15:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 682, - "id": 687, - "nodeType": "Return", - "src": "6201:22:0" - } - ] - }, - "documentation": null, - "id": 689, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getY", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 679, - "nodeType": "ParameterList", - "parameters": [], - "src": "6161:2:0" - }, - "returnParameters": { - "id": 682, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 681, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 689, - "src": "6185:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 680, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "6185:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "6184:6:0" - }, - "scope": 1340, - "src": "6148:82:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 727, - "nodeType": "Block", - "src": "6285:215:0", - "statements": [ - { - "assignments": [ - 697 - ], - "declarations": [ - { - "constant": false, - "id": 697, - "name": "validators", - "nodeType": "VariableDeclaration", - "scope": 727, - "src": "6295:27:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 695, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "6295:7:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 696, - "length": null, - "nodeType": "ArrayTypeName", - "src": "6295:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 700, - "initialValue": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 698, - "name": "getValidators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 780, - "src": "6325:13:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_array$_t_address_$dyn_memory_ptr_$", - "typeString": "function () view returns (address[] memory)" - } - }, - "id": 699, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6325:15:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "6295:45:0" - }, - { - "body": { - "id": 723, - "nodeType": "Block", - "src": "6390:86:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 717, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 712, - "name": "validators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 697, - "src": "6408:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 714, - "indexExpression": { - "argumentTypes": null, - "id": 713, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 702, - "src": "6419:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6408:13:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 715, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13088, - "src": "6425:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 716, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "6425:10:0", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "src": "6408:27:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 722, - "nodeType": "IfStatement", - "src": "6404:61:0", - "trueBody": { - "expression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 720, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 718, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 702, - "src": "6460:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 719, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6464:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "6460:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 693, - "id": 721, - "nodeType": "Return", - "src": "6453:12:0" - } - } - ] - }, - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 708, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 705, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 702, - "src": "6367:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 706, - "name": "getParties", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 531, - 555 - ], - "referencedDeclaration": 531, - "src": "6371:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 707, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6371:12:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "6367:16:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 724, - "initializationExpression": { - "assignments": [ - 702 - ], - "declarations": [ - { - "constant": false, - "id": 702, - "name": "i", - "nodeType": "VariableDeclaration", - "scope": 724, - "src": "6355:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 701, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "6355:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 704, - "initialValue": { - "argumentTypes": null, - "hexValue": "30", - "id": 703, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6364:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "6355:10:0" - }, - "loopExpression": { - "expression": { - "argumentTypes": null, - "id": 710, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "6385:3:0", - "subExpression": { - "argumentTypes": null, - "id": 709, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 702, - "src": "6385:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 711, - "nodeType": "ExpressionStatement", - "src": "6385:3:0" - }, - "nodeType": "ForStatement", - "src": "6350:126:0" - }, - { - "expression": { - "argumentTypes": null, - "hexValue": "30", - "id": 725, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6492:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "functionReturnParameters": 693, - "id": 726, - "nodeType": "Return", - "src": "6485:8:0" - } - ] - }, - "documentation": null, - "id": 728, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getPartyId", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 690, - "nodeType": "ParameterList", - "parameters": [], - "src": "6255:2:0" - }, - "returnParameters": { - "id": 693, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 692, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 728, - "src": "6279:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 691, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "6279:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "6278:6:0" - }, - "scope": 1340, - "src": "6236:264:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 767, - "nodeType": "Block", - "src": "6568:214:0", - "statements": [ - { - "assignments": [ - 738 - ], - "declarations": [ - { - "constant": false, - "id": 738, - "name": "validators", - "nodeType": "VariableDeclaration", - "scope": 767, - "src": "6578:27:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 736, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "6578:7:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 737, - "length": null, - "nodeType": "ArrayTypeName", - "src": "6578:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 741, - "initialValue": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 739, - "name": "getNextValidators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 792, - "src": "6608:17:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_array$_t_address_$dyn_memory_ptr_$", - "typeString": "function () view returns (address[] memory)" - } - }, - "id": 740, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6608:19:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "6578:49:0" - }, - { - "body": { - "id": 763, - "nodeType": "Block", - "src": "6681:77:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 757, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 753, - "name": "validators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 738, - "src": "6699:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 755, - "indexExpression": { - "argumentTypes": null, - "id": 754, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 743, - "src": "6710:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6699:13:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "id": 756, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 730, - "src": "6716:1:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "6699:18:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 762, - "nodeType": "IfStatement", - "src": "6695:52:0", - "trueBody": { - "expression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 760, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 758, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 743, - "src": "6742:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 759, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6746:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "6742:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 734, - "id": 761, - "nodeType": "Return", - "src": "6735:12:0" - } - } - ] - }, - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 749, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 746, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 743, - "src": "6654:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 747, - "name": "getNextParties", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 541, - "src": "6658:14:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 748, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6658:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "6654:20:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 764, - "initializationExpression": { - "assignments": [ - 743 - ], - "declarations": [ - { - "constant": false, - "id": 743, - "name": "i", - "nodeType": "VariableDeclaration", - "scope": 764, - "src": "6642:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 742, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "6642:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 745, - "initialValue": { - "argumentTypes": null, - "hexValue": "30", - "id": 744, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6651:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "6642:10:0" - }, - "loopExpression": { - "expression": { - "argumentTypes": null, - "id": 751, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "6676:3:0", - "subExpression": { - "argumentTypes": null, - "id": 750, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 743, - "src": "6676:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 752, - "nodeType": "ExpressionStatement", - "src": "6676:3:0" - }, - "nodeType": "ForStatement", - "src": "6637:121:0" - }, - { - "expression": { - "argumentTypes": null, - "hexValue": "30", - "id": 765, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6774:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "functionReturnParameters": 734, - "id": 766, - "nodeType": "Return", - "src": "6767:8:0" - } - ] - }, - "documentation": null, - "id": 768, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getNextPartyId", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 731, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 730, - "name": "a", - "nodeType": "VariableDeclaration", - "scope": 768, - "src": "6530:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 729, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "6530:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "6529:11:0" - }, - "returnParameters": { - "id": 734, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 733, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 768, - "src": "6562:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 732, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "6562:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "6561:6:0" - }, - "scope": 1340, - "src": "6506:276:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 779, - "nodeType": "Block", - "src": "6852:48:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 774, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "6869:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 776, - "indexExpression": { - "argumentTypes": null, - "id": 775, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "6876:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6869:13:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 777, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "validators", - "nodeType": "MemberAccess", - "referencedDeclaration": 35, - "src": "6869:24:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "functionReturnParameters": 773, - "id": 778, - "nodeType": "Return", - "src": "6862:31:0" - } - ] - }, - "documentation": null, - "id": 780, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getValidators", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 769, - "nodeType": "ParameterList", - "parameters": [], - "src": "6810:2:0" - }, - "returnParameters": { - "id": 773, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 772, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 780, - "src": "6834:16:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 770, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "6834:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 771, - "length": null, - "nodeType": "ArrayTypeName", - "src": "6834:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "6833:18:0" - }, - "scope": 1340, - "src": "6788:112:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 791, - "nodeType": "Block", - "src": "6974:52:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 786, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "6991:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 788, - "indexExpression": { - "argumentTypes": null, - "id": 787, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "6998:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6991:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 789, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "validators", - "nodeType": "MemberAccess", - "referencedDeclaration": 35, - "src": "6991:28:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "functionReturnParameters": 785, - "id": 790, - "nodeType": "Return", - "src": "6984:35:0" - } - ] - }, - "documentation": null, - "id": 792, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getNextValidators", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 781, - "nodeType": "ParameterList", - "parameters": [], - "src": "6932:2:0" - }, - "returnParameters": { - "id": 785, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 784, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 792, - "src": "6956:16:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 782, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "6956:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 783, - "length": null, - "nodeType": "ArrayTypeName", - "src": "6956:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "6955:18:0" - }, - "scope": 1340, - "src": "6906:120:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 837, - "nodeType": "Block", - "src": "7093:296:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 800, - "name": "Vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 64, - "src": "7115:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", - "typeString": "type(enum Bridge.Vote)" - } - }, - "id": 801, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "START_VOTING", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "7115:17:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - ], - "id": 799, - "name": "tryVote", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1084, - 1109, - 1134, - 1164 - ], - "referencedDeclaration": 1084, - "src": "7107:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$returns$_t_bool_$", - "typeString": "function (enum Bridge.Vote) returns (bool)" - } - }, - "id": 802, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7107:26:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 836, - "nodeType": "IfStatement", - "src": "7103:280:0", - "trueBody": { - "id": 835, - "nodeType": "Block", - "src": "7135:248:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 804, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "7149:11:0", - "subExpression": { - "argumentTypes": null, - "id": 803, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "7149:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 805, - "nodeType": "ExpressionStatement", - "src": "7149:11:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 809, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 806, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 90, - "src": "7174:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 807, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 53, - "src": "7183:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$53_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 808, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "VOTING", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "7183:13:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "src": "7174:22:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "id": 810, - "nodeType": "ExpressionStatement", - "src": "7174:22:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 817, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 811, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "7210:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 813, - "indexExpression": { - "argumentTypes": null, - "id": 812, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "7217:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "7210:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 814, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "threshold", - "nodeType": "MemberAccess", - "referencedDeclaration": 37, - "src": "7210:27:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 815, - "name": "getThreshold", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 565, - 588 - ], - "referencedDeclaration": 565, - "src": "7240:12:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 816, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7240:14:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "7210:44:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 818, - "nodeType": "ExpressionStatement", - "src": "7210:44:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 825, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 819, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "7268:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 821, - "indexExpression": { - "argumentTypes": null, - "id": 820, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "7275:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "7268:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 822, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "validators", - "nodeType": "MemberAccess", - "referencedDeclaration": 35, - "src": "7268:28:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 823, - "name": "getValidators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 780, - "src": "7299:13:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_array$_t_address_$dyn_memory_ptr_$", - "typeString": "function () view returns (address[] memory)" - } - }, - "id": 824, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7299:15:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "src": "7268:46:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 826, - "nodeType": "ExpressionStatement", - "src": "7268:46:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 833, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 827, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "7328:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 829, - "indexExpression": { - "argumentTypes": null, - "id": 828, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "7335:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "7328:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 830, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "rangeSize", - "nodeType": "MemberAccess", - "referencedDeclaration": 39, - "src": "7328:27:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 831, - "name": "getRangeSize", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 621, - 644 - ], - "referencedDeclaration": 621, - "src": "7358:12:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 832, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7358:14:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "7328:44:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 834, - "nodeType": "ExpressionStatement", - "src": "7328:44:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 838, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 795, - "modifierName": { - "argumentTypes": null, - "id": 794, - "name": "readyOrVoting", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 213, - "src": "7062:13:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "7062:13:0" - }, - { - "arguments": null, - "id": 797, - "modifierName": { - "argumentTypes": null, - "id": 796, - "name": "currentValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 261, - "src": "7076:16:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "7076:16:0" - } - ], - "name": "startVoting", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 793, - "nodeType": "ParameterList", - "parameters": [], - "src": "7052:2:0" - }, - "returnParameters": { - "id": 798, - "nodeType": "ParameterList", - "parameters": [], - "src": "7093:0:0" - }, - "scope": 1340, - "src": "7032:357:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 871, - "nodeType": "Block", - "src": "7471:202:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 852, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 849, - "name": "validator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 840, - "src": "7504:9:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 848, - "name": "getNextPartyId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 768, - "src": "7489:14:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_uint256_$", - "typeString": "function (address) view returns (uint256)" - } - }, - "id": 850, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7489:25:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 851, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "7518:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "7489:30:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "416c726561647920612076616c696461746f72", - "id": 853, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "7521:21:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_aeb0fe100da2796aa6136a3b1c66282f002b435141be331237dfa7127e6df6ff", - "typeString": "literal_string \"Already a validator\"" - }, - "value": "Already a validator" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_aeb0fe100da2796aa6136a3b1c66282f002b435141be331237dfa7127e6df6ff", - "typeString": "literal_string \"Already a validator\"" - } - ], - "id": 847, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 13091, - 13092 - ], - "referencedDeclaration": 13092, - "src": "7481:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 854, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7481:62:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 855, - "nodeType": "ExpressionStatement", - "src": "7481:62:0" - }, - { - "condition": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 857, - "name": "Vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 64, - "src": "7566:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", - "typeString": "type(enum Bridge.Vote)" - } - }, - "id": 858, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "ADD_VALIDATOR", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "7566:18:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 859, - "name": "validator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 840, - "src": "7586:9:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 856, - "name": "tryVote", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1084, - 1109, - 1134, - 1164 - ], - "referencedDeclaration": 1109, - "src": "7558:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$_t_address_$returns$_t_bool_$", - "typeString": "function (enum Bridge.Vote,address) returns (bool)" - } - }, - "id": 860, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7558:38:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 870, - "nodeType": "IfStatement", - "src": "7554:113:0", - "trueBody": { - "id": 869, - "nodeType": "Block", - "src": "7598:69:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 866, - "name": "validator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 840, - "src": "7646:9:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 861, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "7612:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 863, - "indexExpression": { - "argumentTypes": null, - "id": 862, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "7619:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "7612:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 864, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "validators", - "nodeType": "MemberAccess", - "referencedDeclaration": 35, - "src": "7612:28:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 865, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "push", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "7612:33:0", - "typeDescriptions": { - "typeIdentifier": "t_function_arraypush_nonpayable$_t_address_$returns$_t_uint256_$", - "typeString": "function (address) returns (uint256)" - } - }, - "id": 867, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7612:44:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 868, - "nodeType": "ExpressionStatement", - "src": "7612:44:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 872, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 843, - "modifierName": { - "argumentTypes": null, - "id": 842, - "name": "voting", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 225, - "src": "7447:6:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "7447:6:0" - }, - { - "arguments": null, - "id": 845, - "modifierName": { - "argumentTypes": null, - "id": 844, - "name": "currentValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 261, - "src": "7454:16:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "7454:16:0" - } - ], - "name": "voteAddValidator", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 841, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 840, - "name": "validator", - "nodeType": "VariableDeclaration", - "scope": 872, - "src": "7421:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 839, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "7421:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "7420:19:0" - }, - "returnParameters": { - "id": 846, - "nodeType": "ParameterList", - "parameters": [], - "src": "7471:0:0" - }, - "scope": 1340, - "src": "7395:278:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 901, - "nodeType": "Block", - "src": "7758:192:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 886, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 883, - "name": "validator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 874, - "src": "7791:9:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 882, - "name": "getNextPartyId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 768, - "src": "7776:14:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_uint256_$", - "typeString": "function (address) view returns (uint256)" - } - }, - "id": 884, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7776:25:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 885, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "7805:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "7776:30:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "416c7265616479206e6f7420612076616c696461746f72", - "id": 887, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "7808:25:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_2332ed568e8af3d64f1f2b0b098c504cab97ba4128fb9f08cfa3f851ced05961", - "typeString": "literal_string \"Already not a validator\"" - }, - "value": "Already not a validator" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_2332ed568e8af3d64f1f2b0b098c504cab97ba4128fb9f08cfa3f851ced05961", - "typeString": "literal_string \"Already not a validator\"" - } - ], - "id": 881, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 13091, - 13092 - ], - "referencedDeclaration": 13092, - "src": "7768:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 888, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7768:66:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 889, - "nodeType": "ExpressionStatement", - "src": "7768:66:0" - }, - { - "condition": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 891, - "name": "Vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 64, - "src": "7857:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", - "typeString": "type(enum Bridge.Vote)" - } - }, - "id": 892, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "REMOVE_VALIDATOR", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "7857:21:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 893, - "name": "validator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 874, - "src": "7880:9:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 890, - "name": "tryVote", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1084, - 1109, - 1134, - 1164 - ], - "referencedDeclaration": 1109, - "src": "7849:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$_t_address_$returns$_t_bool_$", - "typeString": "function (enum Bridge.Vote,address) returns (bool)" - } - }, - "id": 894, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7849:41:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 900, - "nodeType": "IfStatement", - "src": "7845:99:0", - "trueBody": { - "id": 899, - "nodeType": "Block", - "src": "7892:52:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 896, - "name": "validator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 874, - "src": "7923:9:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 895, - "name": "_removeValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 967, - "src": "7906:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$", - "typeString": "function (address)" - } - }, - "id": 897, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7906:27:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 898, - "nodeType": "ExpressionStatement", - "src": "7906:27:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 902, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 877, - "modifierName": { - "argumentTypes": null, - "id": 876, - "name": "voting", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 225, - "src": "7734:6:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "7734:6:0" - }, - { - "arguments": null, - "id": 879, - "modifierName": { - "argumentTypes": null, - "id": 878, - "name": "currentValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 261, - "src": "7741:16:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "7741:16:0" - } - ], - "name": "voteRemoveValidator", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 875, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 874, - "name": "validator", - "nodeType": "VariableDeclaration", - "scope": 902, - "src": "7708:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 873, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "7708:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "7707:19:0" - }, - "returnParameters": { - "id": 880, - "nodeType": "ParameterList", - "parameters": [], - "src": "7758:0:0" - }, - "scope": 1340, - "src": "7679:271:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 966, - "nodeType": "Block", - "src": "8009:383:0", - "statements": [ - { - "body": { - "id": 946, - "nodeType": "Block", - "src": "8067:205:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 927, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 920, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "8085:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 922, - "indexExpression": { - "argumentTypes": null, - "id": 921, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "8092:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8085:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 923, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "validators", - "nodeType": "MemberAccess", - "referencedDeclaration": 35, - "src": "8085:28:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 925, - "indexExpression": { - "argumentTypes": null, - "id": 924, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 908, - "src": "8114:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8085:31:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "id": 926, - "name": "validator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 904, - "src": "8120:9:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "8085:44:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 945, - "nodeType": "IfStatement", - "src": "8081:181:0", - "trueBody": { - "id": 944, - "nodeType": "Block", - "src": "8131:131:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 941, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 928, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "8149:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 930, - "indexExpression": { - "argumentTypes": null, - "id": 929, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "8156:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8149:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 931, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "validators", - "nodeType": "MemberAccess", - "referencedDeclaration": 35, - "src": "8149:28:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 933, - "indexExpression": { - "argumentTypes": null, - "id": 932, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 908, - "src": "8178:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "8149:31:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 934, - "name": "getNextValidators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 792, - "src": "8183:17:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_array$_t_address_$dyn_memory_ptr_$", - "typeString": "function () view returns (address[] memory)" - } - }, - "id": 935, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8183:19:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 940, - "indexExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 939, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 936, - "name": "getNextParties", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 541, - "src": "8203:14:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 937, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8203:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 938, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8222:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "8203:20:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8183:41:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "8149:75:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 942, - "nodeType": "ExpressionStatement", - "src": "8149:75:0" - }, - { - "id": 943, - "nodeType": "Break", - "src": "8242:5:0" - } - ] - } - } - ] - }, - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 916, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 911, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 908, - "src": "8036:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 915, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 912, - "name": "getNextParties", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 541, - "src": "8040:14:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 913, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8040:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 914, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8059:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "8040:20:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "8036:24:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 947, - "initializationExpression": { - "assignments": [ - 908 - ], - "declarations": [ - { - "constant": false, - "id": 908, - "name": "i", - "nodeType": "VariableDeclaration", - "scope": 947, - "src": "8024:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 907, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "8024:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 910, - "initialValue": { - "argumentTypes": null, - "hexValue": "30", - "id": 909, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8033:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "8024:10:0" - }, - "loopExpression": { - "expression": { - "argumentTypes": null, - "id": 918, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "8062:3:0", - "subExpression": { - "argumentTypes": null, - "id": 917, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 908, - "src": "8062:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 919, - "nodeType": "ExpressionStatement", - "src": "8062:3:0" - }, - "nodeType": "ForStatement", - "src": "8019:253:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 957, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "delete", - "prefix": true, - "src": "8281:57:0", - "subExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 948, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "8288:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 950, - "indexExpression": { - "argumentTypes": null, - "id": 949, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "8295:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8288:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 951, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "validators", - "nodeType": "MemberAccess", - "referencedDeclaration": 35, - "src": "8288:28:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 956, - "indexExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 955, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 952, - "name": "getNextParties", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 541, - "src": "8317:14:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 953, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8317:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 954, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8336:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "8317:20:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "8288:50:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 958, - "nodeType": "ExpressionStatement", - "src": "8281:57:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 964, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "--", - "prefix": false, - "src": "8348:37:0", - "subExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 959, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "8348:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 961, - "indexExpression": { - "argumentTypes": null, - "id": 960, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "8355:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8348:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 962, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "validators", - "nodeType": "MemberAccess", - "referencedDeclaration": 35, - "src": "8348:28:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 963, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "8348:35:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 965, - "nodeType": "ExpressionStatement", - "src": "8348:37:0" - } - ] - }, - "documentation": null, - "id": 967, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "_removeValidator", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 905, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 904, - "name": "validator", - "nodeType": "VariableDeclaration", - "scope": 967, - "src": "7982:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 903, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "7982:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "7981:19:0" - }, - "returnParameters": { - "id": 906, - "nodeType": "ParameterList", - "parameters": [], - "src": "8009:0:0" - }, - "scope": 1340, - "src": "7956:436:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "private" - }, - { - "body": { - "id": 990, - "nodeType": "Block", - "src": "8474:127:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 977, - "name": "Vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 64, - "src": "8496:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", - "typeString": "type(enum Bridge.Vote)" - } - }, - "id": 978, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "CHANGE_THRESHOLD", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "8496:21:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 979, - "name": "threshold", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 969, - "src": "8519:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 976, - "name": "tryVote", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1084, - 1109, - 1134, - 1164 - ], - "referencedDeclaration": 1134, - "src": "8488:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$_t_uint256_$returns$_t_bool_$", - "typeString": "function (enum Bridge.Vote,uint256) returns (bool)" - } - }, - "id": 980, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8488:41:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 989, - "nodeType": "IfStatement", - "src": "8484:111:0", - "trueBody": { - "id": 988, - "nodeType": "Block", - "src": "8531:64:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 986, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 981, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "8545:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 983, - "indexExpression": { - "argumentTypes": null, - "id": 982, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "8552:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8545:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 984, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "threshold", - "nodeType": "MemberAccess", - "referencedDeclaration": 37, - "src": "8545:27:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 985, - "name": "threshold", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 969, - "src": "8575:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "8545:39:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 987, - "nodeType": "ExpressionStatement", - "src": "8545:39:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 991, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 972, - "modifierName": { - "argumentTypes": null, - "id": 971, - "name": "voting", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 225, - "src": "8450:6:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "8450:6:0" - }, - { - "arguments": null, - "id": 974, - "modifierName": { - "argumentTypes": null, - "id": 973, - "name": "currentValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 261, - "src": "8457:16:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "8457:16:0" - } - ], - "name": "voteChangeThreshold", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 970, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 969, - "name": "threshold", - "nodeType": "VariableDeclaration", - "scope": 991, - "src": "8427:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 968, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "8427:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "8426:16:0" - }, - "returnParameters": { - "id": 975, - "nodeType": "ParameterList", - "parameters": [], - "src": "8474:0:0" - }, - "scope": 1340, - "src": "8398:203:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 1014, - "nodeType": "Block", - "src": "8683:128:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1001, - "name": "Vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 64, - "src": "8705:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", - "typeString": "type(enum Bridge.Vote)" - } - }, - "id": 1002, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "CHANGE_RANGE_SIZE", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "8705:22:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 1003, - "name": "rangeSize", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 993, - "src": "8729:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 1000, - "name": "tryVote", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1084, - 1109, - 1134, - 1164 - ], - "referencedDeclaration": 1134, - "src": "8697:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$_t_uint256_$returns$_t_bool_$", - "typeString": "function (enum Bridge.Vote,uint256) returns (bool)" - } - }, - "id": 1004, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8697:42:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 1013, - "nodeType": "IfStatement", - "src": "8693:112:0", - "trueBody": { - "id": 1012, - "nodeType": "Block", - "src": "8741:64:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 1010, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1005, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "8755:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 1007, - "indexExpression": { - "argumentTypes": null, - "id": 1006, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "8762:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8755:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 1008, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "rangeSize", - "nodeType": "MemberAccess", - "referencedDeclaration": 39, - "src": "8755:27:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 1009, - "name": "rangeSize", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 993, - "src": "8785:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "8755:39:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 1011, - "nodeType": "ExpressionStatement", - "src": "8755:39:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 1015, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 996, - "modifierName": { - "argumentTypes": null, - "id": 995, - "name": "voting", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 225, - "src": "8659:6:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "8659:6:0" - }, - { - "arguments": null, - "id": 998, - "modifierName": { - "argumentTypes": null, - "id": 997, - "name": "currentValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 261, - "src": "8666:16:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "8666:16:0" - } - ], - "name": "voteChangeRangeSize", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 994, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 993, - "name": "rangeSize", - "nodeType": "VariableDeclaration", - "scope": 1015, - "src": "8636:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 992, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "8636:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "8635:16:0" - }, - "returnParameters": { - "id": 999, - "nodeType": "ParameterList", - "parameters": [], - "src": "8683:0:0" - }, - "scope": 1340, - "src": "8607:204:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 1038, - "nodeType": "Block", - "src": "8875:141:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1023, - "name": "Vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 64, - "src": "8897:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", - "typeString": "type(enum Bridge.Vote)" - } - }, - "id": 1024, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "START_KEYGEN", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "8897:17:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - ], - "id": 1022, - "name": "tryVote", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1084, - 1109, - 1134, - 1164 - ], - "referencedDeclaration": 1084, - "src": "8889:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$returns$_t_bool_$", - "typeString": "function (enum Bridge.Vote) returns (bool)" - } - }, - "id": 1025, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8889:26:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 1037, - "nodeType": "IfStatement", - "src": "8885:125:0", - "trueBody": { - "id": 1036, - "nodeType": "Block", - "src": "8917:93:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 1029, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 1026, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 90, - "src": "8931:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1027, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 53, - "src": "8940:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$53_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 1028, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "KEYGEN", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "8940:13:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "src": "8931:22:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "id": 1030, - "nodeType": "ExpressionStatement", - "src": "8931:22:0" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1032, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "8982:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 1033, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "8989:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 1031, - "name": "NewEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 14, - "src": "8973:8:0", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$returns$__$", - "typeString": "function (uint256,uint256)" - } - }, - "id": 1034, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8973:26:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 1035, - "nodeType": "EmitStatement", - "src": "8968:31:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 1039, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 1018, - "modifierName": { - "argumentTypes": null, - "id": 1017, - "name": "voting", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 225, - "src": "8851:6:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "8851:6:0" - }, - { - "arguments": null, - "id": 1020, - "modifierName": { - "argumentTypes": null, - "id": 1019, - "name": "currentValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 261, - "src": "8858:16:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "8858:16:0" - } - ], - "name": "voteStartKeygen", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1016, - "nodeType": "ParameterList", - "parameters": [], - "src": "8841:2:0" - }, - "returnParameters": { - "id": 1021, - "nodeType": "ParameterList", - "parameters": [], - "src": "8875:0:0" - }, - "scope": 1340, - "src": "8817:199:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 1061, - "nodeType": "Block", - "src": "9081:144:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1047, - "name": "Vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 64, - "src": "9103:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", - "typeString": "type(enum Bridge.Vote)" - } - }, - "id": 1048, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "CANCEL_KEYGEN", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "9103:18:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - ], - "id": 1046, - "name": "tryVote", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1084, - 1109, - 1134, - 1164 - ], - "referencedDeclaration": 1084, - "src": "9095:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$returns$_t_bool_$", - "typeString": "function (enum Bridge.Vote) returns (bool)" - } - }, - "id": 1049, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9095:27:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 1060, - "nodeType": "IfStatement", - "src": "9091:128:0", - "trueBody": { - "id": 1059, - "nodeType": "Block", - "src": "9124:95:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 1053, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 1050, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 90, - "src": "9138:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1051, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 53, - "src": "9147:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$53_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 1052, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "VOTING", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "9147:13:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "src": "9138:22:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "id": 1054, - "nodeType": "ExpressionStatement", - "src": "9138:22:0" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1056, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "9198:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 1055, - "name": "NewEpochCancelled", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 18, - "src": "9180:17:0", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$returns$__$", - "typeString": "function (uint256)" - } - }, - "id": 1057, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9180:28:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 1058, - "nodeType": "EmitStatement", - "src": "9175:33:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 1062, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 1042, - "modifierName": { - "argumentTypes": null, - "id": 1041, - "name": "keygen", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 237, - "src": "9057:6:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "9057:6:0" - }, - { - "arguments": null, - "id": 1044, - "modifierName": { - "argumentTypes": null, - "id": 1043, - "name": "currentValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 261, - "src": "9064:16:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "9064:16:0" - } - ], - "name": "voteCancelKeygen", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1040, - "nodeType": "ParameterList", - "parameters": [], - "src": "9047:2:0" - }, - "returnParameters": { - "id": 1045, - "nodeType": "ParameterList", - "parameters": [], - "src": "9081:0:0" - }, - "scope": 1340, - "src": "9022:203:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 1083, - "nodeType": "Block", - "src": "9286:110:0", - "statements": [ - { - "assignments": [ - 1070 - ], - "declarations": [ - { - "constant": false, - "id": 1070, - "name": "vote", - "nodeType": "VariableDeclaration", - "scope": 1083, - "src": "9296:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1069, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "9296:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 1078, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1074, - "name": "voteType", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1064, - "src": "9338:8:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 1075, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "9348:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 1072, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13075, - "src": "9321:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 1073, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "9321:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 1076, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9321:37:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 1071, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13082, - "src": "9311:9:0", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 1077, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9311:48:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "9296:63:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1080, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1070, - "src": "9384:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "id": 1079, - "name": "putVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1268, - "src": "9376:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$_t_bool_$", - "typeString": "function (bytes32) returns (bool)" - } - }, - "id": 1081, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9376:13:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "functionReturnParameters": 1068, - "id": 1082, - "nodeType": "Return", - "src": "9369:20:0" - } - ] - }, - "documentation": null, - "id": 1084, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "tryVote", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1065, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1064, - "name": "voteType", - "nodeType": "VariableDeclaration", - "scope": 1084, - "src": "9248:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - "typeName": { - "contractScope": null, - "id": 1063, - "name": "Vote", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 64, - "src": "9248:4:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "9247:15:0" - }, - "returnParameters": { - "id": 1068, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1067, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 1084, - "src": "9280:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 1066, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "9280:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "9279:6:0" - }, - "scope": 1340, - "src": "9231:165:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "private" - }, - { - "body": { - "id": 1108, - "nodeType": "Block", - "src": "9471:116:0", - "statements": [ - { - "assignments": [ - 1094 - ], - "declarations": [ - { - "constant": false, - "id": 1094, - "name": "vote", - "nodeType": "VariableDeclaration", - "scope": 1108, - "src": "9481:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1093, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "9481:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 1103, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1098, - "name": "voteType", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1086, - "src": "9523:8:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 1099, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "9533:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 1100, - "name": "addr", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1088, - "src": "9544:4:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "expression": { - "argumentTypes": null, - "id": 1096, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13075, - "src": "9506:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 1097, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "9506:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 1101, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9506:43:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 1095, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13082, - "src": "9496:9:0", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 1102, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9496:54:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "9481:69:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1105, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1094, - "src": "9575:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "id": 1104, - "name": "putVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1268, - "src": "9567:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$_t_bool_$", - "typeString": "function (bytes32) returns (bool)" - } - }, - "id": 1106, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9567:13:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "functionReturnParameters": 1092, - "id": 1107, - "nodeType": "Return", - "src": "9560:20:0" - } - ] - }, - "documentation": null, - "id": 1109, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "tryVote", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1089, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1086, - "name": "voteType", - "nodeType": "VariableDeclaration", - "scope": 1109, - "src": "9419:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - "typeName": { - "contractScope": null, - "id": 1085, - "name": "Vote", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 64, - "src": "9419:4:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 1088, - "name": "addr", - "nodeType": "VariableDeclaration", - "scope": 1109, - "src": "9434:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1087, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "9434:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "9418:29:0" - }, - "returnParameters": { - "id": 1092, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1091, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 1109, - "src": "9465:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 1090, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "9465:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "9464:6:0" - }, - "scope": 1340, - "src": "9402:185:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "private" - }, - { - "body": { - "id": 1133, - "nodeType": "Block", - "src": "9658:115:0", - "statements": [ - { - "assignments": [ - 1119 - ], - "declarations": [ - { - "constant": false, - "id": 1119, - "name": "vote", - "nodeType": "VariableDeclaration", - "scope": 1133, - "src": "9668:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1118, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "9668:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 1128, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1123, - "name": "voteType", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1111, - "src": "9710:8:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 1124, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "9720:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 1125, - "name": "num", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1113, - "src": "9731:3:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 1121, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13075, - "src": "9693:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 1122, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "9693:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 1126, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9693:42:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 1120, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13082, - "src": "9683:9:0", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 1127, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9683:53:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "9668:68:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1130, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1119, - "src": "9761:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "id": 1129, - "name": "putVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1268, - "src": "9753:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$_t_bool_$", - "typeString": "function (bytes32) returns (bool)" - } - }, - "id": 1131, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9753:13:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "functionReturnParameters": 1117, - "id": 1132, - "nodeType": "Return", - "src": "9746:20:0" - } - ] - }, - "documentation": null, - "id": 1134, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "tryVote", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1114, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1111, - "name": "voteType", - "nodeType": "VariableDeclaration", - "scope": 1134, - "src": "9610:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - "typeName": { - "contractScope": null, - "id": 1110, - "name": "Vote", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 64, - "src": "9610:4:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 1113, - "name": "num", - "nodeType": "VariableDeclaration", - "scope": 1134, - "src": "9625:8:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1112, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "9625:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "9609:25:0" - }, - "returnParameters": { - "id": 1117, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1116, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 1134, - "src": "9652:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 1115, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "9652:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "9651:6:0" - }, - "scope": 1340, - "src": "9593:180:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "private" - }, - { - "body": { - "id": 1163, - "nodeType": "Block", - "src": "9872:116:0", - "statements": [ - { - "assignments": [ - 1148 - ], - "declarations": [ - { - "constant": false, - "id": 1148, - "name": "vote", - "nodeType": "VariableDeclaration", - "scope": 1163, - "src": "9882:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1147, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "9882:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 1158, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1152, - "name": "voteType", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1136, - "src": "9924:8:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 1153, - "name": "hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1138, - "src": "9934:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "id": 1154, - "name": "to", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1140, - "src": "9940:2:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 1155, - "name": "value", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1142, - "src": "9944:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 1150, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13075, - "src": "9907:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 1151, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "9907:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 1156, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9907:43:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 1149, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13082, - "src": "9897:9:0", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 1157, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9897:54:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "9882:69:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1160, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1148, - "src": "9976:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "id": 1159, - "name": "putVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1268, - "src": "9968:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$_t_bool_$", - "typeString": "function (bytes32) returns (bool)" - } - }, - "id": 1161, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9968:13:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "functionReturnParameters": 1146, - "id": 1162, - "nodeType": "Return", - "src": "9961:20:0" - } - ] - }, - "documentation": null, - "id": 1164, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "tryVote", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1143, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1136, - "name": "voteType", - "nodeType": "VariableDeclaration", - "scope": 1164, - "src": "9796:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - "typeName": { - "contractScope": null, - "id": 1135, - "name": "Vote", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 64, - "src": "9796:4:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 1138, - "name": "hash", - "nodeType": "VariableDeclaration", - "scope": 1164, - "src": "9811:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1137, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "9811:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 1140, - "name": "to", - "nodeType": "VariableDeclaration", - "scope": 1164, - "src": "9825:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1139, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "9825:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 1142, - "name": "value", - "nodeType": "VariableDeclaration", - "scope": 1164, - "src": "9837:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1141, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "9837:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "9795:53:0" - }, - "returnParameters": { - "id": 1146, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1145, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 1164, - "src": "9866:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 1144, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "9866:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "9865:6:0" - }, - "scope": 1340, - "src": "9779:209:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "private" - }, - { - "body": { - "id": 1185, - "nodeType": "Block", - "src": "10052:113:0", - "statements": [ - { - "assignments": [ - 1172 - ], - "declarations": [ - { - "constant": false, - "id": 1172, - "name": "vote", - "nodeType": "VariableDeclaration", - "scope": 1185, - "src": "10062:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1171, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "10062:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 1180, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1176, - "name": "voteType", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1166, - "src": "10104:8:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 1177, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "10114:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 1174, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13075, - "src": "10087:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 1175, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "10087:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 1178, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10087:37:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 1173, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13082, - "src": "10077:9:0", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 1179, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10077:48:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "10062:63:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1182, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1172, - "src": "10153:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "id": 1181, - "name": "putConfirm", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1322, - "src": "10142:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$_t_bool_$", - "typeString": "function (bytes32) returns (bool)" - } - }, - "id": 1183, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10142:16:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "functionReturnParameters": 1170, - "id": 1184, - "nodeType": "Return", - "src": "10135:23:0" - } - ] - }, - "documentation": null, - "id": 1186, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "tryConfirm", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1167, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1166, - "name": "voteType", - "nodeType": "VariableDeclaration", - "scope": 1186, - "src": "10014:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - "typeName": { - "contractScope": null, - "id": 1165, - "name": "Vote", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 64, - "src": "10014:4:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "10013:15:0" - }, - "returnParameters": { - "id": 1170, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1169, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 1186, - "src": "10046:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 1168, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "10046:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "10045:6:0" - }, - "scope": 1340, - "src": "9994:171:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "private" - }, - { - "body": { - "id": 1213, - "nodeType": "Block", - "src": "10245:119:0", - "statements": [ - { - "assignments": [ - 1198 - ], - "declarations": [ - { - "constant": false, - "id": 1198, - "name": "vote", - "nodeType": "VariableDeclaration", - "scope": 1213, - "src": "10255:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1197, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "10255:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 1208, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1202, - "name": "voteType", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1188, - "src": "10297:8:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 1203, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "10307:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 1204, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1190, - "src": "10318:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 1205, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1192, - "src": "10321:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 1200, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13075, - "src": "10280:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 1201, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "10280:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 1206, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10280:43:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 1199, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13082, - "src": "10270:9:0", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 1207, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10270:54:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "10255:69:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1210, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1198, - "src": "10352:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "id": 1209, - "name": "putConfirm", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1322, - "src": "10341:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$_t_bool_$", - "typeString": "function (bytes32) returns (bool)" - } - }, - "id": 1211, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10341:16:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "functionReturnParameters": 1196, - "id": 1212, - "nodeType": "Return", - "src": "10334:23:0" - } - ] - }, - "documentation": null, - "id": 1214, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "tryConfirm", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1193, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1188, - "name": "voteType", - "nodeType": "VariableDeclaration", - "scope": 1214, - "src": "10191:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - "typeName": { - "contractScope": null, - "id": 1187, - "name": "Vote", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 64, - "src": "10191:4:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 1190, - "name": "x", - "nodeType": "VariableDeclaration", - "scope": 1214, - "src": "10206:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1189, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "10206:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 1192, - "name": "y", - "nodeType": "VariableDeclaration", - "scope": 1214, - "src": "10214:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1191, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "10214:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "10190:31:0" - }, - "returnParameters": { - "id": 1196, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1195, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 1214, - "src": "10239:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 1194, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "10239:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "10238:6:0" - }, - "scope": 1340, - "src": "10171:193:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "private" - }, - { - "body": { - "id": 1267, - "nodeType": "Block", - "src": "10424:355:0", - "statements": [ - { - "assignments": [ - 1222 - ], - "declarations": [ - { - "constant": false, - "id": 1222, - "name": "personalVote", - "nodeType": "VariableDeclaration", - "scope": 1267, - "src": "10434:20:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1221, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "10434:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 1226, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1224, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1216, - "src": "10473:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "id": 1223, - "name": "personalizeVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1339, - "src": "10457:15:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_bytes32_$", - "typeString": "function (bytes32) view returns (bytes32)" - } - }, - "id": 1225, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10457:21:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "10434:44:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1231, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "!", - "prefix": true, - "src": "10496:20:0", - "subExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1228, - "name": "votes", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 84, - "src": "10497:5:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - } - }, - "id": 1230, - "indexExpression": { - "argumentTypes": null, - "id": 1229, - "name": "personalVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1222, - "src": "10503:12:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "10497:19:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "566f74656420616c7265616479", - "id": 1232, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "10518:15:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_230c30109b60c15b21799291aaf5c571045da3dc3f224d8bbd2f2e688c149a47", - "typeString": "literal_string \"Voted already\"" - }, - "value": "Voted already" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_230c30109b60c15b21799291aaf5c571045da3dc3f224d8bbd2f2e688c149a47", - "typeString": "literal_string \"Voted already\"" - } - ], - "id": 1227, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 13091, - 13092 - ], - "referencedDeclaration": 13092, - "src": "10488:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 1233, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10488:46:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 1234, - "nodeType": "ExpressionStatement", - "src": "10488:46:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 1239, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1235, - "name": "votes", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 84, - "src": "10545:5:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - } - }, - "id": 1237, - "indexExpression": { - "argumentTypes": null, - "id": 1236, - "name": "personalVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1222, - "src": "10551:12:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "10545:19:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 1238, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "10567:4:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "src": "10545:26:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 1240, - "nodeType": "ExpressionStatement", - "src": "10545:26:0" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 1246, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1241, - "name": "votesCount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 80, - "src": "10585:10:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - } - }, - "id": 1243, - "indexExpression": { - "argumentTypes": null, - "id": 1242, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1216, - "src": "10596:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "10585:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 1244, - "name": "getThreshold", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 565, - 588 - ], - "referencedDeclaration": 565, - "src": "10605:12:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 1245, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10605:14:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "10585:34:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "id": 1265, - "nodeType": "Block", - "src": "10704:69:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 1261, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "10718:18:0", - "subExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1258, - "name": "votesCount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 80, - "src": "10718:10:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - } - }, - "id": 1260, - "indexExpression": { - "argumentTypes": null, - "id": 1259, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1216, - "src": "10729:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "10718:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 1262, - "nodeType": "ExpressionStatement", - "src": "10718:18:0" - }, - { - "expression": { - "argumentTypes": null, - "hexValue": "66616c7365", - "id": 1263, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "10757:5:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "false" - }, - "functionReturnParameters": 1220, - "id": 1264, - "nodeType": "Return", - "src": "10750:12:0" - } - ] - }, - "id": 1266, - "nodeType": "IfStatement", - "src": "10581:192:0", - "trueBody": { - "id": 1257, - "nodeType": "Block", - "src": "10621:77:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 1253, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1247, - "name": "votesCount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 80, - "src": "10635:10:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - } - }, - "id": 1249, - "indexExpression": { - "argumentTypes": null, - "id": 1248, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1216, - "src": "10646:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "10635:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_rational_57896044618658097711785492504343953926634992332820282019728792003956564819968_by_1", - "typeString": "int_const 5789...(69 digits omitted)...9968" - }, - "id": 1252, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "hexValue": "32", - "id": 1250, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "10654:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "nodeType": "BinaryOperation", - "operator": "**", - "rightExpression": { - "argumentTypes": null, - "hexValue": "323535", - "id": 1251, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "10659:3:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_255_by_1", - "typeString": "int_const 255" - }, - "value": "255" - }, - "src": "10654:8:0", - "typeDescriptions": { - "typeIdentifier": "t_rational_57896044618658097711785492504343953926634992332820282019728792003956564819968_by_1", - "typeString": "int_const 5789...(69 digits omitted)...9968" - } - }, - "src": "10635:27:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 1254, - "nodeType": "ExpressionStatement", - "src": "10635:27:0" - }, - { - "expression": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 1255, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "10683:4:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "functionReturnParameters": 1220, - "id": 1256, - "nodeType": "Return", - "src": "10676:11:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 1268, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "putVote", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1217, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1216, - "name": "vote", - "nodeType": "VariableDeclaration", - "scope": 1268, - "src": "10387:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1215, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "10387:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "10386:14:0" - }, - "returnParameters": { - "id": 1220, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1219, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 1268, - "src": "10418:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 1218, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "10418:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "10417:6:0" - }, - "scope": 1340, - "src": "10370:409:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "private" - }, - { - "body": { - "id": 1321, - "nodeType": "Block", - "src": "10842:363:0", - "statements": [ - { - "assignments": [ - 1276 - ], - "declarations": [ - { - "constant": false, - "id": 1276, - "name": "personalVote", - "nodeType": "VariableDeclaration", - "scope": 1321, - "src": "10852:20:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1275, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "10852:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 1280, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1278, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1270, - "src": "10891:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "id": 1277, - "name": "personalizeVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1339, - "src": "10875:15:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_bytes32_$", - "typeString": "function (bytes32) view returns (bytes32)" - } - }, - "id": 1279, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10875:21:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "10852:44:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1285, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "!", - "prefix": true, - "src": "10914:20:0", - "subExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1282, - "name": "votes", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 84, - "src": "10915:5:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - } - }, - "id": 1284, - "indexExpression": { - "argumentTypes": null, - "id": 1283, - "name": "personalVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1276, - "src": "10921:12:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "10915:19:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "436f6e6669726d656420616c7265616479", - "id": 1286, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "10936:19:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_762a97ce67d271844ad9c09d89a5271fde7fe7537af208da055a904cd67ac7bc", - "typeString": "literal_string \"Confirmed already\"" - }, - "value": "Confirmed already" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_762a97ce67d271844ad9c09d89a5271fde7fe7537af208da055a904cd67ac7bc", - "typeString": "literal_string \"Confirmed already\"" - } - ], - "id": 1281, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 13091, - 13092 - ], - "referencedDeclaration": 13092, - "src": "10906:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 1287, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10906:50:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 1288, - "nodeType": "ExpressionStatement", - "src": "10906:50:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 1293, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1289, - "name": "votes", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 84, - "src": "10967:5:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - } - }, - "id": 1291, - "indexExpression": { - "argumentTypes": null, - "id": 1290, - "name": "personalVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1276, - "src": "10973:12:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "10967:19:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 1292, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "10989:4:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "src": "10967:26:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 1294, - "nodeType": "ExpressionStatement", - "src": "10967:26:0" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 1300, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1295, - "name": "votesCount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 80, - "src": "11007:10:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - } - }, - "id": 1297, - "indexExpression": { - "argumentTypes": null, - "id": 1296, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1270, - "src": "11018:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "11007:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 1298, - "name": "getNextThreshold", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 575, - "src": "11027:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 1299, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "11027:18:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "11007:38:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "id": 1319, - "nodeType": "Block", - "src": "11130:69:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 1315, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "11144:18:0", - "subExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1312, - "name": "votesCount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 80, - "src": "11144:10:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - } - }, - "id": 1314, - "indexExpression": { - "argumentTypes": null, - "id": 1313, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1270, - "src": "11155:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "11144:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 1316, - "nodeType": "ExpressionStatement", - "src": "11144:18:0" - }, - { - "expression": { - "argumentTypes": null, - "hexValue": "66616c7365", - "id": 1317, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "11183:5:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "false" - }, - "functionReturnParameters": 1274, - "id": 1318, - "nodeType": "Return", - "src": "11176:12:0" - } - ] - }, - "id": 1320, - "nodeType": "IfStatement", - "src": "11003:196:0", - "trueBody": { - "id": 1311, - "nodeType": "Block", - "src": "11047:77:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 1307, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1301, - "name": "votesCount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 80, - "src": "11061:10:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - } - }, - "id": 1303, - "indexExpression": { - "argumentTypes": null, - "id": 1302, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1270, - "src": "11072:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "11061:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_rational_57896044618658097711785492504343953926634992332820282019728792003956564819968_by_1", - "typeString": "int_const 5789...(69 digits omitted)...9968" - }, - "id": 1306, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "hexValue": "32", - "id": 1304, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "11080:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "nodeType": "BinaryOperation", - "operator": "**", - "rightExpression": { - "argumentTypes": null, - "hexValue": "323535", - "id": 1305, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "11085:3:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_255_by_1", - "typeString": "int_const 255" - }, - "value": "255" - }, - "src": "11080:8:0", - "typeDescriptions": { - "typeIdentifier": "t_rational_57896044618658097711785492504343953926634992332820282019728792003956564819968_by_1", - "typeString": "int_const 5789...(69 digits omitted)...9968" - } - }, - "src": "11061:27:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 1308, - "nodeType": "ExpressionStatement", - "src": "11061:27:0" - }, - { - "expression": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 1309, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "11109:4:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "functionReturnParameters": 1274, - "id": 1310, - "nodeType": "Return", - "src": "11102:11:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 1322, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "putConfirm", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1271, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1270, - "name": "vote", - "nodeType": "VariableDeclaration", - "scope": 1322, - "src": "10805:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1269, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "10805:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "10804:14:0" - }, - "returnParameters": { - "id": 1274, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1273, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 1322, - "src": "10836:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 1272, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "10836:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "10835:6:0" - }, - "scope": 1340, - "src": "10785:420:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "private" - }, - { - "body": { - "id": 1338, - "nodeType": "Block", - "src": "11281:69:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1332, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1324, - "src": "11325:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1333, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13088, - "src": "11331:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 1334, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "11331:10:0", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - ], - "expression": { - "argumentTypes": null, - "id": 1330, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13075, - "src": "11308:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 1331, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "11308:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 1335, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "11308:34:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 1329, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13082, - "src": "11298:9:0", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 1336, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "11298:45:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "functionReturnParameters": 1328, - "id": 1337, - "nodeType": "Return", - "src": "11291:52:0" - } - ] - }, - "documentation": null, - "id": 1339, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "personalizeVote", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1325, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1324, - "name": "vote", - "nodeType": "VariableDeclaration", - "scope": 1339, - "src": "11236:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1323, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "11236:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "11235:14:0" - }, - "returnParameters": { - "id": 1328, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1327, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 1339, - "src": "11272:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1326, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "11272:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "11271:9:0" - }, - "scope": 1340, - "src": "11211:139:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "private" - } - ], - "scope": 1341, - "src": "93:11259:0" - } - ], - "src": "0:11353:0" - }, - "legacyAST": { - "absolutePath": "/build/contracts/Bridge.sol", - "exportedSymbols": { - "Bridge": [ - 1340 - ] - }, - "id": 1341, - "nodeType": "SourceUnit", - "nodes": [ - { - "id": 1, - "literals": [ - "solidity", - "^", - "0.5", - ".0" - ], - "nodeType": "PragmaDirective", - "src": "0:23:0" - }, - { - "absolutePath": "/build/contracts/openzeppelin-solidity/contracts/token/ERC20/IERC20.sol", - "file": "./openzeppelin-solidity/contracts/token/ERC20/IERC20.sol", - "id": 2, - "nodeType": "ImportDirective", - "scope": 1341, - "sourceUnit": 10033, - "src": "25:66:0", - "symbolAliases": [], - "unitAlias": "" - }, - { - "baseContracts": [], - "contractDependencies": [], - "contractKind": "contract", - "documentation": null, - "fullyImplemented": true, - "id": 1340, - "linearizedBaseContracts": [ - 1340 - ], - "name": "Bridge", - "nodeType": "ContractDefinition", - "nodes": [ - { - "anonymous": false, - "documentation": null, - "id": 8, - "name": "ExchangeRequest", - "nodeType": "EventDefinition", - "parameters": { - "id": 7, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4, - "indexed": false, - "name": "value", - "nodeType": "VariableDeclaration", - "scope": 8, - "src": "137:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 3, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "137:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 6, - "indexed": false, - "name": "nonce", - "nodeType": "VariableDeclaration", - "scope": 8, - "src": "149:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 5, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "149:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "136:24:0" - }, - "src": "115:46:0" - }, - { - "anonymous": false, - "documentation": null, - "id": 14, - "name": "NewEpoch", - "nodeType": "EventDefinition", - "parameters": { - "id": 13, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 10, - "indexed": true, - "name": "oldEpoch", - "nodeType": "VariableDeclaration", - "scope": 14, - "src": "181:21:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 9, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "181:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 12, - "indexed": true, - "name": "newEpoch", - "nodeType": "VariableDeclaration", - "scope": 14, - "src": "204:21:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 11, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "204:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "180:46:0" - }, - "src": "166:61:0" - }, - { - "anonymous": false, - "documentation": null, - "id": 18, - "name": "NewEpochCancelled", - "nodeType": "EventDefinition", - "parameters": { - "id": 17, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 16, - "indexed": true, - "name": "epoch", - "nodeType": "VariableDeclaration", - "scope": 18, - "src": "256:18:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 15, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "256:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "255:20:0" - }, - "src": "232:44:0" - }, - { - "anonymous": false, - "documentation": null, - "id": 24, - "name": "NewFundsTransfer", - "nodeType": "EventDefinition", - "parameters": { - "id": 23, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 20, - "indexed": true, - "name": "oldEpoch", - "nodeType": "VariableDeclaration", - "scope": 24, - "src": "304:21:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 19, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "304:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 22, - "indexed": true, - "name": "newEpoch", - "nodeType": "VariableDeclaration", - "scope": 24, - "src": "327:21:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 21, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "327:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "303:46:0" - }, - "src": "281:69:0" - }, - { - "anonymous": false, - "documentation": null, - "id": 32, - "name": "EpochStart", - "nodeType": "EventDefinition", - "parameters": { - "id": 31, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 26, - "indexed": true, - "name": "epoch", - "nodeType": "VariableDeclaration", - "scope": 32, - "src": "372:18:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 25, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "372:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 28, - "indexed": false, - "name": "x", - "nodeType": "VariableDeclaration", - "scope": 32, - "src": "392:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 27, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "392:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 30, - "indexed": false, - "name": "y", - "nodeType": "VariableDeclaration", - "scope": 32, - "src": "400:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 29, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "400:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "371:36:0" - }, - "src": "355:53:0" - }, - { - "canonicalName": "Bridge.State", - "id": 48, - "members": [ - { - "constant": false, - "id": 35, - "name": "validators", - "nodeType": "VariableDeclaration", - "scope": 48, - "src": "437:20:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 33, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "437:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 34, - "length": null, - "nodeType": "ArrayTypeName", - "src": "437:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 37, - "name": "threshold", - "nodeType": "VariableDeclaration", - "scope": 48, - "src": "467:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 36, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "467:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 39, - "name": "rangeSize", - "nodeType": "VariableDeclaration", - "scope": 48, - "src": "491:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 38, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "491:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 41, - "name": "startBlock", - "nodeType": "VariableDeclaration", - "scope": 48, - "src": "515:15:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 40, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "515:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 43, - "name": "nonce", - "nodeType": "VariableDeclaration", - "scope": 48, - "src": "540:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 42, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "540:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 45, - "name": "x", - "nodeType": "VariableDeclaration", - "scope": 48, - "src": "560:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 44, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "560:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 47, - "name": "y", - "nodeType": "VariableDeclaration", - "scope": 48, - "src": "576:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 46, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "576:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "name": "State", - "nodeType": "StructDefinition", - "scope": 1340, - "src": "414:175:0", - "visibility": "public" - }, - { - "canonicalName": "Bridge.Status", - "id": 53, - "members": [ - { - "id": 49, - "name": "READY", - "nodeType": "EnumValue", - "src": "617:5:0" - }, - { - "id": 50, - "name": "VOTING", - "nodeType": "EnumValue", - "src": "676:6:0" - }, - { - "id": 51, - "name": "KEYGEN", - "nodeType": "EnumValue", - "src": "746:6:0" - }, - { - "id": 52, - "name": "FUNDS_TRANSFER", - "nodeType": "EnumValue", - "src": "789:14:0" - } - ], - "name": "Status", - "nodeType": "EnumDefinition", - "src": "595:253:0" - }, - { - "canonicalName": "Bridge.Vote", - "id": 64, - "members": [ - { - "id": 54, - "name": "CONFIRM_KEYGEN", - "nodeType": "EnumValue", - "src": "874:14:0" - }, - { - "id": 55, - "name": "CONFIRM_FUNDS_TRANSFER", - "nodeType": "EnumValue", - "src": "898:22:0" - }, - { - "id": 56, - "name": "START_VOTING", - "nodeType": "EnumValue", - "src": "930:12:0" - }, - { - "id": 57, - "name": "ADD_VALIDATOR", - "nodeType": "EnumValue", - "src": "952:13:0" - }, - { - "id": 58, - "name": "REMOVE_VALIDATOR", - "nodeType": "EnumValue", - "src": "975:16:0" - }, - { - "id": 59, - "name": "CHANGE_THRESHOLD", - "nodeType": "EnumValue", - "src": "1001:16:0" - }, - { - "id": 60, - "name": "CHANGE_RANGE_SIZE", - "nodeType": "EnumValue", - "src": "1027:17:0" - }, - { - "id": 61, - "name": "START_KEYGEN", - "nodeType": "EnumValue", - "src": "1054:12:0" - }, - { - "id": 62, - "name": "CANCEL_KEYGEN", - "nodeType": "EnumValue", - "src": "1076:13:0" - }, - { - "id": 63, - "name": "TRANSFER", - "nodeType": "EnumValue", - "src": "1099:8:0" - } - ], - "name": "Vote", - "nodeType": "EnumDefinition", - "src": "854:259:0" - }, - { - "constant": false, - "id": 68, - "name": "states", - "nodeType": "VariableDeclaration", - "scope": 1340, - "src": "1119:29:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State)" - }, - "typeName": { - "id": 67, - "keyType": { - "id": 65, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1127:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Mapping", - "src": "1119:22:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State)" - }, - "valueType": { - "contractScope": null, - "id": 66, - "name": "State", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 48, - "src": "1135:5:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage_ptr", - "typeString": "struct Bridge.State" - } - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 72, - "name": "dbTransferCount", - "nodeType": "VariableDeclaration", - "scope": 1340, - "src": "1155:47:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - }, - "typeName": { - "id": 71, - "keyType": { - "id": 69, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1163:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Mapping", - "src": "1155:24:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - }, - "valueType": { - "id": 70, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1174:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 76, - "name": "dbTransfer", - "nodeType": "VariableDeclaration", - "scope": 1340, - "src": "1208:42:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - }, - "typeName": { - "id": 75, - "keyType": { - "id": 73, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1216:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Mapping", - "src": "1208:24:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - }, - "valueType": { - "id": 74, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "1227:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 80, - "name": "votesCount", - "nodeType": "VariableDeclaration", - "scope": 1340, - "src": "1256:42:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - }, - "typeName": { - "id": 79, - "keyType": { - "id": 77, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1264:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Mapping", - "src": "1256:24:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - }, - "valueType": { - "id": 78, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1275:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 84, - "name": "votes", - "nodeType": "VariableDeclaration", - "scope": 1340, - "src": "1304:37:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - }, - "typeName": { - "id": 83, - "keyType": { - "id": 81, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1312:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Mapping", - "src": "1304:24:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - }, - "valueType": { - "id": 82, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "1323:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 88, - "name": "usedRange", - "nodeType": "VariableDeclaration", - "scope": 1340, - "src": "1347:41:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - }, - "typeName": { - "id": 87, - "keyType": { - "id": 85, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1355:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Mapping", - "src": "1347:24:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - }, - "valueType": { - "id": 86, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "1366:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 90, - "name": "status", - "nodeType": "VariableDeclaration", - "scope": 1340, - "src": "1395:20:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - }, - "typeName": { - "contractScope": null, - "id": 89, - "name": "Status", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 53, - "src": "1395:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 92, - "name": "epoch", - "nodeType": "VariableDeclaration", - "scope": 1340, - "src": "1422:17:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 91, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1422:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 94, - "name": "nextEpoch", - "nodeType": "VariableDeclaration", - "scope": 1340, - "src": "1445:21:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 93, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1445:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 96, - "name": "minTxLimit", - "nodeType": "VariableDeclaration", - "scope": 1340, - "src": "1473:15:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 95, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1473:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 98, - "name": "maxTxLimit", - "nodeType": "VariableDeclaration", - "scope": 1340, - "src": "1494:15:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 97, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1494:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "body": { - "id": 181, - "nodeType": "Block", - "src": "1643:403:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 118, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 115, - "name": "validators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 103, - "src": "1661:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 116, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1661:17:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 117, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1681:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "1661:21:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 114, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 13091, - 13092 - ], - "referencedDeclaration": 13091, - "src": "1653:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 119, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1653:30:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 120, - "nodeType": "ExpressionStatement", - "src": "1653:30:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 125, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 122, - "name": "threshold", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 100, - "src": "1701:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 123, - "name": "validators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 103, - "src": "1713:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 124, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1713:17:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1701:29:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 121, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 13091, - 13092 - ], - "referencedDeclaration": 13091, - "src": "1693:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 126, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1693:38:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 127, - "nodeType": "ExpressionStatement", - "src": "1693:38:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 132, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 128, - "name": "tokenContract", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 184, - "src": "1742:13:0", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$10032", - "typeString": "contract IERC20" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 130, - "name": "_tokenContract", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 105, - "src": "1765:14:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 129, - "name": "IERC20", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 10032, - "src": "1758:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_IERC20_$10032_$", - "typeString": "type(contract IERC20)" - } - }, - "id": 131, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1758:22:0", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$10032", - "typeString": "contract IERC20" - } - }, - "src": "1742:38:0", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$10032", - "typeString": "contract IERC20" - } - }, - "id": 133, - "nodeType": "ExpressionStatement", - "src": "1742:38:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 136, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 134, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "1791:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "30", - "id": 135, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1799:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "1791:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 137, - "nodeType": "ExpressionStatement", - "src": "1791:9:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 141, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 138, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 90, - "src": "1810:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 139, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 53, - "src": "1819:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$53_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 140, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "KEYGEN", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1819:13:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "src": "1810:22:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "id": 142, - "nodeType": "ExpressionStatement", - "src": "1810:22:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 145, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 143, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "1842:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "31", - "id": 144, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1854:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "1842:13:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 146, - "nodeType": "ExpressionStatement", - "src": "1842:13:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 162, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 147, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "1866:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 149, - "indexExpression": { - "argumentTypes": null, - "id": 148, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "1873:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "1866:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 151, - "name": "validators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 103, - "src": "1892:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - { - "argumentTypes": null, - "id": 152, - "name": "threshold", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 100, - "src": "1904:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 153, - "name": "rangeSize", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 111, - "src": "1915:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "hexValue": "30", - "id": 154, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1926:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 157, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "-", - "prefix": true, - "src": "1934:2:0", - "subExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 156, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1935:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "typeDescriptions": { - "typeIdentifier": "t_rational_minus_1_by_1", - "typeString": "int_const -1" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_rational_minus_1_by_1", - "typeString": "int_const -1" - } - ], - "id": 155, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "1929:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_uint256_$", - "typeString": "type(uint256)" - }, - "typeName": "uint" - }, - "id": 158, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1929:8:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "hexValue": "30", - "id": 159, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1939:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - { - "argumentTypes": null, - "hexValue": "30", - "id": 160, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1942:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - } - ], - "id": 150, - "name": "State", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 48, - "src": "1886:5:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_struct$_State_$48_storage_ptr_$", - "typeString": "type(struct Bridge.State storage pointer)" - } - }, - "id": 161, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "structConstructorCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1886:58:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_memory", - "typeString": "struct Bridge.State memory" - } - }, - "src": "1866:78:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 163, - "nodeType": "ExpressionStatement", - "src": "1866:78:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 168, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 164, - "name": "minTxLimit", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 96, - "src": "1955:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 165, - "name": "limits", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 109, - "src": "1968:6:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_memory_ptr", - "typeString": "uint256[2] memory" - } - }, - "id": 167, - "indexExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 166, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1975:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "1968:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1955:22:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 169, - "nodeType": "ExpressionStatement", - "src": "1955:22:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 174, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 170, - "name": "maxTxLimit", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 98, - "src": "1987:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 171, - "name": "limits", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 109, - "src": "2000:6:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_memory_ptr", - "typeString": "uint256[2] memory" - } - }, - "id": 173, - "indexExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 172, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2007:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "2000:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1987:22:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 175, - "nodeType": "ExpressionStatement", - "src": "1987:22:0" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "hexValue": "30", - "id": 177, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2034:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - { - "argumentTypes": null, - "hexValue": "31", - "id": 178, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2037:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - } - ], - "id": 176, - "name": "NewEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 14, - "src": "2025:8:0", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$returns$__$", - "typeString": "function (uint256,uint256)" - } - }, - "id": 179, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2025:14:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 180, - "nodeType": "EmitStatement", - "src": "2020:19:0" - } - ] - }, - "documentation": null, - "id": 182, - "implemented": true, - "kind": "constructor", - "modifiers": [], - "name": "", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 112, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 100, - "name": "threshold", - "nodeType": "VariableDeclaration", - "scope": 182, - "src": "1528:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 99, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1528:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 103, - "name": "validators", - "nodeType": "VariableDeclaration", - "scope": 182, - "src": "1544:27:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 101, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1544:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 102, - "length": null, - "nodeType": "ArrayTypeName", - "src": "1544:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 105, - "name": "_tokenContract", - "nodeType": "VariableDeclaration", - "scope": 182, - "src": "1573:22:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 104, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1573:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 109, - "name": "limits", - "nodeType": "VariableDeclaration", - "scope": 182, - "src": "1597:21:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_memory_ptr", - "typeString": "uint256[2]" - }, - "typeName": { - "baseType": { - "id": 106, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1597:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 108, - "length": { - "argumentTypes": null, - "hexValue": "32", - "id": 107, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1602:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "nodeType": "ArrayTypeName", - "src": "1597:7:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_storage_ptr", - "typeString": "uint256[2]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 111, - "name": "rangeSize", - "nodeType": "VariableDeclaration", - "scope": 182, - "src": "1620:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 110, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1620:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1527:108:0" - }, - "returnParameters": { - "id": 113, - "nodeType": "ParameterList", - "parameters": [], - "src": "1643:0:0" - }, - "scope": 1340, - "src": "1516:530:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "constant": false, - "id": 184, - "name": "tokenContract", - "nodeType": "VariableDeclaration", - "scope": 1340, - "src": "2052:27:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$10032", - "typeString": "contract IERC20" - }, - "typeName": { - "contractScope": null, - "id": 183, - "name": "IERC20", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 10032, - "src": "2052:6:0", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$10032", - "typeString": "contract IERC20" - } - }, - "value": null, - "visibility": "public" - }, - { - "body": { - "id": 195, - "nodeType": "Block", - "src": "2101:81:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - }, - "id": 190, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 187, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 90, - "src": "2119:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 188, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 53, - "src": "2129:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$53_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 189, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "READY", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2129:12:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "src": "2119:22:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4e6f7420696e207265616479207374617465", - "id": 191, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2143:20:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_965c39c15b78dbcd8a954511641ca86e15fc1ae6d6c30a67536872ccde75b679", - "typeString": "literal_string \"Not in ready state\"" - }, - "value": "Not in ready state" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_965c39c15b78dbcd8a954511641ca86e15fc1ae6d6c30a67536872ccde75b679", - "typeString": "literal_string \"Not in ready state\"" - } - ], - "id": 186, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 13091, - 13092 - ], - "referencedDeclaration": 13092, - "src": "2111:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 192, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2111:53:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 193, - "nodeType": "ExpressionStatement", - "src": "2111:53:0" - }, - { - "id": 194, - "nodeType": "PlaceholderStatement", - "src": "2174:1:0" - } - ] - }, - "documentation": null, - "id": 196, - "name": "ready", - "nodeType": "ModifierDefinition", - "parameters": { - "id": 185, - "nodeType": "ParameterList", - "parameters": [], - "src": "2101:0:0" - }, - "src": "2086:96:0", - "visibility": "internal" - }, - { - "body": { - "id": 212, - "nodeType": "Block", - "src": "2211:118:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 207, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - }, - "id": 202, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 199, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 90, - "src": "2229:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 200, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 53, - "src": "2239:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$53_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 201, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "READY", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2239:12:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "src": "2229:22:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "||", - "rightExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - }, - "id": 206, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 203, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 90, - "src": "2255:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 204, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 53, - "src": "2265:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$53_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 205, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "VOTING", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2265:13:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "src": "2255:23:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "2229:49:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4e6f7420696e207265616479206f7220766f74696e67207374617465", - "id": 208, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2280:30:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_7e3f7359baa731593d4e3921720b92600c22ed1d950d208e0c826ad2eddebe96", - "typeString": "literal_string \"Not in ready or voting state\"" - }, - "value": "Not in ready or voting state" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_7e3f7359baa731593d4e3921720b92600c22ed1d950d208e0c826ad2eddebe96", - "typeString": "literal_string \"Not in ready or voting state\"" - } - ], - "id": 198, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 13091, - 13092 - ], - "referencedDeclaration": 13092, - "src": "2221:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 209, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2221:90:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 210, - "nodeType": "ExpressionStatement", - "src": "2221:90:0" - }, - { - "id": 211, - "nodeType": "PlaceholderStatement", - "src": "2321:1:0" - } - ] - }, - "documentation": null, - "id": 213, - "name": "readyOrVoting", - "nodeType": "ModifierDefinition", - "parameters": { - "id": 197, - "nodeType": "ParameterList", - "parameters": [], - "src": "2211:0:0" - }, - "src": "2188:141:0", - "visibility": "internal" - }, - { - "body": { - "id": 224, - "nodeType": "Block", - "src": "2351:83:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - }, - "id": 219, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 216, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 90, - "src": "2369:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 217, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 53, - "src": "2379:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$53_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 218, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "VOTING", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2379:13:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "src": "2369:23:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4e6f7420696e20766f74696e67207374617465", - "id": 220, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2394:21:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_0cbee9834b110b21e0730bf5c3d2972fb9867ff221df239e7ae60883592f05d1", - "typeString": "literal_string \"Not in voting state\"" - }, - "value": "Not in voting state" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_0cbee9834b110b21e0730bf5c3d2972fb9867ff221df239e7ae60883592f05d1", - "typeString": "literal_string \"Not in voting state\"" - } - ], - "id": 215, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 13091, - 13092 - ], - "referencedDeclaration": 13092, - "src": "2361:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 221, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2361:55:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 222, - "nodeType": "ExpressionStatement", - "src": "2361:55:0" - }, - { - "id": 223, - "nodeType": "PlaceholderStatement", - "src": "2426:1:0" - } - ] - }, - "documentation": null, - "id": 225, - "name": "voting", - "nodeType": "ModifierDefinition", - "parameters": { - "id": 214, - "nodeType": "ParameterList", - "parameters": [], - "src": "2351:0:0" - }, - "src": "2335:99:0", - "visibility": "internal" - }, - { - "body": { - "id": 236, - "nodeType": "Block", - "src": "2456:83:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - }, - "id": 231, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 228, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 90, - "src": "2474:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 229, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 53, - "src": "2484:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$53_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 230, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "KEYGEN", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2484:13:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "src": "2474:23:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4e6f7420696e206b657967656e207374617465", - "id": 232, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2499:21:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_ed0fee6382e0651a224348a21558d03a4a439c3bd5edc24945894a3417c14010", - "typeString": "literal_string \"Not in keygen state\"" - }, - "value": "Not in keygen state" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_ed0fee6382e0651a224348a21558d03a4a439c3bd5edc24945894a3417c14010", - "typeString": "literal_string \"Not in keygen state\"" - } - ], - "id": 227, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 13091, - 13092 - ], - "referencedDeclaration": 13092, - "src": "2466:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 233, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2466:55:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 234, - "nodeType": "ExpressionStatement", - "src": "2466:55:0" - }, - { - "id": 235, - "nodeType": "PlaceholderStatement", - "src": "2531:1:0" - } - ] - }, - "documentation": null, - "id": 237, - "name": "keygen", - "nodeType": "ModifierDefinition", - "parameters": { - "id": 226, - "nodeType": "ParameterList", - "parameters": [], - "src": "2456:0:0" - }, - "src": "2440:99:0", - "visibility": "internal" - }, - { - "body": { - "id": 248, - "nodeType": "Block", - "src": "2568:99:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - }, - "id": 243, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 240, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 90, - "src": "2586:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 241, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 53, - "src": "2596:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$53_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 242, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "FUNDS_TRANSFER", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2596:21:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "src": "2586:31:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4e6f7420696e2066756e6473207472616e73666572207374617465", - "id": 244, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2619:29:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_6347c9fecd6f58520ad10dfd1347ce3dc42cc0eed7a4182ca64dd11c69fc3008", - "typeString": "literal_string \"Not in funds transfer state\"" - }, - "value": "Not in funds transfer state" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_6347c9fecd6f58520ad10dfd1347ce3dc42cc0eed7a4182ca64dd11c69fc3008", - "typeString": "literal_string \"Not in funds transfer state\"" - } - ], - "id": 239, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 13091, - 13092 - ], - "referencedDeclaration": 13092, - "src": "2578:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 245, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2578:71:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 246, - "nodeType": "ExpressionStatement", - "src": "2578:71:0" - }, - { - "id": 247, - "nodeType": "PlaceholderStatement", - "src": "2659:1:0" - } - ] - }, - "documentation": null, - "id": 249, - "name": "fundsTransfer", - "nodeType": "ModifierDefinition", - "parameters": { - "id": 238, - "nodeType": "ParameterList", - "parameters": [], - "src": "2568:0:0" - }, - "src": "2545:122:0", - "visibility": "internal" - }, - { - "body": { - "id": 260, - "nodeType": "Block", - "src": "2699:81:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 255, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 252, - "name": "getPartyId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 728, - "src": "2717:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 253, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2717:12:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 254, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2733:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "2717:17:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4e6f7420612063757272656e742076616c696461746f72", - "id": 256, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2736:25:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_8dc18d5bb1361900b9758b388df331056e31071cae84b276c0f03794c4dc634a", - "typeString": "literal_string \"Not a current validator\"" - }, - "value": "Not a current validator" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_8dc18d5bb1361900b9758b388df331056e31071cae84b276c0f03794c4dc634a", - "typeString": "literal_string \"Not a current validator\"" - } - ], - "id": 251, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 13091, - 13092 - ], - "referencedDeclaration": 13092, - "src": "2709:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 257, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2709:53:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 258, - "nodeType": "ExpressionStatement", - "src": "2709:53:0" - }, - { - "id": 259, - "nodeType": "PlaceholderStatement", - "src": "2772:1:0" - } - ] - }, - "documentation": null, - "id": 261, - "name": "currentValidator", - "nodeType": "ModifierDefinition", - "parameters": { - "id": 250, - "nodeType": "ParameterList", - "parameters": [], - "src": "2699:0:0" - }, - "src": "2673:107:0", - "visibility": "internal" - }, - { - "body": { - "id": 343, - "nodeType": "Block", - "src": "2829:475:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 281, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 277, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 271, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 269, - "name": "value", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 263, - "src": "2847:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">=", - "rightExpression": { - "argumentTypes": null, - "id": 270, - "name": "minTxLimit", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 96, - "src": "2856:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2847:19:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "&&", - "rightExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 276, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 272, - "name": "value", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 263, - "src": "2870:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">=", - "rightExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_rational_10000000000_by_1", - "typeString": "int_const 10000000000" - }, - "id": 275, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "hexValue": "3130", - "id": 273, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2879:2:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_10_by_1", - "typeString": "int_const 10" - }, - "value": "10" - }, - "nodeType": "BinaryOperation", - "operator": "**", - "rightExpression": { - "argumentTypes": null, - "hexValue": "3130", - "id": 274, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2885:2:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_10_by_1", - "typeString": "int_const 10" - }, - "value": "10" - }, - "src": "2879:8:0", - "typeDescriptions": { - "typeIdentifier": "t_rational_10000000000_by_1", - "typeString": "int_const 10000000000" - } - }, - "src": "2870:17:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "2847:40:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "&&", - "rightExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 280, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 278, - "name": "value", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 263, - "src": "2891:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<=", - "rightExpression": { - "argumentTypes": null, - "id": 279, - "name": "maxTxLimit", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 98, - "src": "2900:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2891:19:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "2847:63:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 268, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 13091, - 13092 - ], - "referencedDeclaration": 13091, - "src": "2839:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 282, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2839:72:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 283, - "nodeType": "ExpressionStatement", - "src": "2839:72:0" - }, - { - "assignments": [ - 285 - ], - "declarations": [ - { - "constant": false, - "id": 285, - "name": "txRange", - "nodeType": "VariableDeclaration", - "scope": 343, - "src": "2922:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 284, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "2922:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 295, - "initialValue": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 294, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "components": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 290, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 286, - "name": "block", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13078, - "src": "2938:5:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_block", - "typeString": "block" - } - }, - "id": 287, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "number", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2938:12:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 288, - "name": "getStartBlock", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 598, - 611 - ], - "referencedDeclaration": 598, - "src": "2953:13:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 289, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2953:15:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2938:30:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "id": 291, - "isConstant": false, - "isInlineArray": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "TupleExpression", - "src": "2937:32:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "/", - "rightExpression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 292, - "name": "getRangeSize", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 621, - 644 - ], - "referencedDeclaration": 621, - "src": "2972:12:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 293, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2972:14:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2937:49:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "2922:64:0" - }, - { - "condition": { - "argumentTypes": null, - "id": 305, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "!", - "prefix": true, - "src": "3000:55:0", - "subExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 296, - "name": "usedRange", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 88, - "src": "3001:9:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - } - }, - "id": 304, - "indexExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 300, - "name": "txRange", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 285, - "src": "3038:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 301, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "3047:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 298, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13075, - "src": "3021:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 299, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3021:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 302, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3021:32:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 297, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13082, - "src": "3011:9:0", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 303, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3011:43:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3001:54:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 325, - "nodeType": "IfStatement", - "src": "2996:182:0", - "trueBody": { - "id": 324, - "nodeType": "Block", - "src": "3057:121:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 316, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 306, - "name": "usedRange", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 88, - "src": "3071:9:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - } - }, - "id": 314, - "indexExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 310, - "name": "txRange", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 285, - "src": "3108:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 311, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "3117:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 308, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13075, - "src": "3091:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 309, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3091:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 312, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3091:32:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 307, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13082, - "src": "3081:9:0", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 313, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3081:43:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "3071:54:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 315, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3128:4:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "src": "3071:61:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 317, - "nodeType": "ExpressionStatement", - "src": "3071:61:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 322, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "3146:21:0", - "subExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 318, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "3146:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 320, - "indexExpression": { - "argumentTypes": null, - "id": 319, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "3153:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3146:13:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 321, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "nonce", - "nodeType": "MemberAccess", - "referencedDeclaration": 43, - "src": "3146:19:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 323, - "nodeType": "ExpressionStatement", - "src": "3146:21:0" - } - ] - } - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 329, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13088, - "src": "3215:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 330, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3215:10:0", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 332, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13104, - "src": "3235:4:0", - "typeDescriptions": { - "typeIdentifier": "t_contract$_Bridge_$1340", - "typeString": "contract Bridge" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_Bridge_$1340", - "typeString": "contract Bridge" - } - ], - "id": 331, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "3227:7:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 333, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3227:13:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 334, - "name": "value", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 263, - "src": "3242:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 326, - "name": "tokenContract", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 184, - "src": "3188:13:0", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$10032", - "typeString": "contract IERC20" - } - }, - "id": 328, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "transferFrom", - "nodeType": "MemberAccess", - "referencedDeclaration": 10015, - "src": "3188:26:0", - "typeDescriptions": { - "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$_t_bool_$", - "typeString": "function (address,address,uint256) external returns (bool)" - } - }, - "id": 335, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3188:60:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 336, - "nodeType": "ExpressionStatement", - "src": "3188:60:0" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 338, - "name": "value", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 263, - "src": "3279:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 339, - "name": "getNonce", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 654, - 667 - ], - "referencedDeclaration": 654, - "src": "3286:8:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 340, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3286:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 337, - "name": "ExchangeRequest", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 8, - "src": "3263:15:0", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$returns$__$", - "typeString": "function (uint256,uint256)" - } - }, - "id": 341, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3263:34:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 342, - "nodeType": "EmitStatement", - "src": "3258:39:0" - } - ] - }, - "documentation": null, - "id": 344, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 266, - "modifierName": { - "argumentTypes": null, - "id": 265, - "name": "ready", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 196, - "src": "2823:5:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "2823:5:0" - } - ], - "name": "exchange", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 264, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 263, - "name": "value", - "nodeType": "VariableDeclaration", - "scope": 344, - "src": "2804:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 262, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "2804:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2803:12:0" - }, - "returnParameters": { - "id": 267, - "nodeType": "ParameterList", - "parameters": [], - "src": "2829:0:0" - }, - "scope": 1340, - "src": "2786:518:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 373, - "nodeType": "Block", - "src": "3404:119:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 358, - "name": "Vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 64, - "src": "3426:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", - "typeString": "type(enum Bridge.Vote)" - } - }, - "id": 359, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "TRANSFER", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3426:13:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 360, - "name": "hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 346, - "src": "3441:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "id": 361, - "name": "to", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 348, - "src": "3447:2:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 362, - "name": "value", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 350, - "src": "3451:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 357, - "name": "tryVote", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1084, - 1109, - 1134, - 1164 - ], - "referencedDeclaration": 1164, - "src": "3418:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$_t_bytes32_$_t_address_$_t_uint256_$returns$_t_bool_$", - "typeString": "function (enum Bridge.Vote,bytes32,address,uint256) returns (bool)" - } - }, - "id": 363, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3418:39:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 372, - "nodeType": "IfStatement", - "src": "3414:103:0", - "trueBody": { - "id": 371, - "nodeType": "Block", - "src": "3459:58:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 367, - "name": "to", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 348, - "src": "3496:2:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 368, - "name": "value", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 350, - "src": "3500:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 364, - "name": "tokenContract", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 184, - "src": "3473:13:0", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$10032", - "typeString": "contract IERC20" - } - }, - "id": 366, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "transfer", - "nodeType": "MemberAccess", - "referencedDeclaration": 9986, - "src": "3473:22:0", - "typeDescriptions": { - "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$_t_bool_$", - "typeString": "function (address,uint256) external returns (bool)" - } - }, - "id": 369, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3473:33:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 370, - "nodeType": "ExpressionStatement", - "src": "3473:33:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 374, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 353, - "modifierName": { - "argumentTypes": null, - "id": 352, - "name": "readyOrVoting", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 213, - "src": "3373:13:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "3373:13:0" - }, - { - "arguments": null, - "id": 355, - "modifierName": { - "argumentTypes": null, - "id": 354, - "name": "currentValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 261, - "src": "3387:16:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "3387:16:0" - } - ], - "name": "transfer", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 351, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 346, - "name": "hash", - "nodeType": "VariableDeclaration", - "scope": 374, - "src": "3328:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 345, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "3328:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 348, - "name": "to", - "nodeType": "VariableDeclaration", - "scope": 374, - "src": "3342:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 347, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "3342:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 350, - "name": "value", - "nodeType": "VariableDeclaration", - "scope": 374, - "src": "3354:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 349, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "3354:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "3327:38:0" - }, - "returnParameters": { - "id": 356, - "nodeType": "ParameterList", - "parameters": [], - "src": "3404:0:0" - }, - "scope": 1340, - "src": "3310:213:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 464, - "nodeType": "Block", - "src": "3582:638:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 389, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 385, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13088, - "src": "3615:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 386, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3615:10:0", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - ], - "id": 384, - "name": "getNextPartyId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 768, - "src": "3600:14:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_uint256_$", - "typeString": "function (address) view returns (uint256)" - } - }, - "id": 387, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3600:26:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 388, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3630:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "3600:31:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4e6f742061206e6578742076616c696461746f72", - "id": 390, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3633:22:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_44981c92ce908443b2fa5f878c54791e1a0c95d4cc04ea4f4d9224b3ec030922", - "typeString": "literal_string \"Not a next validator\"" - }, - "value": "Not a next validator" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_44981c92ce908443b2fa5f878c54791e1a0c95d4cc04ea4f4d9224b3ec030922", - "typeString": "literal_string \"Not a next validator\"" - } - ], - "id": 383, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 13091, - 13092 - ], - "referencedDeclaration": 13092, - "src": "3592:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 391, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3592:64:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 392, - "nodeType": "ExpressionStatement", - "src": "3592:64:0" - }, - { - "condition": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 394, - "name": "Vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 64, - "src": "3682:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", - "typeString": "type(enum Bridge.Vote)" - } - }, - "id": 395, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "CONFIRM_KEYGEN", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3682:19:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 396, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 376, - "src": "3703:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 397, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 378, - "src": "3706:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 393, - "name": "tryConfirm", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1186, - 1214 - ], - "referencedDeclaration": 1214, - "src": "3671:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$_t_uint256_$_t_uint256_$returns$_t_bool_$", - "typeString": "function (enum Bridge.Vote,uint256,uint256) returns (bool)" - } - }, - "id": 398, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3671:37:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 463, - "nodeType": "IfStatement", - "src": "3667:547:0", - "trueBody": { - "id": 462, - "nodeType": "Block", - "src": "3710:504:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 404, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 399, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "3724:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 401, - "indexExpression": { - "argumentTypes": null, - "id": 400, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "3731:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3724:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 402, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "x", - "nodeType": "MemberAccess", - "referencedDeclaration": 45, - "src": "3724:19:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 403, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 376, - "src": "3746:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3724:23:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 405, - "nodeType": "ExpressionStatement", - "src": "3724:23:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 411, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 406, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "3761:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 408, - "indexExpression": { - "argumentTypes": null, - "id": 407, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "3768:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3761:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 409, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "y", - "nodeType": "MemberAccess", - "referencedDeclaration": 47, - "src": "3761:19:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 410, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 378, - "src": "3783:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3761:23:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 412, - "nodeType": "ExpressionStatement", - "src": "3761:23:0" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 415, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 413, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "3802:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 414, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3815:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "3802:14:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "id": 460, - "nodeType": "Block", - "src": "4084:120:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 453, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 450, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 90, - "src": "4102:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 451, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 53, - "src": "4111:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$53_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 452, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "FUNDS_TRANSFER", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4111:21:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "src": "4102:30:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "id": 454, - "nodeType": "ExpressionStatement", - "src": "4102:30:0" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 456, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "4172:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 457, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "4179:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 455, - "name": "NewFundsTransfer", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 24, - "src": "4155:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$returns$__$", - "typeString": "function (uint256,uint256)" - } - }, - "id": 458, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4155:34:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 459, - "nodeType": "EmitStatement", - "src": "4150:39:0" - } - ] - }, - "id": 461, - "nodeType": "IfStatement", - "src": "3798:406:0", - "trueBody": { - "id": 449, - "nodeType": "Block", - "src": "3818:248:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 419, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 416, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 90, - "src": "3836:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 417, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 53, - "src": "3845:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$53_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 418, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "READY", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3845:12:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "src": "3836:21:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "id": 420, - "nodeType": "ExpressionStatement", - "src": "3836:21:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 427, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 421, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "3875:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 423, - "indexExpression": { - "argumentTypes": null, - "id": 422, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "3882:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3875:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 424, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "startBlock", - "nodeType": "MemberAccess", - "referencedDeclaration": 41, - "src": "3875:28:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 425, - "name": "block", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13078, - "src": "3906:5:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_block", - "typeString": "block" - } - }, - "id": 426, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "number", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3906:12:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3875:43:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 428, - "nodeType": "ExpressionStatement", - "src": "3875:43:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 437, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 429, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "3936:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 431, - "indexExpression": { - "argumentTypes": null, - "id": 430, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "3943:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3936:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 432, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "nonce", - "nodeType": "MemberAccess", - "referencedDeclaration": 43, - "src": "3936:23:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 435, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "-", - "prefix": true, - "src": "3967:2:0", - "subExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 434, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3968:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "typeDescriptions": { - "typeIdentifier": "t_rational_minus_1_by_1", - "typeString": "int_const -1" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_rational_minus_1_by_1", - "typeString": "int_const -1" - } - ], - "id": 433, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "3962:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_uint256_$", - "typeString": "type(uint256)" - }, - "typeName": "uint" - }, - "id": 436, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3962:8:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3936:34:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 438, - "nodeType": "ExpressionStatement", - "src": "3936:34:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 441, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 439, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "3988:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 440, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "3996:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3988:17:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 442, - "nodeType": "ExpressionStatement", - "src": "3988:17:0" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 444, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "4039:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 445, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 376, - "src": "4046:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 446, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 378, - "src": "4049:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 443, - "name": "EpochStart", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 32, - "src": "4028:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$_t_uint256_$returns$__$", - "typeString": "function (uint256,uint256,uint256)" - } - }, - "id": 447, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4028:23:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 448, - "nodeType": "EmitStatement", - "src": "4023:28:0" - } - ] - } - } - ] - } - } - ] - }, - "documentation": null, - "id": 465, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 381, - "modifierName": { - "argumentTypes": null, - "id": 380, - "name": "keygen", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 237, - "src": "3575:6:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "3575:6:0" - } - ], - "name": "confirmKeygen", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 379, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 376, - "name": "x", - "nodeType": "VariableDeclaration", - "scope": 465, - "src": "3552:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 375, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "3552:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 378, - "name": "y", - "nodeType": "VariableDeclaration", - "scope": 465, - "src": "3560:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 377, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "3560:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "3551:16:0" - }, - "returnParameters": { - "id": 382, - "nodeType": "ParameterList", - "parameters": [], - "src": "3582:0:0" - }, - "scope": 1340, - "src": "3529:691:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 520, - "nodeType": "Block", - "src": "4296:368:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 475, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 473, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "4314:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 474, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4322:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "4314:9:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "46697273742065706f636820646f6573206e6f74206e6565642066756e6473207472616e73666572", - "id": 476, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4325:42:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_8ddae2cc9da30ed8c59c39c6a950ef823ea484ac89ff6f37abb0317fb5f679a1", - "typeString": "literal_string \"First epoch does not need funds transfer\"" - }, - "value": "First epoch does not need funds transfer" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_8ddae2cc9da30ed8c59c39c6a950ef823ea484ac89ff6f37abb0317fb5f679a1", - "typeString": "literal_string \"First epoch does not need funds transfer\"" - } - ], - "id": 472, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 13091, - 13092 - ], - "referencedDeclaration": 13092, - "src": "4306:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 477, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4306:62:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 478, - "nodeType": "ExpressionStatement", - "src": "4306:62:0" - }, - { - "condition": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 480, - "name": "Vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 64, - "src": "4394:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", - "typeString": "type(enum Bridge.Vote)" - } - }, - "id": 481, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "CONFIRM_FUNDS_TRANSFER", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4394:27:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - ], - "id": 479, - "name": "tryConfirm", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1186, - 1214 - ], - "referencedDeclaration": 1186, - "src": "4383:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$returns$_t_bool_$", - "typeString": "function (enum Bridge.Vote) returns (bool)" - } - }, - "id": 482, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4383:39:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 519, - "nodeType": "IfStatement", - "src": "4379:279:0", - "trueBody": { - "id": 518, - "nodeType": "Block", - "src": "4424:234:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 486, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 483, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 90, - "src": "4438:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 484, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 53, - "src": "4447:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$53_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 485, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "READY", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4447:12:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "src": "4438:21:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "id": 487, - "nodeType": "ExpressionStatement", - "src": "4438:21:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 494, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 488, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "4473:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 490, - "indexExpression": { - "argumentTypes": null, - "id": 489, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "4480:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4473:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 491, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "startBlock", - "nodeType": "MemberAccess", - "referencedDeclaration": 41, - "src": "4473:28:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 492, - "name": "block", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13078, - "src": "4504:5:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_block", - "typeString": "block" - } - }, - "id": 493, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "number", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4504:12:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4473:43:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 495, - "nodeType": "ExpressionStatement", - "src": "4473:43:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 504, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 496, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "4530:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 498, - "indexExpression": { - "argumentTypes": null, - "id": 497, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "4537:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4530:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 499, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "nonce", - "nodeType": "MemberAccess", - "referencedDeclaration": 43, - "src": "4530:23:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 502, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "-", - "prefix": true, - "src": "4561:2:0", - "subExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 501, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4562:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "typeDescriptions": { - "typeIdentifier": "t_rational_minus_1_by_1", - "typeString": "int_const -1" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_rational_minus_1_by_1", - "typeString": "int_const -1" - } - ], - "id": 500, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "4556:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_uint256_$", - "typeString": "type(uint256)" - }, - "typeName": "uint" - }, - "id": 503, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4556:8:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4530:34:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 505, - "nodeType": "ExpressionStatement", - "src": "4530:34:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 508, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 506, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "4578:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 507, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "4586:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4578:17:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 509, - "nodeType": "ExpressionStatement", - "src": "4578:17:0" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 511, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "4625:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 512, - "name": "getX", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 678, - "src": "4632:4:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 513, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4632:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 514, - "name": "getY", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 689, - "src": "4640:4:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 515, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4640:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 510, - "name": "EpochStart", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 32, - "src": "4614:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$_t_uint256_$returns$__$", - "typeString": "function (uint256,uint256,uint256)" - } - }, - "id": 516, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4614:33:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 517, - "nodeType": "EmitStatement", - "src": "4609:38:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 521, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 468, - "modifierName": { - "argumentTypes": null, - "id": 467, - "name": "fundsTransfer", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 249, - "src": "4265:13:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "4265:13:0" - }, - { - "arguments": null, - "id": 470, - "modifierName": { - "argumentTypes": null, - "id": 469, - "name": "currentValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 261, - "src": "4279:16:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "4279:16:0" - } - ], - "name": "confirmFundsTransfer", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 466, - "nodeType": "ParameterList", - "parameters": [], - "src": "4255:2:0" - }, - "returnParameters": { - "id": 471, - "nodeType": "ParameterList", - "parameters": [], - "src": "4296:0:0" - }, - "scope": 1340, - "src": "4226:438:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 530, - "nodeType": "Block", - "src": "4719:41:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 527, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "4747:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 526, - "name": "getParties", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 531, - 555 - ], - "referencedDeclaration": 555, - "src": "4736:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256) view returns (uint256)" - } - }, - "id": 528, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4736:17:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 525, - "id": 529, - "nodeType": "Return", - "src": "4729:24:0" - } - ] - }, - "documentation": null, - "id": 531, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getParties", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 522, - "nodeType": "ParameterList", - "parameters": [], - "src": "4689:2:0" - }, - "returnParameters": { - "id": 525, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 524, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 531, - "src": "4713:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 523, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "4713:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4712:6:0" - }, - "scope": 1340, - "src": "4670:90:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 540, - "nodeType": "Block", - "src": "4819:45:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 537, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "4847:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 536, - "name": "getParties", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 531, - 555 - ], - "referencedDeclaration": 555, - "src": "4836:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256) view returns (uint256)" - } - }, - "id": 538, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4836:21:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 535, - "id": 539, - "nodeType": "Return", - "src": "4829:28:0" - } - ] - }, - "documentation": null, - "id": 541, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getNextParties", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 532, - "nodeType": "ParameterList", - "parameters": [], - "src": "4789:2:0" - }, - "returnParameters": { - "id": 535, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 534, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 541, - "src": "4813:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 533, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "4813:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4812:6:0" - }, - "scope": 1340, - "src": "4766:98:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 554, - "nodeType": "Block", - "src": "4930:56:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 548, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "4947:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 550, - "indexExpression": { - "argumentTypes": null, - "id": 549, - "name": "_epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 543, - "src": "4954:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4947:14:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 551, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "validators", - "nodeType": "MemberAccess", - "referencedDeclaration": 35, - "src": "4947:25:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 552, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4947:32:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 547, - "id": 553, - "nodeType": "Return", - "src": "4940:39:0" - } - ] - }, - "documentation": null, - "id": 555, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getParties", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 544, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 543, - "name": "_epoch", - "nodeType": "VariableDeclaration", - "scope": 555, - "src": "4890:11:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 542, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "4890:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4889:13:0" - }, - "returnParameters": { - "id": 547, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 546, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 555, - "src": "4924:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 545, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "4924:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4923:6:0" - }, - "scope": 1340, - "src": "4870:116:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 564, - "nodeType": "Block", - "src": "5043:43:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 561, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "5073:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 560, - "name": "getThreshold", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 565, - 588 - ], - "referencedDeclaration": 588, - "src": "5060:12:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256) view returns (uint256)" - } - }, - "id": 562, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5060:19:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 559, - "id": 563, - "nodeType": "Return", - "src": "5053:26:0" - } - ] - }, - "documentation": null, - "id": 565, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getThreshold", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 556, - "nodeType": "ParameterList", - "parameters": [], - "src": "5013:2:0" - }, - "returnParameters": { - "id": 559, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 558, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 565, - "src": "5037:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 557, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5037:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5036:6:0" - }, - "scope": 1340, - "src": "4992:94:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 574, - "nodeType": "Block", - "src": "5147:47:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 571, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "5177:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 570, - "name": "getThreshold", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 565, - 588 - ], - "referencedDeclaration": 588, - "src": "5164:12:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256) view returns (uint256)" - } - }, - "id": 572, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5164:23:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 569, - "id": 573, - "nodeType": "Return", - "src": "5157:30:0" - } - ] - }, - "documentation": null, - "id": 575, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getNextThreshold", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 566, - "nodeType": "ParameterList", - "parameters": [], - "src": "5117:2:0" - }, - "returnParameters": { - "id": 569, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 568, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 575, - "src": "5141:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 567, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5141:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5140:6:0" - }, - "scope": 1340, - "src": "5092:102:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 587, - "nodeType": "Block", - "src": "5262:48:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 582, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "5279:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 584, - "indexExpression": { - "argumentTypes": null, - "id": 583, - "name": "_epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 577, - "src": "5286:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "5279:14:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 585, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "threshold", - "nodeType": "MemberAccess", - "referencedDeclaration": 37, - "src": "5279:24:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 581, - "id": 586, - "nodeType": "Return", - "src": "5272:31:0" - } - ] - }, - "documentation": null, - "id": 588, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getThreshold", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 578, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 577, - "name": "_epoch", - "nodeType": "VariableDeclaration", - "scope": 588, - "src": "5222:11:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 576, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5222:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5221:13:0" - }, - "returnParameters": { - "id": 581, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 580, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 588, - "src": "5256:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 579, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5256:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5255:6:0" - }, - "scope": 1340, - "src": "5200:110:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 597, - "nodeType": "Block", - "src": "5368:44:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 594, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "5399:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 593, - "name": "getStartBlock", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 598, - 611 - ], - "referencedDeclaration": 611, - "src": "5385:13:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256) view returns (uint256)" - } - }, - "id": 595, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5385:20:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 592, - "id": 596, - "nodeType": "Return", - "src": "5378:27:0" - } - ] - }, - "documentation": null, - "id": 598, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getStartBlock", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 589, - "nodeType": "ParameterList", - "parameters": [], - "src": "5338:2:0" - }, - "returnParameters": { - "id": 592, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 591, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 598, - "src": "5362:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 590, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5362:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5361:6:0" - }, - "scope": 1340, - "src": "5316:96:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 610, - "nodeType": "Block", - "src": "5481:49:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 605, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "5498:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 607, - "indexExpression": { - "argumentTypes": null, - "id": 606, - "name": "_epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 600, - "src": "5505:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "5498:14:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 608, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "startBlock", - "nodeType": "MemberAccess", - "referencedDeclaration": 41, - "src": "5498:25:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 604, - "id": 609, - "nodeType": "Return", - "src": "5491:32:0" - } - ] - }, - "documentation": null, - "id": 611, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getStartBlock", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 601, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 600, - "name": "_epoch", - "nodeType": "VariableDeclaration", - "scope": 611, - "src": "5441:11:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 599, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5441:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5440:13:0" - }, - "returnParameters": { - "id": 604, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 603, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 611, - "src": "5475:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 602, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5475:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5474:6:0" - }, - "scope": 1340, - "src": "5418:112:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 620, - "nodeType": "Block", - "src": "5587:43:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 617, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "5617:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 616, - "name": "getRangeSize", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 621, - 644 - ], - "referencedDeclaration": 644, - "src": "5604:12:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256) view returns (uint256)" - } - }, - "id": 618, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5604:19:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 615, - "id": 619, - "nodeType": "Return", - "src": "5597:26:0" - } - ] - }, - "documentation": null, - "id": 621, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getRangeSize", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 612, - "nodeType": "ParameterList", - "parameters": [], - "src": "5557:2:0" - }, - "returnParameters": { - "id": 615, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 614, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 621, - "src": "5581:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 613, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5581:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5580:6:0" - }, - "scope": 1340, - "src": "5536:94:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 630, - "nodeType": "Block", - "src": "5691:47:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 627, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "5721:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 626, - "name": "getRangeSize", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 621, - 644 - ], - "referencedDeclaration": 644, - "src": "5708:12:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256) view returns (uint256)" - } - }, - "id": 628, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5708:23:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 625, - "id": 629, - "nodeType": "Return", - "src": "5701:30:0" - } - ] - }, - "documentation": null, - "id": 631, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getNextRangeSize", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 622, - "nodeType": "ParameterList", - "parameters": [], - "src": "5661:2:0" - }, - "returnParameters": { - "id": 625, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 624, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 631, - "src": "5685:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 623, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5685:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5684:6:0" - }, - "scope": 1340, - "src": "5636:102:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 643, - "nodeType": "Block", - "src": "5806:48:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 638, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "5823:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 640, - "indexExpression": { - "argumentTypes": null, - "id": 639, - "name": "_epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 633, - "src": "5830:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "5823:14:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 641, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "rangeSize", - "nodeType": "MemberAccess", - "referencedDeclaration": 39, - "src": "5823:24:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 637, - "id": 642, - "nodeType": "Return", - "src": "5816:31:0" - } - ] - }, - "documentation": null, - "id": 644, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getRangeSize", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 634, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 633, - "name": "_epoch", - "nodeType": "VariableDeclaration", - "scope": 644, - "src": "5766:11:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 632, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5766:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5765:13:0" - }, - "returnParameters": { - "id": 637, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 636, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 644, - "src": "5800:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 635, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5800:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5799:6:0" - }, - "scope": 1340, - "src": "5744:110:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 653, - "nodeType": "Block", - "src": "5907:39:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 650, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "5933:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 649, - "name": "getNonce", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 654, - 667 - ], - "referencedDeclaration": 667, - "src": "5924:8:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256) view returns (uint256)" - } - }, - "id": 651, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5924:15:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 648, - "id": 652, - "nodeType": "Return", - "src": "5917:22:0" - } - ] - }, - "documentation": null, - "id": 654, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getNonce", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 645, - "nodeType": "ParameterList", - "parameters": [], - "src": "5877:2:0" - }, - "returnParameters": { - "id": 648, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 647, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 654, - "src": "5901:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 646, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5901:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5900:6:0" - }, - "scope": 1340, - "src": "5860:86:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 666, - "nodeType": "Block", - "src": "6010:44:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 661, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "6027:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 663, - "indexExpression": { - "argumentTypes": null, - "id": 662, - "name": "_epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 656, - "src": "6034:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6027:14:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 664, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "nonce", - "nodeType": "MemberAccess", - "referencedDeclaration": 43, - "src": "6027:20:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 660, - "id": 665, - "nodeType": "Return", - "src": "6020:27:0" - } - ] - }, - "documentation": null, - "id": 667, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getNonce", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 657, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 656, - "name": "_epoch", - "nodeType": "VariableDeclaration", - "scope": 667, - "src": "5970:11:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 655, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5970:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5969:13:0" - }, - "returnParameters": { - "id": 660, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 659, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 667, - "src": "6004:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 658, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "6004:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "6003:6:0" - }, - "scope": 1340, - "src": "5952:102:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 677, - "nodeType": "Block", - "src": "6103:39:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 672, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "6120:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 674, - "indexExpression": { - "argumentTypes": null, - "id": 673, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "6127:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6120:13:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 675, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "x", - "nodeType": "MemberAccess", - "referencedDeclaration": 45, - "src": "6120:15:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 671, - "id": 676, - "nodeType": "Return", - "src": "6113:22:0" - } - ] - }, - "documentation": null, - "id": 678, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getX", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 668, - "nodeType": "ParameterList", - "parameters": [], - "src": "6073:2:0" - }, - "returnParameters": { - "id": 671, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 670, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 678, - "src": "6097:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 669, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "6097:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "6096:6:0" - }, - "scope": 1340, - "src": "6060:82:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 688, - "nodeType": "Block", - "src": "6191:39:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 683, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "6208:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 685, - "indexExpression": { - "argumentTypes": null, - "id": 684, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "6215:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6208:13:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 686, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "y", - "nodeType": "MemberAccess", - "referencedDeclaration": 47, - "src": "6208:15:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 682, - "id": 687, - "nodeType": "Return", - "src": "6201:22:0" - } - ] - }, - "documentation": null, - "id": 689, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getY", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 679, - "nodeType": "ParameterList", - "parameters": [], - "src": "6161:2:0" - }, - "returnParameters": { - "id": 682, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 681, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 689, - "src": "6185:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 680, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "6185:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "6184:6:0" - }, - "scope": 1340, - "src": "6148:82:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 727, - "nodeType": "Block", - "src": "6285:215:0", - "statements": [ - { - "assignments": [ - 697 - ], - "declarations": [ - { - "constant": false, - "id": 697, - "name": "validators", - "nodeType": "VariableDeclaration", - "scope": 727, - "src": "6295:27:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 695, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "6295:7:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 696, - "length": null, - "nodeType": "ArrayTypeName", - "src": "6295:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 700, - "initialValue": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 698, - "name": "getValidators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 780, - "src": "6325:13:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_array$_t_address_$dyn_memory_ptr_$", - "typeString": "function () view returns (address[] memory)" - } - }, - "id": 699, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6325:15:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "6295:45:0" - }, - { - "body": { - "id": 723, - "nodeType": "Block", - "src": "6390:86:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 717, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 712, - "name": "validators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 697, - "src": "6408:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 714, - "indexExpression": { - "argumentTypes": null, - "id": 713, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 702, - "src": "6419:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6408:13:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 715, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13088, - "src": "6425:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 716, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "6425:10:0", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "src": "6408:27:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 722, - "nodeType": "IfStatement", - "src": "6404:61:0", - "trueBody": { - "expression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 720, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 718, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 702, - "src": "6460:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 719, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6464:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "6460:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 693, - "id": 721, - "nodeType": "Return", - "src": "6453:12:0" - } - } - ] - }, - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 708, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 705, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 702, - "src": "6367:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 706, - "name": "getParties", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 531, - 555 - ], - "referencedDeclaration": 531, - "src": "6371:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 707, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6371:12:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "6367:16:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 724, - "initializationExpression": { - "assignments": [ - 702 - ], - "declarations": [ - { - "constant": false, - "id": 702, - "name": "i", - "nodeType": "VariableDeclaration", - "scope": 724, - "src": "6355:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 701, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "6355:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 704, - "initialValue": { - "argumentTypes": null, - "hexValue": "30", - "id": 703, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6364:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "6355:10:0" - }, - "loopExpression": { - "expression": { - "argumentTypes": null, - "id": 710, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "6385:3:0", - "subExpression": { - "argumentTypes": null, - "id": 709, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 702, - "src": "6385:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 711, - "nodeType": "ExpressionStatement", - "src": "6385:3:0" - }, - "nodeType": "ForStatement", - "src": "6350:126:0" - }, - { - "expression": { - "argumentTypes": null, - "hexValue": "30", - "id": 725, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6492:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "functionReturnParameters": 693, - "id": 726, - "nodeType": "Return", - "src": "6485:8:0" - } - ] - }, - "documentation": null, - "id": 728, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getPartyId", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 690, - "nodeType": "ParameterList", - "parameters": [], - "src": "6255:2:0" - }, - "returnParameters": { - "id": 693, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 692, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 728, - "src": "6279:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 691, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "6279:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "6278:6:0" - }, - "scope": 1340, - "src": "6236:264:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 767, - "nodeType": "Block", - "src": "6568:214:0", - "statements": [ - { - "assignments": [ - 738 - ], - "declarations": [ - { - "constant": false, - "id": 738, - "name": "validators", - "nodeType": "VariableDeclaration", - "scope": 767, - "src": "6578:27:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 736, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "6578:7:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 737, - "length": null, - "nodeType": "ArrayTypeName", - "src": "6578:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 741, - "initialValue": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 739, - "name": "getNextValidators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 792, - "src": "6608:17:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_array$_t_address_$dyn_memory_ptr_$", - "typeString": "function () view returns (address[] memory)" - } - }, - "id": 740, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6608:19:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "6578:49:0" - }, - { - "body": { - "id": 763, - "nodeType": "Block", - "src": "6681:77:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 757, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 753, - "name": "validators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 738, - "src": "6699:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 755, - "indexExpression": { - "argumentTypes": null, - "id": 754, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 743, - "src": "6710:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6699:13:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "id": 756, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 730, - "src": "6716:1:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "6699:18:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 762, - "nodeType": "IfStatement", - "src": "6695:52:0", - "trueBody": { - "expression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 760, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 758, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 743, - "src": "6742:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 759, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6746:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "6742:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 734, - "id": 761, - "nodeType": "Return", - "src": "6735:12:0" - } - } - ] - }, - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 749, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 746, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 743, - "src": "6654:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 747, - "name": "getNextParties", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 541, - "src": "6658:14:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 748, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6658:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "6654:20:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 764, - "initializationExpression": { - "assignments": [ - 743 - ], - "declarations": [ - { - "constant": false, - "id": 743, - "name": "i", - "nodeType": "VariableDeclaration", - "scope": 764, - "src": "6642:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 742, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "6642:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 745, - "initialValue": { - "argumentTypes": null, - "hexValue": "30", - "id": 744, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6651:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "6642:10:0" - }, - "loopExpression": { - "expression": { - "argumentTypes": null, - "id": 751, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "6676:3:0", - "subExpression": { - "argumentTypes": null, - "id": 750, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 743, - "src": "6676:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 752, - "nodeType": "ExpressionStatement", - "src": "6676:3:0" - }, - "nodeType": "ForStatement", - "src": "6637:121:0" - }, - { - "expression": { - "argumentTypes": null, - "hexValue": "30", - "id": 765, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6774:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "functionReturnParameters": 734, - "id": 766, - "nodeType": "Return", - "src": "6767:8:0" - } - ] - }, - "documentation": null, - "id": 768, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getNextPartyId", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 731, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 730, - "name": "a", - "nodeType": "VariableDeclaration", - "scope": 768, - "src": "6530:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 729, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "6530:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "6529:11:0" - }, - "returnParameters": { - "id": 734, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 733, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 768, - "src": "6562:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 732, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "6562:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "6561:6:0" - }, - "scope": 1340, - "src": "6506:276:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 779, - "nodeType": "Block", - "src": "6852:48:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 774, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "6869:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 776, - "indexExpression": { - "argumentTypes": null, - "id": 775, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "6876:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6869:13:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 777, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "validators", - "nodeType": "MemberAccess", - "referencedDeclaration": 35, - "src": "6869:24:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "functionReturnParameters": 773, - "id": 778, - "nodeType": "Return", - "src": "6862:31:0" - } - ] - }, - "documentation": null, - "id": 780, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getValidators", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 769, - "nodeType": "ParameterList", - "parameters": [], - "src": "6810:2:0" - }, - "returnParameters": { - "id": 773, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 772, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 780, - "src": "6834:16:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 770, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "6834:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 771, - "length": null, - "nodeType": "ArrayTypeName", - "src": "6834:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "6833:18:0" - }, - "scope": 1340, - "src": "6788:112:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 791, - "nodeType": "Block", - "src": "6974:52:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 786, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "6991:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 788, - "indexExpression": { - "argumentTypes": null, - "id": 787, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "6998:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6991:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 789, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "validators", - "nodeType": "MemberAccess", - "referencedDeclaration": 35, - "src": "6991:28:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "functionReturnParameters": 785, - "id": 790, - "nodeType": "Return", - "src": "6984:35:0" - } - ] - }, - "documentation": null, - "id": 792, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getNextValidators", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 781, - "nodeType": "ParameterList", - "parameters": [], - "src": "6932:2:0" - }, - "returnParameters": { - "id": 785, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 784, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 792, - "src": "6956:16:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 782, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "6956:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 783, - "length": null, - "nodeType": "ArrayTypeName", - "src": "6956:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "6955:18:0" - }, - "scope": 1340, - "src": "6906:120:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 837, - "nodeType": "Block", - "src": "7093:296:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 800, - "name": "Vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 64, - "src": "7115:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", - "typeString": "type(enum Bridge.Vote)" - } - }, - "id": 801, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "START_VOTING", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "7115:17:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - ], - "id": 799, - "name": "tryVote", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1084, - 1109, - 1134, - 1164 - ], - "referencedDeclaration": 1084, - "src": "7107:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$returns$_t_bool_$", - "typeString": "function (enum Bridge.Vote) returns (bool)" - } - }, - "id": 802, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7107:26:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 836, - "nodeType": "IfStatement", - "src": "7103:280:0", - "trueBody": { - "id": 835, - "nodeType": "Block", - "src": "7135:248:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 804, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "7149:11:0", - "subExpression": { - "argumentTypes": null, - "id": 803, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "7149:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 805, - "nodeType": "ExpressionStatement", - "src": "7149:11:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 809, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 806, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 90, - "src": "7174:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 807, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 53, - "src": "7183:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$53_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 808, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "VOTING", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "7183:13:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "src": "7174:22:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "id": 810, - "nodeType": "ExpressionStatement", - "src": "7174:22:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 817, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 811, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "7210:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 813, - "indexExpression": { - "argumentTypes": null, - "id": 812, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "7217:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "7210:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 814, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "threshold", - "nodeType": "MemberAccess", - "referencedDeclaration": 37, - "src": "7210:27:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 815, - "name": "getThreshold", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 565, - 588 - ], - "referencedDeclaration": 565, - "src": "7240:12:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 816, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7240:14:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "7210:44:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 818, - "nodeType": "ExpressionStatement", - "src": "7210:44:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 825, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 819, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "7268:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 821, - "indexExpression": { - "argumentTypes": null, - "id": 820, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "7275:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "7268:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 822, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "validators", - "nodeType": "MemberAccess", - "referencedDeclaration": 35, - "src": "7268:28:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 823, - "name": "getValidators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 780, - "src": "7299:13:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_array$_t_address_$dyn_memory_ptr_$", - "typeString": "function () view returns (address[] memory)" - } - }, - "id": 824, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7299:15:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "src": "7268:46:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 826, - "nodeType": "ExpressionStatement", - "src": "7268:46:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 833, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 827, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "7328:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 829, - "indexExpression": { - "argumentTypes": null, - "id": 828, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "7335:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "7328:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 830, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "rangeSize", - "nodeType": "MemberAccess", - "referencedDeclaration": 39, - "src": "7328:27:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 831, - "name": "getRangeSize", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 621, - 644 - ], - "referencedDeclaration": 621, - "src": "7358:12:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 832, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7358:14:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "7328:44:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 834, - "nodeType": "ExpressionStatement", - "src": "7328:44:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 838, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 795, - "modifierName": { - "argumentTypes": null, - "id": 794, - "name": "readyOrVoting", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 213, - "src": "7062:13:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "7062:13:0" - }, - { - "arguments": null, - "id": 797, - "modifierName": { - "argumentTypes": null, - "id": 796, - "name": "currentValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 261, - "src": "7076:16:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "7076:16:0" - } - ], - "name": "startVoting", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 793, - "nodeType": "ParameterList", - "parameters": [], - "src": "7052:2:0" - }, - "returnParameters": { - "id": 798, - "nodeType": "ParameterList", - "parameters": [], - "src": "7093:0:0" - }, - "scope": 1340, - "src": "7032:357:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 871, - "nodeType": "Block", - "src": "7471:202:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 852, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 849, - "name": "validator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 840, - "src": "7504:9:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 848, - "name": "getNextPartyId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 768, - "src": "7489:14:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_uint256_$", - "typeString": "function (address) view returns (uint256)" - } - }, - "id": 850, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7489:25:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 851, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "7518:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "7489:30:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "416c726561647920612076616c696461746f72", - "id": 853, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "7521:21:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_aeb0fe100da2796aa6136a3b1c66282f002b435141be331237dfa7127e6df6ff", - "typeString": "literal_string \"Already a validator\"" - }, - "value": "Already a validator" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_aeb0fe100da2796aa6136a3b1c66282f002b435141be331237dfa7127e6df6ff", - "typeString": "literal_string \"Already a validator\"" - } - ], - "id": 847, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 13091, - 13092 - ], - "referencedDeclaration": 13092, - "src": "7481:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 854, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7481:62:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 855, - "nodeType": "ExpressionStatement", - "src": "7481:62:0" - }, - { - "condition": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 857, - "name": "Vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 64, - "src": "7566:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", - "typeString": "type(enum Bridge.Vote)" - } - }, - "id": 858, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "ADD_VALIDATOR", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "7566:18:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 859, - "name": "validator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 840, - "src": "7586:9:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 856, - "name": "tryVote", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1084, - 1109, - 1134, - 1164 - ], - "referencedDeclaration": 1109, - "src": "7558:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$_t_address_$returns$_t_bool_$", - "typeString": "function (enum Bridge.Vote,address) returns (bool)" - } - }, - "id": 860, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7558:38:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 870, - "nodeType": "IfStatement", - "src": "7554:113:0", - "trueBody": { - "id": 869, - "nodeType": "Block", - "src": "7598:69:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 866, - "name": "validator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 840, - "src": "7646:9:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 861, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "7612:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 863, - "indexExpression": { - "argumentTypes": null, - "id": 862, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "7619:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "7612:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 864, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "validators", - "nodeType": "MemberAccess", - "referencedDeclaration": 35, - "src": "7612:28:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 865, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "push", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "7612:33:0", - "typeDescriptions": { - "typeIdentifier": "t_function_arraypush_nonpayable$_t_address_$returns$_t_uint256_$", - "typeString": "function (address) returns (uint256)" - } - }, - "id": 867, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7612:44:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 868, - "nodeType": "ExpressionStatement", - "src": "7612:44:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 872, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 843, - "modifierName": { - "argumentTypes": null, - "id": 842, - "name": "voting", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 225, - "src": "7447:6:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "7447:6:0" - }, - { - "arguments": null, - "id": 845, - "modifierName": { - "argumentTypes": null, - "id": 844, - "name": "currentValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 261, - "src": "7454:16:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "7454:16:0" - } - ], - "name": "voteAddValidator", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 841, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 840, - "name": "validator", - "nodeType": "VariableDeclaration", - "scope": 872, - "src": "7421:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 839, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "7421:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "7420:19:0" - }, - "returnParameters": { - "id": 846, - "nodeType": "ParameterList", - "parameters": [], - "src": "7471:0:0" - }, - "scope": 1340, - "src": "7395:278:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 901, - "nodeType": "Block", - "src": "7758:192:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 886, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 883, - "name": "validator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 874, - "src": "7791:9:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 882, - "name": "getNextPartyId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 768, - "src": "7776:14:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_uint256_$", - "typeString": "function (address) view returns (uint256)" - } - }, - "id": 884, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7776:25:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 885, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "7805:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "7776:30:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "416c7265616479206e6f7420612076616c696461746f72", - "id": 887, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "7808:25:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_2332ed568e8af3d64f1f2b0b098c504cab97ba4128fb9f08cfa3f851ced05961", - "typeString": "literal_string \"Already not a validator\"" - }, - "value": "Already not a validator" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_2332ed568e8af3d64f1f2b0b098c504cab97ba4128fb9f08cfa3f851ced05961", - "typeString": "literal_string \"Already not a validator\"" - } - ], - "id": 881, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 13091, - 13092 - ], - "referencedDeclaration": 13092, - "src": "7768:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 888, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7768:66:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 889, - "nodeType": "ExpressionStatement", - "src": "7768:66:0" - }, - { - "condition": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 891, - "name": "Vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 64, - "src": "7857:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", - "typeString": "type(enum Bridge.Vote)" - } - }, - "id": 892, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "REMOVE_VALIDATOR", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "7857:21:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 893, - "name": "validator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 874, - "src": "7880:9:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 890, - "name": "tryVote", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1084, - 1109, - 1134, - 1164 - ], - "referencedDeclaration": 1109, - "src": "7849:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$_t_address_$returns$_t_bool_$", - "typeString": "function (enum Bridge.Vote,address) returns (bool)" - } - }, - "id": 894, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7849:41:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 900, - "nodeType": "IfStatement", - "src": "7845:99:0", - "trueBody": { - "id": 899, - "nodeType": "Block", - "src": "7892:52:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 896, - "name": "validator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 874, - "src": "7923:9:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 895, - "name": "_removeValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 967, - "src": "7906:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$", - "typeString": "function (address)" - } - }, - "id": 897, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7906:27:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 898, - "nodeType": "ExpressionStatement", - "src": "7906:27:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 902, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 877, - "modifierName": { - "argumentTypes": null, - "id": 876, - "name": "voting", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 225, - "src": "7734:6:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "7734:6:0" - }, - { - "arguments": null, - "id": 879, - "modifierName": { - "argumentTypes": null, - "id": 878, - "name": "currentValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 261, - "src": "7741:16:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "7741:16:0" - } - ], - "name": "voteRemoveValidator", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 875, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 874, - "name": "validator", - "nodeType": "VariableDeclaration", - "scope": 902, - "src": "7708:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 873, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "7708:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "7707:19:0" - }, - "returnParameters": { - "id": 880, - "nodeType": "ParameterList", - "parameters": [], - "src": "7758:0:0" - }, - "scope": 1340, - "src": "7679:271:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 966, - "nodeType": "Block", - "src": "8009:383:0", - "statements": [ - { - "body": { - "id": 946, - "nodeType": "Block", - "src": "8067:205:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 927, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 920, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "8085:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 922, - "indexExpression": { - "argumentTypes": null, - "id": 921, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "8092:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8085:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 923, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "validators", - "nodeType": "MemberAccess", - "referencedDeclaration": 35, - "src": "8085:28:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 925, - "indexExpression": { - "argumentTypes": null, - "id": 924, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 908, - "src": "8114:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8085:31:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "id": 926, - "name": "validator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 904, - "src": "8120:9:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "8085:44:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 945, - "nodeType": "IfStatement", - "src": "8081:181:0", - "trueBody": { - "id": 944, - "nodeType": "Block", - "src": "8131:131:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 941, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 928, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "8149:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 930, - "indexExpression": { - "argumentTypes": null, - "id": 929, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "8156:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8149:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 931, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "validators", - "nodeType": "MemberAccess", - "referencedDeclaration": 35, - "src": "8149:28:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 933, - "indexExpression": { - "argumentTypes": null, - "id": 932, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 908, - "src": "8178:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "8149:31:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 934, - "name": "getNextValidators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 792, - "src": "8183:17:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_array$_t_address_$dyn_memory_ptr_$", - "typeString": "function () view returns (address[] memory)" - } - }, - "id": 935, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8183:19:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 940, - "indexExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 939, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 936, - "name": "getNextParties", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 541, - "src": "8203:14:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 937, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8203:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 938, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8222:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "8203:20:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8183:41:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "8149:75:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 942, - "nodeType": "ExpressionStatement", - "src": "8149:75:0" - }, - { - "id": 943, - "nodeType": "Break", - "src": "8242:5:0" - } - ] - } - } - ] - }, - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 916, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 911, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 908, - "src": "8036:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 915, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 912, - "name": "getNextParties", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 541, - "src": "8040:14:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 913, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8040:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 914, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8059:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "8040:20:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "8036:24:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 947, - "initializationExpression": { - "assignments": [ - 908 - ], - "declarations": [ - { - "constant": false, - "id": 908, - "name": "i", - "nodeType": "VariableDeclaration", - "scope": 947, - "src": "8024:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 907, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "8024:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 910, - "initialValue": { - "argumentTypes": null, - "hexValue": "30", - "id": 909, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8033:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "8024:10:0" - }, - "loopExpression": { - "expression": { - "argumentTypes": null, - "id": 918, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "8062:3:0", - "subExpression": { - "argumentTypes": null, - "id": 917, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 908, - "src": "8062:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 919, - "nodeType": "ExpressionStatement", - "src": "8062:3:0" - }, - "nodeType": "ForStatement", - "src": "8019:253:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 957, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "delete", - "prefix": true, - "src": "8281:57:0", - "subExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 948, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "8288:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 950, - "indexExpression": { - "argumentTypes": null, - "id": 949, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "8295:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8288:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 951, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "validators", - "nodeType": "MemberAccess", - "referencedDeclaration": 35, - "src": "8288:28:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 956, - "indexExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 955, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 952, - "name": "getNextParties", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 541, - "src": "8317:14:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 953, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8317:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 954, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8336:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "8317:20:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "8288:50:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 958, - "nodeType": "ExpressionStatement", - "src": "8281:57:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 964, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "--", - "prefix": false, - "src": "8348:37:0", - "subExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 959, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "8348:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 961, - "indexExpression": { - "argumentTypes": null, - "id": 960, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "8355:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8348:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 962, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "validators", - "nodeType": "MemberAccess", - "referencedDeclaration": 35, - "src": "8348:28:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 963, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "8348:35:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 965, - "nodeType": "ExpressionStatement", - "src": "8348:37:0" - } - ] - }, - "documentation": null, - "id": 967, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "_removeValidator", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 905, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 904, - "name": "validator", - "nodeType": "VariableDeclaration", - "scope": 967, - "src": "7982:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 903, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "7982:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "7981:19:0" - }, - "returnParameters": { - "id": 906, - "nodeType": "ParameterList", - "parameters": [], - "src": "8009:0:0" - }, - "scope": 1340, - "src": "7956:436:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "private" - }, - { - "body": { - "id": 990, - "nodeType": "Block", - "src": "8474:127:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 977, - "name": "Vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 64, - "src": "8496:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", - "typeString": "type(enum Bridge.Vote)" - } - }, - "id": 978, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "CHANGE_THRESHOLD", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "8496:21:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 979, - "name": "threshold", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 969, - "src": "8519:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 976, - "name": "tryVote", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1084, - 1109, - 1134, - 1164 - ], - "referencedDeclaration": 1134, - "src": "8488:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$_t_uint256_$returns$_t_bool_$", - "typeString": "function (enum Bridge.Vote,uint256) returns (bool)" - } - }, - "id": 980, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8488:41:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 989, - "nodeType": "IfStatement", - "src": "8484:111:0", - "trueBody": { - "id": 988, - "nodeType": "Block", - "src": "8531:64:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 986, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 981, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "8545:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 983, - "indexExpression": { - "argumentTypes": null, - "id": 982, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "8552:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8545:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 984, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "threshold", - "nodeType": "MemberAccess", - "referencedDeclaration": 37, - "src": "8545:27:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 985, - "name": "threshold", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 969, - "src": "8575:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "8545:39:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 987, - "nodeType": "ExpressionStatement", - "src": "8545:39:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 991, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 972, - "modifierName": { - "argumentTypes": null, - "id": 971, - "name": "voting", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 225, - "src": "8450:6:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "8450:6:0" - }, - { - "arguments": null, - "id": 974, - "modifierName": { - "argumentTypes": null, - "id": 973, - "name": "currentValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 261, - "src": "8457:16:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "8457:16:0" - } - ], - "name": "voteChangeThreshold", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 970, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 969, - "name": "threshold", - "nodeType": "VariableDeclaration", - "scope": 991, - "src": "8427:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 968, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "8427:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "8426:16:0" - }, - "returnParameters": { - "id": 975, - "nodeType": "ParameterList", - "parameters": [], - "src": "8474:0:0" - }, - "scope": 1340, - "src": "8398:203:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 1014, - "nodeType": "Block", - "src": "8683:128:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1001, - "name": "Vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 64, - "src": "8705:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", - "typeString": "type(enum Bridge.Vote)" - } - }, - "id": 1002, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "CHANGE_RANGE_SIZE", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "8705:22:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 1003, - "name": "rangeSize", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 993, - "src": "8729:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 1000, - "name": "tryVote", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1084, - 1109, - 1134, - 1164 - ], - "referencedDeclaration": 1134, - "src": "8697:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$_t_uint256_$returns$_t_bool_$", - "typeString": "function (enum Bridge.Vote,uint256) returns (bool)" - } - }, - "id": 1004, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8697:42:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 1013, - "nodeType": "IfStatement", - "src": "8693:112:0", - "trueBody": { - "id": 1012, - "nodeType": "Block", - "src": "8741:64:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 1010, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1005, - "name": "states", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "8755:6:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_State_$48_storage_$", - "typeString": "mapping(uint256 => struct Bridge.State storage ref)" - } - }, - "id": 1007, - "indexExpression": { - "argumentTypes": null, - "id": 1006, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "8762:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8755:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_State_$48_storage", - "typeString": "struct Bridge.State storage ref" - } - }, - "id": 1008, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "rangeSize", - "nodeType": "MemberAccess", - "referencedDeclaration": 39, - "src": "8755:27:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 1009, - "name": "rangeSize", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 993, - "src": "8785:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "8755:39:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 1011, - "nodeType": "ExpressionStatement", - "src": "8755:39:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 1015, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 996, - "modifierName": { - "argumentTypes": null, - "id": 995, - "name": "voting", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 225, - "src": "8659:6:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "8659:6:0" - }, - { - "arguments": null, - "id": 998, - "modifierName": { - "argumentTypes": null, - "id": 997, - "name": "currentValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 261, - "src": "8666:16:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "8666:16:0" - } - ], - "name": "voteChangeRangeSize", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 994, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 993, - "name": "rangeSize", - "nodeType": "VariableDeclaration", - "scope": 1015, - "src": "8636:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 992, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "8636:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "8635:16:0" - }, - "returnParameters": { - "id": 999, - "nodeType": "ParameterList", - "parameters": [], - "src": "8683:0:0" - }, - "scope": 1340, - "src": "8607:204:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 1038, - "nodeType": "Block", - "src": "8875:141:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1023, - "name": "Vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 64, - "src": "8897:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", - "typeString": "type(enum Bridge.Vote)" - } - }, - "id": 1024, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "START_KEYGEN", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "8897:17:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - ], - "id": 1022, - "name": "tryVote", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1084, - 1109, - 1134, - 1164 - ], - "referencedDeclaration": 1084, - "src": "8889:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$returns$_t_bool_$", - "typeString": "function (enum Bridge.Vote) returns (bool)" - } - }, - "id": 1025, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8889:26:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 1037, - "nodeType": "IfStatement", - "src": "8885:125:0", - "trueBody": { - "id": 1036, - "nodeType": "Block", - "src": "8917:93:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 1029, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 1026, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 90, - "src": "8931:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1027, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 53, - "src": "8940:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$53_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 1028, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "KEYGEN", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "8940:13:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "src": "8931:22:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "id": 1030, - "nodeType": "ExpressionStatement", - "src": "8931:22:0" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1032, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 92, - "src": "8982:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 1033, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "8989:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 1031, - "name": "NewEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 14, - "src": "8973:8:0", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$returns$__$", - "typeString": "function (uint256,uint256)" - } - }, - "id": 1034, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8973:26:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 1035, - "nodeType": "EmitStatement", - "src": "8968:31:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 1039, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 1018, - "modifierName": { - "argumentTypes": null, - "id": 1017, - "name": "voting", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 225, - "src": "8851:6:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "8851:6:0" - }, - { - "arguments": null, - "id": 1020, - "modifierName": { - "argumentTypes": null, - "id": 1019, - "name": "currentValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 261, - "src": "8858:16:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "8858:16:0" - } - ], - "name": "voteStartKeygen", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1016, - "nodeType": "ParameterList", - "parameters": [], - "src": "8841:2:0" - }, - "returnParameters": { - "id": 1021, - "nodeType": "ParameterList", - "parameters": [], - "src": "8875:0:0" - }, - "scope": 1340, - "src": "8817:199:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 1061, - "nodeType": "Block", - "src": "9081:144:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1047, - "name": "Vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 64, - "src": "9103:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Vote_$64_$", - "typeString": "type(enum Bridge.Vote)" - } - }, - "id": 1048, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "CANCEL_KEYGEN", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "9103:18:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - ], - "id": 1046, - "name": "tryVote", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1084, - 1109, - 1134, - 1164 - ], - "referencedDeclaration": 1084, - "src": "9095:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_enum$_Vote_$64_$returns$_t_bool_$", - "typeString": "function (enum Bridge.Vote) returns (bool)" - } - }, - "id": 1049, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9095:27:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 1060, - "nodeType": "IfStatement", - "src": "9091:128:0", - "trueBody": { - "id": 1059, - "nodeType": "Block", - "src": "9124:95:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 1053, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 1050, - "name": "status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 90, - "src": "9138:6:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1051, - "name": "Status", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 53, - "src": "9147:6:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_Status_$53_$", - "typeString": "type(enum Bridge.Status)" - } - }, - "id": 1052, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "VOTING", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "9147:13:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "src": "9138:22:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Status_$53", - "typeString": "enum Bridge.Status" - } - }, - "id": 1054, - "nodeType": "ExpressionStatement", - "src": "9138:22:0" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1056, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "9198:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 1055, - "name": "NewEpochCancelled", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 18, - "src": "9180:17:0", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$returns$__$", - "typeString": "function (uint256)" - } - }, - "id": 1057, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9180:28:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 1058, - "nodeType": "EmitStatement", - "src": "9175:33:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 1062, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 1042, - "modifierName": { - "argumentTypes": null, - "id": 1041, - "name": "keygen", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 237, - "src": "9057:6:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "9057:6:0" - }, - { - "arguments": null, - "id": 1044, - "modifierName": { - "argumentTypes": null, - "id": 1043, - "name": "currentValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 261, - "src": "9064:16:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "9064:16:0" - } - ], - "name": "voteCancelKeygen", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1040, - "nodeType": "ParameterList", - "parameters": [], - "src": "9047:2:0" - }, - "returnParameters": { - "id": 1045, - "nodeType": "ParameterList", - "parameters": [], - "src": "9081:0:0" - }, - "scope": 1340, - "src": "9022:203:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 1083, - "nodeType": "Block", - "src": "9286:110:0", - "statements": [ - { - "assignments": [ - 1070 - ], - "declarations": [ - { - "constant": false, - "id": 1070, - "name": "vote", - "nodeType": "VariableDeclaration", - "scope": 1083, - "src": "9296:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1069, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "9296:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 1078, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1074, - "name": "voteType", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1064, - "src": "9338:8:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 1075, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "9348:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 1072, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13075, - "src": "9321:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 1073, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "9321:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 1076, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9321:37:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 1071, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13082, - "src": "9311:9:0", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 1077, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9311:48:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "9296:63:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1080, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1070, - "src": "9384:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "id": 1079, - "name": "putVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1268, - "src": "9376:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$_t_bool_$", - "typeString": "function (bytes32) returns (bool)" - } - }, - "id": 1081, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9376:13:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "functionReturnParameters": 1068, - "id": 1082, - "nodeType": "Return", - "src": "9369:20:0" - } - ] - }, - "documentation": null, - "id": 1084, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "tryVote", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1065, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1064, - "name": "voteType", - "nodeType": "VariableDeclaration", - "scope": 1084, - "src": "9248:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - "typeName": { - "contractScope": null, - "id": 1063, - "name": "Vote", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 64, - "src": "9248:4:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "9247:15:0" - }, - "returnParameters": { - "id": 1068, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1067, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 1084, - "src": "9280:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 1066, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "9280:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "9279:6:0" - }, - "scope": 1340, - "src": "9231:165:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "private" - }, - { - "body": { - "id": 1108, - "nodeType": "Block", - "src": "9471:116:0", - "statements": [ - { - "assignments": [ - 1094 - ], - "declarations": [ - { - "constant": false, - "id": 1094, - "name": "vote", - "nodeType": "VariableDeclaration", - "scope": 1108, - "src": "9481:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1093, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "9481:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 1103, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1098, - "name": "voteType", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1086, - "src": "9523:8:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 1099, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "9533:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 1100, - "name": "addr", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1088, - "src": "9544:4:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "expression": { - "argumentTypes": null, - "id": 1096, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13075, - "src": "9506:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 1097, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "9506:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 1101, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9506:43:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 1095, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13082, - "src": "9496:9:0", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 1102, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9496:54:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "9481:69:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1105, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1094, - "src": "9575:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "id": 1104, - "name": "putVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1268, - "src": "9567:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$_t_bool_$", - "typeString": "function (bytes32) returns (bool)" - } - }, - "id": 1106, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9567:13:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "functionReturnParameters": 1092, - "id": 1107, - "nodeType": "Return", - "src": "9560:20:0" - } - ] - }, - "documentation": null, - "id": 1109, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "tryVote", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1089, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1086, - "name": "voteType", - "nodeType": "VariableDeclaration", - "scope": 1109, - "src": "9419:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - "typeName": { - "contractScope": null, - "id": 1085, - "name": "Vote", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 64, - "src": "9419:4:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 1088, - "name": "addr", - "nodeType": "VariableDeclaration", - "scope": 1109, - "src": "9434:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1087, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "9434:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "9418:29:0" - }, - "returnParameters": { - "id": 1092, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1091, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 1109, - "src": "9465:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 1090, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "9465:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "9464:6:0" - }, - "scope": 1340, - "src": "9402:185:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "private" - }, - { - "body": { - "id": 1133, - "nodeType": "Block", - "src": "9658:115:0", - "statements": [ - { - "assignments": [ - 1119 - ], - "declarations": [ - { - "constant": false, - "id": 1119, - "name": "vote", - "nodeType": "VariableDeclaration", - "scope": 1133, - "src": "9668:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1118, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "9668:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 1128, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1123, - "name": "voteType", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1111, - "src": "9710:8:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 1124, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "9720:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 1125, - "name": "num", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1113, - "src": "9731:3:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 1121, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13075, - "src": "9693:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 1122, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "9693:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 1126, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9693:42:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 1120, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13082, - "src": "9683:9:0", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 1127, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9683:53:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "9668:68:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1130, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1119, - "src": "9761:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "id": 1129, - "name": "putVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1268, - "src": "9753:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$_t_bool_$", - "typeString": "function (bytes32) returns (bool)" - } - }, - "id": 1131, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9753:13:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "functionReturnParameters": 1117, - "id": 1132, - "nodeType": "Return", - "src": "9746:20:0" - } - ] - }, - "documentation": null, - "id": 1134, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "tryVote", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1114, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1111, - "name": "voteType", - "nodeType": "VariableDeclaration", - "scope": 1134, - "src": "9610:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - "typeName": { - "contractScope": null, - "id": 1110, - "name": "Vote", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 64, - "src": "9610:4:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 1113, - "name": "num", - "nodeType": "VariableDeclaration", - "scope": 1134, - "src": "9625:8:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1112, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "9625:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "9609:25:0" - }, - "returnParameters": { - "id": 1117, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1116, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 1134, - "src": "9652:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 1115, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "9652:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "9651:6:0" - }, - "scope": 1340, - "src": "9593:180:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "private" - }, - { - "body": { - "id": 1163, - "nodeType": "Block", - "src": "9872:116:0", - "statements": [ - { - "assignments": [ - 1148 - ], - "declarations": [ - { - "constant": false, - "id": 1148, - "name": "vote", - "nodeType": "VariableDeclaration", - "scope": 1163, - "src": "9882:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1147, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "9882:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 1158, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1152, - "name": "voteType", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1136, - "src": "9924:8:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 1153, - "name": "hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1138, - "src": "9934:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "id": 1154, - "name": "to", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1140, - "src": "9940:2:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 1155, - "name": "value", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1142, - "src": "9944:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 1150, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13075, - "src": "9907:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 1151, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "9907:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 1156, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9907:43:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 1149, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13082, - "src": "9897:9:0", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 1157, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9897:54:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "9882:69:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1160, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1148, - "src": "9976:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "id": 1159, - "name": "putVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1268, - "src": "9968:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$_t_bool_$", - "typeString": "function (bytes32) returns (bool)" - } - }, - "id": 1161, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9968:13:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "functionReturnParameters": 1146, - "id": 1162, - "nodeType": "Return", - "src": "9961:20:0" - } - ] - }, - "documentation": null, - "id": 1164, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "tryVote", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1143, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1136, - "name": "voteType", - "nodeType": "VariableDeclaration", - "scope": 1164, - "src": "9796:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - "typeName": { - "contractScope": null, - "id": 1135, - "name": "Vote", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 64, - "src": "9796:4:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 1138, - "name": "hash", - "nodeType": "VariableDeclaration", - "scope": 1164, - "src": "9811:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1137, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "9811:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 1140, - "name": "to", - "nodeType": "VariableDeclaration", - "scope": 1164, - "src": "9825:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1139, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "9825:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 1142, - "name": "value", - "nodeType": "VariableDeclaration", - "scope": 1164, - "src": "9837:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1141, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "9837:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "9795:53:0" - }, - "returnParameters": { - "id": 1146, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1145, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 1164, - "src": "9866:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 1144, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "9866:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "9865:6:0" - }, - "scope": 1340, - "src": "9779:209:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "private" - }, - { - "body": { - "id": 1185, - "nodeType": "Block", - "src": "10052:113:0", - "statements": [ - { - "assignments": [ - 1172 - ], - "declarations": [ - { - "constant": false, - "id": 1172, - "name": "vote", - "nodeType": "VariableDeclaration", - "scope": 1185, - "src": "10062:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1171, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "10062:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 1180, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1176, - "name": "voteType", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1166, - "src": "10104:8:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 1177, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "10114:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 1174, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13075, - "src": "10087:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 1175, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "10087:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 1178, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10087:37:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 1173, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13082, - "src": "10077:9:0", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 1179, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10077:48:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "10062:63:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1182, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1172, - "src": "10153:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "id": 1181, - "name": "putConfirm", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1322, - "src": "10142:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$_t_bool_$", - "typeString": "function (bytes32) returns (bool)" - } - }, - "id": 1183, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10142:16:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "functionReturnParameters": 1170, - "id": 1184, - "nodeType": "Return", - "src": "10135:23:0" - } - ] - }, - "documentation": null, - "id": 1186, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "tryConfirm", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1167, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1166, - "name": "voteType", - "nodeType": "VariableDeclaration", - "scope": 1186, - "src": "10014:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - "typeName": { - "contractScope": null, - "id": 1165, - "name": "Vote", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 64, - "src": "10014:4:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "10013:15:0" - }, - "returnParameters": { - "id": 1170, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1169, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 1186, - "src": "10046:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 1168, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "10046:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "10045:6:0" - }, - "scope": 1340, - "src": "9994:171:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "private" - }, - { - "body": { - "id": 1213, - "nodeType": "Block", - "src": "10245:119:0", - "statements": [ - { - "assignments": [ - 1198 - ], - "declarations": [ - { - "constant": false, - "id": 1198, - "name": "vote", - "nodeType": "VariableDeclaration", - "scope": 1213, - "src": "10255:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1197, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "10255:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 1208, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1202, - "name": "voteType", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1188, - "src": "10297:8:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - { - "argumentTypes": null, - "id": 1203, - "name": "nextEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 94, - "src": "10307:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 1204, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1190, - "src": "10318:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 1205, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1192, - "src": "10321:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 1200, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13075, - "src": "10280:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 1201, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "10280:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 1206, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10280:43:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 1199, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13082, - "src": "10270:9:0", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 1207, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10270:54:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "10255:69:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1210, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1198, - "src": "10352:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "id": 1209, - "name": "putConfirm", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1322, - "src": "10341:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$_t_bool_$", - "typeString": "function (bytes32) returns (bool)" - } - }, - "id": 1211, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10341:16:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "functionReturnParameters": 1196, - "id": 1212, - "nodeType": "Return", - "src": "10334:23:0" - } - ] - }, - "documentation": null, - "id": 1214, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "tryConfirm", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1193, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1188, - "name": "voteType", - "nodeType": "VariableDeclaration", - "scope": 1214, - "src": "10191:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - }, - "typeName": { - "contractScope": null, - "id": 1187, - "name": "Vote", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 64, - "src": "10191:4:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_Vote_$64", - "typeString": "enum Bridge.Vote" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 1190, - "name": "x", - "nodeType": "VariableDeclaration", - "scope": 1214, - "src": "10206:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1189, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "10206:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 1192, - "name": "y", - "nodeType": "VariableDeclaration", - "scope": 1214, - "src": "10214:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1191, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "10214:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "10190:31:0" - }, - "returnParameters": { - "id": 1196, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1195, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 1214, - "src": "10239:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 1194, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "10239:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "10238:6:0" - }, - "scope": 1340, - "src": "10171:193:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "private" - }, - { - "body": { - "id": 1267, - "nodeType": "Block", - "src": "10424:355:0", - "statements": [ - { - "assignments": [ - 1222 - ], - "declarations": [ - { - "constant": false, - "id": 1222, - "name": "personalVote", - "nodeType": "VariableDeclaration", - "scope": 1267, - "src": "10434:20:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1221, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "10434:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 1226, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1224, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1216, - "src": "10473:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "id": 1223, - "name": "personalizeVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1339, - "src": "10457:15:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_bytes32_$", - "typeString": "function (bytes32) view returns (bytes32)" - } - }, - "id": 1225, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10457:21:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "10434:44:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1231, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "!", - "prefix": true, - "src": "10496:20:0", - "subExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1228, - "name": "votes", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 84, - "src": "10497:5:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - } - }, - "id": 1230, - "indexExpression": { - "argumentTypes": null, - "id": 1229, - "name": "personalVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1222, - "src": "10503:12:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "10497:19:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "566f74656420616c7265616479", - "id": 1232, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "10518:15:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_230c30109b60c15b21799291aaf5c571045da3dc3f224d8bbd2f2e688c149a47", - "typeString": "literal_string \"Voted already\"" - }, - "value": "Voted already" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_230c30109b60c15b21799291aaf5c571045da3dc3f224d8bbd2f2e688c149a47", - "typeString": "literal_string \"Voted already\"" - } - ], - "id": 1227, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 13091, - 13092 - ], - "referencedDeclaration": 13092, - "src": "10488:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 1233, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10488:46:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 1234, - "nodeType": "ExpressionStatement", - "src": "10488:46:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 1239, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1235, - "name": "votes", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 84, - "src": "10545:5:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - } - }, - "id": 1237, - "indexExpression": { - "argumentTypes": null, - "id": 1236, - "name": "personalVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1222, - "src": "10551:12:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "10545:19:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 1238, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "10567:4:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "src": "10545:26:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 1240, - "nodeType": "ExpressionStatement", - "src": "10545:26:0" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 1246, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1241, - "name": "votesCount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 80, - "src": "10585:10:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - } - }, - "id": 1243, - "indexExpression": { - "argumentTypes": null, - "id": 1242, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1216, - "src": "10596:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "10585:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 1244, - "name": "getThreshold", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 565, - 588 - ], - "referencedDeclaration": 565, - "src": "10605:12:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 1245, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10605:14:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "10585:34:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "id": 1265, - "nodeType": "Block", - "src": "10704:69:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 1261, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "10718:18:0", - "subExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1258, - "name": "votesCount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 80, - "src": "10718:10:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - } - }, - "id": 1260, - "indexExpression": { - "argumentTypes": null, - "id": 1259, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1216, - "src": "10729:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "10718:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 1262, - "nodeType": "ExpressionStatement", - "src": "10718:18:0" - }, - { - "expression": { - "argumentTypes": null, - "hexValue": "66616c7365", - "id": 1263, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "10757:5:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "false" - }, - "functionReturnParameters": 1220, - "id": 1264, - "nodeType": "Return", - "src": "10750:12:0" - } - ] - }, - "id": 1266, - "nodeType": "IfStatement", - "src": "10581:192:0", - "trueBody": { - "id": 1257, - "nodeType": "Block", - "src": "10621:77:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 1253, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1247, - "name": "votesCount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 80, - "src": "10635:10:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - } - }, - "id": 1249, - "indexExpression": { - "argumentTypes": null, - "id": 1248, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1216, - "src": "10646:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "10635:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_rational_57896044618658097711785492504343953926634992332820282019728792003956564819968_by_1", - "typeString": "int_const 5789...(69 digits omitted)...9968" - }, - "id": 1252, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "hexValue": "32", - "id": 1250, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "10654:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "nodeType": "BinaryOperation", - "operator": "**", - "rightExpression": { - "argumentTypes": null, - "hexValue": "323535", - "id": 1251, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "10659:3:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_255_by_1", - "typeString": "int_const 255" - }, - "value": "255" - }, - "src": "10654:8:0", - "typeDescriptions": { - "typeIdentifier": "t_rational_57896044618658097711785492504343953926634992332820282019728792003956564819968_by_1", - "typeString": "int_const 5789...(69 digits omitted)...9968" - } - }, - "src": "10635:27:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 1254, - "nodeType": "ExpressionStatement", - "src": "10635:27:0" - }, - { - "expression": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 1255, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "10683:4:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "functionReturnParameters": 1220, - "id": 1256, - "nodeType": "Return", - "src": "10676:11:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 1268, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "putVote", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1217, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1216, - "name": "vote", - "nodeType": "VariableDeclaration", - "scope": 1268, - "src": "10387:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1215, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "10387:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "10386:14:0" - }, - "returnParameters": { - "id": 1220, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1219, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 1268, - "src": "10418:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 1218, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "10418:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "10417:6:0" - }, - "scope": 1340, - "src": "10370:409:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "private" - }, - { - "body": { - "id": 1321, - "nodeType": "Block", - "src": "10842:363:0", - "statements": [ - { - "assignments": [ - 1276 - ], - "declarations": [ - { - "constant": false, - "id": 1276, - "name": "personalVote", - "nodeType": "VariableDeclaration", - "scope": 1321, - "src": "10852:20:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1275, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "10852:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 1280, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1278, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1270, - "src": "10891:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "id": 1277, - "name": "personalizeVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1339, - "src": "10875:15:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_bytes32_$", - "typeString": "function (bytes32) view returns (bytes32)" - } - }, - "id": 1279, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10875:21:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "10852:44:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1285, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "!", - "prefix": true, - "src": "10914:20:0", - "subExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1282, - "name": "votes", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 84, - "src": "10915:5:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - } - }, - "id": 1284, - "indexExpression": { - "argumentTypes": null, - "id": 1283, - "name": "personalVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1276, - "src": "10921:12:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "10915:19:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "436f6e6669726d656420616c7265616479", - "id": 1286, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "10936:19:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_762a97ce67d271844ad9c09d89a5271fde7fe7537af208da055a904cd67ac7bc", - "typeString": "literal_string \"Confirmed already\"" - }, - "value": "Confirmed already" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_762a97ce67d271844ad9c09d89a5271fde7fe7537af208da055a904cd67ac7bc", - "typeString": "literal_string \"Confirmed already\"" - } - ], - "id": 1281, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 13091, - 13092 - ], - "referencedDeclaration": 13092, - "src": "10906:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 1287, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10906:50:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 1288, - "nodeType": "ExpressionStatement", - "src": "10906:50:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 1293, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1289, - "name": "votes", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 84, - "src": "10967:5:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - } - }, - "id": 1291, - "indexExpression": { - "argumentTypes": null, - "id": 1290, - "name": "personalVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1276, - "src": "10973:12:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "10967:19:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 1292, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "10989:4:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "src": "10967:26:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 1294, - "nodeType": "ExpressionStatement", - "src": "10967:26:0" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 1300, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1295, - "name": "votesCount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 80, - "src": "11007:10:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - } - }, - "id": 1297, - "indexExpression": { - "argumentTypes": null, - "id": 1296, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1270, - "src": "11018:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "11007:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 1298, - "name": "getNextThreshold", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 575, - "src": "11027:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", - "typeString": "function () view returns (uint256)" - } - }, - "id": 1299, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "11027:18:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "11007:38:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "id": 1319, - "nodeType": "Block", - "src": "11130:69:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 1315, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "11144:18:0", - "subExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1312, - "name": "votesCount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 80, - "src": "11144:10:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - } - }, - "id": 1314, - "indexExpression": { - "argumentTypes": null, - "id": 1313, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1270, - "src": "11155:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "11144:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 1316, - "nodeType": "ExpressionStatement", - "src": "11144:18:0" - }, - { - "expression": { - "argumentTypes": null, - "hexValue": "66616c7365", - "id": 1317, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "11183:5:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "false" - }, - "functionReturnParameters": 1274, - "id": 1318, - "nodeType": "Return", - "src": "11176:12:0" - } - ] - }, - "id": 1320, - "nodeType": "IfStatement", - "src": "11003:196:0", - "trueBody": { - "id": 1311, - "nodeType": "Block", - "src": "11047:77:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 1307, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1301, - "name": "votesCount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 80, - "src": "11061:10:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - } - }, - "id": 1303, - "indexExpression": { - "argumentTypes": null, - "id": 1302, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1270, - "src": "11072:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "11061:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_rational_57896044618658097711785492504343953926634992332820282019728792003956564819968_by_1", - "typeString": "int_const 5789...(69 digits omitted)...9968" - }, - "id": 1306, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "hexValue": "32", - "id": 1304, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "11080:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "nodeType": "BinaryOperation", - "operator": "**", - "rightExpression": { - "argumentTypes": null, - "hexValue": "323535", - "id": 1305, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "11085:3:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_255_by_1", - "typeString": "int_const 255" - }, - "value": "255" - }, - "src": "11080:8:0", - "typeDescriptions": { - "typeIdentifier": "t_rational_57896044618658097711785492504343953926634992332820282019728792003956564819968_by_1", - "typeString": "int_const 5789...(69 digits omitted)...9968" - } - }, - "src": "11061:27:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 1308, - "nodeType": "ExpressionStatement", - "src": "11061:27:0" - }, - { - "expression": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 1309, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "11109:4:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "functionReturnParameters": 1274, - "id": 1310, - "nodeType": "Return", - "src": "11102:11:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 1322, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "putConfirm", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1271, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1270, - "name": "vote", - "nodeType": "VariableDeclaration", - "scope": 1322, - "src": "10805:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1269, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "10805:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "10804:14:0" - }, - "returnParameters": { - "id": 1274, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1273, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 1322, - "src": "10836:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 1272, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "10836:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "10835:6:0" - }, - "scope": 1340, - "src": "10785:420:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "private" - }, - { - "body": { - "id": 1338, - "nodeType": "Block", - "src": "11281:69:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1332, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1324, - "src": "11325:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1333, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13088, - "src": "11331:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 1334, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "11331:10:0", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - ], - "expression": { - "argumentTypes": null, - "id": 1330, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13075, - "src": "11308:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 1331, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "11308:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 1335, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "11308:34:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 1329, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 13082, - "src": "11298:9:0", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 1336, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "11298:45:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "functionReturnParameters": 1328, - "id": 1337, - "nodeType": "Return", - "src": "11291:52:0" - } - ] - }, - "documentation": null, - "id": 1339, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "personalizeVote", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1325, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1324, - "name": "vote", - "nodeType": "VariableDeclaration", - "scope": 1339, - "src": "11236:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1323, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "11236:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "11235:14:0" - }, - "returnParameters": { - "id": 1328, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1327, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 1339, - "src": "11272:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1326, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "11272:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "11271:9:0" - }, - "scope": 1340, - "src": "11211:139:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "private" - } - ], - "scope": 1341, - "src": "93:11259:0" - } - ], - "src": "0:11353:0" - }, - "compiler": { - "name": "solc", - "version": "0.5.9+commit.e560f70d.Emscripten.clang" - }, - "networks": { - "44": { - "events": { - "0x3ef85928df9ae51bdb3eb4c00ec73b92b82307f319ac1b029de14796a0972609": { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "oldEpoch", - "type": "uint256" - }, - { - "indexed": true, - "name": "newEpoch", - "type": "uint256" - } - ], - "name": "NewEpoch", - "type": "event", - "signature": "0x3ef85928df9ae51bdb3eb4c00ec73b92b82307f319ac1b029de14796a0972609" - }, - "0xddbb65cfe1ae4aec03cef0f9667c6d7ba3740927d0c60f4dd4d7104cc31d180a": { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "epoch", - "type": "uint256" - } - ], - "name": "NewEpochCancelled", - "type": "event", - "signature": "0xddbb65cfe1ae4aec03cef0f9667c6d7ba3740927d0c60f4dd4d7104cc31d180a" - }, - "0xf4735b85cc98f9a712832825ecab4cfb1649d658f9a73c57a00ea7dde735c79b": { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "oldEpoch", - "type": "uint256" - }, - { - "indexed": true, - "name": "newEpoch", - "type": "uint256" - } - ], - "name": "NewFundsTransfer", - "type": "event", - "signature": "0xf4735b85cc98f9a712832825ecab4cfb1649d658f9a73c57a00ea7dde735c79b" - }, - "0xc33272939f066c227e913a4b3434d860794f185c551685c29451a3a38b9b259c": { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "epoch", - "type": "uint256" - }, - { - "indexed": false, - "name": "x", - "type": "uint256" - }, - { - "indexed": false, - "name": "y", - "type": "uint256" - } - ], - "name": "EpochStart", - "type": "event", - "signature": "0xc33272939f066c227e913a4b3434d860794f185c551685c29451a3a38b9b259c" - }, - "0x62e1f484b3909b2c013673bad76a9f14b010600ba983f11ad26e83082883570e": { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "name": "value", - "type": "uint256" - } - ], - "name": "ExchangeRequest", - "type": "event", - "signature": "0x62e1f484b3909b2c013673bad76a9f14b010600ba983f11ad26e83082883570e" - }, - "0x9273b6f22cee1ef3d7cdc2a9c031936003526bae368886259511f7dd40044b02": { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "name": "value", - "type": "uint256" - }, - { - "indexed": false, - "name": "nonce", - "type": "uint256" - } - ], - "name": "ExchangeRequest", - "type": "event", - "signature": "0x9273b6f22cee1ef3d7cdc2a9c031936003526bae368886259511f7dd40044b02" - } - }, - "links": {}, - "address": "0x44c158FE850821ae69DaF37AADF5c539e9d0025B", - "transactionHash": "0x912e1b3c5341609e1d0c0cd5d81ff6b7d9b2e8f497bd393ea91af1a4038cba78" - } - }, - "schemaVersion": "3.0.11", - "updatedAt": "2019-10-28T13:22:54.868Z", - "devdoc": { - "methods": {} - }, - "userdoc": { - "methods": {} - } -} \ No newline at end of file diff --git a/src/oracle/proxy/Dockerfile b/src/oracle/proxy/Dockerfile index 431811d..e36f80b 100644 --- a/src/oracle/proxy/Dockerfile +++ b/src/oracle/proxy/Dockerfile @@ -7,6 +7,5 @@ COPY ./proxy/package.json /proxy/ RUN npm install COPY ./proxy/index.js ./proxy/encode.js ./proxy/decode.js ./proxy/sendTx.js ./shared/logger.js ./shared/crypto.js ./shared/wait.js /proxy/ -COPY ./proxy/Bridge.json ./proxy/IERC20.json ./proxy/SharedDB.json /proxy/contracts_data/ ENTRYPOINT ["node", "index.js"] diff --git a/src/oracle/proxy/IERC20.json b/src/oracle/proxy/IERC20.json deleted file mode 100644 index 38bf614..0000000 --- a/src/oracle/proxy/IERC20.json +++ /dev/null @@ -1,1884 +0,0 @@ -{ - "contractName": "IERC20", - "abi": [ - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "from", - "type": "address" - }, - { - "indexed": true, - "name": "to", - "type": "address" - }, - { - "indexed": false, - "name": "value", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "name": "value", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "constant": true, - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "account", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "recipient", - "type": "address" - }, - { - "name": "amount", - "type": "uint256" - } - ], - "name": "transfer", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "owner", - "type": "address" - }, - { - "name": "spender", - "type": "address" - } - ], - "name": "allowance", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "spender", - "type": "address" - }, - { - "name": "amount", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "sender", - "type": "address" - }, - { - "name": "recipient", - "type": "address" - }, - { - "name": "amount", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - } - ], - "metadata": "{\"compiler\":{\"version\":\"0.5.9+commit.e560f70d\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":false,\"inputs\":[{\"name\":\"spender\",\"type\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"sender\",\"type\":\"address\"},{\"name\":\"recipient\",\"type\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"recipient\",\"type\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"owner\",\"type\":\"address\"},{\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"}],\"devdoc\":{\"details\":\"Interface of the ERC20 standard as defined in the EIP. Does not include the optional functions; to access them see `ERC20Detailed`.\",\"methods\":{\"allowance(address,address)\":{\"details\":\"Returns the remaining number of tokens that `spender` will be allowed to spend on behalf of `owner` through `transferFrom`. This is zero by default. * This value changes when `approve` or `transferFrom` are called.\"},\"approve(address,uint256)\":{\"details\":\"Sets `amount` as the allowance of `spender` over the caller's tokens. * Returns a boolean value indicating whether the operation succeeded. * > Beware that changing an allowance with this method brings the risk that someone may use both the old and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * Emits an `Approval` event.\"},\"balanceOf(address)\":{\"details\":\"Returns the amount of tokens owned by `account`.\"},\"totalSupply()\":{\"details\":\"Returns the amount of tokens in existence.\"},\"transfer(address,uint256)\":{\"details\":\"Moves `amount` tokens from the caller's account to `recipient`. * Returns a boolean value indicating whether the operation succeeded. * Emits a `Transfer` event.\"},\"transferFrom(address,address,uint256)\":{\"details\":\"Moves `amount` tokens from `sender` to `recipient` using the allowance mechanism. `amount` is then deducted from the caller's allowance. * Returns a boolean value indicating whether the operation succeeded. * Emits a `Transfer` event.\"}}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/build/contracts/openzeppelin-solidity/contracts/token/ERC20/IERC20.sol\":\"IERC20\"},\"evmVersion\":\"petersburg\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":3},\"remappings\":[]},\"sources\":{\"/build/contracts/openzeppelin-solidity/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0x90e8c2521653bbb1768b05889c5760031e688d9cd361f167489b89215e201b95\",\"urls\":[\"bzzr://aa8b45b57edafc3d67bc5d916327ea16807fae33f753ca163ae0c4061b789766\",\"dweb:/ipfs/QmP5NaEwZthQeM2ESz4WTT3osrP7jhbvu7ocbttBi2JAw6\"]}},\"version\":1}", - "bytecode": "0x", - "deployedBytecode": "0x", - "sourceMap": "", - "deployedSourceMap": "", - "source": "pragma solidity ^0.5.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP. Does not include\n * the optional functions; to access them see `ERC20Detailed`.\n */\ninterface IERC20 {\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a `Transfer` event.\n */\n function transfer(address recipient, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through `transferFrom`. This is\n * zero by default.\n *\n * This value changes when `approve` or `transferFrom` are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * > Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an `Approval` event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a `Transfer` event.\n */\n function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);\n\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to `approve`. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n}\n", - "sourcePath": "/build/contracts/openzeppelin-solidity/contracts/token/ERC20/IERC20.sol", - "ast": { - "absolutePath": "/build/contracts/openzeppelin-solidity/contracts/token/ERC20/IERC20.sol", - "exportedSymbols": { - "IERC20": [ - 8691 - ] - }, - "id": 8692, - "nodeType": "SourceUnit", - "nodes": [ - { - "id": 8624, - "literals": [ - "solidity", - "^", - "0.5", - ".0" - ], - "nodeType": "PragmaDirective", - "src": "0:23:113" - }, - { - "baseContracts": [], - "contractDependencies": [], - "contractKind": "interface", - "documentation": "@dev Interface of the ERC20 standard as defined in the EIP. Does not include\nthe optional functions; to access them see `ERC20Detailed`.", - "fullyImplemented": false, - "id": 8691, - "linearizedBaseContracts": [ - 8691 - ], - "name": "IERC20", - "nodeType": "ContractDefinition", - "nodes": [ - { - "body": null, - "documentation": "@dev Returns the amount of tokens in existence.", - "id": 8629, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "totalSupply", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 8625, - "nodeType": "ParameterList", - "parameters": [], - "src": "290:2:113" - }, - "returnParameters": { - "id": 8628, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 8627, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 8629, - "src": "316:7:113", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 8626, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "316:7:113", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "315:9:113" - }, - "scope": 8691, - "src": "270:55:113", - "stateMutability": "view", - "superFunction": 11425, - "visibility": "external" - }, - { - "body": null, - "documentation": "@dev Returns the amount of tokens owned by `account`.", - "id": 8636, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "balanceOf", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 8632, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 8631, - "name": "account", - "nodeType": "VariableDeclaration", - "scope": 8636, - "src": "427:15:113", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 8630, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "427:7:113", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "426:17:113" - }, - "returnParameters": { - "id": 8635, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 8634, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 8636, - "src": "467:7:113", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 8633, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "467:7:113", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "466:9:113" - }, - "scope": 8691, - "src": "408:68:113", - "stateMutability": "view", - "superFunction": 11432, - "visibility": "external" - }, - { - "body": null, - "documentation": "@dev Moves `amount` tokens from the caller's account to `recipient`.\n * Returns a boolean value indicating whether the operation succeeded.\n * Emits a `Transfer` event.", - "id": 8645, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "transfer", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 8641, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 8638, - "name": "recipient", - "nodeType": "VariableDeclaration", - "scope": 8645, - "src": "714:17:113", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 8637, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "714:7:113", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 8640, - "name": "amount", - "nodeType": "VariableDeclaration", - "scope": 8645, - "src": "733:14:113", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 8639, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "733:7:113", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "713:35:113" - }, - "returnParameters": { - "id": 8644, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 8643, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 8645, - "src": "767:4:113", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 8642, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "767:4:113", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "766:6:113" - }, - "scope": 8691, - "src": "696:77:113", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "external" - }, - { - "body": null, - "documentation": "@dev Returns the remaining number of tokens that `spender` will be\nallowed to spend on behalf of `owner` through `transferFrom`. This is\nzero by default.\n * This value changes when `approve` or `transferFrom` are called.", - "id": 8654, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "allowance", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 8650, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 8647, - "name": "owner", - "nodeType": "VariableDeclaration", - "scope": 8654, - "src": "1067:13:113", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 8646, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1067:7:113", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 8649, - "name": "spender", - "nodeType": "VariableDeclaration", - "scope": 8654, - "src": "1082:15:113", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 8648, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1082:7:113", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1066:32:113" - }, - "returnParameters": { - "id": 8653, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 8652, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 8654, - "src": "1122:7:113", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 8651, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1122:7:113", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1121:9:113" - }, - "scope": 8691, - "src": "1048:83:113", - "stateMutability": "view", - "superFunction": null, - "visibility": "external" - }, - { - "body": null, - "documentation": "@dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n * Returns a boolean value indicating whether the operation succeeded.\n * > Beware that changing an allowance with this method brings the risk\nthat someone may use both the old and the new allowance by unfortunate\ntransaction ordering. One possible solution to mitigate this race\ncondition is to first reduce the spender's allowance to 0 and set the\ndesired value afterwards:\nhttps://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n * Emits an `Approval` event.", - "id": 8663, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "approve", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 8659, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 8656, - "name": "spender", - "nodeType": "VariableDeclaration", - "scope": 8663, - "src": "1792:15:113", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 8655, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1792:7:113", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 8658, - "name": "amount", - "nodeType": "VariableDeclaration", - "scope": 8663, - "src": "1809:14:113", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 8657, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1809:7:113", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1791:33:113" - }, - "returnParameters": { - "id": 8662, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 8661, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 8663, - "src": "1843:4:113", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 8660, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "1843:4:113", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1842:6:113" - }, - "scope": 8691, - "src": "1775:74:113", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "external" - }, - { - "body": null, - "documentation": "@dev Moves `amount` tokens from `sender` to `recipient` using the\nallowance mechanism. `amount` is then deducted from the caller's\nallowance.\n * Returns a boolean value indicating whether the operation succeeded.\n * Emits a `Transfer` event.", - "id": 8674, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "transferFrom", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 8670, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 8665, - "name": "sender", - "nodeType": "VariableDeclaration", - "scope": 8674, - "src": "2178:14:113", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 8664, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2178:7:113", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 8667, - "name": "recipient", - "nodeType": "VariableDeclaration", - "scope": 8674, - "src": "2194:17:113", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 8666, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2194:7:113", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 8669, - "name": "amount", - "nodeType": "VariableDeclaration", - "scope": 8674, - "src": "2213:14:113", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 8668, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2213:7:113", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2177:51:113" - }, - "returnParameters": { - "id": 8673, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 8672, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 8674, - "src": "2247:4:113", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 8671, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "2247:4:113", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2246:6:113" - }, - "scope": 8691, - "src": "2156:97:113", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "external" - }, - { - "anonymous": false, - "documentation": "@dev Emitted when `value` tokens are moved from one account (`from`) to\nanother (`to`).\n * Note that `value` may be zero.", - "id": 8682, - "name": "Transfer", - "nodeType": "EventDefinition", - "parameters": { - "id": 8681, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 8676, - "indexed": true, - "name": "from", - "nodeType": "VariableDeclaration", - "scope": 8682, - "src": "2437:20:113", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 8675, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2437:7:113", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 8678, - "indexed": true, - "name": "to", - "nodeType": "VariableDeclaration", - "scope": 8682, - "src": "2459:18:113", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 8677, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2459:7:113", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 8680, - "indexed": false, - "name": "value", - "nodeType": "VariableDeclaration", - "scope": 8682, - "src": "2479:13:113", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 8679, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2479:7:113", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2436:57:113" - }, - "src": "2422:72:113" - }, - { - "anonymous": false, - "documentation": "@dev Emitted when the allowance of a `spender` for an `owner` is set by\na call to `approve`. `value` is the new allowance.", - "id": 8690, - "name": "Approval", - "nodeType": "EventDefinition", - "parameters": { - "id": 8689, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 8684, - "indexed": true, - "name": "owner", - "nodeType": "VariableDeclaration", - "scope": 8690, - "src": "2668:21:113", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 8683, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2668:7:113", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 8686, - "indexed": true, - "name": "spender", - "nodeType": "VariableDeclaration", - "scope": 8690, - "src": "2691:23:113", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 8685, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2691:7:113", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 8688, - "indexed": false, - "name": "value", - "nodeType": "VariableDeclaration", - "scope": 8690, - "src": "2716:13:113", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 8687, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2716:7:113", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2667:63:113" - }, - "src": "2653:78:113" - } - ], - "scope": 8692, - "src": "176:2557:113" - } - ], - "src": "0:2734:113" - }, - "legacyAST": { - "absolutePath": "/build/contracts/openzeppelin-solidity/contracts/token/ERC20/IERC20.sol", - "exportedSymbols": { - "IERC20": [ - 8691 - ] - }, - "id": 8692, - "nodeType": "SourceUnit", - "nodes": [ - { - "id": 8624, - "literals": [ - "solidity", - "^", - "0.5", - ".0" - ], - "nodeType": "PragmaDirective", - "src": "0:23:113" - }, - { - "baseContracts": [], - "contractDependencies": [], - "contractKind": "interface", - "documentation": "@dev Interface of the ERC20 standard as defined in the EIP. Does not include\nthe optional functions; to access them see `ERC20Detailed`.", - "fullyImplemented": false, - "id": 8691, - "linearizedBaseContracts": [ - 8691 - ], - "name": "IERC20", - "nodeType": "ContractDefinition", - "nodes": [ - { - "body": null, - "documentation": "@dev Returns the amount of tokens in existence.", - "id": 8629, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "totalSupply", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 8625, - "nodeType": "ParameterList", - "parameters": [], - "src": "290:2:113" - }, - "returnParameters": { - "id": 8628, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 8627, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 8629, - "src": "316:7:113", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 8626, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "316:7:113", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "315:9:113" - }, - "scope": 8691, - "src": "270:55:113", - "stateMutability": "view", - "superFunction": 11425, - "visibility": "external" - }, - { - "body": null, - "documentation": "@dev Returns the amount of tokens owned by `account`.", - "id": 8636, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "balanceOf", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 8632, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 8631, - "name": "account", - "nodeType": "VariableDeclaration", - "scope": 8636, - "src": "427:15:113", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 8630, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "427:7:113", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "426:17:113" - }, - "returnParameters": { - "id": 8635, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 8634, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 8636, - "src": "467:7:113", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 8633, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "467:7:113", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "466:9:113" - }, - "scope": 8691, - "src": "408:68:113", - "stateMutability": "view", - "superFunction": 11432, - "visibility": "external" - }, - { - "body": null, - "documentation": "@dev Moves `amount` tokens from the caller's account to `recipient`.\n * Returns a boolean value indicating whether the operation succeeded.\n * Emits a `Transfer` event.", - "id": 8645, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "transfer", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 8641, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 8638, - "name": "recipient", - "nodeType": "VariableDeclaration", - "scope": 8645, - "src": "714:17:113", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 8637, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "714:7:113", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 8640, - "name": "amount", - "nodeType": "VariableDeclaration", - "scope": 8645, - "src": "733:14:113", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 8639, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "733:7:113", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "713:35:113" - }, - "returnParameters": { - "id": 8644, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 8643, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 8645, - "src": "767:4:113", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 8642, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "767:4:113", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "766:6:113" - }, - "scope": 8691, - "src": "696:77:113", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "external" - }, - { - "body": null, - "documentation": "@dev Returns the remaining number of tokens that `spender` will be\nallowed to spend on behalf of `owner` through `transferFrom`. This is\nzero by default.\n * This value changes when `approve` or `transferFrom` are called.", - "id": 8654, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "allowance", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 8650, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 8647, - "name": "owner", - "nodeType": "VariableDeclaration", - "scope": 8654, - "src": "1067:13:113", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 8646, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1067:7:113", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 8649, - "name": "spender", - "nodeType": "VariableDeclaration", - "scope": 8654, - "src": "1082:15:113", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 8648, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1082:7:113", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1066:32:113" - }, - "returnParameters": { - "id": 8653, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 8652, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 8654, - "src": "1122:7:113", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 8651, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1122:7:113", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1121:9:113" - }, - "scope": 8691, - "src": "1048:83:113", - "stateMutability": "view", - "superFunction": null, - "visibility": "external" - }, - { - "body": null, - "documentation": "@dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n * Returns a boolean value indicating whether the operation succeeded.\n * > Beware that changing an allowance with this method brings the risk\nthat someone may use both the old and the new allowance by unfortunate\ntransaction ordering. One possible solution to mitigate this race\ncondition is to first reduce the spender's allowance to 0 and set the\ndesired value afterwards:\nhttps://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n * Emits an `Approval` event.", - "id": 8663, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "approve", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 8659, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 8656, - "name": "spender", - "nodeType": "VariableDeclaration", - "scope": 8663, - "src": "1792:15:113", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 8655, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1792:7:113", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 8658, - "name": "amount", - "nodeType": "VariableDeclaration", - "scope": 8663, - "src": "1809:14:113", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 8657, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1809:7:113", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1791:33:113" - }, - "returnParameters": { - "id": 8662, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 8661, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 8663, - "src": "1843:4:113", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 8660, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "1843:4:113", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1842:6:113" - }, - "scope": 8691, - "src": "1775:74:113", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "external" - }, - { - "body": null, - "documentation": "@dev Moves `amount` tokens from `sender` to `recipient` using the\nallowance mechanism. `amount` is then deducted from the caller's\nallowance.\n * Returns a boolean value indicating whether the operation succeeded.\n * Emits a `Transfer` event.", - "id": 8674, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "transferFrom", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 8670, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 8665, - "name": "sender", - "nodeType": "VariableDeclaration", - "scope": 8674, - "src": "2178:14:113", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 8664, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2178:7:113", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 8667, - "name": "recipient", - "nodeType": "VariableDeclaration", - "scope": 8674, - "src": "2194:17:113", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 8666, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2194:7:113", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 8669, - "name": "amount", - "nodeType": "VariableDeclaration", - "scope": 8674, - "src": "2213:14:113", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 8668, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2213:7:113", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2177:51:113" - }, - "returnParameters": { - "id": 8673, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 8672, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 8674, - "src": "2247:4:113", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 8671, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "2247:4:113", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2246:6:113" - }, - "scope": 8691, - "src": "2156:97:113", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "external" - }, - { - "anonymous": false, - "documentation": "@dev Emitted when `value` tokens are moved from one account (`from`) to\nanother (`to`).\n * Note that `value` may be zero.", - "id": 8682, - "name": "Transfer", - "nodeType": "EventDefinition", - "parameters": { - "id": 8681, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 8676, - "indexed": true, - "name": "from", - "nodeType": "VariableDeclaration", - "scope": 8682, - "src": "2437:20:113", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 8675, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2437:7:113", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 8678, - "indexed": true, - "name": "to", - "nodeType": "VariableDeclaration", - "scope": 8682, - "src": "2459:18:113", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 8677, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2459:7:113", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 8680, - "indexed": false, - "name": "value", - "nodeType": "VariableDeclaration", - "scope": 8682, - "src": "2479:13:113", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 8679, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2479:7:113", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2436:57:113" - }, - "src": "2422:72:113" - }, - { - "anonymous": false, - "documentation": "@dev Emitted when the allowance of a `spender` for an `owner` is set by\na call to `approve`. `value` is the new allowance.", - "id": 8690, - "name": "Approval", - "nodeType": "EventDefinition", - "parameters": { - "id": 8689, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 8684, - "indexed": true, - "name": "owner", - "nodeType": "VariableDeclaration", - "scope": 8690, - "src": "2668:21:113", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 8683, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2668:7:113", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 8686, - "indexed": true, - "name": "spender", - "nodeType": "VariableDeclaration", - "scope": 8690, - "src": "2691:23:113", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 8685, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2691:7:113", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 8688, - "indexed": false, - "name": "value", - "nodeType": "VariableDeclaration", - "scope": 8690, - "src": "2716:13:113", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 8687, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2716:7:113", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2667:63:113" - }, - "src": "2653:78:113" - } - ], - "scope": 8692, - "src": "176:2557:113" - } - ], - "src": "0:2734:113" - }, - "compiler": { - "name": "solc", - "version": "0.5.9+commit.e560f70d.Emscripten.clang" - }, - "networks": {}, - "schemaVersion": "3.0.11", - "updatedAt": "2019-09-17T15:35:53.888Z", - "devdoc": { - "details": "Interface of the ERC20 standard as defined in the EIP. Does not include the optional functions; to access them see `ERC20Detailed`.", - "methods": { - "allowance(address,address)": { - "details": "Returns the remaining number of tokens that `spender` will be allowed to spend on behalf of `owner` through `transferFrom`. This is zero by default. * This value changes when `approve` or `transferFrom` are called." - }, - "approve(address,uint256)": { - "details": "Sets `amount` as the allowance of `spender` over the caller's tokens. * Returns a boolean value indicating whether the operation succeeded. * > Beware that changing an allowance with this method brings the risk that someone may use both the old and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * Emits an `Approval` event." - }, - "balanceOf(address)": { - "details": "Returns the amount of tokens owned by `account`." - }, - "totalSupply()": { - "details": "Returns the amount of tokens in existence." - }, - "transfer(address,uint256)": { - "details": "Moves `amount` tokens from the caller's account to `recipient`. * Returns a boolean value indicating whether the operation succeeded. * Emits a `Transfer` event." - }, - "transferFrom(address,address,uint256)": { - "details": "Moves `amount` tokens from `sender` to `recipient` using the allowance mechanism. `amount` is then deducted from the caller's allowance. * Returns a boolean value indicating whether the operation succeeded. * Emits a `Transfer` event." - } - } - }, - "userdoc": { - "methods": {} - } -} \ No newline at end of file diff --git a/src/oracle/proxy/SharedDB.json b/src/oracle/proxy/SharedDB.json deleted file mode 100644 index 9e3494b..0000000 --- a/src/oracle/proxy/SharedDB.json +++ /dev/null @@ -1,6274 +0,0 @@ -{ - "contractName": "SharedDB", - "abi": [ - { - "constant": true, - "inputs": [ - { - "name": "", - "type": "bytes32" - } - ], - "name": "dbSignups", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "", - "type": "bytes32" - } - ], - "name": "signupsCount", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "", - "type": "bytes32" - } - ], - "name": "db", - "outputs": [ - { - "name": "", - "type": "bytes" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "hash", - "type": "bytes32" - } - ], - "name": "signupSign", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "hash", - "type": "bytes32" - }, - { - "name": "validators", - "type": "address[]" - }, - { - "name": "validator", - "type": "address" - } - ], - "name": "getSignupNumber", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "hash", - "type": "bytes32" - }, - { - "name": "validators", - "type": "address[]" - }, - { - "name": "signupNumber", - "type": "uint256" - } - ], - "name": "getSignupAddress", - "outputs": [ - { - "name": "", - "type": "address" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "hash", - "type": "bytes32" - }, - { - "name": "key", - "type": "bytes32" - }, - { - "name": "data", - "type": "bytes" - } - ], - "name": "setData", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "from", - "type": "address" - }, - { - "name": "hash", - "type": "bytes32" - }, - { - "name": "key", - "type": "bytes32" - } - ], - "name": "getData", - "outputs": [ - { - "name": "", - "type": "bytes" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - } - ], - "metadata": "{\"compiler\":{\"version\":\"0.5.9+commit.e560f70d\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":true,\"inputs\":[{\"name\":\"hash\",\"type\":\"bytes32\"},{\"name\":\"validators\",\"type\":\"address[]\"},{\"name\":\"signupNumber\",\"type\":\"uint256\"}],\"name\":\"getSignupAddress\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"from\",\"type\":\"address\"},{\"name\":\"hash\",\"type\":\"bytes32\"},{\"name\":\"key\",\"type\":\"bytes32\"}],\"name\":\"getData\",\"outputs\":[{\"name\":\"\",\"type\":\"bytes\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"hash\",\"type\":\"bytes32\"}],\"name\":\"signupSign\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"dbSignups\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"signupsCount\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"hash\",\"type\":\"bytes32\"},{\"name\":\"validators\",\"type\":\"address[]\"},{\"name\":\"validator\",\"type\":\"address\"}],\"name\":\"getSignupNumber\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"db\",\"outputs\":[{\"name\":\"\",\"type\":\"bytes\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"hash\",\"type\":\"bytes32\"},{\"name\":\"key\",\"type\":\"bytes32\"},{\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"setData\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/build/contracts/SharedDB.sol\":\"SharedDB\"},\"evmVersion\":\"petersburg\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":3},\"remappings\":[]},\"sources\":{\"/build/contracts/SharedDB.sol\":{\"keccak256\":\"0x94e823a0aa4d7aaca55e82121659cc162ce5ee7772b98e3d0c983b65ebabe22b\",\"urls\":[\"bzzr://ad1ac5702de081e8516595760054a0b4d8eaab39b75a002554ddb43ae738f37b\",\"dweb:/ipfs/QmRLrhNxxeoeJKpLpT2CakVxkmwuRQuvyVjZjF6cqKkz4f\"]}},\"version\":1}", - "bytecode": "0x608060405234801561001057600080fd5b5061093b806100206000396000f3fe608060405234801561001057600080fd5b50600436106100785760003560e01c80631aaaffbd1461007d57806348b2865e1461014357806374ce45e1146101ea5780637ad5f33d1461020957806399648b3214610238578063ca2a834714610255578063ecf265bc14610308578063f865c6fc14610325575b600080fd5b6101276004803603606081101561009357600080fd5b81359190810190604081016020820135600160201b8111156100b457600080fd5b8201836020820111156100c657600080fd5b803590602001918460208302840111600160201b831117156100e757600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092955050913592506103d5915050565b604080516001600160a01b039092168252519081900360200190f35b6101756004803603606081101561015957600080fd5b506001600160a01b038135169060208101359060400135610438565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101af578181015183820152602001610197565b50505050905090810190601f1680156101dc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102076004803603602081101561020057600080fd5b5035610516565b005b6102266004803603602081101561021f57600080fd5b50356105eb565b60408051918252519081900360200190f35b6102266004803603602081101561024e57600080fd5b50356105fd565b6102266004803603606081101561026b57600080fd5b81359190810190604081016020820135600160201b81111561028c57600080fd5b82018360208201111561029e57600080fd5b803590602001918460208302840111600160201b831117156102bf57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550505090356001600160a01b0316915061060f9050565b6101756004803603602081101561031e57600080fd5b5035610777565b6102076004803603606081101561033b57600080fd5b813591602081013591810190606081016040820135600160201b81111561036157600080fd5b82018360208201111561037357600080fd5b803590602001918460018302840111600160201b8311171561039457600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610811945050505050565b6000805b835181101561042b578261040186868785815181106103f457fe5b602002602001015161060f565b14156104235783818151811061041357fe5b6020026020010151915050610431565b6001016103d9565b50600090505b9392505050565b60408051606085811b6001600160601b03191660208084019190915260348301869052605480840186905284518085039091018152607484018086528151918301919091206000908152808352859020805460026001821615610100026000190190911604601f8101849004909302850160949081019096528282529294909301828280156105085780601f106104dd57610100808354040283529160200191610508565b820191906000526020600020905b8154815290600101906020018083116104eb57829003601f168201915b505050505090509392505050565b604080513360601b602080830191909152603480830185905283518084039091018152605490920183528151918101919091206000908152600290915220541561059a576040805162461bcd60e51b815260206004820152601060248201526f105b1c9958591e481cda59db9d5c195960821b604482015290519081900360640190fd5b600081815260016020818152604080842080549093019283905580513360601b8184015260348082019690965281518082039096018652605401815284519482019490942083526002905291902055565b60026020526000908152604090205481565b60016020526000908152604090205481565b600060026000838660405160200180836001600160a01b03166001600160a01b031660601b815260140182815260200192505050604051602081830303815290604052805190602001208152602001908152602001600020546000141561067857506000610431565b600160005b845181101561076e5760006002600087848151811061069857fe5b60200260200101518960405160200180836001600160a01b03166001600160a01b031660601b815260140182815260200192505050604051602081830303815290604052805190602001208152602001908152602001600020549050600081118015610759575060026000868960405160200180836001600160a01b03166001600160a01b031660601b8152601401828152602001925050506040516020818303038152906040528051906020012081526020019081526020016000205481105b15610765576001909201915b5060010161067d565b50949350505050565b600060208181529181526040908190208054825160026001831615610100026000190190921691909104601f8101859004850282018501909352828152929091908301828280156108095780601f106107de57610100808354040283529160200191610809565b820191906000526020600020905b8154815290600101906020018083116107ec57829003601f168201915b505050505081565b604080513360601b602080830191909152603482018690526054808301869052835180840390910181526074909201835281519181019190912060009081528082529190912082516108659284019061086b565b50505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106108ac57805160ff19168380011785556108d9565b828001600101855582156108d9579182015b828111156108d95782518255916020019190600101906108be565b506108e59291506108e9565b5090565b61090391905b808211156108e557600081556001016108ef565b9056fea265627a7a723058203b87ffa77e3c8cbdec6d449f68f04dffd78ea0048b5bc86e3b9a1073187a6e1f64736f6c63430005090032", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100785760003560e01c80631aaaffbd1461007d57806348b2865e1461014357806374ce45e1146101ea5780637ad5f33d1461020957806399648b3214610238578063ca2a834714610255578063ecf265bc14610308578063f865c6fc14610325575b600080fd5b6101276004803603606081101561009357600080fd5b81359190810190604081016020820135600160201b8111156100b457600080fd5b8201836020820111156100c657600080fd5b803590602001918460208302840111600160201b831117156100e757600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092955050913592506103d5915050565b604080516001600160a01b039092168252519081900360200190f35b6101756004803603606081101561015957600080fd5b506001600160a01b038135169060208101359060400135610438565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101af578181015183820152602001610197565b50505050905090810190601f1680156101dc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102076004803603602081101561020057600080fd5b5035610516565b005b6102266004803603602081101561021f57600080fd5b50356105eb565b60408051918252519081900360200190f35b6102266004803603602081101561024e57600080fd5b50356105fd565b6102266004803603606081101561026b57600080fd5b81359190810190604081016020820135600160201b81111561028c57600080fd5b82018360208201111561029e57600080fd5b803590602001918460208302840111600160201b831117156102bf57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550505090356001600160a01b0316915061060f9050565b6101756004803603602081101561031e57600080fd5b5035610777565b6102076004803603606081101561033b57600080fd5b813591602081013591810190606081016040820135600160201b81111561036157600080fd5b82018360208201111561037357600080fd5b803590602001918460018302840111600160201b8311171561039457600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610811945050505050565b6000805b835181101561042b578261040186868785815181106103f457fe5b602002602001015161060f565b14156104235783818151811061041357fe5b6020026020010151915050610431565b6001016103d9565b50600090505b9392505050565b60408051606085811b6001600160601b03191660208084019190915260348301869052605480840186905284518085039091018152607484018086528151918301919091206000908152808352859020805460026001821615610100026000190190911604601f8101849004909302850160949081019096528282529294909301828280156105085780601f106104dd57610100808354040283529160200191610508565b820191906000526020600020905b8154815290600101906020018083116104eb57829003601f168201915b505050505090509392505050565b604080513360601b602080830191909152603480830185905283518084039091018152605490920183528151918101919091206000908152600290915220541561059a576040805162461bcd60e51b815260206004820152601060248201526f105b1c9958591e481cda59db9d5c195960821b604482015290519081900360640190fd5b600081815260016020818152604080842080549093019283905580513360601b8184015260348082019690965281518082039096018652605401815284519482019490942083526002905291902055565b60026020526000908152604090205481565b60016020526000908152604090205481565b600060026000838660405160200180836001600160a01b03166001600160a01b031660601b815260140182815260200192505050604051602081830303815290604052805190602001208152602001908152602001600020546000141561067857506000610431565b600160005b845181101561076e5760006002600087848151811061069857fe5b60200260200101518960405160200180836001600160a01b03166001600160a01b031660601b815260140182815260200192505050604051602081830303815290604052805190602001208152602001908152602001600020549050600081118015610759575060026000868960405160200180836001600160a01b03166001600160a01b031660601b8152601401828152602001925050506040516020818303038152906040528051906020012081526020019081526020016000205481105b15610765576001909201915b5060010161067d565b50949350505050565b600060208181529181526040908190208054825160026001831615610100026000190190921691909104601f8101859004850282018501909352828152929091908301828280156108095780601f106107de57610100808354040283529160200191610809565b820191906000526020600020905b8154815290600101906020018083116107ec57829003601f168201915b505050505081565b604080513360601b602080830191909152603482018690526054808301869052835180840390910181526074909201835281519181019190912060009081528082529190912082516108659284019061086b565b50505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106108ac57805160ff19168380011785556108d9565b828001600101855582156108d9579182015b828111156108d95782518255916020019190600101906108be565b506108e59291506108e9565b5090565b61090391905b808211156108e557600081556001016108ef565b9056fea265627a7a723058203b87ffa77e3c8cbdec6d449f68f04dffd78ea0048b5bc86e3b9a1073187a6e1f64736f6c63430005090032", - "sourceMap": "25:1611:1:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;25:1611:1;;;;;;;", - "deployedSourceMap": "25:1611:1:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;25:1611:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;956:353;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;956:353:1;;;;;;;;;;;;;;-1:-1:-1;;;5:28;;2:2;;;46:1;43;36:12;2:2;956:353:1;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;956:353:1;;;;;;101:9:-1;95:2;81:12;77:21;67:8;63:36;60:51;-1:-1;;;25:12;22:29;11:108;8:2;;;132:1;129;122:12;8:2;956:353:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;81:16;;74:27;;;;-1:-1;956:353:1;;-1:-1:-1;;956:353:1;;;-1:-1:-1;956:353:1;;-1:-1:-1;;956:353:1:i;:::-;;;;-1:-1:-1;;;;;956:353:1;;;;;;;;;;;;;;1469:165;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;1469:165:1;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:100:-1;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;1469:165:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;188:238;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;188:238:1;;:::i;:::-;;140:41;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;140:41:1;;:::i;:::-;;;;;;;;;;;;;;;;90:44;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;90:44:1;;:::i;432:518::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;432:518:1;;;;;;;;;;;;;;-1:-1:-1;;;5:28;;2:2;;;46:1;43;36:12;2:2;432:518:1;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;432:518:1;;;;;;101:9:-1;95:2;81:12;77:21;67:8;63:36;60:51;-1:-1;;;25:12;22:29;11:108;8:2;;;132:1;129;122:12;8:2;432:518:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;81:16;;74:27;;;;-1:-1;432:518:1;;-1:-1:-1;;;432:518:1;;-1:-1:-1;;;;;432:518:1;;-1:-1:-1;432:518:1;;-1:-1:-1;432:518:1:i;49:35::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;49:35:1;;:::i;1315:148::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;1315:148:1;;;;;;;;;;;;;;;;;;-1:-1:-1;;;5:28;;2:2;;;46:1;43;36:12;2:2;1315:148:1;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;1315:148:1;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;-1:-1;;;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;1315:148:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;81:16;;74:27;;;;-1:-1;1315:148:1;;-1:-1:-1;1315:148:1;;-1:-1:-1;;;;;1315:148:1:i;956:353::-;1065:7;;1084:192;1105:10;:17;1101:1;:21;1084:192;;;1199:12;1147:48;1163:4;1169:10;1181;1192:1;1181:13;;;;;;;;;;;;;;1147:15;:48::i;:::-;:64;1143:123;;;1238:10;1249:1;1238:13;;;;;;;;;;;;;;1231:20;;;;;1143:123;1124:3;;1084:192;;;;1300:1;1285:17;;956:353;;;;;;:::o;1469:165::-;1592:33;;;1548:12;1592:33;;;-1:-1:-1;;;;;;1592:33:1;;;;;;;;;;;;;;;;;;;;;;;;26:21:-1;;;22:32;;;6:49;;1592:33:1;;;;;;1582:44;;;;;;;;;-1:-1:-1;1579:48:1;;;;;;;;;1572:55;;;;;;;;;-1:-1:-1;;1572:55:1;;;;;;;;;;;;;;;;;;;;;;;;;;1548:12;;1592:33;;1572:55;1579:48;1572:55;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1469:165;;;;;:::o;188:238::-;267:34;;;284:10;267:34;;;;;;;;;;;;;;;;;;;26:21:-1;;;22:32;;;6:49;;267:34:1;;;;;;257:45;;;;;;;;;247:56;;;;:9;:56;;;;;:61;239:90;;;;;-1:-1:-1;;;239:90:1;;;;;;;;;;;;-1:-1:-1;;;239:90:1;;;;;;;;;;;;;;;401:18;;;;:12;:18;;;;;;;;399:20;;;;;;;;;360:34;;377:10;360:34;;;;;;;;;;;;;;;;26:21:-1;;;22:32;;;6:49;;360:34:1;;;;350:45;;;;;;;;;340:56;;:9;:56;;;;;:79;188:238::o;140:41::-;;;;;;;;;;;;;:::o;90:44::-;;;;;;;;;;;;;:::o;432:518::-;540:4;560:9;:55;597:9;608:4;580:33;;;;;;-1:-1:-1;;;;;580:33:1;-1:-1:-1;;;;;580:33:1;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;580:33:1;;;570:44;;;;;;560:55;;;;;;;;;;;;619:1;560:60;556:86;;;-1:-1:-1;641:1:1;634:8;;556:86;662:1;652:7;673:252;694:10;:17;690:1;:21;673:252;;;732:8;743:9;:59;780:10;791:1;780:13;;;;;;;;;;;;;;795:4;763:37;;;;;;-1:-1:-1;;;;;763:37:1;-1:-1:-1;;;;;763:37:1;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;763:37:1;;;753:48;;;;;;743:59;;;;;;;;;;;;732:70;;826:1;820:3;:7;:72;;;;;837:9;:55;874:9;885:4;857:33;;;;;;-1:-1:-1;;;;;857:33:1;-1:-1:-1;;;;;857:33:1;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;857:33:1;;;847:44;;;;;;837:55;;;;;;;;;;;;831:3;:61;820:72;816:98;;;910:4;;;;;816:98;-1:-1:-1;713:3:1;;673:252;;;-1:-1:-1;941:2:1;432:518;-1:-1:-1;;;;432:518:1:o;49:35::-;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;49:35:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;1315:148::-;1408:39;;;1425:10;1408:39;;;;;;;;;;;;;;;;;;;;;;;;;26:21:-1;;;22:32;;;6:49;;1408:39:1;;;;;;1398:50;;;;;;;;;1395:2;:54;;;;;;;;;;:61;;;;;;;;:::i;:::-;;1315:148;;;:::o;25:1611::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;25:1611:1;;;-1:-1:-1;25:1611:1;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;:::o", - "source": "pragma solidity ^0.5.0;\n\ncontract SharedDB {\n mapping(bytes32 => bytes) public db;\n mapping(bytes32 => uint) public signupsCount;\n mapping(bytes32 => uint) public dbSignups;\n\n function signupSign(bytes32 hash) public {\n require(dbSignups[keccak256(abi.encodePacked(msg.sender, hash))] == 0, \"Already signuped\");\n\n dbSignups[keccak256(abi.encodePacked(msg.sender, hash))] = ++signupsCount[hash];\n }\n\n function getSignupNumber(bytes32 hash, address[] memory validators, address validator) view public returns (uint) {\n if (dbSignups[keccak256(abi.encodePacked(validator, hash))] == 0)\n return 0;\n uint id = 1;\n for (uint i = 0; i < validators.length; i++) {\n uint vid = dbSignups[keccak256(abi.encodePacked(validators[i], hash))];\n if (vid > 0 && vid < dbSignups[keccak256(abi.encodePacked(validator, hash))])\n id++;\n }\n return id;\n }\n\n function getSignupAddress(bytes32 hash, address[] memory validators, uint signupNumber) view public returns (address) {\n for (uint i = 0; i < validators.length; i++) {\n if (getSignupNumber(hash, validators, validators[i]) == signupNumber) {\n return validators[i];\n }\n }\n return address(0);\n }\n\n function setData(bytes32 hash, bytes32 key, bytes memory data) public {\n db[keccak256(abi.encodePacked(msg.sender, hash, key))] = data;\n }\n\n function getData(address from, bytes32 hash, bytes32 key) view public returns (bytes memory) {\n return db[keccak256(abi.encodePacked(from, hash, key))];\n }\n}\n", - "sourcePath": "/build/contracts/SharedDB.sol", - "ast": { - "absolutePath": "/build/contracts/SharedDB.sol", - "exportedSymbols": { - "SharedDB": [ - 280 - ] - }, - "id": 281, - "nodeType": "SourceUnit", - "nodes": [ - { - "id": 58, - "literals": [ - "solidity", - "^", - "0.5", - ".0" - ], - "nodeType": "PragmaDirective", - "src": "0:23:1" - }, - { - "baseContracts": [], - "contractDependencies": [], - "contractKind": "contract", - "documentation": null, - "fullyImplemented": true, - "id": 280, - "linearizedBaseContracts": [ - 280 - ], - "name": "SharedDB", - "nodeType": "ContractDefinition", - "nodes": [ - { - "constant": false, - "id": 62, - "name": "db", - "nodeType": "VariableDeclaration", - "scope": 280, - "src": "49:35:1", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes_storage_$", - "typeString": "mapping(bytes32 => bytes)" - }, - "typeName": { - "id": 61, - "keyType": { - "id": 59, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "57:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Mapping", - "src": "49:25:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes_storage_$", - "typeString": "mapping(bytes32 => bytes)" - }, - "valueType": { - "id": 60, - "name": "bytes", - "nodeType": "ElementaryTypeName", - "src": "68:5:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage_ptr", - "typeString": "bytes" - } - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 66, - "name": "signupsCount", - "nodeType": "VariableDeclaration", - "scope": 280, - "src": "90:44:1", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - }, - "typeName": { - "id": 65, - "keyType": { - "id": 63, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "98:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Mapping", - "src": "90:24:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - }, - "valueType": { - "id": 64, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "109:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 70, - "name": "dbSignups", - "nodeType": "VariableDeclaration", - "scope": 280, - "src": "140:41:1", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - }, - "typeName": { - "id": 69, - "keyType": { - "id": 67, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "148:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Mapping", - "src": "140:24:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - }, - "valueType": { - "id": 68, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "159:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - }, - "value": null, - "visibility": "public" - }, - { - "body": { - "id": 107, - "nodeType": "Block", - "src": "229:197:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 87, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 76, - "name": "dbSignups", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 70, - "src": "247:9:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - } - }, - "id": 85, - "indexExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 80, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 295, - "src": "284:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 81, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "284:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 82, - "name": "hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 72, - "src": "296:4:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "expression": { - "argumentTypes": null, - "id": 78, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 282, - "src": "267:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 79, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "267:16:1", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 83, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "267:34:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 77, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 289, - "src": "257:9:1", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 84, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "257:45:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "247:56:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 86, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "307:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "247:61:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "416c7265616479207369676e75706564", - "id": 88, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "310:18:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_0f787a2da91c95ceebba72e41285d8837122ce3874f0bcdf553fa97876cf60b0", - "typeString": "literal_string \"Already signuped\"" - }, - "value": "Already signuped" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_0f787a2da91c95ceebba72e41285d8837122ce3874f0bcdf553fa97876cf60b0", - "typeString": "literal_string \"Already signuped\"" - } - ], - "id": 75, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 298, - 299 - ], - "referencedDeclaration": 299, - "src": "239:7:1", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 89, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "239:90:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 90, - "nodeType": "ExpressionStatement", - "src": "239:90:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 105, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 91, - "name": "dbSignups", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 70, - "src": "340:9:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - } - }, - "id": 100, - "indexExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 95, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 295, - "src": "377:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 96, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "377:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 97, - "name": "hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 72, - "src": "389:4:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "expression": { - "argumentTypes": null, - "id": 93, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 282, - "src": "360:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 94, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "360:16:1", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 98, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "360:34:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 92, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 289, - "src": "350:9:1", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 99, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "350:45:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "340:56:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 104, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": true, - "src": "399:20:1", - "subExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 101, - "name": "signupsCount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 66, - "src": "401:12:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - } - }, - "id": 103, - "indexExpression": { - "argumentTypes": null, - "id": 102, - "name": "hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 72, - "src": "414:4:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "401:18:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "340:79:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 106, - "nodeType": "ExpressionStatement", - "src": "340:79:1" - } - ] - }, - "documentation": null, - "id": 108, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "signupSign", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 73, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 72, - "name": "hash", - "nodeType": "VariableDeclaration", - "scope": 108, - "src": "208:12:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 71, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "208:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "207:14:1" - }, - "returnParameters": { - "id": 74, - "nodeType": "ParameterList", - "parameters": [], - "src": "229:0:1" - }, - "scope": 280, - "src": "188:238:1", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 186, - "nodeType": "Block", - "src": "546:404:1", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 130, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 120, - "name": "dbSignups", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 70, - "src": "560:9:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - } - }, - "id": 128, - "indexExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 124, - "name": "validator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 115, - "src": "597:9:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 125, - "name": "hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 110, - "src": "608:4:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "expression": { - "argumentTypes": null, - "id": 122, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 282, - "src": "580:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 123, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "580:16:1", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 126, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "580:33:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 121, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 289, - "src": "570:9:1", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 127, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "570:44:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "560:55:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 129, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "619:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "560:60:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 133, - "nodeType": "IfStatement", - "src": "556:86:1", - "trueBody": { - "expression": { - "argumentTypes": null, - "hexValue": "30", - "id": 131, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "641:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "functionReturnParameters": 119, - "id": 132, - "nodeType": "Return", - "src": "634:8:1" - } - }, - { - "assignments": [ - 135 - ], - "declarations": [ - { - "constant": false, - "id": 135, - "name": "id", - "nodeType": "VariableDeclaration", - "scope": 186, - "src": "652:7:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 134, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "652:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 137, - "initialValue": { - "argumentTypes": null, - "hexValue": "31", - "id": 136, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "662:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "nodeType": "VariableDeclarationStatement", - "src": "652:11:1" - }, - { - "body": { - "id": 182, - "nodeType": "Block", - "src": "718:207:1", - "statements": [ - { - "assignments": [ - 150 - ], - "declarations": [ - { - "constant": false, - "id": 150, - "name": "vid", - "nodeType": "VariableDeclaration", - "scope": 182, - "src": "732:8:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 149, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "732:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 162, - "initialValue": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 151, - "name": "dbSignups", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 70, - "src": "743:9:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - } - }, - "id": 161, - "indexExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 155, - "name": "validators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 113, - "src": "780:10:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 157, - "indexExpression": { - "argumentTypes": null, - "id": 156, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 139, - "src": "791:1:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "780:13:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 158, - "name": "hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 110, - "src": "795:4:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "expression": { - "argumentTypes": null, - "id": 153, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 282, - "src": "763:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 154, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "763:16:1", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 159, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "763:37:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 152, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 289, - "src": "753:9:1", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 160, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "753:48:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "743:59:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "732:70:1" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 177, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 165, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 163, - "name": "vid", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 150, - "src": "820:3:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 164, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "826:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "820:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "&&", - "rightExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 176, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 166, - "name": "vid", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 150, - "src": "831:3:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 167, - "name": "dbSignups", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 70, - "src": "837:9:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - } - }, - "id": 175, - "indexExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 171, - "name": "validator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 115, - "src": "874:9:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 172, - "name": "hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 110, - "src": "885:4:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "expression": { - "argumentTypes": null, - "id": 169, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 282, - "src": "857:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 170, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "857:16:1", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 173, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "857:33:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 168, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 289, - "src": "847:9:1", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 174, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "847:44:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "837:55:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "831:61:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "820:72:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 181, - "nodeType": "IfStatement", - "src": "816:98:1", - "trueBody": { - "expression": { - "argumentTypes": null, - "id": 179, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "910:4:1", - "subExpression": { - "argumentTypes": null, - "id": 178, - "name": "id", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 135, - "src": "910:2:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 180, - "nodeType": "ExpressionStatement", - "src": "910:4:1" - } - } - ] - }, - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 145, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 142, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 139, - "src": "690:1:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 143, - "name": "validators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 113, - "src": "694:10:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 144, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "694:17:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "690:21:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 183, - "initializationExpression": { - "assignments": [ - 139 - ], - "declarations": [ - { - "constant": false, - "id": 139, - "name": "i", - "nodeType": "VariableDeclaration", - "scope": 183, - "src": "678:6:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 138, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "678:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 141, - "initialValue": { - "argumentTypes": null, - "hexValue": "30", - "id": 140, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "687:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "678:10:1" - }, - "loopExpression": { - "expression": { - "argumentTypes": null, - "id": 147, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "713:3:1", - "subExpression": { - "argumentTypes": null, - "id": 146, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 139, - "src": "713:1:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 148, - "nodeType": "ExpressionStatement", - "src": "713:3:1" - }, - "nodeType": "ForStatement", - "src": "673:252:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 184, - "name": "id", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 135, - "src": "941:2:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 119, - "id": 185, - "nodeType": "Return", - "src": "934:9:1" - } - ] - }, - "documentation": null, - "id": 187, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getSignupNumber", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 116, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 110, - "name": "hash", - "nodeType": "VariableDeclaration", - "scope": 187, - "src": "457:12:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 109, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "457:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 113, - "name": "validators", - "nodeType": "VariableDeclaration", - "scope": 187, - "src": "471:27:1", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 111, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "471:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 112, - "length": null, - "nodeType": "ArrayTypeName", - "src": "471:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 115, - "name": "validator", - "nodeType": "VariableDeclaration", - "scope": 187, - "src": "500:17:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 114, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "500:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "456:62:1" - }, - "returnParameters": { - "id": 119, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 118, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 187, - "src": "540:4:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 117, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "540:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "539:6:1" - }, - "scope": 280, - "src": "432:518:1", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 231, - "nodeType": "Block", - "src": "1074:235:1", - "statements": [ - { - "body": { - "id": 225, - "nodeType": "Block", - "src": "1129:147:1", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 218, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 211, - "name": "hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 189, - "src": "1163:4:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "id": 212, - "name": "validators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 192, - "src": "1169:10:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 213, - "name": "validators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 192, - "src": "1181:10:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 215, - "indexExpression": { - "argumentTypes": null, - "id": 214, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 200, - "src": "1192:1:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "1181:13:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 210, - "name": "getSignupNumber", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 187, - "src": "1147:15:1", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_bytes32_$_t_array$_t_address_$dyn_memory_ptr_$_t_address_$returns$_t_uint256_$", - "typeString": "function (bytes32,address[] memory,address) view returns (uint256)" - } - }, - "id": 216, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1147:48:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "id": 217, - "name": "signupNumber", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 194, - "src": "1199:12:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1147:64:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 224, - "nodeType": "IfStatement", - "src": "1143:123:1", - "trueBody": { - "id": 223, - "nodeType": "Block", - "src": "1213:53:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 219, - "name": "validators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 192, - "src": "1238:10:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 221, - "indexExpression": { - "argumentTypes": null, - "id": 220, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 200, - "src": "1249:1:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "1238:13:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "functionReturnParameters": 198, - "id": 222, - "nodeType": "Return", - "src": "1231:20:1" - } - ] - } - } - ] - }, - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 206, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 203, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 200, - "src": "1101:1:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 204, - "name": "validators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 192, - "src": "1105:10:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 205, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1105:17:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1101:21:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 226, - "initializationExpression": { - "assignments": [ - 200 - ], - "declarations": [ - { - "constant": false, - "id": 200, - "name": "i", - "nodeType": "VariableDeclaration", - "scope": 226, - "src": "1089:6:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 199, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1089:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 202, - "initialValue": { - "argumentTypes": null, - "hexValue": "30", - "id": 201, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1098:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "1089:10:1" - }, - "loopExpression": { - "expression": { - "argumentTypes": null, - "id": 208, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "1124:3:1", - "subExpression": { - "argumentTypes": null, - "id": 207, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 200, - "src": "1124:1:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 209, - "nodeType": "ExpressionStatement", - "src": "1124:3:1" - }, - "nodeType": "ForStatement", - "src": "1084:192:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "hexValue": "30", - "id": 228, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1300:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - } - ], - "id": 227, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "1292:7:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 229, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1292:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "functionReturnParameters": 198, - "id": 230, - "nodeType": "Return", - "src": "1285:17:1" - } - ] - }, - "documentation": null, - "id": 232, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getSignupAddress", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 195, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 189, - "name": "hash", - "nodeType": "VariableDeclaration", - "scope": 232, - "src": "982:12:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 188, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "982:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 192, - "name": "validators", - "nodeType": "VariableDeclaration", - "scope": 232, - "src": "996:27:1", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 190, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "996:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 191, - "length": null, - "nodeType": "ArrayTypeName", - "src": "996:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 194, - "name": "signupNumber", - "nodeType": "VariableDeclaration", - "scope": 232, - "src": "1025:17:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 193, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1025:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "981:62:1" - }, - "returnParameters": { - "id": 198, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 197, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 232, - "src": "1065:7:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 196, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1065:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1064:9:1" - }, - "scope": 280, - "src": "956:353:1", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 255, - "nodeType": "Block", - "src": "1385:78:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 253, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 241, - "name": "db", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 62, - "src": "1395:2:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes_storage_$", - "typeString": "mapping(bytes32 => bytes storage ref)" - } - }, - "id": 251, - "indexExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 245, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 295, - "src": "1425:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 246, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1425:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 247, - "name": "hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 234, - "src": "1437:4:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "id": 248, - "name": "key", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 236, - "src": "1443:3:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "expression": { - "argumentTypes": null, - "id": 243, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 282, - "src": "1408:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 244, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1408:16:1", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 249, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1408:39:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 242, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 289, - "src": "1398:9:1", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 250, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1398:50:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "1395:54:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage", - "typeString": "bytes storage ref" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 252, - "name": "data", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 238, - "src": "1452:4:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - }, - "src": "1395:61:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage", - "typeString": "bytes storage ref" - } - }, - "id": 254, - "nodeType": "ExpressionStatement", - "src": "1395:61:1" - } - ] - }, - "documentation": null, - "id": 256, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "setData", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 239, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 234, - "name": "hash", - "nodeType": "VariableDeclaration", - "scope": 256, - "src": "1332:12:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 233, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1332:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 236, - "name": "key", - "nodeType": "VariableDeclaration", - "scope": 256, - "src": "1346:11:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 235, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1346:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 238, - "name": "data", - "nodeType": "VariableDeclaration", - "scope": 256, - "src": "1359:17:1", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes" - }, - "typeName": { - "id": 237, - "name": "bytes", - "nodeType": "ElementaryTypeName", - "src": "1359:5:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage_ptr", - "typeString": "bytes" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1331:46:1" - }, - "returnParameters": { - "id": 240, - "nodeType": "ParameterList", - "parameters": [], - "src": "1385:0:1" - }, - "scope": 280, - "src": "1315:148:1", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 278, - "nodeType": "Block", - "src": "1562:72:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 267, - "name": "db", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 62, - "src": "1579:2:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes_storage_$", - "typeString": "mapping(bytes32 => bytes storage ref)" - } - }, - "id": 276, - "indexExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 271, - "name": "from", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 258, - "src": "1609:4:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 272, - "name": "hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 260, - "src": "1615:4:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "id": 273, - "name": "key", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 262, - "src": "1621:3:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "expression": { - "argumentTypes": null, - "id": 269, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 282, - "src": "1592:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 270, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1592:16:1", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 274, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1592:33:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 268, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 289, - "src": "1582:9:1", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 275, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1582:44:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "1579:48:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage", - "typeString": "bytes storage ref" - } - }, - "functionReturnParameters": 266, - "id": 277, - "nodeType": "Return", - "src": "1572:55:1" - } - ] - }, - "documentation": null, - "id": 279, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getData", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 263, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 258, - "name": "from", - "nodeType": "VariableDeclaration", - "scope": 279, - "src": "1486:12:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 257, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1486:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 260, - "name": "hash", - "nodeType": "VariableDeclaration", - "scope": 279, - "src": "1500:12:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 259, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1500:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 262, - "name": "key", - "nodeType": "VariableDeclaration", - "scope": 279, - "src": "1514:11:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 261, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1514:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1485:41:1" - }, - "returnParameters": { - "id": 266, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 265, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 279, - "src": "1548:12:1", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes" - }, - "typeName": { - "id": 264, - "name": "bytes", - "nodeType": "ElementaryTypeName", - "src": "1548:5:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage_ptr", - "typeString": "bytes" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1547:14:1" - }, - "scope": 280, - "src": "1469:165:1", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - } - ], - "scope": 281, - "src": "25:1611:1" - } - ], - "src": "0:1637:1" - }, - "legacyAST": { - "absolutePath": "/build/contracts/SharedDB.sol", - "exportedSymbols": { - "SharedDB": [ - 280 - ] - }, - "id": 281, - "nodeType": "SourceUnit", - "nodes": [ - { - "id": 58, - "literals": [ - "solidity", - "^", - "0.5", - ".0" - ], - "nodeType": "PragmaDirective", - "src": "0:23:1" - }, - { - "baseContracts": [], - "contractDependencies": [], - "contractKind": "contract", - "documentation": null, - "fullyImplemented": true, - "id": 280, - "linearizedBaseContracts": [ - 280 - ], - "name": "SharedDB", - "nodeType": "ContractDefinition", - "nodes": [ - { - "constant": false, - "id": 62, - "name": "db", - "nodeType": "VariableDeclaration", - "scope": 280, - "src": "49:35:1", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes_storage_$", - "typeString": "mapping(bytes32 => bytes)" - }, - "typeName": { - "id": 61, - "keyType": { - "id": 59, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "57:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Mapping", - "src": "49:25:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes_storage_$", - "typeString": "mapping(bytes32 => bytes)" - }, - "valueType": { - "id": 60, - "name": "bytes", - "nodeType": "ElementaryTypeName", - "src": "68:5:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage_ptr", - "typeString": "bytes" - } - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 66, - "name": "signupsCount", - "nodeType": "VariableDeclaration", - "scope": 280, - "src": "90:44:1", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - }, - "typeName": { - "id": 65, - "keyType": { - "id": 63, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "98:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Mapping", - "src": "90:24:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - }, - "valueType": { - "id": 64, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "109:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 70, - "name": "dbSignups", - "nodeType": "VariableDeclaration", - "scope": 280, - "src": "140:41:1", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - }, - "typeName": { - "id": 69, - "keyType": { - "id": 67, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "148:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Mapping", - "src": "140:24:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - }, - "valueType": { - "id": 68, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "159:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - }, - "value": null, - "visibility": "public" - }, - { - "body": { - "id": 107, - "nodeType": "Block", - "src": "229:197:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 87, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 76, - "name": "dbSignups", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 70, - "src": "247:9:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - } - }, - "id": 85, - "indexExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 80, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 295, - "src": "284:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 81, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "284:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 82, - "name": "hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 72, - "src": "296:4:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "expression": { - "argumentTypes": null, - "id": 78, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 282, - "src": "267:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 79, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "267:16:1", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 83, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "267:34:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 77, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 289, - "src": "257:9:1", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 84, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "257:45:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "247:56:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 86, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "307:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "247:61:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "416c7265616479207369676e75706564", - "id": 88, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "310:18:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_0f787a2da91c95ceebba72e41285d8837122ce3874f0bcdf553fa97876cf60b0", - "typeString": "literal_string \"Already signuped\"" - }, - "value": "Already signuped" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_0f787a2da91c95ceebba72e41285d8837122ce3874f0bcdf553fa97876cf60b0", - "typeString": "literal_string \"Already signuped\"" - } - ], - "id": 75, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 298, - 299 - ], - "referencedDeclaration": 299, - "src": "239:7:1", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 89, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "239:90:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 90, - "nodeType": "ExpressionStatement", - "src": "239:90:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 105, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 91, - "name": "dbSignups", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 70, - "src": "340:9:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - } - }, - "id": 100, - "indexExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 95, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 295, - "src": "377:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 96, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "377:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 97, - "name": "hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 72, - "src": "389:4:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "expression": { - "argumentTypes": null, - "id": 93, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 282, - "src": "360:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 94, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "360:16:1", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 98, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "360:34:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 92, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 289, - "src": "350:9:1", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 99, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "350:45:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "340:56:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 104, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": true, - "src": "399:20:1", - "subExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 101, - "name": "signupsCount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 66, - "src": "401:12:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - } - }, - "id": 103, - "indexExpression": { - "argumentTypes": null, - "id": 102, - "name": "hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 72, - "src": "414:4:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "401:18:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "340:79:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 106, - "nodeType": "ExpressionStatement", - "src": "340:79:1" - } - ] - }, - "documentation": null, - "id": 108, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "signupSign", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 73, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 72, - "name": "hash", - "nodeType": "VariableDeclaration", - "scope": 108, - "src": "208:12:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 71, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "208:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "207:14:1" - }, - "returnParameters": { - "id": 74, - "nodeType": "ParameterList", - "parameters": [], - "src": "229:0:1" - }, - "scope": 280, - "src": "188:238:1", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 186, - "nodeType": "Block", - "src": "546:404:1", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 130, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 120, - "name": "dbSignups", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 70, - "src": "560:9:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - } - }, - "id": 128, - "indexExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 124, - "name": "validator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 115, - "src": "597:9:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 125, - "name": "hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 110, - "src": "608:4:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "expression": { - "argumentTypes": null, - "id": 122, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 282, - "src": "580:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 123, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "580:16:1", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 126, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "580:33:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 121, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 289, - "src": "570:9:1", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 127, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "570:44:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "560:55:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 129, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "619:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "560:60:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 133, - "nodeType": "IfStatement", - "src": "556:86:1", - "trueBody": { - "expression": { - "argumentTypes": null, - "hexValue": "30", - "id": 131, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "641:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "functionReturnParameters": 119, - "id": 132, - "nodeType": "Return", - "src": "634:8:1" - } - }, - { - "assignments": [ - 135 - ], - "declarations": [ - { - "constant": false, - "id": 135, - "name": "id", - "nodeType": "VariableDeclaration", - "scope": 186, - "src": "652:7:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 134, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "652:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 137, - "initialValue": { - "argumentTypes": null, - "hexValue": "31", - "id": 136, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "662:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "nodeType": "VariableDeclarationStatement", - "src": "652:11:1" - }, - { - "body": { - "id": 182, - "nodeType": "Block", - "src": "718:207:1", - "statements": [ - { - "assignments": [ - 150 - ], - "declarations": [ - { - "constant": false, - "id": 150, - "name": "vid", - "nodeType": "VariableDeclaration", - "scope": 182, - "src": "732:8:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 149, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "732:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 162, - "initialValue": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 151, - "name": "dbSignups", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 70, - "src": "743:9:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - } - }, - "id": 161, - "indexExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 155, - "name": "validators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 113, - "src": "780:10:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 157, - "indexExpression": { - "argumentTypes": null, - "id": 156, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 139, - "src": "791:1:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "780:13:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 158, - "name": "hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 110, - "src": "795:4:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "expression": { - "argumentTypes": null, - "id": 153, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 282, - "src": "763:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 154, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "763:16:1", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 159, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "763:37:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 152, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 289, - "src": "753:9:1", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 160, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "753:48:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "743:59:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "732:70:1" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 177, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 165, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 163, - "name": "vid", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 150, - "src": "820:3:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 164, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "826:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "820:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "&&", - "rightExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 176, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 166, - "name": "vid", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 150, - "src": "831:3:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 167, - "name": "dbSignups", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 70, - "src": "837:9:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - } - }, - "id": 175, - "indexExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 171, - "name": "validator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 115, - "src": "874:9:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 172, - "name": "hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 110, - "src": "885:4:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "expression": { - "argumentTypes": null, - "id": 169, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 282, - "src": "857:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 170, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "857:16:1", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 173, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "857:33:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 168, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 289, - "src": "847:9:1", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 174, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "847:44:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "837:55:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "831:61:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "820:72:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 181, - "nodeType": "IfStatement", - "src": "816:98:1", - "trueBody": { - "expression": { - "argumentTypes": null, - "id": 179, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "910:4:1", - "subExpression": { - "argumentTypes": null, - "id": 178, - "name": "id", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 135, - "src": "910:2:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 180, - "nodeType": "ExpressionStatement", - "src": "910:4:1" - } - } - ] - }, - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 145, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 142, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 139, - "src": "690:1:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 143, - "name": "validators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 113, - "src": "694:10:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 144, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "694:17:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "690:21:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 183, - "initializationExpression": { - "assignments": [ - 139 - ], - "declarations": [ - { - "constant": false, - "id": 139, - "name": "i", - "nodeType": "VariableDeclaration", - "scope": 183, - "src": "678:6:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 138, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "678:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 141, - "initialValue": { - "argumentTypes": null, - "hexValue": "30", - "id": 140, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "687:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "678:10:1" - }, - "loopExpression": { - "expression": { - "argumentTypes": null, - "id": 147, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "713:3:1", - "subExpression": { - "argumentTypes": null, - "id": 146, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 139, - "src": "713:1:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 148, - "nodeType": "ExpressionStatement", - "src": "713:3:1" - }, - "nodeType": "ForStatement", - "src": "673:252:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 184, - "name": "id", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 135, - "src": "941:2:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 119, - "id": 185, - "nodeType": "Return", - "src": "934:9:1" - } - ] - }, - "documentation": null, - "id": 187, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getSignupNumber", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 116, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 110, - "name": "hash", - "nodeType": "VariableDeclaration", - "scope": 187, - "src": "457:12:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 109, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "457:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 113, - "name": "validators", - "nodeType": "VariableDeclaration", - "scope": 187, - "src": "471:27:1", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 111, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "471:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 112, - "length": null, - "nodeType": "ArrayTypeName", - "src": "471:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 115, - "name": "validator", - "nodeType": "VariableDeclaration", - "scope": 187, - "src": "500:17:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 114, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "500:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "456:62:1" - }, - "returnParameters": { - "id": 119, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 118, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 187, - "src": "540:4:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 117, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "540:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "539:6:1" - }, - "scope": 280, - "src": "432:518:1", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 231, - "nodeType": "Block", - "src": "1074:235:1", - "statements": [ - { - "body": { - "id": 225, - "nodeType": "Block", - "src": "1129:147:1", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 218, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 211, - "name": "hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 189, - "src": "1163:4:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "id": 212, - "name": "validators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 192, - "src": "1169:10:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 213, - "name": "validators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 192, - "src": "1181:10:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 215, - "indexExpression": { - "argumentTypes": null, - "id": 214, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 200, - "src": "1192:1:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "1181:13:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 210, - "name": "getSignupNumber", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 187, - "src": "1147:15:1", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_bytes32_$_t_array$_t_address_$dyn_memory_ptr_$_t_address_$returns$_t_uint256_$", - "typeString": "function (bytes32,address[] memory,address) view returns (uint256)" - } - }, - "id": 216, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1147:48:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "id": 217, - "name": "signupNumber", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 194, - "src": "1199:12:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1147:64:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 224, - "nodeType": "IfStatement", - "src": "1143:123:1", - "trueBody": { - "id": 223, - "nodeType": "Block", - "src": "1213:53:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 219, - "name": "validators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 192, - "src": "1238:10:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 221, - "indexExpression": { - "argumentTypes": null, - "id": 220, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 200, - "src": "1249:1:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "1238:13:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "functionReturnParameters": 198, - "id": 222, - "nodeType": "Return", - "src": "1231:20:1" - } - ] - } - } - ] - }, - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 206, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 203, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 200, - "src": "1101:1:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 204, - "name": "validators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 192, - "src": "1105:10:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 205, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1105:17:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1101:21:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 226, - "initializationExpression": { - "assignments": [ - 200 - ], - "declarations": [ - { - "constant": false, - "id": 200, - "name": "i", - "nodeType": "VariableDeclaration", - "scope": 226, - "src": "1089:6:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 199, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1089:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 202, - "initialValue": { - "argumentTypes": null, - "hexValue": "30", - "id": 201, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1098:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "1089:10:1" - }, - "loopExpression": { - "expression": { - "argumentTypes": null, - "id": 208, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "1124:3:1", - "subExpression": { - "argumentTypes": null, - "id": 207, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 200, - "src": "1124:1:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 209, - "nodeType": "ExpressionStatement", - "src": "1124:3:1" - }, - "nodeType": "ForStatement", - "src": "1084:192:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "hexValue": "30", - "id": 228, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1300:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - } - ], - "id": 227, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "1292:7:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 229, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1292:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "functionReturnParameters": 198, - "id": 230, - "nodeType": "Return", - "src": "1285:17:1" - } - ] - }, - "documentation": null, - "id": 232, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getSignupAddress", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 195, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 189, - "name": "hash", - "nodeType": "VariableDeclaration", - "scope": 232, - "src": "982:12:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 188, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "982:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 192, - "name": "validators", - "nodeType": "VariableDeclaration", - "scope": 232, - "src": "996:27:1", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 190, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "996:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 191, - "length": null, - "nodeType": "ArrayTypeName", - "src": "996:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 194, - "name": "signupNumber", - "nodeType": "VariableDeclaration", - "scope": 232, - "src": "1025:17:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 193, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1025:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "981:62:1" - }, - "returnParameters": { - "id": 198, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 197, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 232, - "src": "1065:7:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 196, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1065:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1064:9:1" - }, - "scope": 280, - "src": "956:353:1", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 255, - "nodeType": "Block", - "src": "1385:78:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 253, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 241, - "name": "db", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 62, - "src": "1395:2:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes_storage_$", - "typeString": "mapping(bytes32 => bytes storage ref)" - } - }, - "id": 251, - "indexExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 245, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 295, - "src": "1425:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 246, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1425:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 247, - "name": "hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 234, - "src": "1437:4:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "id": 248, - "name": "key", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 236, - "src": "1443:3:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "expression": { - "argumentTypes": null, - "id": 243, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 282, - "src": "1408:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 244, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1408:16:1", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 249, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1408:39:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 242, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 289, - "src": "1398:9:1", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 250, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1398:50:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "1395:54:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage", - "typeString": "bytes storage ref" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 252, - "name": "data", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 238, - "src": "1452:4:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - }, - "src": "1395:61:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage", - "typeString": "bytes storage ref" - } - }, - "id": 254, - "nodeType": "ExpressionStatement", - "src": "1395:61:1" - } - ] - }, - "documentation": null, - "id": 256, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "setData", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 239, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 234, - "name": "hash", - "nodeType": "VariableDeclaration", - "scope": 256, - "src": "1332:12:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 233, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1332:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 236, - "name": "key", - "nodeType": "VariableDeclaration", - "scope": 256, - "src": "1346:11:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 235, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1346:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 238, - "name": "data", - "nodeType": "VariableDeclaration", - "scope": 256, - "src": "1359:17:1", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes" - }, - "typeName": { - "id": 237, - "name": "bytes", - "nodeType": "ElementaryTypeName", - "src": "1359:5:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage_ptr", - "typeString": "bytes" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1331:46:1" - }, - "returnParameters": { - "id": 240, - "nodeType": "ParameterList", - "parameters": [], - "src": "1385:0:1" - }, - "scope": 280, - "src": "1315:148:1", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 278, - "nodeType": "Block", - "src": "1562:72:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 267, - "name": "db", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 62, - "src": "1579:2:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes_storage_$", - "typeString": "mapping(bytes32 => bytes storage ref)" - } - }, - "id": 276, - "indexExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 271, - "name": "from", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 258, - "src": "1609:4:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 272, - "name": "hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 260, - "src": "1615:4:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "id": 273, - "name": "key", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 262, - "src": "1621:3:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "expression": { - "argumentTypes": null, - "id": 269, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 282, - "src": "1592:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 270, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1592:16:1", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 274, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1592:33:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 268, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 289, - "src": "1582:9:1", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 275, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1582:44:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "1579:48:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage", - "typeString": "bytes storage ref" - } - }, - "functionReturnParameters": 266, - "id": 277, - "nodeType": "Return", - "src": "1572:55:1" - } - ] - }, - "documentation": null, - "id": 279, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getData", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 263, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 258, - "name": "from", - "nodeType": "VariableDeclaration", - "scope": 279, - "src": "1486:12:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 257, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1486:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 260, - "name": "hash", - "nodeType": "VariableDeclaration", - "scope": 279, - "src": "1500:12:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 259, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1500:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 262, - "name": "key", - "nodeType": "VariableDeclaration", - "scope": 279, - "src": "1514:11:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 261, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1514:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1485:41:1" - }, - "returnParameters": { - "id": 266, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 265, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 279, - "src": "1548:12:1", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes" - }, - "typeName": { - "id": 264, - "name": "bytes", - "nodeType": "ElementaryTypeName", - "src": "1548:5:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage_ptr", - "typeString": "bytes" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1547:14:1" - }, - "scope": 280, - "src": "1469:165:1", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - } - ], - "scope": 281, - "src": "25:1611:1" - } - ], - "src": "0:1637:1" - }, - "compiler": { - "name": "solc", - "version": "0.5.9+commit.e560f70d.Emscripten.clang" - }, - "networks": { - "33": { - "events": {}, - "links": {}, - "address": "0xd5fE0D28e058D375b0b038fFbB446Da37E85fFdc", - "transactionHash": "0xfc024dbdc05c6deb0bd921701809dec226f03100b24e7a91d8de4ccb76467f21" - } - }, - "schemaVersion": "3.0.11", - "updatedAt": "2019-10-28T13:23:05.363Z", - "devdoc": { - "methods": {} - }, - "userdoc": { - "methods": {} - } -} \ No newline at end of file diff --git a/src/oracle/proxy/index.js b/src/oracle/proxy/index.js index d520245..07dcfe8 100644 --- a/src/oracle/proxy/index.js +++ b/src/oracle/proxy/index.js @@ -1,9 +1,8 @@ const express = require('express') -const Web3 = require('web3') const AsyncLock = require('async-lock') const axios = require('axios') const BN = require('bignumber.js') -const { utils } = require('ethers') +const ethers = require('ethers') const encode = require('./encode') const decode = require('./decode') @@ -15,16 +14,54 @@ const { HOME_RPC_URL, HOME_BRIDGE_ADDRESS, SIDE_RPC_URL, SIDE_SHARED_DB_ADDRESS, VALIDATOR_PRIVATE_KEY, HOME_TOKEN_ADDRESS, FOREIGN_URL, FOREIGN_ASSET } = process.env -const abiSharedDb = require('./contracts_data/SharedDB.json').abi -const abiBridge = require('./contracts_data/Bridge.json').abi -const abiToken = require('./contracts_data/IERC20.json').abi -const homeWeb3 = new Web3(HOME_RPC_URL, null, { transactionConfirmationBlocks: 1 }) -const sideWeb3 = new Web3(SIDE_RPC_URL, null, { transactionConfirmationBlocks: 1 }) -const bridge = new homeWeb3.eth.Contract(abiBridge, HOME_BRIDGE_ADDRESS) -const token = new homeWeb3.eth.Contract(abiToken, HOME_TOKEN_ADDRESS) -const sharedDb = new sideWeb3.eth.Contract(abiSharedDb, SIDE_SHARED_DB_ADDRESS) -const validatorAddress = homeWeb3.eth.accounts.privateKeyToAccount(`0x${VALIDATOR_PRIVATE_KEY}`).address +const tokenAbi = [ + 'function balanceOf(address account) view returns (uint256)' +] +const bridgeAbi = [ + 'function getX() view returns (uint)', + 'function getY() view returns (uint)', + 'function epoch() view returns (uint)', + 'function getRangeSize() view returns (uint)', + 'function getNextRangeSize() view returns (uint)', + 'function getStartBlock() view returns (uint)', + 'function getNonce() view returns (uint)', + 'function nextEpoch() view returns (uint)', + 'function getThreshold() view returns (uint)', + 'function getNextThreshold() view returns (uint)', + 'function getValidators() view returns (address[])', + 'function getNextValidators() view returns (address[])', + 'function status() view returns (uint)', + 'function votesCount(bytes32) view returns (uint)', + 'function getNextPartyId(address a) view returns (uint)', + 'function confirmKeygen(uint x, uint y)', + 'function confirmFundsTransfer()', + 'function startVoting()', + 'function voteStartKeygen()', + 'function voteCancelKeygen()', + 'function voteAddValidator(address validator)', + 'function voteRemoveValidator(address validator)', + 'function voteChangeThreshold(uint threshold)', + 'function transfer(bytes32 hash, address to, uint value)' +] +const sharedDbAbi = [ + 'function getSignupAddress(bytes32 hash, address[] validators, uint signupNumber) view returns (address)', + 'function getData(address from, bytes32 hash, bytes32 key) view returns (bytes)', + 'function getSignupNumber(bytes32 hash, address[] validators, address validator) view returns (uint)', + 'function setData(bytes32 hash, bytes32 key, bytes data)', + 'function signupSign(bytes32 hash)' +] + +const homeProvider = new ethers.providers.JsonRpcProvider(HOME_RPC_URL) +const sideProvider = new ethers.providers.JsonRpcProvider(SIDE_RPC_URL) +const homeWallet = new ethers.Wallet(VALIDATOR_PRIVATE_KEY, homeProvider) +const sideWallet = new ethers.Wallet(VALIDATOR_PRIVATE_KEY, sideProvider) + +const token = new ethers.Contract(HOME_TOKEN_ADDRESS, tokenAbi, homeWallet) +const bridge = new ethers.Contract(HOME_BRIDGE_ADDRESS, bridgeAbi, homeWallet) +const sharedDb = new ethers.Contract(SIDE_SHARED_DB_ADDRESS, sharedDbAbi, sideWallet) + +const validatorAddress = homeWallet.address const httpClient = axios.create({ baseURL: FOREIGN_URL }) @@ -42,8 +79,8 @@ app.use(express.urlencoded({ extended: true })) const votesProxyApp = express() async function main() { - homeValidatorNonce = await homeWeb3.eth.getTransactionCount(validatorAddress) - sideValidatorNonce = await sideWeb3.eth.getTransactionCount(validatorAddress) + homeValidatorNonce = await homeWallet.getTransactionCount() + sideValidatorNonce = await sideWallet.getTransactionCount() homeSender = await createSender(HOME_RPC_URL, VALIDATOR_PRIVATE_KEY) sideSender = await createSender(SIDE_RPC_URL, VALIDATOR_PRIVATE_KEY) @@ -72,9 +109,8 @@ function Err(data) { function sideSendQuery(query) { return lock.acquire('home', async () => { logger.debug('Sending side query') - const encodedABI = query.encodeABI() const senderResponse = await sideSender({ - data: encodedABI, + data: query, to: SIDE_SHARED_DB_ADDRESS, nonce: sideValidatorNonce }) @@ -88,9 +124,8 @@ function sideSendQuery(query) { function homeSendQuery(query) { return lock.acquire('home', async () => { logger.debug('Sending home query') - const encodedABI = query.encodeABI() const senderResponse = await homeSender({ - data: encodedABI, + data: query, to: HOME_BRIDGE_ADDRESS, nonce: homeValidatorNonce }) @@ -107,22 +142,19 @@ async function get(req, res) { const uuid = req.body.key.third let from if (uuid.startsWith('k')) { - from = (await bridge.methods.getNextValidators() - .call())[parseInt(req.body.key.first, 10) - 1] + from = (await bridge.getNextValidators())[parseInt(req.body.key.first, 10) - 1] } else { - const validators = await bridge.methods.getValidators() - .call() - from = await sharedDb.methods.getSignupAddress( + const validators = await bridge.getValidators() + from = await sharedDb.getSignupAddress( uuid, - validators, parseInt(req.body.key.first, 10) + validators, + parseInt(req.body.key.first, 10) ) - .call() } const to = Number(req.body.key.fourth) // 0 if empty - const key = homeWeb3.utils.sha3(`${round}_${to}`) + const key = ethers.utils.id(`${round}_${to}`) - const data = await sharedDb.methods.getData(from, sideWeb3.utils.sha3(uuid), key) - .call() + const data = await sharedDb.getData(from, ethers.utils.id(uuid), key) if (data.length > 2) { logger.trace(`Received encoded data: ${data}`) @@ -144,13 +176,13 @@ async function set(req, res) { const round = req.body.key.second const uuid = req.body.key.third const to = Number(req.body.key.fourth) - const key = homeWeb3.utils.sha3(`${round}_${to}`) + const key = ethers.utils.id(`${round}_${to}`) logger.trace('Received data: %o', req.body.value) const encoded = encode(uuid[0] === 'k', round, req.body.value) logger.trace(`Encoded data: ${encoded.toString('hex')}`) logger.trace(`Received data: ${req.body.value.length} bytes, encoded data: ${encoded.length} bytes`) - const query = sharedDb.methods.setData(sideWeb3.utils.sha3(uuid), key, encoded) + const query = sharedDb.interface.functions.setData.encode([ethers.utils.id(uuid), key, encoded]) await sideSendQuery(query) res.send(Ok(null)) @@ -159,8 +191,8 @@ async function set(req, res) { async function signupKeygen(req, res) { logger.debug('SignupKeygen call') - const epoch = (await bridge.methods.nextEpoch().call()).toNumber() - const partyId = (await bridge.methods.getNextPartyId(validatorAddress).call()).toNumber() + const epoch = (await bridge.nextEpoch()).toNumber() + const partyId = (await bridge.getNextPartyId(validatorAddress)).toNumber() if (partyId === 0) { res.send(Err({ message: 'Not a validator' })) @@ -176,8 +208,8 @@ async function signupKeygen(req, res) { async function signupSign(req, res) { logger.debug('SignupSign call') - const hash = sideWeb3.utils.sha3(`0x${req.body.third}`) - const query = sharedDb.methods.signupSign(hash) + const hash = ethers.utils.id(req.body.third) + const query = sharedDb.interface.functions.signupSign.encode([hash]) const { txHash } = await sideSendQuery(query) const receipt = await waitForReceipt(SIDE_RPC_URL, txHash) @@ -191,9 +223,8 @@ async function signupSign(req, res) { return } - const validators = await bridge.methods.getValidators().call() - const id = (await sharedDb.methods.getSignupNumber(hash, validators, validatorAddress).call()) - .toNumber() + const validators = await bridge.getValidators() + const id = (await sharedDb.getSignupNumber(hash, validators, validatorAddress)).toNumber() res.send(Ok({ uuid: hash, @@ -205,7 +236,7 @@ async function signupSign(req, res) { async function confirmKeygen(req, res) { logger.debug('Confirm keygen call') const { x, y } = req.body[5] - const query = bridge.methods.confirmKeygen(`0x${x}`, `0x${y}`) + const query = bridge.interface.functions.confirmKeygen.encode([`0x${x}`, `0x${y}`]) await homeSendQuery(query) res.send() logger.debug('Confirm keygen end') @@ -213,7 +244,7 @@ async function confirmKeygen(req, res) { async function confirmFundsTransfer(req, res) { logger.debug('Confirm funds transfer call') - const query = bridge.methods.confirmFundsTransfer() + const query = bridge.interface.functions.confirmFundsTransfer.encode([]) await homeSendQuery(query) res.send() logger.debug('Confirm funds transfer end') @@ -255,37 +286,37 @@ async function sendVote(query, req, res, waitFlag = false) { async function voteStartVoting(req, res) { logger.info('Voting for starting new epoch voting process') - const query = bridge.methods.startVoting() + const query = bridge.interface.functions.startVoting.encode([]) await sendVote(query, req, res, true) } async function voteStartKeygen(req, res) { logger.info('Voting for starting new epoch keygen') - const query = bridge.methods.voteStartKeygen() + const query = bridge.interface.functions.voteStartKeygen.encode([]) await sendVote(query, req, res) } async function voteCancelKeygen(req, res) { logger.info('Voting for cancelling new epoch keygen') - const query = bridge.methods.voteCancelKeygen() + const query = bridge.interface.functions.voteCancelKeygen.encode([]) await sendVote(query, req, res) } async function voteAddValidator(req, res) { logger.info('Voting for adding new validator') - const query = bridge.methods.voteAddValidator(req.params.validator) + const query = bridge.interface.functions.voteAddValidator.encode([req.params.validator]) await sendVote(query, req, res) } async function voteChangeThreshold(req, res) { logger.info('Voting for changing threshold') - const query = bridge.methods.voteChangeThreshold(req.params.threshold) + const query = bridge.interface.functions.voteChangeThreshold.encode([req.params.threshold]) await sendVote(query, req, res) } async function voteRemoveValidator(req, res) { logger.info('Voting for removing validator') - const query = bridge.methods.voteRemoveValidator(req.params.validator) + const query = bridge.interface.functions.voteRemoveValidator.encode([req.params.validator]) await sendVote(query, req, res, true) } @@ -315,9 +346,9 @@ function boundX(x) { async function transfer(req, res) { logger.info('Transfer start') const { hash, to, value } = req.body - if (homeWeb3.utils.isAddress(to)) { + if (ethers.utils.isHexString(to, 20)) { logger.info(`Calling transfer to ${to}, ${value} tokens`) - const query = bridge.methods.transfer(hash, to, `0x${new BN(value).toString(16)}`) + const query = bridge.interface.functions.transfer.encode([hash, to, `0x${new BN(value).toString(16)}`]) await homeSendQuery(query) } res.send() @@ -335,6 +366,12 @@ function getForeignBalances(address) { .catch(() => ({})) } +function getVotesCount(nextEpoch, voteType) { + return bridge.votesCount( + ethers.utils.keccak256(ethers.utils.solidityPack(['uint8', 'uint256'], [voteType, nextEpoch])) + ).then(boundX) +} + async function info(req, res) { logger.debug('Info start') try { @@ -342,37 +379,29 @@ async function info(req, res) { x, y, epoch, rangeSize, nextRangeSize, epochStartBlock, foreignNonce, nextEpoch, threshold, nextThreshold, validators, nextValidators, status, homeBalance ] = await Promise.all([ - bridge.methods.getX().call().then((value) => new BN(value).toString(16)), - bridge.methods.getY().call().then((value) => new BN(value).toString(16)), - bridge.methods.epoch().call().then(boundX), - bridge.methods.getRangeSize().call().then(boundX), - bridge.methods.getNextRangeSize().call().then(boundX), - bridge.methods.getStartBlock().call().then(boundX), - bridge.methods.getNonce().call().then(boundX), - bridge.methods.nextEpoch().call().then(boundX), - bridge.methods.getThreshold().call().then(boundX), - bridge.methods.getNextThreshold().call().then(boundX), - bridge.methods.getValidators().call(), - bridge.methods.getNextValidators().call(), - bridge.methods.status().call(), - token.methods.balanceOf(HOME_BRIDGE_ADDRESS).call() + bridge.getX().then((value) => new BN(value).toString(16)), + bridge.getY().then((value) => new BN(value).toString(16)), + bridge.epoch().then(boundX), + bridge.getRangeSize().then(boundX), + bridge.getNextRangeSize().then(boundX), + bridge.getStartBlock().then(boundX), + bridge.getNonce().then(boundX), + bridge.nextEpoch().then(boundX), + bridge.getThreshold().then(boundX), + bridge.getNextThreshold().then(boundX), + bridge.getValidators(), + bridge.getNextValidators(), + bridge.status().then(boundX), + token.balanceOf(HOME_BRIDGE_ADDRESS) .then((value) => parseFloat(new BN(value).dividedBy(10 ** 18).toFixed(8, 3))) ]) const [ confirmationsForFundsTransfer, votesForVoting, votesForKeygen, votesForCancelKeygen ] = await Promise.all([ - bridge.methods.votesCount( - homeWeb3.utils.sha3(utils.solidityPack(['uint8', 'uint256'], [1, nextEpoch])) - ).call().then(boundX), - bridge.methods.votesCount( - homeWeb3.utils.sha3(utils.solidityPack(['uint8', 'uint256'], [2, nextEpoch])) - ).call().then(boundX), - bridge.methods.votesCount( - homeWeb3.utils.sha3(utils.solidityPack(['uint8', 'uint256'], [7, nextEpoch])) - ).call().then(boundX), - bridge.methods.votesCount( - homeWeb3.utils.sha3(utils.solidityPack(['uint8', 'uint256'], [8, nextEpoch])) - ).call().then(boundX) + getVotesCount(nextEpoch, 1), + getVotesCount(nextEpoch, 2), + getVotesCount(nextEpoch, 7), + getVotesCount(nextEpoch, 8) ]) const foreignAddress = publicKeyToAddress({ x, diff --git a/src/oracle/proxy/package.json b/src/oracle/proxy/package.json index 6624098..33c7e10 100644 --- a/src/oracle/proxy/package.json +++ b/src/oracle/proxy/package.json @@ -2,7 +2,6 @@ "name": "proxy", "version": "0.0.1", "dependencies": { - "web3": "1.0.0-beta.55", "bech32": "1.1.3", "express": "4.17.1", "async-lock": "1.2.0", diff --git a/src/oracle/proxy/sendTx.js b/src/oracle/proxy/sendTx.js index 9e9b0cd..f00188e 100644 --- a/src/oracle/proxy/sendTx.js +++ b/src/oracle/proxy/sendTx.js @@ -1,4 +1,3 @@ -const Web3 = require('web3') const axios = require('axios') const ethers = require('ethers') const BN = require('bignumber.js') @@ -21,10 +20,10 @@ async function sendRpcRequest(url, method, params) { } async function createSender(url, privateKey) { - const web3 = new Web3(url, null, { transactionConfirmationBlocks: 1 }) - const signer = new ethers.utils.SigningKey(privateKey) + const provider = new ethers.providers.JsonRpcProvider(url) + const wallet = new ethers.Wallet(privateKey, provider) - const chainId = await web3.eth.net.getId() + const { chainId } = await provider.getNetwork() return async function send(tx) { const newTx = { data: tx.data, @@ -38,7 +37,7 @@ async function createSender(url, privateKey) { try { logger.trace(`Preparing and sending transaction %o on ${url}`, newTx) const estimate = await sendRpcRequest(url, 'eth_estimateGas', [{ - from: signer.address, + from: wallet.address, to: newTx.to, data: newTx.data, gasPrice: newTx.gasPrice, @@ -50,14 +49,14 @@ async function createSender(url, privateKey) { logger.debug('Gas estimate failed %o, skipping tx, reverting nonce', estimate.error) return true } - const gasLimit = BN.min(new BN(estimate.result, 16) - .multipliedBy(GAS_LIMIT_FACTOR), MAX_GAS_LIMIT) + const gasLimit = BN.min( + new BN(estimate.result, 16).multipliedBy(GAS_LIMIT_FACTOR), + MAX_GAS_LIMIT + ) newTx.gasLimit = `0x${new BN(gasLimit).toString(16)}` logger.trace(`Estimated gas to ${gasLimit}`) - const hash = web3.utils.sha3(ethers.utils.serializeTransaction(newTx)) - const signature = signer.signDigest(hash) - const signedTx = ethers.utils.serializeTransaction(newTx, signature) + const signedTx = await wallet.sign(newTx) const { result, error } = await sendRpcRequest(url, 'eth_sendRawTransaction', [signedTx]) // handle nonce error @@ -79,14 +78,15 @@ async function createSender(url, privateKey) { } async function waitForReceipt(url, txHash) { + const provider = new ethers.providers.JsonRpcProvider(url) while (true) { - const { result, error } = await sendRpcRequest(url, 'eth_getTransactionReceipt', [txHash]) + const receipt = await provider.getTransactionReceipt(txHash) - if (result === null || error) { - await delay(1000) - } else { - return result + if (receipt) { + return receipt } + + await delay(1000) } } From 8e8af2ba34308491df2f1cd6b8af562636f57f65 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Tue, 5 Nov 2019 11:00:54 +0300 Subject: [PATCH 063/129] Refactored proxy, splitted code in several files --- src/oracle/proxy/Dockerfile | 2 +- src/oracle/proxy/contractsAbi.js | 42 ++++++++++ src/oracle/proxy/index.js | 130 +++++++++---------------------- src/oracle/proxy/utils.js | 37 +++++++++ 4 files changed, 116 insertions(+), 95 deletions(-) create mode 100644 src/oracle/proxy/contractsAbi.js create mode 100644 src/oracle/proxy/utils.js diff --git a/src/oracle/proxy/Dockerfile b/src/oracle/proxy/Dockerfile index e36f80b..2069f11 100644 --- a/src/oracle/proxy/Dockerfile +++ b/src/oracle/proxy/Dockerfile @@ -6,6 +6,6 @@ COPY ./proxy/package.json /proxy/ RUN npm install -COPY ./proxy/index.js ./proxy/encode.js ./proxy/decode.js ./proxy/sendTx.js ./shared/logger.js ./shared/crypto.js ./shared/wait.js /proxy/ +COPY ./proxy/index.js ./proxy/encode.js ./proxy/decode.js ./proxy/sendTx.js ./proxy/contractsAbi.js ./proxy/utils.js ./shared/logger.js ./shared/crypto.js ./shared/wait.js /proxy/ ENTRYPOINT ["node", "index.js"] diff --git a/src/oracle/proxy/contractsAbi.js b/src/oracle/proxy/contractsAbi.js new file mode 100644 index 0000000..312681c --- /dev/null +++ b/src/oracle/proxy/contractsAbi.js @@ -0,0 +1,42 @@ +const tokenAbi = [ + 'function balanceOf(address account) view returns (uint256)' +] +const bridgeAbi = [ + 'function getX() view returns (uint)', + 'function getY() view returns (uint)', + 'function epoch() view returns (uint)', + 'function getRangeSize() view returns (uint)', + 'function getNextRangeSize() view returns (uint)', + 'function getStartBlock() view returns (uint)', + 'function getNonce() view returns (uint)', + 'function nextEpoch() view returns (uint)', + 'function getThreshold() view returns (uint)', + 'function getNextThreshold() view returns (uint)', + 'function getValidators() view returns (address[])', + 'function getNextValidators() view returns (address[])', + 'function status() view returns (uint)', + 'function votesCount(bytes32) view returns (uint)', + 'function getNextPartyId(address a) view returns (uint)', + 'function confirmKeygen(uint x, uint y)', + 'function confirmFundsTransfer()', + 'function startVoting()', + 'function voteStartKeygen()', + 'function voteCancelKeygen()', + 'function voteAddValidator(address validator)', + 'function voteRemoveValidator(address validator)', + 'function voteChangeThreshold(uint threshold)', + 'function transfer(bytes32 hash, address to, uint value)' +] +const sharedDbAbi = [ + 'function getSignupAddress(bytes32 hash, address[] validators, uint signupNumber) view returns (address)', + 'function getData(address from, bytes32 hash, bytes32 key) view returns (bytes)', + 'function getSignupNumber(bytes32 hash, address[] validators, address validator) view returns (uint)', + 'function setData(bytes32 hash, bytes32 key, bytes data)', + 'function signupSign(bytes32 hash)' +] + +module.exports = { + tokenAbi, + bridgeAbi, + sharedDbAbi +} diff --git a/src/oracle/proxy/index.js b/src/oracle/proxy/index.js index 07dcfe8..ec539d4 100644 --- a/src/oracle/proxy/index.js +++ b/src/oracle/proxy/index.js @@ -4,6 +4,10 @@ const axios = require('axios') const BN = require('bignumber.js') const ethers = require('ethers') +const { tokenAbi, bridgeAbi, sharedDbAbi } = require('./contractsAbi') +const { + Ok, Err, decodeStatus, boundX +} = require('./utils') const encode = require('./encode') const decode = require('./decode') const { createSender, waitForReceipt } = require('./sendTx') @@ -15,43 +19,6 @@ const { HOME_TOKEN_ADDRESS, FOREIGN_URL, FOREIGN_ASSET } = process.env -const tokenAbi = [ - 'function balanceOf(address account) view returns (uint256)' -] -const bridgeAbi = [ - 'function getX() view returns (uint)', - 'function getY() view returns (uint)', - 'function epoch() view returns (uint)', - 'function getRangeSize() view returns (uint)', - 'function getNextRangeSize() view returns (uint)', - 'function getStartBlock() view returns (uint)', - 'function getNonce() view returns (uint)', - 'function nextEpoch() view returns (uint)', - 'function getThreshold() view returns (uint)', - 'function getNextThreshold() view returns (uint)', - 'function getValidators() view returns (address[])', - 'function getNextValidators() view returns (address[])', - 'function status() view returns (uint)', - 'function votesCount(bytes32) view returns (uint)', - 'function getNextPartyId(address a) view returns (uint)', - 'function confirmKeygen(uint x, uint y)', - 'function confirmFundsTransfer()', - 'function startVoting()', - 'function voteStartKeygen()', - 'function voteCancelKeygen()', - 'function voteAddValidator(address validator)', - 'function voteRemoveValidator(address validator)', - 'function voteChangeThreshold(uint threshold)', - 'function transfer(bytes32 hash, address to, uint value)' -] -const sharedDbAbi = [ - 'function getSignupAddress(bytes32 hash, address[] validators, uint signupNumber) view returns (address)', - 'function getData(address from, bytes32 hash, bytes32 key) view returns (bytes)', - 'function getSignupNumber(bytes32 hash, address[] validators, address validator) view returns (uint)', - 'function setData(bytes32 hash, bytes32 key, bytes data)', - 'function signupSign(bytes32 hash)' -] - const homeProvider = new ethers.providers.JsonRpcProvider(HOME_RPC_URL) const sideProvider = new ethers.providers.JsonRpcProvider(SIDE_RPC_URL) const homeWallet = new ethers.Wallet(VALIDATOR_PRIVATE_KEY, homeProvider) @@ -78,36 +45,8 @@ app.use(express.urlencoded({ extended: true })) const votesProxyApp = express() -async function main() { - homeValidatorNonce = await homeWallet.getTransactionCount() - sideValidatorNonce = await sideWallet.getTransactionCount() - - homeSender = await createSender(HOME_RPC_URL, VALIDATOR_PRIVATE_KEY) - sideSender = await createSender(SIDE_RPC_URL, VALIDATOR_PRIVATE_KEY) - - logger.warn(`My validator address in home and side networks is ${validatorAddress}`) - - app.listen(8001, () => { - logger.debug('Proxy is listening on port 8001') - }) - - votesProxyApp.listen(8002, () => { - logger.debug('Votes proxy is listening on port 8002') - }) -} - -main() - -function Ok(data) { - return { Ok: data } -} - -function Err(data) { - return { Err: data } -} - function sideSendQuery(query) { - return lock.acquire('home', async () => { + return lock.acquire('side', async () => { logger.debug('Sending side query') const senderResponse = await sideSender({ data: query, @@ -304,42 +243,25 @@ async function voteCancelKeygen(req, res) { async function voteAddValidator(req, res) { logger.info('Voting for adding new validator') - const query = bridge.interface.functions.voteAddValidator.encode([req.params.validator]) - await sendVote(query, req, res) + if (ethers.utils.isHexString(req.params.validator, 20)) { + const query = bridge.interface.functions.voteAddValidator.encode([req.params.validator]) + await sendVote(query, req, res) + } } async function voteChangeThreshold(req, res) { logger.info('Voting for changing threshold') - const query = bridge.interface.functions.voteChangeThreshold.encode([req.params.threshold]) - await sendVote(query, req, res) + if (/^[0-9]+$/.test(req.params.threshold)) { + const query = bridge.interface.functions.voteChangeThreshold.encode([req.params.threshold]) + await sendVote(query, req, res) + } } async function voteRemoveValidator(req, res) { logger.info('Voting for removing validator') - const query = bridge.interface.functions.voteRemoveValidator.encode([req.params.validator]) - await sendVote(query, req, res, true) -} - -function decodeStatus(status) { - switch (status) { - case 0: - return 'ready' - case 1: - return 'voting' - case 2: - return 'keygen' - case 3: - return 'funds_transfer' - default: - return 'unknown_state' - } -} - -function boundX(x) { - try { - return x.toNumber() - } catch (e) { - return -1 + if (ethers.utils.isHexString(req.params.validator, 20)) { + const query = bridge.interface.functions.voteRemoveValidator.encode([req.params.validator]) + await sendVote(query, req, res, true) } } @@ -458,3 +380,23 @@ votesProxyApp.get('/vote/addValidator/:validator', voteAddValidator) votesProxyApp.get('/vote/removeValidator/:validator', voteRemoveValidator) votesProxyApp.get('/vote/changeThreshold/:threshold', voteChangeThreshold) votesProxyApp.get('/info', info) + +async function main() { + homeValidatorNonce = await homeWallet.getTransactionCount() + sideValidatorNonce = await sideWallet.getTransactionCount() + + homeSender = await createSender(HOME_RPC_URL, VALIDATOR_PRIVATE_KEY) + sideSender = await createSender(SIDE_RPC_URL, VALIDATOR_PRIVATE_KEY) + + logger.warn(`My validator address in home and side networks is ${validatorAddress}`) + + app.listen(8001, () => { + logger.debug('Proxy is listening on port 8001') + }) + + votesProxyApp.listen(8002, () => { + logger.debug('Votes proxy is listening on port 8002') + }) +} + +main() diff --git a/src/oracle/proxy/utils.js b/src/oracle/proxy/utils.js new file mode 100644 index 0000000..72bd8e9 --- /dev/null +++ b/src/oracle/proxy/utils.js @@ -0,0 +1,37 @@ +function Ok(data) { + return { Ok: data } +} + +function Err(data) { + return { Err: data } +} + +function decodeStatus(status) { + switch (status) { + case 0: + return 'ready' + case 1: + return 'voting' + case 2: + return 'keygen' + case 3: + return 'funds_transfer' + default: + return 'unknown_state' + } +} + +function boundX(x) { + try { + return x.toNumber() + } catch (e) { + return -1 + } +} + +module.exports = { + Ok, + Err, + decodeStatus, + boundX +} From 85ca572e1c4435a11b12d65b9cd2c562c66180ad Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Tue, 5 Nov 2019 21:14:22 +0300 Subject: [PATCH 064/129] Handle attempts changing in signer properly --- demo/validator1/.env.development | 4 ++ demo/validator1/.env.staging | 4 ++ demo/validator2/.env.development | 4 ++ demo/validator2/.env.staging | 4 ++ demo/validator3/.env.development | 4 ++ demo/validator3/.env.staging | 4 ++ package.json | 3 - src/oracle/docker-compose-test.yml | 3 + src/oracle/docker-compose.yml | 3 + src/oracle/proxy/index.js | 6 +- src/oracle/tss-sign/signer.js | 103 ++++++++++++++++++++++------- src/tss/multi-party-ecdsa | 2 +- 12 files changed, 113 insertions(+), 31 deletions(-) diff --git a/demo/validator1/.env.development b/demo/validator1/.env.development index 3166e7b..183da5a 100644 --- a/demo/validator1/.env.development +++ b/demo/validator1/.env.development @@ -14,6 +14,10 @@ FOREIGN_START_TIME=1572500000000 FOREIGN_FETCH_INTERVAL=5000 FOREIGN_FETCH_BLOCK_TIME_OFFSET=10000 +SIGN_ATTEMPT_TIMEOUT=120000 +SIGN_NONCE_CHECK_INTERVAL=10000 +SEND_TIMEOUT=60000 + VALIDATOR_PRIVATE_KEY=2be3f252e16541bf1bb2d4a517d2bf173e6d09f2d765d32c64dc50515aec63ea VOTES_PROXY_PORT=5001 diff --git a/demo/validator1/.env.staging b/demo/validator1/.env.staging index 5513f42..2bd353f 100644 --- a/demo/validator1/.env.staging +++ b/demo/validator1/.env.staging @@ -14,6 +14,10 @@ FOREIGN_START_TIME=1572500000000 FOREIGN_FETCH_INTERVAL=5000 FOREIGN_FETCH_BLOCK_TIME_OFFSET=10000 +SIGN_ATTEMPT_TIMEOUT=120000 +SIGN_NONCE_CHECK_INTERVAL=10000 +SEND_TIMEOUT=60000 + #VALIDATOR_PRIVATE_KEY is taken from .keys VOTES_PROXY_PORT=5001 diff --git a/demo/validator2/.env.development b/demo/validator2/.env.development index 433ee15..491d22f 100644 --- a/demo/validator2/.env.development +++ b/demo/validator2/.env.development @@ -14,6 +14,10 @@ FOREIGN_START_TIME=1572500000000 FOREIGN_FETCH_INTERVAL=5000 FOREIGN_FETCH_BLOCK_TIME_OFFSET=10000 +SIGN_ATTEMPT_TIMEOUT=120000 +SIGN_NONCE_CHECK_INTERVAL=10000 +SEND_TIMEOUT=60000 + VALIDATOR_PRIVATE_KEY=e59d58c77b791f98f10187117374ae9c589d48a62720ec6a5e142b0cc134f685 VOTES_PROXY_PORT=5002 diff --git a/demo/validator2/.env.staging b/demo/validator2/.env.staging index e2f6756..ed88661 100644 --- a/demo/validator2/.env.staging +++ b/demo/validator2/.env.staging @@ -14,6 +14,10 @@ FOREIGN_START_TIME=1572500000000 FOREIGN_FETCH_INTERVAL=5000 FOREIGN_FETCH_BLOCK_TIME_OFFSET=10000 +SIGN_ATTEMPT_TIMEOUT=120000 +SIGN_NONCE_CHECK_INTERVAL=10000 +SEND_TIMEOUT=60000 + #VALIDATOR_PRIVATE_KEY is taken from .keys VOTES_PROXY_PORT=5002 diff --git a/demo/validator3/.env.development b/demo/validator3/.env.development index 9c175f8..014db1a 100644 --- a/demo/validator3/.env.development +++ b/demo/validator3/.env.development @@ -14,6 +14,10 @@ FOREIGN_START_TIME=1572500000000 FOREIGN_FETCH_INTERVAL=5000 FOREIGN_FETCH_BLOCK_TIME_OFFSET=10000 +SIGN_ATTEMPT_TIMEOUT=120000 +SIGN_NONCE_CHECK_INTERVAL=10000 +SEND_TIMEOUT=60000 + VALIDATOR_PRIVATE_KEY=afaa4d4d6e54d25b0bf0361e3fd6cef562f6311bf6200de2dd0aa4cab63ae3b5 VOTES_PROXY_PORT=5003 diff --git a/demo/validator3/.env.staging b/demo/validator3/.env.staging index 3925fbc..a1e5fef 100644 --- a/demo/validator3/.env.staging +++ b/demo/validator3/.env.staging @@ -14,6 +14,10 @@ FOREIGN_START_TIME=1572500000000 FOREIGN_FETCH_INTERVAL=5000 FOREIGN_FETCH_BLOCK_TIME_OFFSET=10000 +SIGN_ATTEMPT_TIMEOUT=120000 +SIGN_NONCE_CHECK_INTERVAL=10000 +SEND_TIMEOUT=60000 + #VALIDATOR_PRIVATE_KEY is taken from .keys VOTES_PROXY_PORT=5003 diff --git a/package.json b/package.json index 154668e..e954bd9 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,5 @@ }, "engines": { "node": ">=10.6.0" - }, - "dependencies": { - "ethers": "^4.0.39" } } diff --git a/src/oracle/docker-compose-test.yml b/src/oracle/docker-compose-test.yml index 8725650..3286cba 100644 --- a/src/oracle/docker-compose-test.yml +++ b/src/oracle/docker-compose-test.yml @@ -47,6 +47,9 @@ services: - FOREIGN_CHAIN_ID - FOREIGN_URL - FOREIGN_ASSET + - SIGN_ATTEMPT_TIMEOUT + - SIGN_NONCE_CHECK_INTERVAL + - SEND_TIMEOUT - LOG_LEVEL volumes: - '${PWD}/${TARGET_NETWORK}/keys:/keys' diff --git a/src/oracle/docker-compose.yml b/src/oracle/docker-compose.yml index e16cbe4..3463f2b 100644 --- a/src/oracle/docker-compose.yml +++ b/src/oracle/docker-compose.yml @@ -49,6 +49,9 @@ services: - FOREIGN_CHAIN_ID - FOREIGN_URL - FOREIGN_ASSET + - SIGN_ATTEMPT_TIMEOUT + - SIGN_NONCE_CHECK_INTERVAL + - SEND_TIMEOUT - LOG_LEVEL volumes: - '${PWD}/${TARGET_NETWORK}/keys:/keys' diff --git a/src/oracle/proxy/index.js b/src/oracle/proxy/index.js index ec539d4..7546cbb 100644 --- a/src/oracle/proxy/index.js +++ b/src/oracle/proxy/index.js @@ -242,24 +242,24 @@ async function voteCancelKeygen(req, res) { } async function voteAddValidator(req, res) { - logger.info('Voting for adding new validator') if (ethers.utils.isHexString(req.params.validator, 20)) { + logger.info('Voting for adding new validator') const query = bridge.interface.functions.voteAddValidator.encode([req.params.validator]) await sendVote(query, req, res) } } async function voteChangeThreshold(req, res) { - logger.info('Voting for changing threshold') if (/^[0-9]+$/.test(req.params.threshold)) { + logger.info('Voting for changing threshold') const query = bridge.interface.functions.voteChangeThreshold.encode([req.params.threshold]) await sendVote(query, req, res) } } async function voteRemoveValidator(req, res) { - logger.info('Voting for removing validator') if (ethers.utils.isHexString(req.params.validator, 20)) { + logger.info('Voting for removing validator') const query = bridge.interface.functions.voteRemoveValidator.encode([req.params.validator]) await sendVote(query, req, res, true) } diff --git a/src/oracle/tss-sign/signer.js b/src/oracle/tss-sign/signer.js index c79e5f0..d46bce7 100644 --- a/src/oracle/tss-sign/signer.js +++ b/src/oracle/tss-sign/signer.js @@ -16,9 +16,16 @@ const app = express() const { RABBITMQ_URL, FOREIGN_URL, PROXY_URL, FOREIGN_ASSET } = process.env +const SIGN_ATTEMPT_TIMEOUT = parseInt(process.env.SIGN_ATTEMPT_TIMEOUT, 10) +const SIGN_NONCE_CHECK_INTERVAL = parseInt(process.env.SIGN_NONCE_CHECK_INTERVAL, 10) +const SEND_TIMEOUT = parseInt(process.env.SEND_TIMEOUT, 10) const httpClient = axios.create({ baseURL: FOREIGN_URL }) +const SIGN_OK = 0 +const SIGN_NONCE_INTERRUPT = 1 +const SIGN_FAILED = 2 + let attempt let nextAttempt = null let cancelled @@ -46,12 +53,18 @@ async function getExchangeMessages(nonce) { return messages } -function restart(req, res) { - logger.info('Cancelling current sign') - nextAttempt = req.params.attempt +function killSigner() { exec.execSync('pkill gg18_sign || true') - cancelled = true - res.send('Cancelled') +} + +function restart(req, res) { + if (/^[0-9]+$/.test(req.params.attempt)) { + logger.info(`Manual cancelling current sign attempt, starting ${req.params.attempt} attempt`) + nextAttempt = parseInt(req.params.attempt, 10) + killSigner() + cancelled = true + res.send('Done') + } } function confirmFundsTransfer() { @@ -85,7 +98,7 @@ async function waitForAccountNonce(address, nonce) { if (sequence >= nonce) { break } - await new Promise((resolve) => setTimeout(resolve, 1000)) + await delay(1000) logger.debug('Waiting for needed account nonce') } logger.info('Account nonce is OK') @@ -100,20 +113,26 @@ function sendTx(tx) { 'Content-Type': 'text/plain' } }) - .catch((err) => { + .catch(async (err) => { if (err.response.data.message.includes('Tx already exists in cache')) { logger.debug('Tx already exists in cache') return true } logger.info('Something failed, restarting: %o', err.response) - return new Promise((resolve) => setTimeout(() => resolve(sendTx(tx)), 1000)) + await delay(1000) + return await sendTx(tx) }) } -function sign(keysFile, hash, tx, publicKey) { +function sign(keysFile, hash, tx, publicKey, signerAddress) { + let restartTimeoutId + let nonceDaemonIntervalId + let nonceInterrupt = false return new Promise((resolve) => { const cmd = exec.execFile('./sign-entrypoint.sh', [PROXY_URL, keysFile, hash], async (error) => { - if (fs.existsSync('signature')) { + clearInterval(nonceDaemonIntervalId) + clearTimeout(restartTimeoutId) + if (fs.existsSync('signature')) { // if signature was generated logger.info('Finished signature generation') const signature = JSON.parse(fs.readFileSync('signature')) logger.debug('%o', signature) @@ -127,16 +146,50 @@ function sign(keysFile, hash, tx, publicKey) { logger.info('Sending transaction') logger.debug(signedTx) await sendTx(signedTx) - resolve(true) - } else if (error === null || error.code === 0) { - resolve(true) + // if nonce does not update in some time, cancel process, consider sign as failed + const sendTimeoutId = setTimeout(() => { + cancelled = true + }, SEND_TIMEOUT) + const waitResponse = await waitForAccountNonce(signerAddress, tx.tx.sequence) + clearTimeout(sendTimeoutId) + resolve(waitResponse ? SIGN_OK : SIGN_FAILED) + } else if (error === null || error.code === 0) { // if was already enough parties + const signTimeoutId = setTimeout(() => { + cancelled = true + }, SIGN_ATTEMPT_TIMEOUT) + const waitResponse = await waitForAccountNonce(signerAddress, tx.tx.sequence) + clearTimeout(signTimeoutId) + resolve(waitResponse ? SIGN_OK : SIGN_FAILED) + } else if (error.code !== null && error.code !== 0) { // if process has failed + logger.warn('Sign process has failed') + resolve(SIGN_FAILED) + } else if (error.code === null && error.signal === 'SIGTERM') { // if process was killed + logger.warn('Sign process was killed') + resolve(nonceInterrupt ? SIGN_NONCE_INTERRUPT : SIGN_FAILED) } else { - logger.warn('Sign failed') - resolve(false) + logger.warn('Unknown error state %o', error) + resolve(SIGN_FAILED) } }) - cmd.stdout.on('data', (data) => logger.debug(data.toString())) + cmd.stdout.on('data', (data) => { + const str = data.toString() + if (str.includes('Got all party ids')) { + restartTimeoutId = setTimeout(killSigner, SIGN_ATTEMPT_TIMEOUT) + } + logger.debug(str) + }) cmd.stderr.on('data', (data) => logger.debug(data.toString())) + + // Kill signer if current nonce is already processed at some time + nonceDaemonIntervalId = setInterval(async () => { + nonceInterrupt = true + logger.info(`Checking if account ${signerAddress} has nonce ${tx.tx.sequence + 1}`) + const { sequence } = await getAccount(signerAddress) + if (sequence > tx.tx.sequence) { + logger.info('Account already has needed nonce, cancelling current sign process') + killSigner() + } + }, SIGN_NONCE_CHECK_INTERVAL) }) } @@ -201,17 +254,18 @@ async function main() { const hash = sha256(tx.getSignBytes()) logger.info(`Starting signature generation for transaction hash ${hash}`) - const done = await sign(keysFile, hash, tx, publicKey) - && await waitForAccountNonce(from, nonce + 1) + const signResult = await sign(keysFile, hash, tx, publicKey, from) - if (done) { + if (signResult === SIGN_OK || signResult === SIGN_NONCE_INTERRUPT) { // eslint-disable-next-line no-loop-func exchanges.forEach((exchangeMsg) => channel.ack(exchangeMsg)) break } + + // signer either failed, or timed out after parties signup attempt = nextAttempt || attempt + 1 - logger.warn(`Sign failed, starting next attempt ${attempt}`) nextAttempt = null + logger.warn(`Sign failed, starting next attempt ${attempt}`) await delay(1000) } } @@ -236,16 +290,17 @@ async function main() { const hash = sha256(tx.getSignBytes()) logger.info(`Starting signature generation for transaction hash ${hash}`) - const done = await sign(keysFile, hash, tx, publicKey) - && await waitForAccountNonce(from, nonce + 1) + const signResult = await sign(keysFile, hash, tx, publicKey, from) - if (done) { + if (signResult === SIGN_OK || signResult === SIGN_NONCE_INTERRUPT) { await confirmFundsTransfer() break } + + // signer either failed, or timed out after parties signup attempt = nextAttempt || attempt + 1 - logger.warn(`Sign failed, starting next attempt ${attempt}`) nextAttempt = null + logger.warn(`Sign failed, starting next attempt ${attempt}`) await delay(1000) } } else { diff --git a/src/tss/multi-party-ecdsa b/src/tss/multi-party-ecdsa index 73a6db9..f67cc7f 160000 --- a/src/tss/multi-party-ecdsa +++ b/src/tss/multi-party-ecdsa @@ -1 +1 @@ -Subproject commit 73a6db93f4805b27f5c0f2b2c139869e8cecf581 +Subproject commit f67cc7ffab0f460807f6e112ad93b5ce58e47ac6 From e484308774c11e2406b7fecbc5b560b2342d283c Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Tue, 5 Nov 2019 21:14:48 +0300 Subject: [PATCH 065/129] Tests for signer restarts --- tests/.env | 2 + tests/run.sh | 1 + tests/test/ethToBncWithRestart.js | 74 ++++++++++++++++++++++++++++ tests/test/index.js | 3 ++ tests/test/utils/sideController.js | 11 +++++ tests/test/utils/signerController.js | 22 +++++++++ 6 files changed, 113 insertions(+) create mode 100644 tests/test/ethToBncWithRestart.js create mode 100644 tests/test/utils/sideController.js create mode 100644 tests/test/utils/signerController.js diff --git a/tests/.env b/tests/.env index d6c7a4b..e54b083 100644 --- a/tests/.env +++ b/tests/.env @@ -3,6 +3,8 @@ HOME_BRIDGE_ADDRESS=0x44c158FE850821ae69DaF37AADF5c539e9d0025B HOME_TOKEN_ADDRESS=0xd5fE0D28e058D375b0b038fFbB446Da37E85fFdc HOME_PRIVATE_KEY=e2aeb24eaa63102d0c0821717c3b6384abdabd7af2ad4ec8e650dce300798b27 +SIDE_RPC_URL=http://ganache_side:8545 + FOREIGN_URL=https://testnet-dex.binance.org/ FOREIGN_CHAIN_ID=Binance-Chain-Nile FOREIGN_ASSET=KFT-94F diff --git a/tests/run.sh b/tests/run.sh index a4f7090..a81a6e6 100755 --- a/tests/run.sh +++ b/tests/run.sh @@ -11,6 +11,7 @@ docker create --name tests \ tests $@ docker network connect blockchain_home tests +docker network connect blockchain_side tests docker network connect validator1_test_network tests docker network connect validator2_test_network tests docker network connect validator3_test_network tests diff --git a/tests/test/ethToBncWithRestart.js b/tests/test/ethToBncWithRestart.js new file mode 100644 index 0000000..ed6c3f9 --- /dev/null +++ b/tests/test/ethToBncWithRestart.js @@ -0,0 +1,74 @@ +const assert = require('assert') + +const { getBncSequence } = require('./utils/bncController') +const { waitPromise, delay, seqMap } = require('./utils/wait') + +const { controller1 } = require('./utils/proxyController') +const { getNonce } = require('./utils/sideController') +const { signerController1, signerController2 } = require('./utils/signerController') + +const { validators } = require('../config') + +const { HOME_BRIDGE_ADDRESS } = process.env + +module.exports = (getUsers, newAttempt) => { + describe('exchange of tokens in eth => bnc direction with restart', function () { + let info + let users + let ethBalances + let bncBalances + let bncBridgeSequence + let validatorNonces + let newValidatorNonces + + before(async function () { + users = getUsers() + info = await controller1.getInfo() + ethBalances = await Promise.all(users.map((user) => user.getErcBalance())) + bncBalances = await seqMap(users, (user) => user.getBepBalance()) + validatorNonces = await Promise.all(validators.map(getNonce)) + + bncBridgeSequence = await getBncSequence(info.foreignBridgeAddress) + await Promise.all(users.map((user, i) => user.approveErc(HOME_BRIDGE_ADDRESS, 5 + i))) + }) + + it('should accept exchange requests', async function () { + await Promise.all(users.map((user, i) => user.exchangeErc(5 + i))) + const newEthBalances = await Promise.all(users.map((user) => user.getErcBalance())) + for (let i = 0; i < 3; i += 1) { + assert.strictEqual(newEthBalances[i], ethBalances[i] - 5 - i, `Balance of ${users[i].ethAddress} did not updated as expected`) + } + }) + + it('should start signing transaction', async function () { + this.timeout(120000) + newValidatorNonces = await waitPromise( + () => Promise.all(validators.map(getNonce)), + (nonces) => nonces[0] > validatorNonces[0] + 2 + || nonces[1] > validatorNonces[1] + 2 + || nonces[2] > validatorNonces[2] + 2 + ) + }) + + it('should restart signature generation and regenerate signature properly', async function () { + this.timeout(360000) + if (newValidatorNonces[0] > validatorNonces[0] + 2) { + await signerController1.restart(newAttempt) + } else { + await signerController2.restart(newAttempt) + } + await waitPromise( + () => getBncSequence(info.foreignBridgeAddress), + (sequence) => sequence === bncBridgeSequence + 1 + ) + }) + + it('should make correct exchange transaction', async function () { + await delay(10000) + const newBncBalances = await Promise.all(users.map((user) => user.getBepBalance())) + for (let i = 0; i < 3; i += 1) { + assert.strictEqual(newBncBalances[i], bncBalances[i] + 5 + i, `Balance of ${users[i].bncAddress} did not updated as expected`) + } + }) + }) +} diff --git a/tests/test/index.js b/tests/test/index.js index 379689c..cfaa4ea 100644 --- a/tests/test/index.js +++ b/tests/test/index.js @@ -4,6 +4,7 @@ const createUser = require('./utils/user') const { waitPromise, seqMap } = require('./utils/wait') const testEthToBnc = require('./ethToBnc') +const testEthToBncWithRestart = require('./ethToBncWithRestart') const testBncToEth = require('./bncToEth') const testRemoveValidator = require('./removeValidator') const testAddValidator = require('./addValidator') @@ -80,9 +81,11 @@ describe('bridge tests', function () { testEthToBnc(() => users) testBncToEth(() => users) + testEthToBncWithRestart(() => users, 99) testChangeThreshold(3) testEthToBnc(() => users) testBncToEth(() => users) + testEthToBncWithRestart(() => users, 2) }) diff --git a/tests/test/utils/sideController.js b/tests/test/utils/sideController.js new file mode 100644 index 0000000..24fac5e --- /dev/null +++ b/tests/test/utils/sideController.js @@ -0,0 +1,11 @@ +const ethers = require('ethers') + +const { SIDE_RPC_URL } = process.env + +const provider = new ethers.providers.JsonRpcProvider(SIDE_RPC_URL) + +module.exports = { + async getNonce(address) { + return await provider.getTransactionCount(address) + } +} diff --git a/tests/test/utils/signerController.js b/tests/test/utils/signerController.js new file mode 100644 index 0000000..12cfb1c --- /dev/null +++ b/tests/test/utils/signerController.js @@ -0,0 +1,22 @@ +const axios = require('axios') + +function createController(validatorId) { + const url = `http://validator${validatorId}_signer_1:8001/` + + const sideClient = axios.create({ + baseURL: url, + timeout: 10000 + }) + + return { + async restart(attempt) { + return (await sideClient.get(`/restart/${attempt}`)).data + } + } +} + +module.exports = { + signerController1: createController(1), + signerController2: createController(2), + signerController3: createController(3) +} From 5322d790fc3f3fd58c018e94f83e310268e6c85c Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Tue, 5 Nov 2019 23:23:07 +0300 Subject: [PATCH 066/129] Fixed signer --- src/oracle/tss-sign/signer.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/oracle/tss-sign/signer.js b/src/oracle/tss-sign/signer.js index d46bce7..b23ce4f 100644 --- a/src/oracle/tss-sign/signer.js +++ b/src/oracle/tss-sign/signer.js @@ -130,6 +130,7 @@ function sign(keysFile, hash, tx, publicKey, signerAddress) { let nonceInterrupt = false return new Promise((resolve) => { const cmd = exec.execFile('./sign-entrypoint.sh', [PROXY_URL, keysFile, hash], async (error) => { + logger.debug('%o', error) clearInterval(nonceDaemonIntervalId) clearTimeout(restartTimeoutId) if (fs.existsSync('signature')) { // if signature was generated @@ -150,22 +151,22 @@ function sign(keysFile, hash, tx, publicKey, signerAddress) { const sendTimeoutId = setTimeout(() => { cancelled = true }, SEND_TIMEOUT) - const waitResponse = await waitForAccountNonce(signerAddress, tx.tx.sequence) + const waitResponse = await waitForAccountNonce(signerAddress, tx.tx.sequence + 1) clearTimeout(sendTimeoutId) resolve(waitResponse ? SIGN_OK : SIGN_FAILED) } else if (error === null || error.code === 0) { // if was already enough parties const signTimeoutId = setTimeout(() => { cancelled = true }, SIGN_ATTEMPT_TIMEOUT) - const waitResponse = await waitForAccountNonce(signerAddress, tx.tx.sequence) + const waitResponse = await waitForAccountNonce(signerAddress, tx.tx.sequence + 1) clearTimeout(signTimeoutId) resolve(waitResponse ? SIGN_OK : SIGN_FAILED) + } else if (error.code === 143) { // if process was killed + logger.warn('Sign process was killed') + resolve(nonceInterrupt ? SIGN_NONCE_INTERRUPT : SIGN_FAILED) } else if (error.code !== null && error.code !== 0) { // if process has failed logger.warn('Sign process has failed') resolve(SIGN_FAILED) - } else if (error.code === null && error.signal === 'SIGTERM') { // if process was killed - logger.warn('Sign process was killed') - resolve(nonceInterrupt ? SIGN_NONCE_INTERRUPT : SIGN_FAILED) } else { logger.warn('Unknown error state %o', error) resolve(SIGN_FAILED) @@ -182,11 +183,11 @@ function sign(keysFile, hash, tx, publicKey, signerAddress) { // Kill signer if current nonce is already processed at some time nonceDaemonIntervalId = setInterval(async () => { - nonceInterrupt = true logger.info(`Checking if account ${signerAddress} has nonce ${tx.tx.sequence + 1}`) const { sequence } = await getAccount(signerAddress) if (sequence > tx.tx.sequence) { logger.info('Account already has needed nonce, cancelling current sign process') + nonceInterrupt = true killSigner() } }, SIGN_NONCE_CHECK_INTERVAL) From 4093400137d7a6483ba9fa86a6236cd7aa277ba9 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Tue, 5 Nov 2019 23:24:47 +0300 Subject: [PATCH 067/129] Repeating eth to bnc transfer tests --- tests/test/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/test/index.js b/tests/test/index.js index cfaa4ea..e19698b 100644 --- a/tests/test/index.js +++ b/tests/test/index.js @@ -71,11 +71,13 @@ describe('bridge tests', function () { testEthToBnc(() => users) testBncToEth(() => users) + testEthToBnc(() => users) testRemoveValidator(validatorsConfig[1]) testEthToBnc(() => users) testBncToEth(() => users) + testEthToBnc(() => users) testAddValidator(validatorsConfig[1]) @@ -88,4 +90,5 @@ describe('bridge tests', function () { testEthToBnc(() => users) testBncToEth(() => users) testEthToBncWithRestart(() => users, 2) + testEthToBnc(() => users) }) From a19ccdc68ee2c57450660ddb41273a7bdfd469f5 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Wed, 6 Nov 2019 00:27:11 +0300 Subject: [PATCH 068/129] Increased prefunding amount for bridge and users --- tests/test/index.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/test/index.js b/tests/test/index.js index e19698b..03d3131 100644 --- a/tests/test/index.js +++ b/tests/test/index.js @@ -36,25 +36,25 @@ describe('bridge tests', function () { bncPrefundedUser = await createUser(FOREIGN_PRIVATE_KEY) const bnbBalance = await bncPrefundedUser.getBnbBalance() - assert.ok(bnbBalance >= 0.5, `Insufficient BNB balance on ${bncPrefundedUser.ethAddress} in Binance network, expected 0.5 BNB, got ${bnbBalance}`) + assert.ok(bnbBalance >= 1, `Insufficient BNB balance on ${bncPrefundedUser.ethAddress} in Binance network, expected 1 BNB, got ${bnbBalance}`) const bepBalance = await bncPrefundedUser.getBepBalance() - assert.ok(bepBalance >= 500, `Insufficient BEP2 balance on ${bncPrefundedUser.ethAddress} in Binance network, expected 500 ${FOREIGN_ASSET}, got ${bepBalance}`) + assert.ok(bepBalance >= 2000, `Insufficient BEP2 balance on ${bncPrefundedUser.ethAddress} in Binance network, expected 2000 ${FOREIGN_ASSET}, got ${bepBalance}`) const ethBalance = await ethPrefundedUser.getEthBalance() - assert.ok(ethBalance >= 0.5, `Insufficient ETH balance on ${ethPrefundedUser.ethAddress} in Ethereum network, expected 0.5 ETH, got ${ethBalance}`) + assert.ok(ethBalance >= 1, `Insufficient ETH balance on ${ethPrefundedUser.ethAddress} in Ethereum network, expected 1 ETH, got ${ethBalance}`) const ercBalance = await ethPrefundedUser.getErcBalance() - assert.ok(ercBalance >= 500, `Insufficient ERC20 balance on ${ethPrefundedUser.ethAddress} in Ethereum network, expected 500 ERC20, got ${ercBalance}`) + assert.ok(ercBalance >= 2000, `Insufficient ERC20 balance on ${ethPrefundedUser.ethAddress} in Ethereum network, expected 2000 ERC20, got ${ercBalance}`) for (let i = 0; i < 3; i += 1) { const userEthBalance = await users[i].getEthBalance() - assert.ok(userEthBalance >= 0.2, `Insufficient ETH balance on ${users[i].ethAddress} in Ethereum network, expected 0.2 ETH, got ${userEthBalance}`) + assert.ok(userEthBalance >= 0.3, `Insufficient ETH balance on ${users[i].ethAddress} in Ethereum network, expected 0.3 ETH, got ${userEthBalance}`) const userErcBalance = await users[i].getErcBalance() - assert.ok(userErcBalance >= 50, `Insufficient ERC20 balance on ${users[i].ethAddress} in Ethereum network, expected 50 ERC20, got ${userErcBalance}`) + assert.ok(userErcBalance >= 200, `Insufficient ERC20 balance on ${users[i].ethAddress} in Ethereum network, expected 200 ERC20, got ${userErcBalance}`) const userBnbBalance = await users[i].getBepBalance() - assert.ok(userBnbBalance >= 0.1, `Insufficient BNB balance on ${users[i].bncAddress} in Binance network, expected 0.1 BNB, got ${userBnbBalance}`) + assert.ok(userBnbBalance >= 0.2, `Insufficient BNB balance on ${users[i].bncAddress} in Binance network, expected 0.2 BNB, got ${userBnbBalance}`) const userBepBalance = await users[i].getBepBalance() - assert.ok(userErcBalance >= 50, `Insufficient BEP2 balance on ${users[i].bncAddress} in Binance network, expected 50 ${FOREIGN_ASSET}, got ${userBepBalance}`) + assert.ok(userErcBalance >= 200, `Insufficient BEP2 balance on ${users[i].bncAddress} in Binance network, expected 200 ${FOREIGN_ASSET}, got ${userBepBalance}`) } }) @@ -64,8 +64,8 @@ describe('bridge tests', function () { }) after(async function () { - await bncPrefundedUser.transferBepBnb(info.foreignBridgeAddress, 100, 0.1) - await ethPrefundedUser.transferErc(HOME_BRIDGE_ADDRESS, 100) + await bncPrefundedUser.transferBepBnb(info.foreignBridgeAddress, 1000, 0.1) + await ethPrefundedUser.transferErc(HOME_BRIDGE_ADDRESS, 1000) }) }) From a6354fd536fbf646f5a20bfe5ffc34e0f4519188 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Wed, 6 Nov 2019 09:03:32 +0300 Subject: [PATCH 069/129] Increased prefunding amount for bridge and users --- .circleci/config.yml | 4 ++-- tests/init.sh | 4 ++-- tests/test/index.js | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0160b08..b20acda 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -151,7 +151,7 @@ jobs: name: "Run dev environment, deploy contracts, prefund accounts" command: | BLOCK_TIME=3 ./demo/start-environment.sh - cat ./tests/config.json | jq .users[].ethAddress | xargs -I {} ./src/test-services/ethereumSend/run.sh {} 100 + cat ./tests/config.json | jq .users[].ethAddress | xargs -I {} ./src/test-services/ethereumSend/run.sh {} 300 - run: name: "Stop dev environment" command: docker kill ganache_side ganache_home @@ -160,7 +160,7 @@ jobs: name: "Prefund bnc addresses" command: | echo "FOREIGN_PRIVATE_KEY=$FOREIGN_PRIVATE_KEY" > ./src/test-services/.keys.$TARGET_NETWORK - cat ./tests/config.json | jq .users[].bncAddress | xargs -I {} ./src/test-services/binanceSend/run.sh {} 100 0.1 + cat ./tests/config.json | jq .users[].bncAddress | xargs -I {} ./src/test-services/binanceSend/run.sh {} 300 0.1 run_tests: executor: bridge/node-dev steps: diff --git a/tests/init.sh b/tests/init.sh index 08a506c..d459a22 100755 --- a/tests/init.sh +++ b/tests/init.sh @@ -7,8 +7,8 @@ docker build -t tss ./src/tss ./demo/start-environment.sh -cat ./tests/config.json | jq .users[].ethAddress | xargs -I {} ./src/test-services/ethereumSend/run.sh {} 100 -cat ./tests/config.json | jq .users[].bncAddress | xargs -I {} ./src/test-services/binanceSend/run.sh {} 100 0.1 +cat ./tests/config.json | jq .users[].ethAddress | xargs -I {} ./src/test-services/ethereumSend/run.sh {} 300 +cat ./tests/config.json | jq .users[].bncAddress | xargs -I {} ./src/test-services/binanceSend/run.sh {} 300 0.1 N=1 ./demo/validator-demo.sh -d N=2 ./demo/validator-demo.sh -d diff --git a/tests/test/index.js b/tests/test/index.js index 03d3131..7f440c4 100644 --- a/tests/test/index.js +++ b/tests/test/index.js @@ -48,11 +48,11 @@ describe('bridge tests', function () { for (let i = 0; i < 3; i += 1) { const userEthBalance = await users[i].getEthBalance() - assert.ok(userEthBalance >= 0.3, `Insufficient ETH balance on ${users[i].ethAddress} in Ethereum network, expected 0.3 ETH, got ${userEthBalance}`) + assert.ok(userEthBalance >= 0.1, `Insufficient ETH balance on ${users[i].ethAddress} in Ethereum network, expected 0.1 ETH, got ${userEthBalance}`) const userErcBalance = await users[i].getErcBalance() assert.ok(userErcBalance >= 200, `Insufficient ERC20 balance on ${users[i].ethAddress} in Ethereum network, expected 200 ERC20, got ${userErcBalance}`) const userBnbBalance = await users[i].getBepBalance() - assert.ok(userBnbBalance >= 0.2, `Insufficient BNB balance on ${users[i].bncAddress} in Binance network, expected 0.2 BNB, got ${userBnbBalance}`) + assert.ok(userBnbBalance >= 0.1, `Insufficient BNB balance on ${users[i].bncAddress} in Binance network, expected 0.1 BNB, got ${userBnbBalance}`) const userBepBalance = await users[i].getBepBalance() assert.ok(userErcBalance >= 200, `Insufficient BEP2 balance on ${users[i].bncAddress} in Binance network, expected 200 ${FOREIGN_ASSET}, got ${userBepBalance}`) } From 6ea6df820c26c0e8219fbb414f988f4a9d081e25 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Wed, 6 Nov 2019 09:27:59 +0300 Subject: [PATCH 070/129] Retrying api request on timeout exceeded in tests --- tests/test/utils/bncController.js | 10 +++++----- tests/test/utils/proxyController.js | 14 ++++++++------ 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/tests/test/utils/bncController.js b/tests/test/utils/bncController.js index d1c9122..bb2ca86 100644 --- a/tests/test/utils/bncController.js +++ b/tests/test/utils/bncController.js @@ -6,22 +6,22 @@ const { FOREIGN_URL, FOREIGN_ASSET } = process.env const bnc = axios.create({ baseURL: FOREIGN_URL, - timeout: 15000 + timeout: 10000 }) module.exports = { async getBnbBalance(address) { - const response = await retry(() => bnc.get(`/api/v1/account/${address}`), 5) - const tokens = response.data.balances.find((x) => x.symbol === FOREIGN_ASSET) + const response = await retry(() => bnc.get(`/api/v1/account/${address}`)) + const tokens = response.data.balances.find((x) => x.symbol === 'BNB') return response && tokens ? parseFloat(tokens.free) : 0 }, async getBepBalance(address) { - const response = await retry(() => bnc.get(`/api/v1/account/${address}`), 5) + const response = await retry(() => bnc.get(`/api/v1/account/${address}`)) const tokens = response.data.balances.find((x) => x.symbol === FOREIGN_ASSET) return response && tokens ? parseFloat(tokens.free) : 0 }, async getBncSequence(address) { - const response = await retry(() => bnc.get(`/api/v1/account/${address}/sequence`), 5) + const response = await retry(() => bnc.get(`/api/v1/account/${address}/sequence`)) return response ? response.data.sequence : 0 } } diff --git a/tests/test/utils/proxyController.js b/tests/test/utils/proxyController.js index 6e3fc5c..13d03c0 100644 --- a/tests/test/utils/proxyController.js +++ b/tests/test/utils/proxyController.js @@ -1,5 +1,7 @@ const axios = require('axios') +const {retry} = require('./wait') + function createController(validatorId) { const url = `http://validator${validatorId}_proxy_1:8002/` @@ -10,22 +12,22 @@ function createController(validatorId) { return { async getInfo() { - return (await proxy.get('/info')).data + return (await retry(() => proxy.get('/info'))).data }, async voteStartVoting() { - return (await proxy.get('/vote/startVoting')).data + return (await retry(() => proxy.get('/vote/startVoting'))).data }, async voteStartKeygen() { - return (await proxy.get('/vote/startKeygen')).data + return (await retry(() => proxy.get('/vote/startKeygen'))).data }, async voteAddValidator(validatorAddress) { - return (await proxy.get(`/vote/addValidator/${validatorAddress}`)).data + return (await retry(() => proxy.get(`/vote/addValidator/${validatorAddress}`))).data }, async voteRemoveValidator(validatorAddress) { - return (await proxy.get(`/vote/removeValidator/${validatorAddress}`)).data + return (await retry(() => proxy.get(`/vote/removeValidator/${validatorAddress}`))).data }, async voteChangeThreshold(threshold) { - return (await proxy.get(`/vote/changeThreshold/${threshold}`)).data + return (await retry(() => proxy.get(`/vote/changeThreshold/${threshold}`))).data } } } From 37a5c1e9893b5a9d3da69d5005ef5cc22f79ac68 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Thu, 7 Nov 2019 17:06:12 +0300 Subject: [PATCH 071/129] Made bnc watcher fetch policy to be dependent on eth block timestamps --- demo/validator1/.env.development | 2 +- demo/validator1/.env.staging | 2 +- demo/validator2/.env.development | 2 +- demo/validator2/.env.staging | 2 +- demo/validator3/.env.development | 2 +- demo/validator3/.env.staging | 2 +- src/deploy/deploy-home/contracts/Bridge.sol | 18 ++- src/oracle/bncWatcher/Dockerfile | 2 +- src/oracle/bncWatcher/bncWatcher.js | 143 +++++++++++++++----- src/oracle/bncWatcher/package.json | 1 + src/oracle/docker-compose-test.yml | 2 +- src/oracle/docker-compose.yml | 2 +- src/oracle/ethWatcher/ethWatcher.js | 45 +++++- src/oracle/shared/.eslintrc | 9 ++ src/oracle/shared/amqp.js | 11 +- src/oracle/tss-keygen/keygen.js | 1 - src/oracle/tss-sign/signer.js | 3 +- tests/test/utils/proxyController.js | 2 +- 18 files changed, 189 insertions(+), 62 deletions(-) create mode 100644 src/oracle/shared/.eslintrc diff --git a/demo/validator1/.env.development b/demo/validator1/.env.development index 183da5a..6335b08 100644 --- a/demo/validator1/.env.development +++ b/demo/validator1/.env.development @@ -10,7 +10,7 @@ SIDE_SHARED_DB_ADDRESS=0xd5fE0D28e058D375b0b038fFbB446Da37E85fFdc FOREIGN_URL=https://testnet-dex.binance.org/ FOREIGN_CHAIN_ID=Binance-Chain-Nile FOREIGN_ASSET=KFT-94F -FOREIGN_START_TIME=1572500000000 +FOREIGN_FETCH_MAX_TIME_INTERVAL=60000 FOREIGN_FETCH_INTERVAL=5000 FOREIGN_FETCH_BLOCK_TIME_OFFSET=10000 diff --git a/demo/validator1/.env.staging b/demo/validator1/.env.staging index 2bd353f..83a0313 100644 --- a/demo/validator1/.env.staging +++ b/demo/validator1/.env.staging @@ -10,7 +10,7 @@ SIDE_SHARED_DB_ADDRESS=0xda9a1cA2Fcb18cAB02934269369627D2b4ea8902 FOREIGN_URL=https://testnet-dex.binance.org/ FOREIGN_CHAIN_ID=Binance-Chain-Nile FOREIGN_ASSET=KFT-94F -FOREIGN_START_TIME=1572500000000 +FOREIGN_FETCH_MAX_TIME_INTERVAL=60000 FOREIGN_FETCH_INTERVAL=5000 FOREIGN_FETCH_BLOCK_TIME_OFFSET=10000 diff --git a/demo/validator2/.env.development b/demo/validator2/.env.development index 491d22f..305ec1d 100644 --- a/demo/validator2/.env.development +++ b/demo/validator2/.env.development @@ -10,7 +10,7 @@ SIDE_SHARED_DB_ADDRESS=0xd5fE0D28e058D375b0b038fFbB446Da37E85fFdc FOREIGN_URL=https://testnet-dex.binance.org/ FOREIGN_CHAIN_ID=Binance-Chain-Nile FOREIGN_ASSET=KFT-94F -FOREIGN_START_TIME=1572500000000 +FOREIGN_FETCH_MAX_TIME_INTERVAL=60000 FOREIGN_FETCH_INTERVAL=5000 FOREIGN_FETCH_BLOCK_TIME_OFFSET=10000 diff --git a/demo/validator2/.env.staging b/demo/validator2/.env.staging index ed88661..94c04a1 100644 --- a/demo/validator2/.env.staging +++ b/demo/validator2/.env.staging @@ -10,7 +10,7 @@ SIDE_SHARED_DB_ADDRESS=0xda9a1cA2Fcb18cAB02934269369627D2b4ea8902 FOREIGN_URL=https://testnet-dex.binance.org/ FOREIGN_CHAIN_ID=Binance-Chain-Nile FOREIGN_ASSET=KFT-94F -FOREIGN_START_TIME=1572500000000 +FOREIGN_FETCH_MAX_TIME_INTERVAL=60000 FOREIGN_FETCH_INTERVAL=5000 FOREIGN_FETCH_BLOCK_TIME_OFFSET=10000 diff --git a/demo/validator3/.env.development b/demo/validator3/.env.development index 014db1a..7025ee3 100644 --- a/demo/validator3/.env.development +++ b/demo/validator3/.env.development @@ -10,7 +10,7 @@ SIDE_SHARED_DB_ADDRESS=0xd5fE0D28e058D375b0b038fFbB446Da37E85fFdc FOREIGN_URL=https://testnet-dex.binance.org/ FOREIGN_CHAIN_ID=Binance-Chain-Nile FOREIGN_ASSET=KFT-94F -FOREIGN_START_TIME=1572500000000 +FOREIGN_FETCH_MAX_TIME_INTERVAL=60000 FOREIGN_FETCH_INTERVAL=5000 FOREIGN_FETCH_BLOCK_TIME_OFFSET=10000 diff --git a/demo/validator3/.env.staging b/demo/validator3/.env.staging index a1e5fef..458974f 100644 --- a/demo/validator3/.env.staging +++ b/demo/validator3/.env.staging @@ -10,7 +10,7 @@ SIDE_SHARED_DB_ADDRESS=0xda9a1cA2Fcb18cAB02934269369627D2b4ea8902 FOREIGN_URL=https://testnet-dex.binance.org/ FOREIGN_CHAIN_ID=Binance-Chain-Nile FOREIGN_ASSET=KFT-94F -FOREIGN_START_TIME=1572500000000 +FOREIGN_FETCH_MAX_TIME_INTERVAL=60000 FOREIGN_FETCH_INTERVAL=5000 FOREIGN_FETCH_BLOCK_TIME_OFFSET=10000 diff --git a/src/deploy/deploy-home/contracts/Bridge.sol b/src/deploy/deploy-home/contracts/Bridge.sol index c424563..63ce4e1 100644 --- a/src/deploy/deploy-home/contracts/Bridge.sol +++ b/src/deploy/deploy-home/contracts/Bridge.sol @@ -4,6 +4,7 @@ import './openzeppelin-solidity/contracts/token/ERC20/IERC20.sol'; contract Bridge { event ExchangeRequest(uint value, uint nonce); + event EpochEnd(uint indexed epoch); event NewEpoch(uint indexed oldEpoch, uint indexed newEpoch); event NewEpochCancelled(uint indexed epoch); event NewFundsTransfer(uint indexed oldEpoch, uint indexed newEpoch); @@ -14,6 +15,7 @@ contract Bridge { uint threshold; uint rangeSize; uint startBlock; + uint endBlock; uint nonce; uint x; uint y; @@ -65,7 +67,16 @@ contract Bridge { status = Status.KEYGEN; nextEpoch = 1; - states[nextEpoch] = State(validators, threshold, rangeSize, 0, uint(-1), 0, 0); + states[nextEpoch] = State({ + validators : validators, + threshold : threshold, + rangeSize : rangeSize, + startBlock : 0, + endBlock : uint(-1), + nonce : uint(-1), + x : 0, + y : 0 + }); minTxLimit = limits[0]; maxTxLimit = limits[1]; @@ -133,7 +144,7 @@ contract Bridge { if (nextEpoch == 1) { status = Status.READY; states[nextEpoch].startBlock = block.number; - states[nextEpoch].nonce = uint(-1); + states[nextEpoch].nonce = uint(- 1); epoch = nextEpoch; emit EpochStart(epoch, x, y); } @@ -246,9 +257,12 @@ contract Bridge { if (tryVote(Vote.START_VOTING, epoch)) { nextEpoch++; status = Status.VOTING; + states[nextEpoch].endBlock = block.number; states[nextEpoch].threshold = getThreshold(); states[nextEpoch].validators = getValidators(); states[nextEpoch].rangeSize = getRangeSize(); + + emit EpochEnd(epoch); } } diff --git a/src/oracle/bncWatcher/Dockerfile b/src/oracle/bncWatcher/Dockerfile index 104556b..af9ce69 100644 --- a/src/oracle/bncWatcher/Dockerfile +++ b/src/oracle/bncWatcher/Dockerfile @@ -9,6 +9,6 @@ COPY ./bncWatcher/package.json /watcher/ RUN npm install -COPY ./bncWatcher/bncWatcher.js ./shared/db.js ./shared/logger.js ./shared/crypto.js ./shared/wait.js /watcher/ +COPY ./bncWatcher/bncWatcher.js ./shared/db.js ./shared/logger.js ./shared/crypto.js ./shared/amqp.js ./shared/wait.js /watcher/ ENTRYPOINT ["node", "bncWatcher.js"] diff --git a/src/oracle/bncWatcher/bncWatcher.js b/src/oracle/bncWatcher/bncWatcher.js index 966d159..1320e43 100644 --- a/src/oracle/bncWatcher/bncWatcher.js +++ b/src/oracle/bncWatcher/bncWatcher.js @@ -7,25 +7,30 @@ const logger = require('./logger') const redis = require('./db') const { publicKeyToAddress } = require('./crypto') const { delay, retry } = require('./wait') +const { connectRabbit, assertQueue } = require('./amqp') -const { FOREIGN_URL, PROXY_URL, FOREIGN_ASSET } = process.env +const { + FOREIGN_URL, PROXY_URL, FOREIGN_ASSET, RABBITMQ_URL +} = process.env -const FOREIGN_START_TIME = parseInt(process.env.FOREIGN_START_TIME, 10) const FOREIGN_FETCH_INTERVAL = parseInt(process.env.FOREIGN_FETCH_INTERVAL, 10) const FOREIGN_FETCH_BLOCK_TIME_OFFSET = parseInt(process.env.FOREIGN_FETCH_BLOCK_TIME_OFFSET, 10) +const FOREIGN_FETCH_MAX_TIME_INTERVAL = parseInt(process.env.FOREIGN_FETCH_MAX_TIME_INTERVAL, 10) const foreignHttpClient = axios.create({ baseURL: FOREIGN_URL }) const proxyHttpClient = axios.create({ baseURL: PROXY_URL }) -function getLastForeignAddress() { - const epoch = Math.max(0, ...fs.readdirSync('/keys') - .map((x) => parseInt(x.split('.')[0].substr(4), 10))) - if (epoch === 0) { +let channel +let epochTimeIntervalsQueue + +function getForeignAddress(epoch) { + const keysFile = `/keys/keys${epoch}.store` + try { + const publicKey = JSON.parse(fs.readFileSync(keysFile))[5] + return publicKeyToAddress(publicKey) + } catch (e) { return null } - const keysFile = `/keys/keys${epoch}.store` - const publicKey = JSON.parse(fs.readFileSync(keysFile))[5] - return publicKeyToAddress(publicKey) } async function getTx(hash) { @@ -45,15 +50,8 @@ async function getBlockTime() { return Date.parse(response.data.block_time) - FOREIGN_FETCH_BLOCK_TIME_OFFSET } -async function fetchNewTransactions() { +async function fetchNewTransactions(address, startTime, endTime) { logger.debug('Fetching new transactions') - const startTime = parseInt(await redis.get('foreignTime'), 10) + 1 - const address = getLastForeignAddress() - const endTime = Math.min(startTime + 3 * 30 * 24 * 60 * 60 * 1000, await getBlockTime()) - if (address === null) { - return {} - } - logger.debug('Sending api transactions request') const params = { address, side: 'RECEIVE', @@ -63,27 +61,101 @@ async function fetchNewTransactions() { endTime } - logger.trace('%o', params) - const transactions = (await retry(() => foreignHttpClient - .get('/api/v1/transactions', { params }))).data.tx + logger.trace('Transactions fetch params %o', params) + return ( + await retry(() => foreignHttpClient.get('/api/v1/transactions', { params })) + ).data.tx +} +async function fetchTimeIntervalsQueue() { + let epoch = null + let startTime = null + let endTime = null + const lastBncBlockTime = await getBlockTime() + logger.trace(`Binance last block timestamp ${lastBncBlockTime}`) + while (true) { + const msg = await epochTimeIntervalsQueue.get() + if (msg === false) { + break + } + const data = JSON.parse(msg.content) + logger.trace('Consumed time interval event %o', data) + if (epoch !== null && epoch !== data.epoch) { + logger.warn('Two consequently events have different epochs, should not be like this') + channel.nack(msg, false, true) + break + } + if (data.startTime) { + logger.trace('Set foreign time', data) + await redis.set(`foreignTime${data.epoch}`, data.startTime) + channel.ack(msg) + break + } + if (epoch === null) { + epoch = data.epoch + startTime = await redis.get(`foreignTime${epoch}`) + logger.trace(`Retrieved epoch ${epoch} and start time ${startTime} from redis`) + if (startTime === null) { + logger.warn(`Empty foreign time for epoch ${epoch}`) + } + } /* + if (data.endTime) { + if (data.endTime - startTime < FOREIGN_FETCH_MAX_TIME_INTERVAL + && data.endTime < lastBncBlockTime) { + endTime = data.endTime + channel.ack(msg) + } else { + logger.trace('Requeuing current queue message') + channel.nack(msg, false, true) + } + break + } */ + if (data.prolongedTime - startTime < FOREIGN_FETCH_MAX_TIME_INTERVAL + && data.prolongedTime < lastBncBlockTime) { + endTime = data.prolongedTime + channel.ack(msg) + } else { + logger.trace('Requeuing current queue message') + channel.nack(msg, false, true) + break + } + } return { - transactions, + epoch, + startTime, endTime } } async function initialize() { - if (await redis.get('foreignTime') === null) { - logger.info('Set default foreign time') - await redis.set('foreignTime', FOREIGN_START_TIME) - } + channel = await connectRabbit(RABBITMQ_URL) + logger.info('Connecting to epoch time intervals queue') + epochTimeIntervalsQueue = await assertQueue(channel, 'epochTimeIntervalsQueue') } async function loop() { - const { transactions, endTime } = await fetchNewTransactions() - if (!transactions || transactions.length === 0) { + const { epoch, startTime, endTime } = await fetchTimeIntervalsQueue() + + if (!startTime || !endTime) { + logger.debug('Nothing to fetch') + await delay(FOREIGN_FETCH_INTERVAL) + return + } + + const address = getForeignAddress(epoch) + + if (!address) { + logger.debug('Validator is not included in current epoch') + await redis.set(`foreignTime${epoch}`, endTime) + await delay(FOREIGN_FETCH_INTERVAL) + return + } + + const transactions = await fetchNewTransactions(address, startTime, endTime) + + if (transactions.length === 0) { logger.debug('Found 0 new transactions') + await redis.set(`foreignTime${epoch}`, endTime) await delay(FOREIGN_FETCH_INTERVAL) return } @@ -95,17 +167,16 @@ async function loop() { const tx = transactions[i] if (tx.memo !== 'funding') { const publicKeyEncoded = (await getTx(tx.txHash)).signatures[0].pub_key.value - await proxyHttpClient - .post('/transfer', { - to: computeAddress(Buffer.from(publicKeyEncoded, 'base64')), - value: new BN(tx.value) - .multipliedBy(10 ** 18) - .integerValue(), - hash: `0x${tx.txHash}` - }) + await proxyHttpClient.post('/transfer', { + to: computeAddress(Buffer.from(publicKeyEncoded, 'base64')), + value: new BN(tx.value) + .multipliedBy(10 ** 18) + .integerValue(), + hash: `0x${tx.txHash}` + }) } } - await redis.set('foreignTime', endTime) + await redis.set(`foreignTime${epoch}`, endTime) } async function main() { diff --git a/src/oracle/bncWatcher/package.json b/src/oracle/bncWatcher/package.json index 721ea33..08a6559 100644 --- a/src/oracle/bncWatcher/package.json +++ b/src/oracle/bncWatcher/package.json @@ -2,6 +2,7 @@ "name": "watcher", "version": "0.0.1", "dependencies": { + "amqplib": "0.5.3", "ioredis": "4.10.0", "axios": "0.19.0", "bech32": "1.1.3", diff --git a/src/oracle/docker-compose-test.yml b/src/oracle/docker-compose-test.yml index 3286cba..8c7a4b0 100644 --- a/src/oracle/docker-compose-test.yml +++ b/src/oracle/docker-compose-test.yml @@ -103,7 +103,7 @@ services: - FOREIGN_ASSET - 'RABBITMQ_URL=amqp://rabbitmq:5672' - 'PROXY_URL=http://proxy:8001' - - FOREIGN_START_TIME + - FOREIGN_FETCH_MAX_TIME_INTERVAL - FOREIGN_FETCH_INTERVAL - FOREIGN_FETCH_BLOCK_TIME_OFFSET - LOG_LEVEL diff --git a/src/oracle/docker-compose.yml b/src/oracle/docker-compose.yml index 3463f2b..38f56f7 100644 --- a/src/oracle/docker-compose.yml +++ b/src/oracle/docker-compose.yml @@ -112,7 +112,7 @@ services: - FOREIGN_ASSET - 'RABBITMQ_URL=amqp://rabbitmq:5672' - 'PROXY_URL=http://proxy:8001' - - FOREIGN_START_TIME + - FOREIGN_FETCH_MAX_TIME_INTERVAL - FOREIGN_FETCH_INTERVAL - FOREIGN_FETCH_BLOCK_TIME_OFFSET - LOG_LEVEL diff --git a/src/oracle/ethWatcher/ethWatcher.js b/src/oracle/ethWatcher/ethWatcher.js index f770fda..813ff0b 100644 --- a/src/oracle/ethWatcher/ethWatcher.js +++ b/src/oracle/ethWatcher/ethWatcher.js @@ -16,6 +16,7 @@ const HOME_MAX_FETCH_RANGE_SIZE = parseInt(process.env.HOME_MAX_FETCH_RANGE_SIZE const provider = new ethers.providers.JsonRpcProvider(HOME_RPC_URL) const bridgeAbi = [ 'event ExchangeRequest(uint value, uint nonce)', + 'event EpochEnd(uint indexed epoch)', 'event NewEpoch(uint indexed oldEpoch, uint indexed newEpoch)', 'event NewEpochCancelled(uint indexed epoch)', 'event NewFundsTransfer(uint indexed oldEpoch, uint indexed newEpoch)', @@ -34,6 +35,7 @@ let exchangeQueue let signQueue let keygenQueue let cancelKeygenQueue +let epochTimeIntervalsQueue let chainId let blockNumber let epoch @@ -42,6 +44,11 @@ let redisTx let rangeSize let lastTransactionBlockNumber let isCurrentValidator +let activeEpoch + +async function getBlockTimestamp(n) { + return (await provider.getBlock(n, false)).timestamp +} async function resetFutureMessages(queue) { logger.debug(`Resetting future messages in queue ${queue.name}`) @@ -169,8 +176,7 @@ async function processEpochStart(event) { epochStart = blockNumber logger.info(`Epoch ${epoch} started`) rangeSize = (await bridge.getRangeSize()).toNumber() - isCurrentValidator = (await bridge.getValidators()) - .includes(validatorAddress) + isCurrentValidator = (await bridge.getValidators()).includes(validatorAddress) if (isCurrentValidator) { logger.info(`${validatorAddress} is a current validator`) } else { @@ -186,6 +192,9 @@ async function initialize() { signQueue = await assertQueue(channel, 'signQueue') keygenQueue = await assertQueue(channel, 'keygenQueue') cancelKeygenQueue = await assertQueue(channel, 'cancelKeygenQueue') + epochTimeIntervalsQueue = await assertQueue(channel, 'epochTimeIntervalsQueue') + + activeEpoch = !!(await redis.get('activeEpoch')) chainId = (await provider.getNetwork()).chainId @@ -228,6 +237,7 @@ async function initialize() { await resetFutureMessages(cancelKeygenQueue) await resetFutureMessages(exchangeQueue) await resetFutureMessages(signQueue) + await resetFutureMessages(epochTimeIntervalsQueue) logger.debug('Sending start commands') await axios.get('http://keygen:8001/start') await axios.get('http://signer:8001/start') @@ -255,9 +265,11 @@ async function loop() { })) for (let curBlockNumber = blockNumber, i = 0; curBlockNumber <= endBlock; curBlockNumber += 1) { + let epochTimeUpdated = false + const curBlockTimestamp = await getBlockTimestamp(curBlockNumber) while (i < bridgeEvents.length && bridgeEvents[i].blockNumber === curBlockNumber) { const event = bridge.interface.parseLog(bridgeEvents[i]) - logger.debug('%o %o', event, bridgeEvents[i]) + logger.trace('Consumed event %o %o', event, bridgeEvents[i]) switch (event.name) { case 'NewEpoch': await sendKeygen(event) @@ -277,12 +289,39 @@ async function loop() { break case 'EpochStart': await processEpochStart(event) + await redis.set('activeEpoch', true) + activeEpoch = true + epochTimeIntervalsQueue.send({ + blockNumber: curBlockNumber, + startTime: curBlockTimestamp * 1000, + epoch + }) + epochTimeUpdated = true + break + case 'EpochEnd': + logger.debug(`Consumed epoch ${epoch} end event`) + await redis.set('activeEpoch', false) + activeEpoch = false + epochTimeIntervalsQueue.send({ + blockNumber: curBlockNumber, + prolongedTime: curBlockTimestamp * 1000, + epoch + }) break default: logger.warn('Unknown event %o', event) } i += 1 } + + if (!epochTimeUpdated && epoch > 0 && activeEpoch) { + epochTimeIntervalsQueue.send({ + blockNumber: curBlockNumber, + prolongedTime: curBlockTimestamp * 1000, + epoch + }) + } + if ((curBlockNumber + 1 - epochStart) % rangeSize === 0) { logger.info('Reached end of the current block range') diff --git a/src/oracle/shared/.eslintrc b/src/oracle/shared/.eslintrc new file mode 100644 index 0000000..54d0153 --- /dev/null +++ b/src/oracle/shared/.eslintrc @@ -0,0 +1,9 @@ +{ + "extends": [ + "../../../.eslintrc" + ], + "rules": { + "import/no-extraneous-dependencies": 0, + "node/no-extraneous-require": 0 + } +} diff --git a/src/oracle/shared/amqp.js b/src/oracle/shared/amqp.js index e6a88d9..e05c37f 100644 --- a/src/oracle/shared/amqp.js +++ b/src/oracle/shared/amqp.js @@ -1,16 +1,11 @@ const amqp = require('amqplib') const logger = require('./logger') +const { retry } = require('./wait') async function connectRabbit(url) { - while (true) { - try { - return (await amqp.connect(url)).createChannel() - } catch (e) { - logger.debug('Failed to connect to rabbitmqServer, reconnecting') - await new Promise((resolve) => setTimeout(resolve, 2000)) - } - } + logger.info('Connecting to RabbitMQ server') + return (await retry(() => amqp.connect(url))).createChannel() } async function assertQueue(channel, name) { diff --git a/src/oracle/tss-keygen/keygen.js b/src/oracle/tss-keygen/keygen.js index 2315936..0f16b9e 100644 --- a/src/oracle/tss-keygen/keygen.js +++ b/src/oracle/tss-keygen/keygen.js @@ -19,7 +19,6 @@ async function confirmKeygen(keysFile) { } async function main() { - logger.info('Connecting to RabbitMQ server') const channel = await connectRabbit(RABBITMQ_URL) logger.info('Connecting to epoch events queue') const keygenQueue = await assertQueue(channel, 'keygenQueue') diff --git a/src/oracle/tss-sign/signer.js b/src/oracle/tss-sign/signer.js index b23ce4f..1b89ae5 100644 --- a/src/oracle/tss-sign/signer.js +++ b/src/oracle/tss-sign/signer.js @@ -130,7 +130,7 @@ function sign(keysFile, hash, tx, publicKey, signerAddress) { let nonceInterrupt = false return new Promise((resolve) => { const cmd = exec.execFile('./sign-entrypoint.sh', [PROXY_URL, keysFile, hash], async (error) => { - logger.debug('%o', error) + logger.trace('Sign entrypoint exited, %o', error) clearInterval(nonceDaemonIntervalId) clearTimeout(restartTimeoutId) if (fs.existsSync('signature')) { // if signature was generated @@ -195,7 +195,6 @@ function sign(keysFile, hash, tx, publicKey, signerAddress) { } async function main() { - logger.info('Connecting to RabbitMQ server') channel = await connectRabbit(RABBITMQ_URL) logger.info('Connecting to signature events queue') exchangeQueue = await assertQueue(channel, 'exchangeQueue') diff --git a/tests/test/utils/proxyController.js b/tests/test/utils/proxyController.js index 13d03c0..3dac478 100644 --- a/tests/test/utils/proxyController.js +++ b/tests/test/utils/proxyController.js @@ -1,6 +1,6 @@ const axios = require('axios') -const {retry} = require('./wait') +const { retry } = require('./wait') function createController(validatorId) { const url = `http://validator${validatorId}_proxy_1:8002/` From d00d78ec6c379b1def8b07ca87b71577e84e7ae6 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Fri, 8 Nov 2019 11:38:53 +0300 Subject: [PATCH 072/129] Created initial docker configurations for running dev binance testnet inside test environment --- src/binance-testnet/api-server/Dockerfile | 11 +++++++ src/binance-testnet/api-server/index.js | 12 +++++++ src/binance-testnet/api-server/package.json | 11 +++++++ src/binance-testnet/docker-compose.yml | 21 +++++++++++++ src/binance-testnet/run.sh | 6 ++++ src/binance-testnet/testnet/Dockerfile | 35 +++++++++++++++++++++ src/oracle/docker-compose-test.yml | 4 +-- src/oracle/docker-compose.yml | 4 +-- 8 files changed, 100 insertions(+), 4 deletions(-) create mode 100644 src/binance-testnet/api-server/Dockerfile create mode 100644 src/binance-testnet/api-server/index.js create mode 100644 src/binance-testnet/api-server/package.json create mode 100644 src/binance-testnet/docker-compose.yml create mode 100755 src/binance-testnet/run.sh create mode 100644 src/binance-testnet/testnet/Dockerfile diff --git a/src/binance-testnet/api-server/Dockerfile b/src/binance-testnet/api-server/Dockerfile new file mode 100644 index 0000000..885fdc2 --- /dev/null +++ b/src/binance-testnet/api-server/Dockerfile @@ -0,0 +1,11 @@ +FROM node:10.16.0-alpine + +WORKDIR /api-server + +COPY ./package.json ./ + +RUN npm install + +COPY ./index.js ./ + +ENTRYPOINT ["node", "./index.js"] diff --git a/src/binance-testnet/api-server/index.js b/src/binance-testnet/api-server/index.js new file mode 100644 index 0000000..fad99a8 --- /dev/null +++ b/src/binance-testnet/api-server/index.js @@ -0,0 +1,12 @@ +const fs = require('fs') +const express = require('express') + +const app = express() + +app.get('/', (req, res) => { + res.send(fs.readFileSync('./marketdata/marketdata.json').toString()) +}) + +app.listen(8000, () => { + console.log('Listening on port 8000') +}) diff --git a/src/binance-testnet/api-server/package.json b/src/binance-testnet/api-server/package.json new file mode 100644 index 0000000..0be9173 --- /dev/null +++ b/src/binance-testnet/api-server/package.json @@ -0,0 +1,11 @@ +{ + "name": "api-server", + "version": "0.0.1", + "dependencies": { + "express": "4.17.1", + "axios": "0.19.0" + }, + "engines": { + "node": ">=10.6.0" + } +} diff --git a/src/binance-testnet/docker-compose.yml b/src/binance-testnet/docker-compose.yml new file mode 100644 index 0000000..a90d997 --- /dev/null +++ b/src/binance-testnet/docker-compose.yml @@ -0,0 +1,21 @@ +version: '3.0' +services: + testnet: + build: ./testnet + image: bnc-testnet + volumes: + - 'marketdata:/root/.bnbchaind/marketdata' + api-server: + build: ./api-server + image: bnc-api-server + networks: + - binance_net + ports: + - '8000:8000' + volumes: + - 'marketdata:/api-server/marketdata' +networks: + binance_net: + external: true +volumes: + marketdata: diff --git a/src/binance-testnet/run.sh b/src/binance-testnet/run.sh new file mode 100755 index 0000000..f1191a9 --- /dev/null +++ b/src/binance-testnet/run.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +set -e + +docker network create binance_net > /dev/null 2>&1 || true +docker-compose up --build diff --git a/src/binance-testnet/testnet/Dockerfile b/src/binance-testnet/testnet/Dockerfile new file mode 100644 index 0000000..a7425b5 --- /dev/null +++ b/src/binance-testnet/testnet/Dockerfile @@ -0,0 +1,35 @@ +FROM ubuntu:19.10 as build + +ARG BNC_VERSION=0.6.2 + +RUN apt-get update && \ + apt-get install -y git git-lfs + +WORKDIR /binaries + +RUN GIT_LFS_SKIP_SMUDGE=1 git clone --depth 1 https://github.com/binance-chain/node-binary.git . + +RUN git lfs pull -I fullnode/testnet/${BNC_VERSION}/linux +RUN git lfs pull -I cli/testnet/${BNC_VERSION}/linux + +RUN ./fullnode/testnet/${BNC_VERSION}/linux/bnbchaind testnet --acc-prefix tbnb --chain-id Binance-Dev --v 1 + +RUN sed -i "s/publishTransfer = false/publishTransfer = true/" ./mytestnet/node0/gaiad/config/app.toml && \ + sed -i "s/publishLocal = false/publishLocal = true/" ./mytestnet/node0/gaiad/config/app.toml + +#echo 12345678 | docker exec -i 5f6f653730442d81b6e34a82ac3dc8a82f071c1eec130bc09a0dca803ad00bd2 ./tbnbcli send --to tbnb1efjg7xt98t67ql2cmwjc5860lgayet9l8m55ym --amount 100:BNB --from node0 --chain-id Binance-Dev --json + +FROM alpine:3.9.4 + +ARG BNC_VERSION=0.6.2 + +WORKDIR /bnc + +COPY --from=build /binaries/fullnode/testnet/${BNC_VERSION}/linux/bnbchaind ./ +COPY --from=build /binaries/cli/testnet/${BNC_VERSION}/linux/tbnbcli ./ +COPY --from=build /binaries/mytestnet/node0/gaiacli /root/.bnbcli +COPY --from=build /binaries/mytestnet/node0/gaiad /root/.bnbchaind + +EXPOSE 26657 + +ENTRYPOINT ["./bnbchaind", "start"] diff --git a/src/oracle/docker-compose-test.yml b/src/oracle/docker-compose-test.yml index 8c7a4b0..d331ee7 100644 --- a/src/oracle/docker-compose-test.yml +++ b/src/oracle/docker-compose-test.yml @@ -15,8 +15,8 @@ services: - FOREIGN_URL - FOREIGN_ASSET - LOG_LEVEL - - "GAS_LIMIT_FACTOR=3" - - "MAX_GAS_LIMIT=6000000" + - 'GAS_LIMIT_FACTOR=3' + - 'MAX_GAS_LIMIT=6000000' ports: - '${VOTES_PROXY_PORT}:8002' networks: diff --git a/src/oracle/docker-compose.yml b/src/oracle/docker-compose.yml index 38f56f7..2867def 100644 --- a/src/oracle/docker-compose.yml +++ b/src/oracle/docker-compose.yml @@ -15,8 +15,8 @@ services: - FOREIGN_URL - FOREIGN_ASSET - LOG_LEVEL - - "GAS_LIMIT_FACTOR=3" - - "MAX_GAS_LIMIT=6000000" + - 'GAS_LIMIT_FACTOR=3' + - 'MAX_GAS_LIMIT=6000000' ports: - '${VOTES_PROXY_PORT}:8002' networks: From 64e4d5e9f167ac970ebfab007fbdb355a8fdb20a Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Fri, 8 Nov 2019 11:42:56 +0300 Subject: [PATCH 073/129] Added network for node rpc communication --- src/binance-testnet/docker-compose.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/binance-testnet/docker-compose.yml b/src/binance-testnet/docker-compose.yml index a90d997..c923940 100644 --- a/src/binance-testnet/docker-compose.yml +++ b/src/binance-testnet/docker-compose.yml @@ -3,6 +3,8 @@ services: testnet: build: ./testnet image: bnc-testnet + networks: + - binance_rpc_net volumes: - 'marketdata:/root/.bnbchaind/marketdata' api-server: @@ -10,6 +12,7 @@ services: image: bnc-api-server networks: - binance_net + - binance_rpc_net ports: - '8000:8000' volumes: @@ -17,5 +20,6 @@ services: networks: binance_net: external: true + binance_rpc_net: volumes: marketdata: From e83287489122b2c02280223e9625f1528fd257cc Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Fri, 8 Nov 2019 16:02:47 +0300 Subject: [PATCH 074/129] Implemented /api/v1/tx mock --- package.json | 4 ++ src/binance-testnet/{testnet => }/Dockerfile | 17 ----- src/binance-testnet/api-server/Dockerfile | 4 ++ src/binance-testnet/api-server/index.js | 67 +++++++++++++++++++- src/binance-testnet/docker-compose.yml | 6 +- src/binance-testnet/node/Dockerfile | 15 +++++ src/binance-testnet/run.sh | 3 + 7 files changed, 95 insertions(+), 21 deletions(-) rename src/binance-testnet/{testnet => }/Dockerfile (51%) create mode 100644 src/binance-testnet/node/Dockerfile diff --git a/package.json b/package.json index e954bd9..38bf0fb 100644 --- a/package.json +++ b/package.json @@ -10,5 +10,9 @@ }, "engines": { "node": ">=10.6.0" + }, + "dependencies": { + "@binance-chain/javascript-sdk": "^2.16.1", + "@tendermint/amino-js": "^0.4.5" } } diff --git a/src/binance-testnet/testnet/Dockerfile b/src/binance-testnet/Dockerfile similarity index 51% rename from src/binance-testnet/testnet/Dockerfile rename to src/binance-testnet/Dockerfile index a7425b5..fa8a813 100644 --- a/src/binance-testnet/testnet/Dockerfile +++ b/src/binance-testnet/Dockerfile @@ -16,20 +16,3 @@ RUN ./fullnode/testnet/${BNC_VERSION}/linux/bnbchaind testnet --acc-prefix tbnb RUN sed -i "s/publishTransfer = false/publishTransfer = true/" ./mytestnet/node0/gaiad/config/app.toml && \ sed -i "s/publishLocal = false/publishLocal = true/" ./mytestnet/node0/gaiad/config/app.toml - -#echo 12345678 | docker exec -i 5f6f653730442d81b6e34a82ac3dc8a82f071c1eec130bc09a0dca803ad00bd2 ./tbnbcli send --to tbnb1efjg7xt98t67ql2cmwjc5860lgayet9l8m55ym --amount 100:BNB --from node0 --chain-id Binance-Dev --json - -FROM alpine:3.9.4 - -ARG BNC_VERSION=0.6.2 - -WORKDIR /bnc - -COPY --from=build /binaries/fullnode/testnet/${BNC_VERSION}/linux/bnbchaind ./ -COPY --from=build /binaries/cli/testnet/${BNC_VERSION}/linux/tbnbcli ./ -COPY --from=build /binaries/mytestnet/node0/gaiacli /root/.bnbcli -COPY --from=build /binaries/mytestnet/node0/gaiad /root/.bnbchaind - -EXPOSE 26657 - -ENTRYPOINT ["./bnbchaind", "start"] diff --git a/src/binance-testnet/api-server/Dockerfile b/src/binance-testnet/api-server/Dockerfile index 885fdc2..05773ce 100644 --- a/src/binance-testnet/api-server/Dockerfile +++ b/src/binance-testnet/api-server/Dockerfile @@ -1,7 +1,11 @@ FROM node:10.16.0-alpine +ARG BNC_VERSION=0.6.2 + WORKDIR /api-server +COPY --from=testnet-binaries /binaries/cli/testnet/${BNC_VERSION}/linux/tbnbcli ./ + COPY ./package.json ./ RUN npm install diff --git a/src/binance-testnet/api-server/index.js b/src/binance-testnet/api-server/index.js index fad99a8..7e1819f 100644 --- a/src/binance-testnet/api-server/index.js +++ b/src/binance-testnet/api-server/index.js @@ -1,10 +1,73 @@ const fs = require('fs') const express = require('express') +const axios = require('axios') +const { execSync } = require('child_process') + +const rpcClient = axios.create({ + baseURL: process.env.FOREIGN_RPC_URL, + timeout: 10000 +}) + +async function delay(ms) { + await new Promise((res) => setTimeout(res, ms)) +} + +async function retry(getPromise, n = -1, sleep = 3000) { + while (n) { + try { + return await getPromise() + } catch (e) { + console.debug(`Promise failed, retrying, ${n - 1} attempts left`) + await delay(sleep) + // eslint-disable-next-line no-param-reassign + n -= 1 + } + } + return null +} + +async function sendRpcRequest(subUrl, method, params) { + console.trace(`Request to ${subUrl}, method ${method}, params `, params) + const response = await retry(() => rpcClient.post(subUrl, { + jsonrpc: '2.0', + method, + params, + id: 1 + })) + console.trace('Response, ', response.data) + return response.data +} const app = express() -app.get('/', (req, res) => { - res.send(fs.readFileSync('./marketdata/marketdata.json').toString()) +// GET +// /api/v1/tx/:hash +// /api/v1/time +// /api/v1/transactions +// ?address=a&side=RECEIVE&txAsset=FOREIGN_ASSET&txType=TRANSFER&startTime=111&endTime=222 +// /api/v1/account/:account +// /api/v1/account/:account/sequence +// POST +// /api/v1/broadcast?sync=true + +app.get('/api/v1/tx/:hash', async (req, res) => { + try { + const { + tx, hash, height, result + } = JSON.parse( + execSync(`./tbnbcli tx ${req.params.hash} --node "http://node:26657" --chain-id Binance-Dev`) + ) + res.send({ + code: 0, + hash, + height, + log: result.log, + ok: true, + tx + }) + } catch (e) { + res.status(404).end() + } }) app.listen(8000, () => { diff --git a/src/binance-testnet/docker-compose.yml b/src/binance-testnet/docker-compose.yml index c923940..feb560a 100644 --- a/src/binance-testnet/docker-compose.yml +++ b/src/binance-testnet/docker-compose.yml @@ -1,10 +1,12 @@ version: '3.0' services: - testnet: - build: ./testnet + node: + build: node image: bnc-testnet networks: - binance_rpc_net + ports: + - '26657:26657' volumes: - 'marketdata:/root/.bnbchaind/marketdata' api-server: diff --git a/src/binance-testnet/node/Dockerfile b/src/binance-testnet/node/Dockerfile new file mode 100644 index 0000000..fabf1b2 --- /dev/null +++ b/src/binance-testnet/node/Dockerfile @@ -0,0 +1,15 @@ +#echo 12345678 | docker exec -i 5f6f653730442d81b6e34a82ac3dc8a82f071c1eec130bc09a0dca803ad00bd2 ./tbnbcli send --to tbnb1efjg7xt98t67ql2cmwjc5860lgayet9l8m55ym --amount 100:BNB --from node0 --chain-id Binance-Dev --json +FROM alpine:3.9.4 + +ARG BNC_VERSION=0.6.2 + +WORKDIR /bnc + +COPY --from=testnet-binaries /binaries/fullnode/testnet/${BNC_VERSION}/linux/bnbchaind ./ +COPY --from=testnet-binaries /binaries/cli/testnet/${BNC_VERSION}/linux/tbnbcli ./ +COPY --from=testnet-binaries /binaries/mytestnet/node0/gaiacli /root/.bnbcli +COPY --from=testnet-binaries /binaries/mytestnet/node0/gaiad /root/.bnbchaind + +EXPOSE 26657 + +ENTRYPOINT ["./bnbchaind", "start"] diff --git a/src/binance-testnet/run.sh b/src/binance-testnet/run.sh index f1191a9..a8ddf37 100755 --- a/src/binance-testnet/run.sh +++ b/src/binance-testnet/run.sh @@ -3,4 +3,7 @@ set -e docker network create binance_net > /dev/null 2>&1 || true + +docker build -t testnet-binaries . + docker-compose up --build From 6b43434f53be4665fa2e9a2639c0cbd5e911c1bf Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Sat, 9 Nov 2019 15:11:39 +0300 Subject: [PATCH 075/129] Implemented remaining stubs for api --- src/binance-testnet/api-server/Dockerfile | 8 +- src/binance-testnet/api-server/index.js | 75 ----------- src/binance-testnet/docker-compose.yml | 14 +- src/binance-testnet/http-api/Dockerfile | 15 +++ src/binance-testnet/http-api/index.js | 125 ++++++++++++++++++ .../{api-server => http-api}/package.json | 3 +- src/binance-testnet/http-api/parser.js | 44 ++++++ 7 files changed, 201 insertions(+), 83 deletions(-) delete mode 100644 src/binance-testnet/api-server/index.js create mode 100644 src/binance-testnet/http-api/Dockerfile create mode 100644 src/binance-testnet/http-api/index.js rename src/binance-testnet/{api-server => http-api}/package.json (73%) create mode 100644 src/binance-testnet/http-api/parser.js diff --git a/src/binance-testnet/api-server/Dockerfile b/src/binance-testnet/api-server/Dockerfile index 05773ce..1ea7aef 100644 --- a/src/binance-testnet/api-server/Dockerfile +++ b/src/binance-testnet/api-server/Dockerfile @@ -6,10 +6,8 @@ WORKDIR /api-server COPY --from=testnet-binaries /binaries/cli/testnet/${BNC_VERSION}/linux/tbnbcli ./ -COPY ./package.json ./ +RUN echo 12345678 | ./tbnbcli keys add key -RUN npm install +EXPOSE 8080 -COPY ./index.js ./ - -ENTRYPOINT ["node", "./index.js"] +ENTRYPOINT ["./tbnbcli", "api-server", "--chain-id", "Binance-Dev", "--node", "http://node:26657", "--laddr", "tcp://0.0.0.0:8080"] diff --git a/src/binance-testnet/api-server/index.js b/src/binance-testnet/api-server/index.js deleted file mode 100644 index 7e1819f..0000000 --- a/src/binance-testnet/api-server/index.js +++ /dev/null @@ -1,75 +0,0 @@ -const fs = require('fs') -const express = require('express') -const axios = require('axios') -const { execSync } = require('child_process') - -const rpcClient = axios.create({ - baseURL: process.env.FOREIGN_RPC_URL, - timeout: 10000 -}) - -async function delay(ms) { - await new Promise((res) => setTimeout(res, ms)) -} - -async function retry(getPromise, n = -1, sleep = 3000) { - while (n) { - try { - return await getPromise() - } catch (e) { - console.debug(`Promise failed, retrying, ${n - 1} attempts left`) - await delay(sleep) - // eslint-disable-next-line no-param-reassign - n -= 1 - } - } - return null -} - -async function sendRpcRequest(subUrl, method, params) { - console.trace(`Request to ${subUrl}, method ${method}, params `, params) - const response = await retry(() => rpcClient.post(subUrl, { - jsonrpc: '2.0', - method, - params, - id: 1 - })) - console.trace('Response, ', response.data) - return response.data -} - -const app = express() - -// GET -// /api/v1/tx/:hash -// /api/v1/time -// /api/v1/transactions -// ?address=a&side=RECEIVE&txAsset=FOREIGN_ASSET&txType=TRANSFER&startTime=111&endTime=222 -// /api/v1/account/:account -// /api/v1/account/:account/sequence -// POST -// /api/v1/broadcast?sync=true - -app.get('/api/v1/tx/:hash', async (req, res) => { - try { - const { - tx, hash, height, result - } = JSON.parse( - execSync(`./tbnbcli tx ${req.params.hash} --node "http://node:26657" --chain-id Binance-Dev`) - ) - res.send({ - code: 0, - hash, - height, - log: result.log, - ok: true, - tx - }) - } catch (e) { - res.status(404).end() - } -}) - -app.listen(8000, () => { - console.log('Listening on port 8000') -}) diff --git a/src/binance-testnet/docker-compose.yml b/src/binance-testnet/docker-compose.yml index feb560a..f4917b5 100644 --- a/src/binance-testnet/docker-compose.yml +++ b/src/binance-testnet/docker-compose.yml @@ -10,15 +10,25 @@ services: volumes: - 'marketdata:/root/.bnbchaind/marketdata' api-server: - build: ./api-server + build: api-server image: bnc-api-server + networks: + - binance_rpc_net + ports: + - '8080:8080' + http-api: + build: http-api + image: bnc-http-api + environment: + FOREIGN_RPC_URL: 'http://node:26657' + FOREIGN_API_SERVER_URL: 'http://api-server:8080' networks: - binance_net - binance_rpc_net ports: - '8000:8000' volumes: - - 'marketdata:/api-server/marketdata' + - 'marketdata:/http-api/marketdata' networks: binance_net: external: true diff --git a/src/binance-testnet/http-api/Dockerfile b/src/binance-testnet/http-api/Dockerfile new file mode 100644 index 0000000..1be9e4c --- /dev/null +++ b/src/binance-testnet/http-api/Dockerfile @@ -0,0 +1,15 @@ +FROM node:10.16.0-alpine + +ARG BNC_VERSION=0.6.2 + +WORKDIR /http-api + +COPY --from=testnet-binaries /binaries/cli/testnet/${BNC_VERSION}/linux/tbnbcli ./ + +COPY ./package.json ./ + +RUN npm install + +COPY ./index.js ./parser.js ./ + +ENTRYPOINT ["node", "./index.js"] diff --git a/src/binance-testnet/http-api/index.js b/src/binance-testnet/http-api/index.js new file mode 100644 index 0000000..49de564 --- /dev/null +++ b/src/binance-testnet/http-api/index.js @@ -0,0 +1,125 @@ +const { execSync } = require('child_process') + +const express = require('express') +const axios = require('axios') +const BN = require('bignumber.js') + +const createParser = require('./parser') + +const rpcClient = axios.create({ + baseURL: process.env.FOREIGN_RPC_URL, + timeout: 10000 +}) + +const apiClient = axios.create({ + baseURL: process.env.FOREIGN_API_SERVER_URL, + timeout: 10000 +}) + +const transfers = [] + +const parser = createParser('/http-api/marketdata/marketdata.json', 20 * 1024) +parser.eventEmitter.on('object', (obj) => { + obj.Transfers.forEach((event) => { + // eslint-disable-next-line no-param-reassign + event.Timestamp = Math.ceil(obj.Timestamp / 1000) + transfers.push(event) + }) +}) + +const app = express() +app.use(express.json()) +app.use(express.urlencoded({ extended: true })) + +function wrap(f) { + return async (req, res) => { + try { + await f(req, res) + } catch (e) { + res.status(404).end() + } + } +} + +async function handleTx(req, res) { + const { + tx, hash, height, result + } = JSON.parse( + execSync(`./tbnbcli tx ${req.params.hash} --node "http://node:26657" --chain-id Binance-Dev`) + ) + res.send({ + code: 0, + hash, + height, + log: result.log, + ok: true, + tx + }) +} + +async function handleTransactions(req, res) { + // eslint-disable-next-line no-empty + while (parser.update()) {} + const { + address, side, txAsset, txType, startTime, endTime + } = req.query + if (txType !== 'TRANSFER' || side !== 'RECEIVE') { + res.status(400).send('Given parameters are not supported') + } + const filtered = transfers.filter((event) => event.Timestamp >= parseInt(startTime, 10) + && event.Timestamp <= parseInt(endTime, 10) + && event.To.length === 1 + && event.To[0].Addr === address + && event.To[0].Coins.length === 1 + && event.To[0].Coins[0].denom === txAsset) + res.send({ + tx: filtered.map((tx) => ({ + txHash: tx.TxHash, + memo: tx.Memo, + value: new BN(tx.To[0].Coins[0].amount).dividedBy(10 ** 8).toFixed(8, 3) + })), + total: filtered.length + }) +} + +async function handleTime(req, res) { + const response = (await rpcClient.get('/status')).data + res.send({ + ap_time: response.result.sync_info.latest_block_time, + block_time: response.result.sync_info.latest_block_time + }) +} + +async function handleAccount(req, res) { + const response = (await apiClient.get(`/api/v1/account/${req.params.account}`)).data + res.send(response) +} + +async function handleAccountSequence(req, res) { + const response = (await apiClient.get(`/api/v1/account/${req.params.account}`)).data + res.send(response.sequence.toString()) +} + +async function handleBroadcast(req, res) { + if (req.query.sync !== 'true') { + res.status(400).send('Async broadcast is not supported') + } else { + const response = (await rpcClient.get('/broadcast_tx_sync', { + params: { + tx: req.body + } + })).data + res.send(response.result) + } +} + +app.get('/api/v1/tx/:hash', wrap(handleTx)) +app.get('/api/v1/time', wrap(handleTime)) +app.get('/api/v1/transactions', wrap(handleTransactions)) +app.get('/api/v1/account/:account', wrap(handleAccount)) +app.get('/api/v1/account/:account/sequence', wrap(handleAccountSequence)) +app.post('/api/v1/broadcast', wrap(handleBroadcast)) + +app.listen(8000, () => { + console.log('Listening on port 8000') +}) diff --git a/src/binance-testnet/api-server/package.json b/src/binance-testnet/http-api/package.json similarity index 73% rename from src/binance-testnet/api-server/package.json rename to src/binance-testnet/http-api/package.json index 0be9173..d776fa9 100644 --- a/src/binance-testnet/api-server/package.json +++ b/src/binance-testnet/http-api/package.json @@ -3,7 +3,8 @@ "version": "0.0.1", "dependencies": { "express": "4.17.1", - "axios": "0.19.0" + "axios": "0.19.0", + "bignumber.js": "9.0.0" }, "engines": { "node": ">=10.6.0" diff --git a/src/binance-testnet/http-api/parser.js b/src/binance-testnet/http-api/parser.js new file mode 100644 index 0000000..fc88586 --- /dev/null +++ b/src/binance-testnet/http-api/parser.js @@ -0,0 +1,44 @@ +const events = require('events') +const fs = require('fs') + +function createParser(file, bufferSize) { + const buf = Buffer.alloc(bufferSize) + const eventEmitter = new events.EventEmitter() + let fd + let position = 0 + let end = 0 + + return { + update() { + if (!fd) { + try { + fd = fs.openSync(file, 'r') + } catch (e) { + return 0 + } + } + const bytesRead = fs.readSync(fd, buf, position, buf.length - position, null) + for (let i = position; i < position + bytesRead; i += 1) { + if (buf[i] === 10) { + const obj = buf.slice(end, i) + end = i + 1 + eventEmitter.emit('object', JSON.parse(obj)) + } + } + position += bytesRead + + if (buf.length - position < bufferSize / 2) { + buf.copy(buf, 0, end, position) + position -= end + end = 0 + } + return bytesRead + }, + close() { + fs.closeSync(fd) + }, + eventEmitter + } +} + +module.exports = createParser From 591cdf88f32acd216eaedf03fb1cba8e60b57e80 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Sat, 9 Nov 2019 15:14:06 +0300 Subject: [PATCH 076/129] Added binance_net network in docker configs, updated validator configs --- demo/validator1/.env.development | 10 ++++--- demo/validator2/.env.development | 10 ++++--- demo/validator3/.env.development | 10 ++++--- package.json | 4 --- src/binance-testnet/run.sh | 27 +++++++++++++++++-- src/oracle/docker-compose-test.yml | 5 ++++ .../binanceSend/.env.development | 2 +- 7 files changed, 52 insertions(+), 16 deletions(-) diff --git a/demo/validator1/.env.development b/demo/validator1/.env.development index 6335b08..2987613 100644 --- a/demo/validator1/.env.development +++ b/demo/validator1/.env.development @@ -7,9 +7,13 @@ HOME_MAX_FETCH_RANGE_SIZE=10 SIDE_RPC_URL=http://ganache_side:8545 SIDE_SHARED_DB_ADDRESS=0xd5fE0D28e058D375b0b038fFbB446Da37E85fFdc -FOREIGN_URL=https://testnet-dex.binance.org/ -FOREIGN_CHAIN_ID=Binance-Chain-Nile -FOREIGN_ASSET=KFT-94F +#FOREIGN_URL=https://testnet-dex.binance.org/ +#FOREIGN_CHAIN_ID=Binance-Chain-Nile +#FOREIGN_ASSET=KFT-94F +FOREIGN_URL=http://node:8000 +FOREIGN_CHAIN_ID=Binance-Dev +FOREIGN_ASSET=DEV-996 + FOREIGN_FETCH_MAX_TIME_INTERVAL=60000 FOREIGN_FETCH_INTERVAL=5000 FOREIGN_FETCH_BLOCK_TIME_OFFSET=10000 diff --git a/demo/validator2/.env.development b/demo/validator2/.env.development index 305ec1d..d250505 100644 --- a/demo/validator2/.env.development +++ b/demo/validator2/.env.development @@ -7,9 +7,13 @@ HOME_MAX_FETCH_RANGE_SIZE=10 SIDE_RPC_URL=http://ganache_side:8545 SIDE_SHARED_DB_ADDRESS=0xd5fE0D28e058D375b0b038fFbB446Da37E85fFdc -FOREIGN_URL=https://testnet-dex.binance.org/ -FOREIGN_CHAIN_ID=Binance-Chain-Nile -FOREIGN_ASSET=KFT-94F +#FOREIGN_URL=https://testnet-dex.binance.org/ +#FOREIGN_CHAIN_ID=Binance-Chain-Nile +#FOREIGN_ASSET=KFT-94F +FOREIGN_URL=http://node:8000 +FOREIGN_CHAIN_ID=Binance-Dev +FOREIGN_ASSET=DEV-996 + FOREIGN_FETCH_MAX_TIME_INTERVAL=60000 FOREIGN_FETCH_INTERVAL=5000 FOREIGN_FETCH_BLOCK_TIME_OFFSET=10000 diff --git a/demo/validator3/.env.development b/demo/validator3/.env.development index 7025ee3..6ee1766 100644 --- a/demo/validator3/.env.development +++ b/demo/validator3/.env.development @@ -7,9 +7,13 @@ HOME_MAX_FETCH_RANGE_SIZE=10 SIDE_RPC_URL=http://ganache_side:8545 SIDE_SHARED_DB_ADDRESS=0xd5fE0D28e058D375b0b038fFbB446Da37E85fFdc -FOREIGN_URL=https://testnet-dex.binance.org/ -FOREIGN_CHAIN_ID=Binance-Chain-Nile -FOREIGN_ASSET=KFT-94F +#FOREIGN_URL=https://testnet-dex.binance.org/ +#FOREIGN_CHAIN_ID=Binance-Chain-Nile +#FOREIGN_ASSET=KFT-94F +FOREIGN_URL=http://node:8000 +FOREIGN_CHAIN_ID=Binance-Dev +FOREIGN_ASSET=DEV-996 + FOREIGN_FETCH_MAX_TIME_INTERVAL=60000 FOREIGN_FETCH_INTERVAL=5000 FOREIGN_FETCH_BLOCK_TIME_OFFSET=10000 diff --git a/package.json b/package.json index 38bf0fb..e954bd9 100644 --- a/package.json +++ b/package.json @@ -10,9 +10,5 @@ }, "engines": { "node": ">=10.6.0" - }, - "dependencies": { - "@binance-chain/javascript-sdk": "^2.16.1", - "@tendermint/amino-js": "^0.4.5" } } diff --git a/src/binance-testnet/run.sh b/src/binance-testnet/run.sh index a8ddf37..7216460 100755 --- a/src/binance-testnet/run.sh +++ b/src/binance-testnet/run.sh @@ -2,8 +2,31 @@ set -e +tbnbcli() { + echo 12345678 | docker exec -i binance-testnet_node_1 ./tbnbcli $@ --from node0 --node http://node:26657 --chain-id Binance-Dev --json +} + +echo "Removing old environment" +docker kill $(docker ps -a | grep binance-testnet_ | awk '{print $1}') > /dev/null 2>&1 || true +docker rm $(docker ps -a | grep binance-testnet_ | awk '{print $1}') > /dev/null 2>&1 || true +docker volume rm binance-testnet_marketdata > /dev/null 2>&1 || true + docker network create binance_net > /dev/null 2>&1 || true -docker build -t testnet-binaries . +echo "Building required binaries" +docker build -t testnet-binaries . > /dev/null 2>&1 || true -docker-compose up --build +echo "Running environment" +docker-compose up --build -d + +sleep 2 + +echo "Issuing test asset" +ISSUED_LOG=$(tbnbcli token issue --symbol DEV --total-supply 1000000000000 --token-name "DEV Token" | jq .Response.log) +TOKEN_SYMBOL=${ISSUED_LOG:(-8):7} +echo "Issued $TOKEN_SYMBOL" + +sleep 2 + +echo "Sending tokens to controlled address" +tbnbcli token multi-send --transfers '[{"to":"tbnb1z7u9f8mcuwxanns9xa6qgjtlka0d392epc0m9x","amount":"1000000000000:BNB,1000000000000:'"$TOKEN_SYMBOL"'"}]' \ No newline at end of file diff --git a/src/oracle/docker-compose-test.yml b/src/oracle/docker-compose-test.yml index d331ee7..c626a47 100644 --- a/src/oracle/docker-compose-test.yml +++ b/src/oracle/docker-compose-test.yml @@ -23,6 +23,7 @@ services: - test_network - blockchain_home - blockchain_side + - binance_net keygen: image: keygen-client build: @@ -57,6 +58,7 @@ services: - '${SIGN_RESTART_PORT}:8001' networks: - test_network + - binance_net redis: image: redis build: @@ -111,9 +113,12 @@ services: - '${PWD}/${TARGET_NETWORK}/keys:/keys' networks: - test_network + - binance_net networks: test_network: blockchain_side: external: true blockchain_home: external: true + binance_net: + external: true diff --git a/src/test-services/binanceSend/.env.development b/src/test-services/binanceSend/.env.development index 9660ff3..212c788 100644 --- a/src/test-services/binanceSend/.env.development +++ b/src/test-services/binanceSend/.env.development @@ -1,4 +1,4 @@ FOREIGN_URL=https://testnet-dex.binance.org/ FOREIGN_ASSET=KFT-94F -#FOREIGN_PRIVATE_KEY is taken from src/test-services/.keys.development +FOREIGN_PRIVATE_KEY=dd5ec5a7abe9d1fff21170ae591085f000fc6fd9ca0107fe047593f44e328e40 From fb27aa8fbc0972ab60098bf3576864ddbcb20de0 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Mon, 11 Nov 2019 19:40:04 +0300 Subject: [PATCH 077/129] node-info, fees requests, automatic foreign asset id replacements --- src/binance-testnet/http-api/index.js | 36 +++++++++++++++++++++------ src/binance-testnet/run.sh | 13 +++++++++- 2 files changed, 40 insertions(+), 9 deletions(-) diff --git a/src/binance-testnet/http-api/index.js b/src/binance-testnet/http-api/index.js index 49de564..58d52aa 100644 --- a/src/binance-testnet/http-api/index.js +++ b/src/binance-testnet/http-api/index.js @@ -22,14 +22,21 @@ const parser = createParser('/http-api/marketdata/marketdata.json', 20 * 1024) parser.eventEmitter.on('object', (obj) => { obj.Transfers.forEach((event) => { // eslint-disable-next-line no-param-reassign - event.Timestamp = Math.ceil(obj.Timestamp / 1000) + event.Timestamp = Math.ceil(obj.Timestamp / 10 ** 6) transfers.push(event) }) }) const app = express() -app.use(express.json()) -app.use(express.urlencoded({ extended: true })) +app.use('/api/v1/broadcast', (req, res, next) => { + req.rawBody = '' + req.on('data', (chunk) => { + req.rawBody += chunk.toString() + }) + req.on('end', () => { + next() + }) +}) function wrap(f) { return async (req, res) => { @@ -97,19 +104,29 @@ async function handleAccount(req, res) { async function handleAccountSequence(req, res) { const response = (await apiClient.get(`/api/v1/account/${req.params.account}`)).data - res.send(response.sequence.toString()) + res.send({ sequence: response.sequence }) +} + +async function handleNodeInfo(req, res) { + const response = (await rpcClient.get('/status')).data + res.send(response.result) +} + +async function handleFees(req, res) { + const response = (await apiClient.get('/api/v1/fees')).data + res.send(response) } async function handleBroadcast(req, res) { if (req.query.sync !== 'true') { res.status(400).send('Async broadcast is not supported') } else { - const response = (await rpcClient.get('/broadcast_tx_sync', { + const response = await rpcClient.get('/broadcast_tx_sync', { params: { - tx: req.body + tx: `0x${req.rawBody}` } - })).data - res.send(response.result) + }) + res.send([response.data.result]) } } @@ -118,8 +135,11 @@ app.get('/api/v1/time', wrap(handleTime)) app.get('/api/v1/transactions', wrap(handleTransactions)) app.get('/api/v1/account/:account', wrap(handleAccount)) app.get('/api/v1/account/:account/sequence', wrap(handleAccountSequence)) +app.get('/api/v1/node-info', wrap(handleNodeInfo)) +app.get('/api/v1/fees', wrap(handleFees)) app.post('/api/v1/broadcast', wrap(handleBroadcast)) app.listen(8000, () => { + // eslint-disable-next-line no-console console.log('Listening on port 8000') }) diff --git a/src/binance-testnet/run.sh b/src/binance-testnet/run.sh index 7216460..99f9dc8 100755 --- a/src/binance-testnet/run.sh +++ b/src/binance-testnet/run.sh @@ -2,6 +2,8 @@ set -e +cd $(dirname "$0") + tbnbcli() { echo 12345678 | docker exec -i binance-testnet_node_1 ./tbnbcli $@ --from node0 --node http://node:26657 --chain-id Binance-Dev --json } @@ -26,7 +28,16 @@ ISSUED_LOG=$(tbnbcli token issue --symbol DEV --total-supply 1000000000000 --tok TOKEN_SYMBOL=${ISSUED_LOG:(-8):7} echo "Issued $TOKEN_SYMBOL" +sed -i 's/FOREIGN_ASSET=.*$/FOREIGN_ASSET='"$TOKEN_SYMBOL"'/' ../test-services/binanceBalance/.env.development +sed -i 's/FOREIGN_ASSET=.*$/FOREIGN_ASSET='"$TOKEN_SYMBOL"'/' ../test-services/binanceSend/.env.development +sed -i 's/FOREIGN_ASSET=.*$/FOREIGN_ASSET='"$TOKEN_SYMBOL"'/' ../../demo/validator1/.env.development +sed -i 's/FOREIGN_ASSET=.*$/FOREIGN_ASSET='"$TOKEN_SYMBOL"'/' ../../demo/validator2/.env.development +sed -i 's/FOREIGN_ASSET=.*$/FOREIGN_ASSET='"$TOKEN_SYMBOL"'/' ../../demo/validator3/.env.development +sed -i 's/FOREIGN_ASSET=.*$/FOREIGN_ASSET='"$TOKEN_SYMBOL"'/' ../../tests/.env + sleep 2 echo "Sending tokens to controlled address" -tbnbcli token multi-send --transfers '[{"to":"tbnb1z7u9f8mcuwxanns9xa6qgjtlka0d392epc0m9x","amount":"1000000000000:BNB,1000000000000:'"$TOKEN_SYMBOL"'"}]' \ No newline at end of file +tbnbcli token multi-send --transfers '[{"to":"tbnb1z7u9f8mcuwxanns9xa6qgjtlka0d392epc0m9x","amount":"1000000000000:BNB,1000000000000:'"$TOKEN_SYMBOL"'"}]' + +sleep 2 \ No newline at end of file From 93292ffe452da3edd39b905d3c41fc261b640640 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Mon, 11 Nov 2019 19:41:17 +0300 Subject: [PATCH 078/129] Automatic fee detection for transfering all funds --- src/oracle/tss-sign/signer.js | 9 ++++++++- src/oracle/tss-sign/tx.js | 15 +++++---------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/oracle/tss-sign/signer.js b/src/oracle/tss-sign/signer.js index 1b89ae5..1123998 100644 --- a/src/oracle/tss-sign/signer.js +++ b/src/oracle/tss-sign/signer.js @@ -90,6 +90,12 @@ async function getAccount(address) { return response.data } +async function getFee() { + logger.info('Getting fees') + const response = await retry(() => httpClient.get('/api/v1/fees')) + return response.data.filter((fee) => fee.multi_transfer_fee)[0].multi_transfer_fee * 2 +} + async function waitForAccountNonce(address, nonce) { cancelled = false logger.info(`Waiting for account ${address} to have nonce ${nonce}`) @@ -275,6 +281,7 @@ async function main() { while (to !== '') { logger.info(`Building corresponding transaction for transferring all funds, nonce ${nonce}, recipient ${to}`) + const fee = await getFee() const tx = new Transaction({ from, accountNumber: account.account_number, @@ -282,7 +289,7 @@ async function main() { recipients: [{ to, tokens: account.balances.find((token) => token.symbol === FOREIGN_ASSET).free, - bnbs: new BN(account.balances.find((token) => token.symbol === 'BNB').free).minus(new BN(60000).div(10 ** 8)) + bnbs: new BN(account.balances.find((token) => token.symbol === 'BNB').free).minus(new BN(fee).div(10 ** 8)) }], asset: FOREIGN_ASSET, memo: `Attempt ${attempt}` diff --git a/src/oracle/tss-sign/tx.js b/src/oracle/tss-sign/tx.js index fa3ec96..ee6cfcc 100644 --- a/src/oracle/tss-sign/tx.js +++ b/src/oracle/tss-sign/tx.js @@ -25,15 +25,13 @@ class Transaction { if (asset && totalTokens.isGreaterThan(0)) { senderCoins.push({ denom: asset, - amount: totalTokens.multipliedBy(10 ** 8) - .toNumber() + amount: totalTokens.multipliedBy(10 ** 8).toNumber() }) } if (totalBnbs.isGreaterThan(0)) { senderCoins.push({ denom: BNB_ASSET, - amount: totalBnbs.multipliedBy(10 ** 8) - .toNumber() + amount: totalBnbs.multipliedBy(10 ** 8).toNumber() }) } senderCoins.sort((a, b) => a.denom > b.denom) @@ -47,15 +45,13 @@ class Transaction { if (asset && tokens) { receiverCoins.push({ denom: asset, - amount: new BN(tokens).multipliedBy(10 ** 8) - .toNumber() + amount: new BN(tokens).multipliedBy(10 ** 8).toNumber() }) } if (bnbs) { receiverCoins.push({ denom: BNB_ASSET, - amount: new BN(bnbs).multipliedBy(10 ** 8) - .toNumber() + amount: new BN(bnbs).multipliedBy(10 ** 8).toNumber() }) } receiverCoins.sort((a, b) => a.denom > b.denom) @@ -103,8 +99,7 @@ class Transaction { if (s.gt(n.div(2))) { logger.debug('Normalizing s') // eslint-disable-next-line no-param-reassign - signature.s = n.minus(s) - .toString(16) + signature.s = n.minus(s).toString(16) } const publicKeyEncoded = Buffer.from(`eb5ae98721${yLast % 2 ? '03' : '02'}${padZeros(publicKey.x, 64)}`, 'hex') this.tx.signatures = [{ From 17690e7ac2c1ffa41b46dd10980cc1547a19fd01 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Mon, 11 Nov 2019 19:42:09 +0300 Subject: [PATCH 079/129] Updated env files to use local binance network --- demo/validator1/.env.development | 6 +++--- demo/validator2/.env.development | 6 +++--- demo/validator3/.env.development | 6 +++--- src/test-services/binanceBalance/.env.development | 4 ++-- src/test-services/binanceBalance/run.sh | 2 +- src/test-services/binanceSend/.env.development | 4 ++-- src/test-services/binanceSend/run.sh | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/demo/validator1/.env.development b/demo/validator1/.env.development index 2987613..832f088 100644 --- a/demo/validator1/.env.development +++ b/demo/validator1/.env.development @@ -9,10 +9,10 @@ SIDE_SHARED_DB_ADDRESS=0xd5fE0D28e058D375b0b038fFbB446Da37E85fFdc #FOREIGN_URL=https://testnet-dex.binance.org/ #FOREIGN_CHAIN_ID=Binance-Chain-Nile -#FOREIGN_ASSET=KFT-94F -FOREIGN_URL=http://node:8000 +#FOREIGN_ASSET=DEV-BA8 +FOREIGN_URL=http://http-api:8000 FOREIGN_CHAIN_ID=Binance-Dev -FOREIGN_ASSET=DEV-996 +FOREIGN_ASSET=DEV-BA8 FOREIGN_FETCH_MAX_TIME_INTERVAL=60000 FOREIGN_FETCH_INTERVAL=5000 diff --git a/demo/validator2/.env.development b/demo/validator2/.env.development index d250505..56cd098 100644 --- a/demo/validator2/.env.development +++ b/demo/validator2/.env.development @@ -9,10 +9,10 @@ SIDE_SHARED_DB_ADDRESS=0xd5fE0D28e058D375b0b038fFbB446Da37E85fFdc #FOREIGN_URL=https://testnet-dex.binance.org/ #FOREIGN_CHAIN_ID=Binance-Chain-Nile -#FOREIGN_ASSET=KFT-94F -FOREIGN_URL=http://node:8000 +#FOREIGN_ASSET=DEV-BA8 +FOREIGN_URL=http://http-api:8000 FOREIGN_CHAIN_ID=Binance-Dev -FOREIGN_ASSET=DEV-996 +FOREIGN_ASSET=DEV-BA8 FOREIGN_FETCH_MAX_TIME_INTERVAL=60000 FOREIGN_FETCH_INTERVAL=5000 diff --git a/demo/validator3/.env.development b/demo/validator3/.env.development index 6ee1766..bb3def1 100644 --- a/demo/validator3/.env.development +++ b/demo/validator3/.env.development @@ -9,10 +9,10 @@ SIDE_SHARED_DB_ADDRESS=0xd5fE0D28e058D375b0b038fFbB446Da37E85fFdc #FOREIGN_URL=https://testnet-dex.binance.org/ #FOREIGN_CHAIN_ID=Binance-Chain-Nile -#FOREIGN_ASSET=KFT-94F -FOREIGN_URL=http://node:8000 +#FOREIGN_ASSET=DEV-BA8 +FOREIGN_URL=http://http-api:8000 FOREIGN_CHAIN_ID=Binance-Dev -FOREIGN_ASSET=DEV-996 +FOREIGN_ASSET=DEV-BA8 FOREIGN_FETCH_MAX_TIME_INTERVAL=60000 FOREIGN_FETCH_INTERVAL=5000 diff --git a/src/test-services/binanceBalance/.env.development b/src/test-services/binanceBalance/.env.development index 4f96a09..9169981 100644 --- a/src/test-services/binanceBalance/.env.development +++ b/src/test-services/binanceBalance/.env.development @@ -1,2 +1,2 @@ -FOREIGN_URL=https://testnet-dex.binance.org/ -FOREIGN_ASSET=KFT-94F +FOREIGN_URL=http://http-api:8000 +FOREIGN_ASSET=DEV-BA8 diff --git a/src/test-services/binanceBalance/run.sh b/src/test-services/binanceBalance/run.sh index ec82b26..72c66f2 100755 --- a/src/test-services/binanceBalance/run.sh +++ b/src/test-services/binanceBalance/run.sh @@ -9,4 +9,4 @@ TARGET_NETWORK=${TARGET_NETWORK:=development} docker build -t binance-balance . > /dev/null -docker run --rm --env-file ".env.$TARGET_NETWORK" binance-balance $@ +docker run --rm --network binance_net --env-file ".env.$TARGET_NETWORK" binance-balance $@ diff --git a/src/test-services/binanceSend/.env.development b/src/test-services/binanceSend/.env.development index 212c788..db94446 100644 --- a/src/test-services/binanceSend/.env.development +++ b/src/test-services/binanceSend/.env.development @@ -1,4 +1,4 @@ -FOREIGN_URL=https://testnet-dex.binance.org/ -FOREIGN_ASSET=KFT-94F +FOREIGN_URL=http://http-api:8000 +FOREIGN_ASSET=DEV-BA8 FOREIGN_PRIVATE_KEY=dd5ec5a7abe9d1fff21170ae591085f000fc6fd9ca0107fe047593f44e328e40 diff --git a/src/test-services/binanceSend/run.sh b/src/test-services/binanceSend/run.sh index e96570c..dbed1fa 100755 --- a/src/test-services/binanceSend/run.sh +++ b/src/test-services/binanceSend/run.sh @@ -9,4 +9,4 @@ TARGET_NETWORK=${TARGET_NETWORK:=development} docker build -t binance-send . > /dev/null -docker run --rm --env-file ".env.$TARGET_NETWORK" --env-file "../.keys.$TARGET_NETWORK" -e "PRIVATE_KEY=$PRIVATE_KEY" binance-send $@ +docker run --rm --network binance_net --env-file ".env.$TARGET_NETWORK" --env-file "../.keys.$TARGET_NETWORK" -e "PRIVATE_KEY=$PRIVATE_KEY" binance-send $@ From 1b91c790f14e23802a13830c123caee51bbd9589 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Mon, 11 Nov 2019 19:43:28 +0300 Subject: [PATCH 080/129] Updated tests env file and scripts. --- tests/.env | 7 +++--- tests/init.sh | 1 + tests/run.sh | 2 +- tests/test/index.js | 4 ++-- tests/test/utils/user.js | 52 +++++++++++++++++++++------------------- 5 files changed, 36 insertions(+), 30 deletions(-) diff --git a/tests/.env b/tests/.env index e54b083..f4cca67 100644 --- a/tests/.env +++ b/tests/.env @@ -5,6 +5,7 @@ HOME_PRIVATE_KEY=e2aeb24eaa63102d0c0821717c3b6384abdabd7af2ad4ec8e650dce300798b2 SIDE_RPC_URL=http://ganache_side:8545 -FOREIGN_URL=https://testnet-dex.binance.org/ -FOREIGN_CHAIN_ID=Binance-Chain-Nile -FOREIGN_ASSET=KFT-94F +FOREIGN_URL=http://http-api:8000 +FOREIGN_CHAIN_ID=Binance-Dev +FOREIGN_ASSET=DEV-BA8 +FOREIGN_PRIVATE_KEY=dd5ec5a7abe9d1fff21170ae591085f000fc6fd9ca0107fe047593f44e328e40 diff --git a/tests/init.sh b/tests/init.sh index d459a22..794fd8c 100755 --- a/tests/init.sh +++ b/tests/init.sh @@ -6,6 +6,7 @@ set -v docker build -t tss ./src/tss ./demo/start-environment.sh +./src/binance-testnet/run.sh cat ./tests/config.json | jq .users[].ethAddress | xargs -I {} ./src/test-services/ethereumSend/run.sh {} 300 cat ./tests/config.json | jq .users[].bncAddress | xargs -I {} ./src/test-services/binanceSend/run.sh {} 300 0.1 diff --git a/tests/run.sh b/tests/run.sh index a81a6e6..3eb29d7 100755 --- a/tests/run.sh +++ b/tests/run.sh @@ -7,9 +7,9 @@ docker build -t tests ./tests docker rm tests > /dev/null 2>&1 || true docker create --name tests \ --env-file ./tests/.env \ - -e FOREIGN_PRIVATE_KEY \ tests $@ +docker network connect binance_net tests docker network connect blockchain_home tests docker network connect blockchain_side tests docker network connect validator1_test_network tests diff --git a/tests/test/index.js b/tests/test/index.js index 7f440c4..7b7da2e 100644 --- a/tests/test/index.js +++ b/tests/test/index.js @@ -32,8 +32,8 @@ describe('bridge tests', function () { let bncPrefundedUser before(async function () { - ethPrefundedUser = await createUser(HOME_PRIVATE_KEY) - bncPrefundedUser = await createUser(FOREIGN_PRIVATE_KEY) + ethPrefundedUser = await createUser(HOME_PRIVATE_KEY, 'eth') + bncPrefundedUser = await createUser(FOREIGN_PRIVATE_KEY, 'bnc') const bnbBalance = await bncPrefundedUser.getBnbBalance() assert.ok(bnbBalance >= 1, `Insufficient BNB balance on ${bncPrefundedUser.ethAddress} in Binance network, expected 1 BNB, got ${bnbBalance}`) diff --git a/tests/test/utils/user.js b/tests/test/utils/user.js index 72b6954..a0c035c 100644 --- a/tests/test/utils/user.js +++ b/tests/test/utils/user.js @@ -13,34 +13,38 @@ const txOptions = { const { SIDE_RPC_URL } = process.env -async function createUser(privateKey) { - const providerSide = new ethers.providers.JsonRpcProvider(SIDE_RPC_URL) - const walletSide = new ethers.Wallet(privateKey, providerSide) - const wallet = new ethers.Wallet(privateKey, provider) - const ethAddress = wallet.address - const bncAddress = getAddressFromPrivateKey(privateKey) - const token = tokenContract.connect(wallet) - const bridge = bridgeContract.connect(wallet) - - const bncClient = await createBncClient(privateKey) +async function createUser(privateKey, network) { + const opts = {} + if (network !== 'bnc') { + opts.providerSide = new ethers.providers.JsonRpcProvider(SIDE_RPC_URL) + opts.walletSide = new ethers.Wallet(privateKey, opts.providerSide) + opts.wallet = new ethers.Wallet(privateKey, provider) + opts.ethAddress = opts.wallet.address + opts.token = tokenContract.connect(opts.wallet) + opts.bridge = bridgeContract.connect(opts.wallet) + } + if (network !== 'eth') { + opts.bncAddress = getAddressFromPrivateKey(privateKey) + opts.bncClient = await createBncClient(privateKey) + } return { - ethAddress, - bncAddress, + ethAddress: opts.ethAddress, + bncAddress: opts.bncAddress, async getEthBalance() { - const balance = await wallet.getBalance() + const balance = await opts.wallet.getBalance() return parseFloat(new BN(balance).dividedBy(10 ** 18).toFixed(8, 3)) }, async getSideEthBalance() { - const balance = await walletSide.getBalance() + const balance = await opts.walletSide.getBalance() return parseFloat(new BN(balance).dividedBy(10 ** 18).toFixed(8, 3)) }, async getErcBalance() { - const balance = await token.balanceOf(ethAddress) + const balance = await opts.token.balanceOf(opts.ethAddress) return parseFloat(new BN(balance).dividedBy(10 ** 18).toFixed(8, 3)) }, async transferEth(to, value) { - const tx = await wallet.sendTransaction( + const tx = await opts.wallet.sendTransaction( { to, value: `0x${new BN(value).multipliedBy(10 ** 18).toString(16)}` @@ -50,7 +54,7 @@ async function createUser(privateKey) { await tx.wait() }, async transferEthSide(to, value) { - const tx = await walletSide.sendTransaction( + const tx = await opts.walletSide.sendTransaction( { to, value: `0x${new BN(value).multipliedBy(10 ** 18).toString(16)}` @@ -60,7 +64,7 @@ async function createUser(privateKey) { await tx.wait() }, async transferErc(to, value) { - const tx = await token.transfer( + const tx = await opts.token.transfer( to, `0x${new BN(value).multipliedBy(10 ** 18).toString(16)}`, txOptions @@ -68,7 +72,7 @@ async function createUser(privateKey) { await tx.wait() }, async approveErc(to, value) { - const tx = await token.approve( + const tx = await opts.token.approve( to, `0x${new BN(value).multipliedBy(10 ** 18).toString(16)}`, txOptions @@ -76,27 +80,27 @@ async function createUser(privateKey) { await tx.wait() }, async exchangeErc(value) { - const tx = await bridge.exchange( + const tx = await opts.bridge.exchange( `0x${new BN(value).multipliedBy(10 ** 18).toString(16)}`, txOptions ) await tx.wait() }, async getBnbBalance() { - const balance = await getBnbBalance(bncAddress) + const balance = await getBnbBalance(opts.bncAddress) await delay(1000) return balance }, async getBepBalance() { - const balance = await getBepBalance(bncAddress) + const balance = await getBepBalance(opts.bncAddress) await delay(1000) return balance }, async transferBepBnb(to, tokens, bnbs) { - return await bncClient.transfer(to, tokens, bnbs) + return await opts.bncClient.transfer(to, tokens, bnbs) }, async exchangeBep(bridgeAddress, value) { - return await bncClient.exchange(bridgeAddress, value) + return await opts.bncClient.exchange(bridgeAddress, value) } } } From 610e4e774285a5648f58dd1a96aeabbe89fb2b8c Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Mon, 11 Nov 2019 19:43:56 +0300 Subject: [PATCH 081/129] Fixed name overlapping for proxy container in docker-compose networks --- src/oracle/docker-compose-test.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/oracle/docker-compose-test.yml b/src/oracle/docker-compose-test.yml index c626a47..939f22f 100644 --- a/src/oracle/docker-compose-test.yml +++ b/src/oracle/docker-compose-test.yml @@ -20,10 +20,12 @@ services: ports: - '${VOTES_PROXY_PORT}:8002' networks: - - test_network - - blockchain_home - - blockchain_side - - binance_net + test_network: + aliases: + - local_proxy + blockchain_home: + blockchain_side: + binance_net: keygen: image: keygen-client build: @@ -31,7 +33,7 @@ services: context: . environment: - 'RABBITMQ_URL=amqp://rabbitmq:5672' - - 'PROXY_URL=http://proxy:8001' + - 'PROXY_URL=http://local_proxy:8001' - LOG_LEVEL volumes: - '${PWD}/${TARGET_NETWORK}/keys:/keys' @@ -44,7 +46,7 @@ services: context: . environment: - 'RABBITMQ_URL=amqp://rabbitmq:5672' - - 'PROXY_URL=http://proxy:8001' + - 'PROXY_URL=http://local_proxy:8001' - FOREIGN_CHAIN_ID - FOREIGN_URL - FOREIGN_ASSET @@ -104,7 +106,7 @@ services: - FOREIGN_URL - FOREIGN_ASSET - 'RABBITMQ_URL=amqp://rabbitmq:5672' - - 'PROXY_URL=http://proxy:8001' + - 'PROXY_URL=http://local_proxy:8001' - FOREIGN_FETCH_MAX_TIME_INTERVAL - FOREIGN_FETCH_INTERVAL - FOREIGN_FETCH_BLOCK_TIME_OFFSET From 9a7c2432955709c9dade9d0b56c602af855dad47 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Mon, 11 Nov 2019 19:51:05 +0300 Subject: [PATCH 082/129] Updated run.sh scripts for test services --- .gitignore | 1 - src/test-services/.keys.development.example | 1 - src/test-services/binanceBalance/run.sh | 6 +++++- src/test-services/binanceSend/run.sh | 6 +++++- src/test-services/ethereumBalance/run.sh | 6 +++++- src/test-services/ethereumSend/run.sh | 6 +++++- src/test-services/sidePrefund/run.sh | 6 +++++- 7 files changed, 25 insertions(+), 7 deletions(-) delete mode 100644 src/test-services/.keys.development.example diff --git a/.gitignore b/.gitignore index 6806d9b..f9ab79b 100644 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,6 @@ demo/validator*/.keys.staging src/deploy/deploy*/build/ src/deploy/.keys.staging src/test-services/.keys.staging -src/test-services/.keys.development src/test.js tests/results.xml package-lock.json diff --git a/src/test-services/.keys.development.example b/src/test-services/.keys.development.example deleted file mode 100644 index 6224ee0..0000000 --- a/src/test-services/.keys.development.example +++ /dev/null @@ -1 +0,0 @@ -FOREIGN_PRIVATE_KEY=0000000000000000000000000000000000000000000000000000000000000000 diff --git a/src/test-services/binanceBalance/run.sh b/src/test-services/binanceBalance/run.sh index 72c66f2..35375b0 100755 --- a/src/test-services/binanceBalance/run.sh +++ b/src/test-services/binanceBalance/run.sh @@ -9,4 +9,8 @@ TARGET_NETWORK=${TARGET_NETWORK:=development} docker build -t binance-balance . > /dev/null -docker run --rm --network binance_net --env-file ".env.$TARGET_NETWORK" binance-balance $@ +if [[ "$TARGET_NETWORK" == "development" ]]; then + docker run --rm --network binance_net --env-file ".env.$TARGET_NETWORK" binance-balance $@ +else + docker run --rm --env-file ".env.$TARGET_NETWORK" binance-balance $@ +fi \ No newline at end of file diff --git a/src/test-services/binanceSend/run.sh b/src/test-services/binanceSend/run.sh index dbed1fa..908a2b4 100755 --- a/src/test-services/binanceSend/run.sh +++ b/src/test-services/binanceSend/run.sh @@ -9,4 +9,8 @@ TARGET_NETWORK=${TARGET_NETWORK:=development} docker build -t binance-send . > /dev/null -docker run --rm --network binance_net --env-file ".env.$TARGET_NETWORK" --env-file "../.keys.$TARGET_NETWORK" -e "PRIVATE_KEY=$PRIVATE_KEY" binance-send $@ +if [[ "$TARGET_NETWORK" == "development" ]]; then + docker run --rm --network binance_net --env-file ".env.$TARGET_NETWORK" -e "PRIVATE_KEY=$PRIVATE_KEY" binance-send $@ +else + docker run --rm --env-file ".env.$TARGET_NETWORK" --env-file "../.keys.$TARGET_NETWORK" -e "PRIVATE_KEY=$PRIVATE_KEY" binance-send $@ +fi diff --git a/src/test-services/ethereumBalance/run.sh b/src/test-services/ethereumBalance/run.sh index 369a2b5..9dbef3f 100755 --- a/src/test-services/ethereumBalance/run.sh +++ b/src/test-services/ethereumBalance/run.sh @@ -9,4 +9,8 @@ TARGET_NETWORK=${TARGET_NETWORK:=development} docker build -t ethereum-balance . > /dev/null -docker run --network blockchain_home --rm --env-file ".env.$TARGET_NETWORK" ethereum-balance $@ +if [[ "$TARGET_NETWORK" == "development" ]]; then + docker run --network blockchain_home --rm --env-file ".env.$TARGET_NETWORK" ethereum-balance $@ +else + docker run --rm --env-file ".env.$TARGET_NETWORK" ethereum-balance $@ +fi diff --git a/src/test-services/ethereumSend/run.sh b/src/test-services/ethereumSend/run.sh index 30d683e..3808257 100755 --- a/src/test-services/ethereumSend/run.sh +++ b/src/test-services/ethereumSend/run.sh @@ -9,4 +9,8 @@ TARGET_NETWORK=${TARGET_NETWORK:=development} docker build -t ethereum-send . > /dev/null -docker run --network blockchain_home --rm --env-file ".env.$TARGET_NETWORK" --env-file "../.keys.$TARGET_NETWORK" -e "PRIVATE_KEY=$PRIVATE_KEY" ethereum-send $@ +if [[ "$TARGET_NETWORK" == "development" ]]; then + docker run --network blockchain_home --rm --env-file ".env.$TARGET_NETWORK" -e "PRIVATE_KEY=$PRIVATE_KEY" ethereum-send $@ +else + docker run --rm --env-file ".env.$TARGET_NETWORK" --env-file "../.keys.$TARGET_NETWORK" -e "PRIVATE_KEY=$PRIVATE_KEY" ethereum-send $@ +fi diff --git a/src/test-services/sidePrefund/run.sh b/src/test-services/sidePrefund/run.sh index 88df060..3955564 100755 --- a/src/test-services/sidePrefund/run.sh +++ b/src/test-services/sidePrefund/run.sh @@ -11,4 +11,8 @@ echo "Using $TARGET_NETWORK network" docker build -t side-prefund . > /dev/null -docker run --network blockchain_side --rm --env-file ".env.$TARGET_NETWORK" --env-file "../.keys.$TARGET_NETWORK" side-prefund $@ +if [[ "$TARGET_NETWORK" == "development" ]]; then + docker run --network blockchain_side --rm --env-file ".env.$TARGET_NETWORK" side-prefund $@ +else + docker run --rm --env-file ".env.$TARGET_NETWORK" --env-file "../.keys.$TARGET_NETWORK" side-prefund $@ +fi From 593bab3121cd903e9d3099ec66fa28f1e2406663 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Mon, 11 Nov 2019 20:14:07 +0300 Subject: [PATCH 083/129] Updated and refactored tests and demo scripts --- .circleci/config.yml | 11 +++++------ .../run.sh => demo/start-binance-environment.sh | 12 ++++++------ ...ironment.sh => start-ethereum-environment.sh} | 0 demo/validator1/.env.development | 4 ---- demo/validator2/.env.development | 4 ---- demo/validator3/.env.development | 4 ---- tests/init.sh | 16 +++++++++++++--- tests/run.sh | 10 ++++++---- 8 files changed, 30 insertions(+), 31 deletions(-) rename src/binance-testnet/run.sh => demo/start-binance-environment.sh (76%) rename demo/{start-environment.sh => start-ethereum-environment.sh} (100%) diff --git a/.circleci/config.yml b/.circleci/config.yml index b20acda..06659cb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -150,7 +150,7 @@ jobs: - run: name: "Run dev environment, deploy contracts, prefund accounts" command: | - BLOCK_TIME=3 ./demo/start-environment.sh + BLOCK_TIME=3 ./demo/start-ethereum-environment.sh cat ./tests/config.json | jq .users[].ethAddress | xargs -I {} ./src/test-services/ethereumSend/run.sh {} 300 - run: name: "Stop dev environment" @@ -158,9 +158,7 @@ jobs: - bridge/save_ganache_data - run: name: "Prefund bnc addresses" - command: | - echo "FOREIGN_PRIVATE_KEY=$FOREIGN_PRIVATE_KEY" > ./src/test-services/.keys.$TARGET_NETWORK - cat ./tests/config.json | jq .users[].bncAddress | xargs -I {} ./src/test-services/binanceSend/run.sh {} 300 0.1 + command: cat ./tests/config.json | jq .users[].bncAddress | xargs -I {} ./src/test-services/binanceSend/run.sh {} 300 0.1 run_tests: executor: bridge/node-dev steps: @@ -173,7 +171,8 @@ jobs: - run: name: "Init tests environment" command: | - BLOCK_TIME=3 ./demo/start-environment.sh + BLOCK_TIME=3 ./demo/start-ethereum-environment.sh + ./demo/start-binance-environment.sh N=1 ./demo/validator-demo.sh -d N=2 ./demo/validator-demo.sh -d N=3 ./demo/validator-demo.sh -d @@ -189,7 +188,7 @@ jobs: name: "Build and prepare tests container" command: | docker build -t tests ./tests - docker create --env-file ./tests/.env -e FOREIGN_PRIVATE_KEY --name tests tests + docker create --env-file ./tests/.env --name tests tests docker network connect blockchain_side tests docker network connect blockchain_home tests docker network connect validator1_test_network tests diff --git a/src/binance-testnet/run.sh b/demo/start-binance-environment.sh similarity index 76% rename from src/binance-testnet/run.sh rename to demo/start-binance-environment.sh index 99f9dc8..2111c20 100755 --- a/src/binance-testnet/run.sh +++ b/demo/start-binance-environment.sh @@ -28,12 +28,12 @@ ISSUED_LOG=$(tbnbcli token issue --symbol DEV --total-supply 1000000000000 --tok TOKEN_SYMBOL=${ISSUED_LOG:(-8):7} echo "Issued $TOKEN_SYMBOL" -sed -i 's/FOREIGN_ASSET=.*$/FOREIGN_ASSET='"$TOKEN_SYMBOL"'/' ../test-services/binanceBalance/.env.development -sed -i 's/FOREIGN_ASSET=.*$/FOREIGN_ASSET='"$TOKEN_SYMBOL"'/' ../test-services/binanceSend/.env.development -sed -i 's/FOREIGN_ASSET=.*$/FOREIGN_ASSET='"$TOKEN_SYMBOL"'/' ../../demo/validator1/.env.development -sed -i 's/FOREIGN_ASSET=.*$/FOREIGN_ASSET='"$TOKEN_SYMBOL"'/' ../../demo/validator2/.env.development -sed -i 's/FOREIGN_ASSET=.*$/FOREIGN_ASSET='"$TOKEN_SYMBOL"'/' ../../demo/validator3/.env.development -sed -i 's/FOREIGN_ASSET=.*$/FOREIGN_ASSET='"$TOKEN_SYMBOL"'/' ../../tests/.env +sed -i 's/FOREIGN_ASSET=.*$/FOREIGN_ASSET='"$TOKEN_SYMBOL"'/' ../src/test-services/binanceBalance/.env.development +sed -i 's/FOREIGN_ASSET=.*$/FOREIGN_ASSET='"$TOKEN_SYMBOL"'/' ../src/test-services/binanceSend/.env.development +sed -i 's/FOREIGN_ASSET=.*$/FOREIGN_ASSET='"$TOKEN_SYMBOL"'/' ../tests/.env +for file in ./validator*/.env.development; do + sed -i 's/FOREIGN_ASSET=.*$/FOREIGN_ASSET='"$TOKEN_SYMBOL"'/' "$file" +done sleep 2 diff --git a/demo/start-environment.sh b/demo/start-ethereum-environment.sh similarity index 100% rename from demo/start-environment.sh rename to demo/start-ethereum-environment.sh diff --git a/demo/validator1/.env.development b/demo/validator1/.env.development index 832f088..54e7248 100644 --- a/demo/validator1/.env.development +++ b/demo/validator1/.env.development @@ -7,13 +7,9 @@ HOME_MAX_FETCH_RANGE_SIZE=10 SIDE_RPC_URL=http://ganache_side:8545 SIDE_SHARED_DB_ADDRESS=0xd5fE0D28e058D375b0b038fFbB446Da37E85fFdc -#FOREIGN_URL=https://testnet-dex.binance.org/ -#FOREIGN_CHAIN_ID=Binance-Chain-Nile -#FOREIGN_ASSET=DEV-BA8 FOREIGN_URL=http://http-api:8000 FOREIGN_CHAIN_ID=Binance-Dev FOREIGN_ASSET=DEV-BA8 - FOREIGN_FETCH_MAX_TIME_INTERVAL=60000 FOREIGN_FETCH_INTERVAL=5000 FOREIGN_FETCH_BLOCK_TIME_OFFSET=10000 diff --git a/demo/validator2/.env.development b/demo/validator2/.env.development index 56cd098..532206d 100644 --- a/demo/validator2/.env.development +++ b/demo/validator2/.env.development @@ -7,13 +7,9 @@ HOME_MAX_FETCH_RANGE_SIZE=10 SIDE_RPC_URL=http://ganache_side:8545 SIDE_SHARED_DB_ADDRESS=0xd5fE0D28e058D375b0b038fFbB446Da37E85fFdc -#FOREIGN_URL=https://testnet-dex.binance.org/ -#FOREIGN_CHAIN_ID=Binance-Chain-Nile -#FOREIGN_ASSET=DEV-BA8 FOREIGN_URL=http://http-api:8000 FOREIGN_CHAIN_ID=Binance-Dev FOREIGN_ASSET=DEV-BA8 - FOREIGN_FETCH_MAX_TIME_INTERVAL=60000 FOREIGN_FETCH_INTERVAL=5000 FOREIGN_FETCH_BLOCK_TIME_OFFSET=10000 diff --git a/demo/validator3/.env.development b/demo/validator3/.env.development index bb3def1..cdf7303 100644 --- a/demo/validator3/.env.development +++ b/demo/validator3/.env.development @@ -7,13 +7,9 @@ HOME_MAX_FETCH_RANGE_SIZE=10 SIDE_RPC_URL=http://ganache_side:8545 SIDE_SHARED_DB_ADDRESS=0xd5fE0D28e058D375b0b038fFbB446Da37E85fFdc -#FOREIGN_URL=https://testnet-dex.binance.org/ -#FOREIGN_CHAIN_ID=Binance-Chain-Nile -#FOREIGN_ASSET=DEV-BA8 FOREIGN_URL=http://http-api:8000 FOREIGN_CHAIN_ID=Binance-Dev FOREIGN_ASSET=DEV-BA8 - FOREIGN_FETCH_MAX_TIME_INTERVAL=60000 FOREIGN_FETCH_INTERVAL=5000 FOREIGN_FETCH_BLOCK_TIME_OFFSET=10000 diff --git a/tests/init.sh b/tests/init.sh index 794fd8c..036b15c 100755 --- a/tests/init.sh +++ b/tests/init.sh @@ -1,20 +1,30 @@ #!/bin/bash set -e -set -v +echo "Killing all remaining validator docker containers" +docker kill $(docker ps | grep validator[1-3]_ | awk '{print $1}') > /dev/null 2>&1 +docker rm $(docker ps | grep validator[1-3]_ | awk '{print $1}') > /dev/null 2>&1 + +echo "Building tss clients" docker build -t tss ./src/tss -./demo/start-environment.sh -./src/binance-testnet/run.sh +echo "Starting ethereum test networks" +BLOCK_TIME=3 ./demo/start-ethereum-environment.sh +echo "Starting binance test network" +./demo/start-binance-environment.sh +echo "Prefunding ethereum user accounts" cat ./tests/config.json | jq .users[].ethAddress | xargs -I {} ./src/test-services/ethereumSend/run.sh {} 300 +echo "Prefunding binance user accounts" cat ./tests/config.json | jq .users[].bncAddress | xargs -I {} ./src/test-services/binanceSend/run.sh {} 300 0.1 +echo "Starting validator daemons" N=1 ./demo/validator-demo.sh -d N=2 ./demo/validator-demo.sh -d N=3 ./demo/validator-demo.sh -d +echo "Waiting until validators are ready" until curl -X GET http://localhost:5001 > /dev/null 2>&1; do sleep 1; done until curl -X GET http://localhost:5002 > /dev/null 2>&1; do sleep 1; done until curl -X GET http://localhost:5003 > /dev/null 2>&1; do sleep 1; done diff --git a/tests/run.sh b/tests/run.sh index 3eb29d7..7889847 100755 --- a/tests/run.sh +++ b/tests/run.sh @@ -2,13 +2,14 @@ set -e +echo "Building tests main image" docker build -t tests ./tests +echo "Creating tests container" docker rm tests > /dev/null 2>&1 || true -docker create --name tests \ - --env-file ./tests/.env \ - tests $@ +docker create --name tests --env-file ./tests/.env tests $@ +echo "Connecting tests container to test networks" docker network connect binance_net tests docker network connect blockchain_home tests docker network connect blockchain_side tests @@ -16,7 +17,8 @@ docker network connect validator1_test_network tests docker network connect validator2_test_network tests docker network connect validator3_test_network tests +echo "Starting tests" docker start -a tests || true +echo "Saving test results" docker cp "tests:/tests/results.xml" "./tests/results.xml" > /dev/null 2>&1 || true -docker rm tests > /dev/null 2>&1 || true From 653ab844a75def7ff9226ea8eb99cac24d2979c5 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Mon, 11 Nov 2019 20:17:34 +0300 Subject: [PATCH 084/129] Automatic cleaning in tests init script --- tests/init.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/init.sh b/tests/init.sh index 036b15c..e5a3297 100755 --- a/tests/init.sh +++ b/tests/init.sh @@ -2,6 +2,9 @@ set -e +echo "Cleaning previous demo environment" +./demo/clean.sh + echo "Killing all remaining validator docker containers" docker kill $(docker ps | grep validator[1-3]_ | awk '{print $1}') > /dev/null 2>&1 docker rm $(docker ps | grep validator[1-3]_ | awk '{print $1}') > /dev/null 2>&1 From 57cec2835703158a6d3ed0cdf1257e5e92fff717 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Mon, 11 Nov 2019 20:25:08 +0300 Subject: [PATCH 085/129] Not failing docker kill/rm --- tests/init.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/init.sh b/tests/init.sh index e5a3297..cb4f279 100755 --- a/tests/init.sh +++ b/tests/init.sh @@ -6,8 +6,8 @@ echo "Cleaning previous demo environment" ./demo/clean.sh echo "Killing all remaining validator docker containers" -docker kill $(docker ps | grep validator[1-3]_ | awk '{print $1}') > /dev/null 2>&1 -docker rm $(docker ps | grep validator[1-3]_ | awk '{print $1}') > /dev/null 2>&1 +docker kill $(docker ps | grep validator[1-3]_ | awk '{print $1}') > /dev/null 2>&1 || true +docker rm $(docker ps | grep validator[1-3]_ | awk '{print $1}') > /dev/null 2>&1 || true echo "Building tss clients" docker build -t tss ./src/tss From 3614f8c2927448bd2a9f02409178a7e55eed81b5 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Mon, 11 Nov 2019 20:54:35 +0300 Subject: [PATCH 086/129] Fixed tests and demo scripts --- demo/start-binance-environment.sh | 4 ++-- tests/init.sh | 12 ++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/demo/start-binance-environment.sh b/demo/start-binance-environment.sh index 2111c20..86ca927 100755 --- a/demo/start-binance-environment.sh +++ b/demo/start-binance-environment.sh @@ -16,10 +16,10 @@ docker volume rm binance-testnet_marketdata > /dev/null 2>&1 || true docker network create binance_net > /dev/null 2>&1 || true echo "Building required binaries" -docker build -t testnet-binaries . > /dev/null 2>&1 || true +docker build -t testnet-binaries ../src/binance-testnet > /dev/null 2>&1 || true echo "Running environment" -docker-compose up --build -d +docker-compose -f ../src/binance-testnet/docker-compose.yml up --build -d sleep 2 diff --git a/tests/init.sh b/tests/init.sh index cb4f279..b94a291 100755 --- a/tests/init.sh +++ b/tests/init.sh @@ -2,12 +2,16 @@ set -e -echo "Cleaning previous demo environment" -./demo/clean.sh - -echo "Killing all remaining validator docker containers" +echo "Killing all remaining docker containers" docker kill $(docker ps | grep validator[1-3]_ | awk '{print $1}') > /dev/null 2>&1 || true docker rm $(docker ps | grep validator[1-3]_ | awk '{print $1}') > /dev/null 2>&1 || true +docker kill ganache_home ganache_side > /dev/null 2>&1 || true +docker rm ganache_home ganache_side > /dev/null 2>&1 || true +docker kill $(docker ps | grep binance-testnet_ | awk '{print $1}') > /dev/null 2>&1 || true +docker rm $(docker ps | grep binance-testnet_ | awk '{print $1}') > /dev/null 2>&1 || true + +echo "Cleaning previous demo environment" +./demo/clean.sh echo "Building tss clients" docker build -t tss ./src/tss From 50c8d4ecf3abde9d0c5aeb3ff674d6835f984349 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Mon, 11 Nov 2019 21:11:25 +0300 Subject: [PATCH 087/129] Moved bnc prefunding in run_tests --- .circleci/config.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 06659cb..a64dad6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -156,9 +156,6 @@ jobs: name: "Stop dev environment" command: docker kill ganache_side ganache_home - bridge/save_ganache_data - - run: - name: "Prefund bnc addresses" - command: cat ./tests/config.json | jq .users[].bncAddress | xargs -I {} ./src/test-services/binanceSend/run.sh {} 300 0.1 run_tests: executor: bridge/node-dev steps: @@ -173,6 +170,7 @@ jobs: command: | BLOCK_TIME=3 ./demo/start-ethereum-environment.sh ./demo/start-binance-environment.sh + cat ./tests/config.json | jq .users[].bncAddress | xargs -I {} ./src/test-services/binanceSend/run.sh {} 300 0.1 N=1 ./demo/validator-demo.sh -d N=2 ./demo/validator-demo.sh -d N=3 ./demo/validator-demo.sh -d From 7ae65fd42f6aca0171fbd51a0e0d9fcefdb1ae44 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Mon, 11 Nov 2019 21:33:55 +0300 Subject: [PATCH 088/129] Connecting to binance test network --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index a64dad6..a1e6183 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -187,6 +187,7 @@ jobs: command: | docker build -t tests ./tests docker create --env-file ./tests/.env --name tests tests + docker network connect binance_net tests docker network connect blockchain_side tests docker network connect blockchain_home tests docker network connect validator1_test_network tests From 5240ae17aba70cfbad3f03c46a51ecf3195e1c07 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Tue, 12 Nov 2019 17:35:12 +0300 Subject: [PATCH 089/129] Updated demo instructions --- DEMO.md | 317 +++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 196 insertions(+), 121 deletions(-) diff --git a/DEMO.md b/DEMO.md index a408598..9dde9b6 100644 --- a/DEMO.md +++ b/DEMO.md @@ -13,7 +13,13 @@ This demo supports two ways of dealing with the Ethereum side of a bridge: As part of this demo two EVM-based chains ([ganache](https://github.com/trufflesuite/ganache-cli)) will be started: - **Home chain** - it keeps an ERC20 contract (`0xd5fE0D28e058D375b0b038fFbB446Da37E85fFdc`) and the bridge contract (`0x44c158FE850821ae69DaF37AADF5c539e9d0025B`). - **Side chain** - the MPC orchestration contract (`0xd5fE0D28e058D375b0b038fFbB446Da37E85fFdc`) is located here -Both chains are run in separate docker containers. +Both chains are run in separate docker containers. +JSON-RPC ports are mapped to the host (7545 - side chain, 8545 - home chain) + +Local Binance network within separate docker container will be used. +In addition, some part of Binance accelerated node [HTTP API](https://docs.binance.org/api-reference/dex-api/paths.html) +will be emulated, since a regular full-node API does not provide all required features. +APIs and NODE RPC ports are mapped to the host (26657 - RPC, 8080 - api-server, 8000 - emulated accelerated node api) #### Staging mode @@ -22,6 +28,9 @@ As part of this demo two EVM-based public chains will be used: - **Side chain** - Sokol POA testnet keeps the MPC orchestration contract. Interaction with chains is done by using public available RPC urls. +Public Binance testnet will be used for demo purposes. +Interaction with chain is done by using a public available HTTP API endpoint. + ### Demo validators Three validators will be run and only two validators are required to confirm the transfer. Every validator node is a set of docker containers (`eth-watcher`, `bnc-watcher`, `signer`, `proxy`, `redis`, `rabbitmq`). @@ -30,161 +39,92 @@ Three validators will be run and only two validators are required to confirm the The public Binance Chain testnet will keep a BEP2 token. -### Running demo +### Running demo in development mode 1. Preparation - * (1.1) Download `tbnbcli` from https://github.com/binance-chain/node-binary/tree/master/cli. - * (1.2) Create a new account through the [web-interface](https://testnet.binance.org/en/create) in the Binance testnet wallet. Copy the private key and mnemonic phrase. The private key will be used to import it in an Ethereum Wallet. The mnemonic phrase is to recover the BNB with `tbnbcli`. - * (1.3) Recover the account in the console with the mnemonic. - ``` - ./tbnbcli keys add test_account1 --recover - ``` - * (1.4) Create few BNB accounts from the console. They will be donors to provide enough funds to issue a BEP2 tokens (500 BNB required). - ``` - ./tbnbcli keys add test_account2 - ./tbnbcli keys add test_account3 - ``` - * (1.5) Register on the Binance site and fund the accounts from the [testnet faucet](https://www.binance.com/en/dex/testnet/address). - * (1.6) Re-arrange funds on the accounts as so the first account will have 550 BNB and others 10-20 BNBs to make transactions. - ``` - ./tbnbcli send --from test_account2 --to
\ - --amount 18500000000:BNB --chain-id=Binance-Chain-Nile \ - --node=data-seed-pre-2-s1.binance.org:80 --memo "donate" - ./tbnbcli send --from test_account3 --to
\ - --amount 18500000000:BNB --chain-id=Binance-Chain-Nile - --node=data-seed-pre-2-s1.binance.org:80 --memo "donate" - ``` - * (1.7) Issue the BEP2 token from the first account. `3141500000000000` corresponds to `31415000.0` tokens. - ``` - ./tbnbcli token issue --token-name "ERC20toBEP2Bridge" --total-supply 3141500000000000 \ - --symbol ETB0819 --mintable --from test_account1 --chain-id=Binance-Chain-Nile \ - --node=data-seed-pre-2-s1.binance.org:80 --trust-node - ``` - In the real deployment most probably the token must not be mintable. - * (1.8) Get the BEP2 token ID in `denom` field (in this example it is `ETB0819-863`). - ``` - ./tbnbcli account
\ - --chain-id=Binance-Chain-Nile --node=data-seed-pre-2-s1.binance.org:80 --trust-node - ``` - * (1.9) Clone the repo and initialize git submodules: + * (1.1) Clone the repo and initialize git submodules: ``` git clone --recurse-submodules https://github.com/k1rill-fedoseev/eth-to-bnc-bridge.git ``` - * (1.10) Build TSS to be used in the bridge oracles: + * (1.2) Build TSS to be used in the bridge oracles: ``` docker build -t tss ./src/tss ``` + * (1.3) Generate several private keys for bridge testing. (e. g. `openssl rand -hex 32`) + * (1.4) Get Ethereum and Binance addresses for recently created accounts via running + ``` + ./src/test-services/getAddresses/run.sh + ``` 2. Run test environment - * 2.1 Running in development mode (using local ganache networks): - * (2.1.1) Modify `src/deploy/deploy-test/.env.development` and specify the amount of tokens to mint in the parameter `TOKEN_INITIAL_MINT`. - * (2.1.2) Run testnets and deploy contracts - ``` - TARGET_NETWORK=development ./demo/start-environment.sh - ``` - This command will also mint tokens, the owner of tokens is the address that corresponds to the - private key specified in `HOME_PRIVATE_KEY` of `src/deploy/deploy-test/.env.development` (`0xA374DC09057D6B3253d04fACb15736B43fBc7943`). - * 2.2 Running in staging mode (using public test networks): - * (2.2.1) Prepare three private keys for validators. Get the Ethereum account addresses for these keys. - * (2.2.2) Modify `src/deploy/deploy-home/.env.staging` and specify the token contract address in - the Kovan network via `HOME_TOKEN_ADDRESS` (use empty address `0x` if you want to create new - ERC20 contract while deployment). \ - Set `VALIDATOR_ADDRESS_*` to Ethereum addresses obtained in the previous step. - * (2.2.3) Modify `src/deploy/.keys.staging` and specify private keys for prefunded accounts in both networks. - These accounts are used for contract deployment. Use `src/deploy/.keys.staging.example` as an example. - * (2.2.4) Deploy contracts - ``` - TARGET_NETWORK=staging ./demo/start-environment.sh - ``` - This command will deploy ERC20 contract and also mint tokens if you left `HOME_TOKEN_ADDRESS` empty, - the owner of tokens is the address that corresponds to the private key specified in - `HOME_PRIVATE_KEY` of `src/deploy/.keys.staging`.\ - Deployed contract address will be automatically updates in all required validators - and test services configs. - * (2.2.5) Prefund validator accounts in home network (Kovan): - ``` - TARGET_NETWORK=staging ./src/test-services/ethereumSend/run.sh 0 0.5 - ``` - * (2.2.6) Prefund validator accounts in side network (Sokol): - ``` - TARGET_NETWORK=staging ./src/test-services/sidePrefund/run.sh 1 - ``` - * (2.3) Get the Ethereum account address for the first test account from its private key (step 1.2). [NiftyWallet](https://forum.poa.network/c/nifty-wallet) could be used for this. - * (2.4) Send few tokens and coins from the current token owner to the first account. Coins are needed to pay transaction fees. + * (2.1) Modify `src/deploy/deploy-test/.env.development` and specify the amount of tokens to mint in the parameter `TOKEN_INITIAL_MINT`. + * (2.2) Run Ethereum testnets and deploy contracts ``` - TARGET_NETWORK= ./src/test-services/ethereumSend/run.sh 5000000000000000000 0.5 + TARGET_NETWORK=development ./demo/start-ethereum-environment.sh ``` - * (2.5) Check that the tokens were transferred properly: + This command will also mint tokens, the owner of tokens is the address that corresponds to the + private key specified in `HOME_PRIVATE_KEY` of `src/deploy/deploy-test/.env.development` (`0xA374DC09057D6B3253d04fACb15736B43fBc7943`). + * (2.4) Run Binance testnet and api services ``` - TARGET_NETWORK= ./src/test-services/ethereumBalance/run.sh + ./demo/start-binance-environment.sh + ``` + This command will also issue a BEP2 token, the owner of tokens is the address that corresponds to the + private key specified in `FOREIGN_PRIVATE_KEY` of `src/test-services/binanceSend/.env.development` (`tbnb1z7u9f8mcuwxanns9xa6qgjtlka0d392epc0m9x`). + The balance of `tbnb1z7u9f8mcuwxanns9xa6qgjtlka0d392epc0m9x` will contain 10000 BNB and 10000 Test Tokens. + * (2.5) Send few tokens and coins from the current token owner to the first account. Coins are needed to pay transaction fees. + ``` + ./src/test-services/ethereumSend/run.sh 5 0.5 + ``` + * (2.6) Check that the tokens were transferred properly: + ``` + ./src/test-services/ethereumBalance/run.sh ``` 3. Run validators nodes: - * (3.1) Modify the parameter `FOREIGN_ASSET` in `demo/validator1/.env.`, `demo/validator2/.env.` - and `demo/validator3/.env.` to specify the identificator of the token (step 1.8) that the oracle will watch. \ - For staging environment additionally specify `VALIDATOR_PRIVATE_KEY` in the `demo/validator/.keys.staging` (step 2.2.1) - * (3.2) Run three validators in separate terminal sessions. + * (3.1) Run three validators in separate terminal sessions. ``` - N=1 TARGET_NETWORK= ./demo/validator-demo.sh - N=2 TARGET_NETWORK= ./demo/validator-demo.sh - N=3 TARGET_NETWORK= ./demo/validator-demo.sh + N=1 ./demo/validator-demo.sh + N=2 ./demo/validator-demo.sh + N=3 ./demo/validator-demo.sh ``` Wait for when the line like the following appears: ``` keygen_1 | Generated multisig account in binance chain: tbnb1mutgnx9n9devmrjh3d0wz332fl8ymgel6tydx6 ``` - The line contains the address of the bridge address in the Bincance Chain. + The line contains the address of the bridge address in the Binance Chain. 4. Initialize the state of the bridge account in the Binance Chain * (4.1) Fill the balance Fund with BNB coins as so the account will be able to make transactions: ``` - ./tbnbcli send --from test_account1 --to
\ - --amount 1000000000:BNB --chain-id=Binance-Chain-Nile \ - --node=data-seed-pre-2-s1.binance.org:80 --memo "initialization" - ``` - * (4.2) Fund the account with bridgeable tokens. **This transaction should have 'funding' in the memo**: + ./src/test-services/binanceSend/run.sh
100 1 ``` - ./tbnbcli send --from test_account1 --to
\ - --amount 3141500000000000:ETB0819-863 --chain-id=Binance-Chain-Nile \ - --node=data-seed-pre-2-s1.binance.org:80 --memo "funding" - ``` - The oracles should catch this transaction but will ignore it: - ``` - bnc-watcher_1 | Fetching new transactions - bnc-watcher_1 | Sending api transactions request - bnc-watcher_1 | Found 1 new transactions - ``` - To check the balance of the bridge account the [Binance Testnet Explorer](https://testnet-explorer.binance.org) could be used. It should report about two assets owned by the account. + To check the balance of the bridge account use `./src/test-services/binanceBalance/run.sh
` 5. Transfer tokens from Ethereum-based chain to the Binance Chain: - * (5.1) Modify the parameter `HOME_PRIVATE_KEY` - (in `src/test-services/ethereumSend/.env.development` or `src/test-services/.keys.staging`) - as so it contains the private key of the first test account (step 1.2) - * (5.2) Send some amount of tokens to the bridge contract: + * (5.1) Send some amount of tokens to the bridge contract, for `PRIVATE_KEY` use some of the keys from step (1.3): ``` - TARGET_NETWORK= ./src/test-services/ethereumSend/run.sh bridge 5000000000000000000 + PRIVATE_KEY= ./src/test-services/ethereumSend/run.sh bridge 5 ``` - * (5.3) The validators will catch the event and start the process to sign the transaction. - * (5.4) As soon as the signature is generated and sent, the balance of the bridge account in both chains will be changed: + * (5.2) The validators will catch the event and start the process to sign the transaction. + * (5.3) As soon as the signature is generated and sent, the balance of the bridge account in both chains will be changed: ``` - TARGET_NETWORK= ./src/test-services/ethereumBalance/run.sh 0x94b40CC641Ed7db241A1f04C8896ba6f6cC36b85 + ./src/test-services/ethereumBalance/run.sh ``` - should report non-zero balance + should report non-zero balance, ``` - ./tbnbcli account
\ - --chain-id=Binance-Chain-Nile --node=data-seed-pre-2-s1.binance.org:80 --trust-node + ./src/test-services/binanceBalance/run.sh ``` should report about the balance reduction. - The balance and transactions related to the bridge account in the Binance Chain could be checked in [Binance Testnet Explorer](https://testnet-explorer.binance.org). - * (5.5) Check that the tokens was transferred to the first test account either by `tbnbcli` or by [Binance Testnet Explorer](https://testnet-explorer.binance.org). + * (5.4) Check that the tokens were transferred properly to the test account: + ``` + ./src/test-services/binanceBalance/run.sh + ``` 6. Transfer tokens from the Binance Chain to Ethereum-based chain: - * Use either `tbnbcli` or the [Binance testnet wallet](https://testnet.binance.org/) to send tokens to the bridge account: + * (6.1) Send some amount of tokens to the bridge account: ``` - ./tbnbcli send --from test_account1 --to
\ - --amount 300000000:ETB0819-863 --chain-id=Binance-Chain-Nile \ - --node=data-seed-pre-2-s1.binance.org:80 --memo "any note" + PRIVATE_KEY= ./src/test-services/binanceSend/run.sh 3 ``` - * Check the balances of the test account on both sides of the bridge to see that the funds were transferred properly. + * (6.2) Check the balances of the test account on both sides of the bridge to see that the funds were transferred properly using commands from (5.3), (5.4). 7. Bridge supports changing the list of validators and required voting threshold via voting process, and then keys regeneration. * (7.0) Obtain information about current epoch, current list validators, upcoming epoch information, bridge state via: ``` - ./curl http://localhost:$PORT/info + curl http://localhost:$PORT/info ``` Where `$PORT` is specific port for some validator oracle. The response object contains lots of useful information about current bridge state. @@ -247,21 +187,156 @@ The public Binance Chain testnet will keep a BEP2 token. * (7.2.2) Change threshold for the next epoch, via sending `$THRESHOLD` requests to `/vote/changeThreshold/$THRESHOLD`. * (7.3) Start keygen process for next epoch, via sending `$THRESHOLD` requests to `/vote/startKeygen` url. Bridge state should be successfully changed to `keygen`, and in some time to `funds_transfer`, and then to `ready`. - * (7.4) If keygen process at some state was stopped(i. e. one validator turned of his oracle), - it can be cancelled via via sending `$THRESHOLD + 1` requests to `/vote/cancelKeygen` url. After + * (7.4) If keygen process at some state was stopped(i. e. one validator turned off his oracle), + it can be cancelled via via sending `$THRESHOLD` requests to `/vote/cancelKeygen` url. After keygen cancellation, bridge state will return to `voting`, and later it can be restarted manually once again. +### Running demo in staging mode + +Staging mode demo is similar to development mode demo, but requires additional manual actions for preparing demo. +Make sure, to first run demo in development mode, before trying to run it in the staging environment. + +1. Preparation + * (1.1) Download `tbnbcli` from https://github.com/binance-chain/node-binary/tree/master/cli. + * (1.2) Create a new account through the [web-interface](https://testnet.binance.org/en/create) in the Binance testnet wallet. Copy the private key and mnemonic phrase. The private key will be used to import it in an Ethereum Wallet. The mnemonic phrase is to recover the BNB with `tbnbcli`. + * (1.3) Recover the account in the console with the mnemonic. + ``` + ./tbnbcli keys add test_account1 --recover + ``` + * (1.4) Create few BNB accounts from the console. They will be donors to provide enough funds to issue a BEP2 tokens (500 BNB required). + ``` + ./tbnbcli keys add test_account2 + ./tbnbcli keys add test_account3 + ``` + * (1.5) Register on the Binance site and fund the accounts from the [testnet faucet](https://www.binance.com/en/dex/testnet/address). + * (1.6) Re-arrange funds on the accounts as so the first account will have 550 BNB and others 10-20 BNBs to make transactions. + ``` + ./tbnbcli send --from test_account2 --to
\ + --amount 18500000000:BNB --chain-id=Binance-Chain-Nile \ + --node=data-seed-pre-2-s1.binance.org:80 --memo "donate" + ./tbnbcli send --from test_account3 --to
\ + --amount 18500000000:BNB --chain-id=Binance-Chain-Nile + --node=data-seed-pre-2-s1.binance.org:80 --memo "donate" + ``` + * (1.7) Issue the BEP2 token from the first account. `3141500000000000` corresponds to `31415000.0` tokens. + ``` + ./tbnbcli token issue --token-name "ERC20toBEP2Bridge" --total-supply 3141500000000000 \ + --symbol ETB0819 --mintable --from test_account1 --chain-id=Binance-Chain-Nile \ + --node=data-seed-pre-2-s1.binance.org:80 --trust-node + ``` + In the real deployment most probably the token must not be mintable. + * (1.8) Get the BEP2 token ID in `denom` field (in this example it is `ETB0819-863`). + ``` + ./tbnbcli account
\ + --chain-id=Binance-Chain-Nile --node=data-seed-pre-2-s1.binance.org:80 --trust-node + ``` + * (1.9) Clone the repo and initialize git submodules: + ``` + git clone --recurse-submodules https://github.com/k1rill-fedoseev/eth-to-bnc-bridge.git + ``` + * (1.10) Build TSS to be used in the bridge oracles: + ``` + docker build -t tss ./src/tss + ``` +2. Run test environment + * (2.1) Prepare three private keys for validators. Get the Ethereum account addresses for these keys. + * (2.2) Modify `src/deploy/deploy-home/.env.staging` and specify the token contract address in + the Kovan network via `HOME_TOKEN_ADDRESS` (use empty address `0x` if you want to create new + ERC20 contract while deployment). \ + Set `VALIDATOR_ADDRESS_*` to Ethereum addresses obtained in the previous step. + * (2.3) Modify `src/deploy/.keys.staging` and specify private keys for prefunded accounts in both networks. + These accounts are used for contract deployment. Use `src/deploy/.keys.staging.example` as an example. + * (2.4) Deploy contracts + ``` + TARGET_NETWORK=staging ./demo/start-ethereum-environment.sh + ``` + This command will deploy ERC20 contract and also mint tokens if you left `HOME_TOKEN_ADDRESS` empty, + the owner of tokens is the address that corresponds to the private key specified in + `HOME_PRIVATE_KEY` of `src/deploy/.keys.staging`.\ + Deployed contract addresses will be automatically updated in all required validators + and test services configs. + * (2.5) Prefund validator accounts in home network (Kovan): + ``` + TARGET_NETWORK=staging ./src/test-services/ethereumSend/run.sh 0 0.5 + ``` + * (2.6) Prefund validator accounts in side network (Sokol): + ``` + TARGET_NETWORK=staging ./src/test-services/sidePrefund/run.sh 1 + ``` + * (2.7) Send few tokens and coins from the current token owner to the first account. Coins are needed to pay transaction fees. + ``` + TARGET_NETWORK=staging ./src/test-services/ethereumSend/run.sh 5 0.5 + ``` + * (2.8) Check that the tokens were transferred properly: + ``` + TARGET_NETWORK=staging ./src/test-services/ethereumBalance/run.sh + ``` +3. Run validators nodes: + * (3.1) Modify the parameter `FOREIGN_ASSET` in `demo/validator1/.env.staging`, `demo/validator2/.env.staging` + and `demo/validator3/.env.staging` to the identificator of the token (step 1.8) that the oracle will track. \ + For staging environment additionally specify `VALIDATOR_PRIVATE_KEY` in the `demo/validator/.keys.staging` (step 2.2.1) + * (3.2) Run three validators in separate terminal sessions. + ``` + N=1 TARGET_NETWORK=staging ./demo/validator-demo.sh + N=2 TARGET_NETWORK=staging ./demo/validator-demo.sh + N=3 TARGET_NETWORK=staging ./demo/validator-demo.sh + ``` + Wait for when the line like the following appears: + ``` + keygen_1 | Generated multisig account in binance chain: tbnb1mutgnx9n9devmrjh3d0wz332fl8ymgel6tydx6 + ``` + The line contains the address of the bridge address in the Binance Chain. +4. Initialize the state of the bridge account in the Binance Chain + * (4.1) Fill the balance Fund with BNB coins as so the account will be able to make transactions: + ``` + ./src/test-services/binanceSend/run.sh
100 1 + ``` + To check the balance of the bridge account use `./src/test-services/binanceBalance/run.sh` + or [Binance Testnet Explorer](https://testnet-explorer.binance.org). It should report about two assets owned by the account. +5. Transfer tokens from Ethereum-based chain to the Binance Chain: + * (5.1) Send some amount of tokens to the bridge contract, for `PRIVATE_KEY` use some of the keys from step (1.3): + ``` + TARGET_NETWORK=staging PRIVATE_KEY= ./src/test-services/ethereumSend/run.sh bridge 5 + ``` + * (5.2) The validators will catch the event and start the process to sign the transaction. + * (5.3) As soon as the signature is generated and sent, the balance of the bridge account in both chains will be changed: + ``` + ./src/test-services/ethereumBalance/run.sh + ``` + should report non-zero balance, + ``` + ./src/test-services/binanceBalance/run.sh + ``` + should report about the balance reduction. + * (5.4) Check that the tokens were transferred properly to the test account: + ``` + ./src/test-services/binanceBalance/run.sh + ``` + The balance and transactions related to the bridge account in the Binance Chain could be checked in + [Binance Testnet Explorer](https://testnet-explorer.binance.org). +6. Transfer tokens from the Binance Chain to Ethereum-based chain: + * (6.1) Send some amount of tokens to the bridge account: + ``` + TARGET_NETWORK=staging PRIVATE_KEY= ./src/test-services/binanceSend/run.sh 3 + ``` + * (6.2) Check the balances of the test account on both sides of the bridge to see that the funds were transferred properly using commands from (5.3), (5.4). +7. Steps for updating validators list are exactly the same for both demo modes. Check the steps from development mode. + ### Finish demo 1. Stop all validator instances by pressing `^C` in the terminal. -2. Stop the local testnets: +2. Stop the local testnets (if any): ``` + docker kill binance-testnet_http-api_1 + docker kill binance-testnet_node_1 + docker kill binance-testnet_api-server_1 docker kill ganache_home docker kill ganache_side ``` 3. Remove virtual networks: ``` + docker network rm binance_net docker network rm blockchain_home docker network rm blockchain_side docker network rm validator1_test_network From f96cc303978cacf6c2df85b00d29c7ca0bbfad2b Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Tue, 12 Nov 2019 17:38:41 +0300 Subject: [PATCH 090/129] Updated tests readme --- tests/README.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/README.md b/tests/README.md index 85ab76a..c6aa152 100644 --- a/tests/README.md +++ b/tests/README.md @@ -14,7 +14,6 @@ CircleCI uses this tests for testing the code base. To run the bridge tests, you first need to clean old test environment, and then initialize a new one: ```bash -./demo/clean.sh ./tests/init.sh ``` This will create a clean development environment, using `./demo/start-environment.sh`. @@ -25,13 +24,12 @@ and wait until they are ready. Next, you can run the tests: ```bash -FOREIGN_PRIVATE_KEY=0000000000000000000000000000000000000000000000000000000000000000 ./tests/run.sh +./tests/run.sh ``` -`FOREIGN_PRIVATE_KEY` is the key, that will be used for initial prefunding first -generated binance side of the bridge. After tests are done, all active docker containers can be killed. ```bash docker kill $(docker ps | grep validator[1-3]_ | awk '{print $1}') docker kill ganache_side ganache_home +docker kill binance-testnet_http-api_1 binance-testnet_node_1 binance-testnet_api-server_1 ``` From 7f6030ee9444bdac177fc2f574232997a2b631d4 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Tue, 12 Nov 2019 18:18:45 +0300 Subject: [PATCH 091/129] Fixed minor bugs in eth-watcher --- demo/validator1/.env.staging | 12 ++++++------ demo/validator2/.env.staging | 10 +++++----- demo/validator3/.env.staging | 10 +++++----- src/deploy/deploy-home/.env.staging | 2 +- src/oracle/ethWatcher/ethWatcher.js | 6 +++--- src/test-services/ethereumBalance/.env.staging | 2 +- src/test-services/ethereumSend/.env.staging | 4 ++-- 7 files changed, 23 insertions(+), 23 deletions(-) diff --git a/demo/validator1/.env.staging b/demo/validator1/.env.staging index 83a0313..9b0cfc2 100644 --- a/demo/validator1/.env.staging +++ b/demo/validator1/.env.staging @@ -1,11 +1,11 @@ HOME_RPC_URL=https://kovan.infura.io/v3/5d7bd94c50ed43fab1cb8e74f58678b0 -HOME_BRIDGE_ADDRESS=0x6ADCa5e691341fb9de8927d15c0a89B83A4E665e -HOME_TOKEN_ADDRESS=0x57d2533B640cfb58f8f1F69C14c089968Da9fdFc -HOME_START_BLOCK=13276224 -HOME_MAX_FETCH_RANGE_SIZE=10 +HOME_BRIDGE_ADDRESS=0x01eD0d6350542E7643cB7bba4bccc96FedE0B616 +HOME_TOKEN_ADDRESS=0x7c7daEf752C80A6d229D4a642B9336ceCd7e26b0 +HOME_START_BLOCK=14760000 +HOME_MAX_FETCH_RANGE_SIZE=50 SIDE_RPC_URL=https://sokol.poa.network -SIDE_SHARED_DB_ADDRESS=0xda9a1cA2Fcb18cAB02934269369627D2b4ea8902 +SIDE_SHARED_DB_ADDRESS=0x7B307e73Ba9808BcA7cf24F1E7Ae9372faCeD102 FOREIGN_URL=https://testnet-dex.binance.org/ FOREIGN_CHAIN_ID=Binance-Chain-Nile @@ -24,4 +24,4 @@ VOTES_PROXY_PORT=5001 SIGN_RESTART_PORT=6001 -LOG_LEVEL=info +LOG_LEVEL=trace diff --git a/demo/validator2/.env.staging b/demo/validator2/.env.staging index 94c04a1..4e97765 100644 --- a/demo/validator2/.env.staging +++ b/demo/validator2/.env.staging @@ -1,11 +1,11 @@ HOME_RPC_URL=https://kovan.infura.io/v3/5d7bd94c50ed43fab1cb8e74f58678b0 -HOME_BRIDGE_ADDRESS=0x6ADCa5e691341fb9de8927d15c0a89B83A4E665e -HOME_TOKEN_ADDRESS=0x57d2533B640cfb58f8f1F69C14c089968Da9fdFc -HOME_START_BLOCK=13276224 -HOME_MAX_FETCH_RANGE_SIZE=10 +HOME_BRIDGE_ADDRESS=0x01eD0d6350542E7643cB7bba4bccc96FedE0B616 +HOME_TOKEN_ADDRESS=0x7c7daEf752C80A6d229D4a642B9336ceCd7e26b0 +HOME_START_BLOCK=14760000 +HOME_MAX_FETCH_RANGE_SIZE=50 SIDE_RPC_URL=https://sokol.poa.network -SIDE_SHARED_DB_ADDRESS=0xda9a1cA2Fcb18cAB02934269369627D2b4ea8902 +SIDE_SHARED_DB_ADDRESS=0x7B307e73Ba9808BcA7cf24F1E7Ae9372faCeD102 FOREIGN_URL=https://testnet-dex.binance.org/ FOREIGN_CHAIN_ID=Binance-Chain-Nile diff --git a/demo/validator3/.env.staging b/demo/validator3/.env.staging index 458974f..9de99d3 100644 --- a/demo/validator3/.env.staging +++ b/demo/validator3/.env.staging @@ -1,11 +1,11 @@ HOME_RPC_URL=https://kovan.infura.io/v3/5d7bd94c50ed43fab1cb8e74f58678b0 -HOME_BRIDGE_ADDRESS=0x6ADCa5e691341fb9de8927d15c0a89B83A4E665e -HOME_TOKEN_ADDRESS=0x57d2533B640cfb58f8f1F69C14c089968Da9fdFc -HOME_START_BLOCK=13276224 -HOME_MAX_FETCH_RANGE_SIZE=10 +HOME_BRIDGE_ADDRESS=0x01eD0d6350542E7643cB7bba4bccc96FedE0B616 +HOME_TOKEN_ADDRESS=0x7c7daEf752C80A6d229D4a642B9336ceCd7e26b0 +HOME_START_BLOCK=14760000 +HOME_MAX_FETCH_RANGE_SIZE=50 SIDE_RPC_URL=https://sokol.poa.network -SIDE_SHARED_DB_ADDRESS=0xda9a1cA2Fcb18cAB02934269369627D2b4ea8902 +SIDE_SHARED_DB_ADDRESS=0x7B307e73Ba9808BcA7cf24F1E7Ae9372faCeD102 FOREIGN_URL=https://testnet-dex.binance.org/ FOREIGN_CHAIN_ID=Binance-Chain-Nile diff --git a/src/deploy/deploy-home/.env.staging b/src/deploy/deploy-home/.env.staging index 550b4bc..2988dc3 100644 --- a/src/deploy/deploy-home/.env.staging +++ b/src/deploy/deploy-home/.env.staging @@ -3,7 +3,7 @@ HOME_RPC_URL=https://kovan.infura.io/v3/5d7bd94c50ed43fab1cb8e74f58678b0 #HOME_PRIVATE_KEY is taken from src/deploy/.keys.staging #Set to '0x' for redeployment of token contract in staging environment -HOME_TOKEN_ADDRESS=0x57d2533B640cfb58f8f1F69C14c089968Da9fdFc +HOME_TOKEN_ADDRESS=0x7c7daEf752C80A6d229D4a642B9336ceCd7e26b0 VALIDATOR_ADDRESS_1=0xaaaaB15630f63cA01bb50943AaAb4008CB53748D VALIDATOR_ADDRESS_2=0xbbbb63D6Fc58bD14dAF9eeF653650c4D10f3dBC8 diff --git a/src/oracle/ethWatcher/ethWatcher.js b/src/oracle/ethWatcher/ethWatcher.js index 813ff0b..a8d616e 100644 --- a/src/oracle/ethWatcher/ethWatcher.js +++ b/src/oracle/ethWatcher/ethWatcher.js @@ -6,7 +6,7 @@ const logger = require('./logger') const redis = require('./db') const { connectRabbit, assertQueue } = require('./amqp') const { publicKeyToAddress } = require('./crypto') -const { delay } = require('./wait') +const { delay, retry } = require('./wait') const { HOME_RPC_URL, HOME_BRIDGE_ADDRESS, RABBITMQ_URL, HOME_START_BLOCK, VALIDATOR_PRIVATE_KEY @@ -266,7 +266,7 @@ async function loop() { for (let curBlockNumber = blockNumber, i = 0; curBlockNumber <= endBlock; curBlockNumber += 1) { let epochTimeUpdated = false - const curBlockTimestamp = await getBlockTimestamp(curBlockNumber) + const curBlockTimestamp = await retry(() => getBlockTimestamp(curBlockNumber)) while (i < bridgeEvents.length && bridgeEvents[i].blockNumber === curBlockNumber) { const event = bridge.interface.parseLog(bridgeEvents[i]) logger.trace('Consumed event %o %o', event, bridgeEvents[i]) @@ -334,7 +334,7 @@ async function loop() { blockNumber = endBlock + 1 // Exec redis tx - await redisTx.incr('homeBlock').exec() + await redisTx.set('homeBlock', blockNumber).exec() await redis.save() } diff --git a/src/test-services/ethereumBalance/.env.staging b/src/test-services/ethereumBalance/.env.staging index 4e7f9da..99f7e77 100644 --- a/src/test-services/ethereumBalance/.env.staging +++ b/src/test-services/ethereumBalance/.env.staging @@ -1,2 +1,2 @@ HOME_RPC_URL=https://kovan.infura.io/v3/5d7bd94c50ed43fab1cb8e74f58678b0 -HOME_TOKEN_ADDRESS=0x57d2533B640cfb58f8f1F69C14c089968Da9fdFc +HOME_TOKEN_ADDRESS=0x7c7daEf752C80A6d229D4a642B9336ceCd7e26b0 diff --git a/src/test-services/ethereumSend/.env.staging b/src/test-services/ethereumSend/.env.staging index adfeac7..b18ceb8 100644 --- a/src/test-services/ethereumSend/.env.staging +++ b/src/test-services/ethereumSend/.env.staging @@ -1,5 +1,5 @@ HOME_RPC_URL=https://kovan.infura.io/v3/5d7bd94c50ed43fab1cb8e74f58678b0 -HOME_BRIDGE_ADDRESS=0x6ADCa5e691341fb9de8927d15c0a89B83A4E665e -HOME_TOKEN_ADDRESS=0x57d2533B640cfb58f8f1F69C14c089968Da9fdFc +HOME_BRIDGE_ADDRESS=0x01eD0d6350542E7643cB7bba4bccc96FedE0B616 +HOME_TOKEN_ADDRESS=0x7c7daEf752C80A6d229D4a642B9336ceCd7e26b0 #HOME_PRIVATE_KEY is taken from src/test-services/.keys.staging From 1de3b2d75a1284cb16278c520b7a811c55ac5a21 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Tue, 12 Nov 2019 18:42:26 +0300 Subject: [PATCH 092/129] Minimized number of eth block timestamp requests --- demo/validator1/.env.staging | 2 +- src/oracle/bncWatcher/bncWatcher.js | 17 ++++------------- src/oracle/ethWatcher/ethWatcher.js | 14 ++++++-------- 3 files changed, 11 insertions(+), 22 deletions(-) diff --git a/demo/validator1/.env.staging b/demo/validator1/.env.staging index 9b0cfc2..89e3609 100644 --- a/demo/validator1/.env.staging +++ b/demo/validator1/.env.staging @@ -24,4 +24,4 @@ VOTES_PROXY_PORT=5001 SIGN_RESTART_PORT=6001 -LOG_LEVEL=trace +LOG_LEVEL=info diff --git a/src/oracle/bncWatcher/bncWatcher.js b/src/oracle/bncWatcher/bncWatcher.js index 1320e43..159156c 100644 --- a/src/oracle/bncWatcher/bncWatcher.js +++ b/src/oracle/bncWatcher/bncWatcher.js @@ -79,6 +79,7 @@ async function fetchTimeIntervalsQueue() { break } const data = JSON.parse(msg.content) + let accept = false logger.trace('Consumed time interval event %o', data) if (epoch !== null && epoch !== data.epoch) { logger.warn('Two consequently events have different epochs, should not be like this') @@ -92,25 +93,15 @@ async function fetchTimeIntervalsQueue() { break } if (epoch === null) { + accept = true epoch = data.epoch startTime = await redis.get(`foreignTime${epoch}`) logger.trace(`Retrieved epoch ${epoch} and start time ${startTime} from redis`) if (startTime === null) { logger.warn(`Empty foreign time for epoch ${epoch}`) } - } /* - if (data.endTime) { - if (data.endTime - startTime < FOREIGN_FETCH_MAX_TIME_INTERVAL - && data.endTime < lastBncBlockTime) { - endTime = data.endTime - channel.ack(msg) - } else { - logger.trace('Requeuing current queue message') - channel.nack(msg, false, true) - } - break - } */ - if (data.prolongedTime - startTime < FOREIGN_FETCH_MAX_TIME_INTERVAL + } + if ((data.prolongedTime - startTime < FOREIGN_FETCH_MAX_TIME_INTERVAL || accept) && data.prolongedTime < lastBncBlockTime) { endTime = data.prolongedTime channel.ack(msg) diff --git a/src/oracle/ethWatcher/ethWatcher.js b/src/oracle/ethWatcher/ethWatcher.js index a8d616e..a37d412 100644 --- a/src/oracle/ethWatcher/ethWatcher.js +++ b/src/oracle/ethWatcher/ethWatcher.js @@ -225,8 +225,7 @@ async function initialize() { rangeSize = (await bridge.getRangeSize()).toNumber() logger.debug(`Range size ${rangeSize}`) logger.debug('Checking if current validator') - isCurrentValidator = (await bridge.getValidators()) - .includes(validatorAddress) + isCurrentValidator = (await bridge.getValidators()).includes(validatorAddress) if (isCurrentValidator) { logger.info(`${validatorAddress} is a current validator`) } else { @@ -266,7 +265,6 @@ async function loop() { for (let curBlockNumber = blockNumber, i = 0; curBlockNumber <= endBlock; curBlockNumber += 1) { let epochTimeUpdated = false - const curBlockTimestamp = await retry(() => getBlockTimestamp(curBlockNumber)) while (i < bridgeEvents.length && bridgeEvents[i].blockNumber === curBlockNumber) { const event = bridge.interface.parseLog(bridgeEvents[i]) logger.trace('Consumed event %o %o', event, bridgeEvents[i]) @@ -293,7 +291,7 @@ async function loop() { activeEpoch = true epochTimeIntervalsQueue.send({ blockNumber: curBlockNumber, - startTime: curBlockTimestamp * 1000, + startTime: await retry(() => getBlockTimestamp(curBlockNumber)) * 1000, epoch }) epochTimeUpdated = true @@ -304,7 +302,7 @@ async function loop() { activeEpoch = false epochTimeIntervalsQueue.send({ blockNumber: curBlockNumber, - prolongedTime: curBlockTimestamp * 1000, + prolongedTime: await retry(() => getBlockTimestamp(curBlockNumber)) * 1000, epoch }) break @@ -314,10 +312,10 @@ async function loop() { i += 1 } - if (!epochTimeUpdated && epoch > 0 && activeEpoch) { + if (curBlockNumber === endBlock && !epochTimeUpdated && epoch > 0 && activeEpoch) { epochTimeIntervalsQueue.send({ blockNumber: curBlockNumber, - prolongedTime: curBlockTimestamp * 1000, + prolongedTime: await retry(() => getBlockTimestamp(curBlockNumber)) * 1000, epoch }) } @@ -334,7 +332,7 @@ async function loop() { blockNumber = endBlock + 1 // Exec redis tx - await redisTx.set('homeBlock', blockNumber).exec() + await redisTx.set('homeBlock', endBlock).exec() await redis.save() } From 38e96b5552928bc3227ccadcc73a925b0cd0769d Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Thu, 14 Nov 2019 13:28:43 +0300 Subject: [PATCH 093/129] Contract support of closing epoch process on binance side --- src/deploy/deploy-home/.env.development | 2 + src/deploy/deploy-home/.env.staging | 2 + src/deploy/deploy-home/contracts/Bridge.sol | 72 ++++++++++++++++--- .../deploy-home/migrations/1_deployment.js | 5 +- 4 files changed, 68 insertions(+), 13 deletions(-) diff --git a/src/deploy/deploy-home/.env.development b/src/deploy/deploy-home/.env.development index 38ec3e0..7c3f528 100644 --- a/src/deploy/deploy-home/.env.development +++ b/src/deploy/deploy-home/.env.development @@ -15,3 +15,5 @@ MIN_TX_LIMIT=10000000000000000 MAX_TX_LIMIT=100000000000000000000 BLOCKS_RANGE_SIZE=10 + +CLOSE_EPOCH_FLAG=true diff --git a/src/deploy/deploy-home/.env.staging b/src/deploy/deploy-home/.env.staging index 2988dc3..7fdaf13 100644 --- a/src/deploy/deploy-home/.env.staging +++ b/src/deploy/deploy-home/.env.staging @@ -16,3 +16,5 @@ MIN_TX_LIMIT=10000000000000000 MAX_TX_LIMIT=100000000000000000000 BLOCKS_RANGE_SIZE=25 + +CLOSE_EPOCH_FLAG=true diff --git a/src/deploy/deploy-home/contracts/Bridge.sol b/src/deploy/deploy-home/contracts/Bridge.sol index 63ce4e1..cdd3f7f 100644 --- a/src/deploy/deploy-home/contracts/Bridge.sol +++ b/src/deploy/deploy-home/contracts/Bridge.sol @@ -5,6 +5,8 @@ import './openzeppelin-solidity/contracts/token/ERC20/IERC20.sol'; contract Bridge { event ExchangeRequest(uint value, uint nonce); event EpochEnd(uint indexed epoch); + event EpochClose(uint indexed epoch); + event ForceSign(); event NewEpoch(uint indexed oldEpoch, uint indexed newEpoch); event NewEpochCancelled(uint indexed epoch); event NewFundsTransfer(uint indexed oldEpoch, uint indexed newEpoch); @@ -19,10 +21,12 @@ contract Bridge { uint nonce; uint x; uint y; + bool closeEpoch; } enum Status { READY, // bridge is in ready to perform operations + CLOSING_EPOCH, // generating transaction for blocking binance side of the bridge VOTING, // voting for changing in next epoch, but still ready KEYGEN, //keygen, can be cancelled FUNDS_TRANSFER // funds transfer, cannot be cancelled @@ -31,11 +35,13 @@ contract Bridge { enum Vote { CONFIRM_KEYGEN, CONFIRM_FUNDS_TRANSFER, + CONFIRM_CLOSE_EPOCH, START_VOTING, ADD_VALIDATOR, REMOVE_VALIDATOR, CHANGE_THRESHOLD, CHANGE_RANGE_SIZE, + CHANGE_CLOSE_EPOCH, START_KEYGEN, CANCEL_KEYGEN, TRANSFER @@ -57,7 +63,7 @@ contract Bridge { uint minTxLimit; uint maxTxLimit; - constructor(uint threshold, address[] memory validators, address _tokenContract, uint[2] memory limits, uint rangeSize) public { + constructor(uint threshold, address[] memory validators, address _tokenContract, uint[2] memory limits, uint rangeSize, bool closeEpoch) public { require(validators.length > 0); require(threshold <= validators.length); @@ -72,11 +78,12 @@ contract Bridge { threshold : threshold, rangeSize : rangeSize, startBlock : 0, - endBlock : uint(-1), - nonce : uint(-1), + endBlock : uint(- 1), + nonce : uint(- 1), x : 0, - y : 0 - }); + y : 0, + closeEpoch : closeEpoch + }); minTxLimit = limits[0]; maxTxLimit = limits[1]; @@ -91,8 +98,13 @@ contract Bridge { _; } - modifier readyOrVoting { - require(status == Status.READY || status == Status.VOTING, "Not in ready or voting state"); + modifier closingEpoch { + require(status == Status.CLOSING_EPOCH, "Not in closing epoch state"); + _; + } + + modifier readyOrClosing { + require(status == Status.READY || status == Status.CLOSING_EPOCH, "Not in ready or closing epoch state"); _; } @@ -101,6 +113,11 @@ contract Bridge { _; } + modifier readyOrVoting { + require(status == Status.READY || status == Status.VOTING, "Not in ready or voting state"); + _; + } + modifier keygen { require(status == Status.KEYGEN, "Not in keygen state"); _; @@ -129,7 +146,7 @@ contract Bridge { emit ExchangeRequest(value, getNonce()); } - function transfer(bytes32 hash, address to, uint value) public readyOrVoting currentValidator { + function transfer(bytes32 hash, address to, uint value) public readyOrClosing currentValidator { if (tryVote(Vote.TRANSFER, hash, to, value)) { tokenContract.transfer(to, value); } @@ -161,12 +178,19 @@ contract Bridge { if (tryConfirm(Vote.CONFIRM_FUNDS_TRANSFER)) { status = Status.READY; states[nextEpoch].startBlock = block.number; - states[nextEpoch].nonce = uint(-1); + states[nextEpoch].nonce = uint(- 1); epoch = nextEpoch; emit EpochStart(epoch, getX(), getY()); } } + function confirmCloseEpoch() public closingEpoch currentValidator { + if (tryConfirm(Vote.CONFIRM_CLOSE_EPOCH)) { + status = Status.VOTING; + emit EpochEnd(epoch); + } + } + function getParties() view public returns (uint) { return getParties(epoch); } @@ -227,6 +251,18 @@ contract Bridge { return states[epoch].y; } + function getCloseEpoch() view public returns (bool) { + return getCloseEpoch(epoch); + } + + function getNextCloseEpoch() view public returns (bool) { + return getCloseEpoch(nextEpoch); + } + + function getCloseEpoch(uint _epoch) view public returns (bool) { + return states[_epoch].closeEpoch; + } + function getPartyId() view public returns (uint) { address[] memory validators = getValidators(); for (uint i = 0; i < getParties(); i++) { @@ -256,13 +292,21 @@ contract Bridge { function startVoting() public readyOrVoting currentValidator { if (tryVote(Vote.START_VOTING, epoch)) { nextEpoch++; - status = Status.VOTING; states[nextEpoch].endBlock = block.number; states[nextEpoch].threshold = getThreshold(); states[nextEpoch].validators = getValidators(); states[nextEpoch].rangeSize = getRangeSize(); + states[nextEpoch].closeEpoch = getCloseEpoch(); - emit EpochEnd(epoch); + if (status == Status.READY && getCloseEpoch()) { + status = Status.CLOSING_EPOCH; + emit ForceSign(); + emit EpochClose(epoch); + } else { + status = Status.VOTING; + emit ForceSign(); + emit EpochEnd(epoch); + } } } @@ -307,6 +351,12 @@ contract Bridge { } } + function voteChangeCloseEpoch(bool closeEpoch) public voting currentValidator { + if (tryVote(Vote.CHANGE_CLOSE_EPOCH, closeEpoch ? 1 : 0)) { + states[nextEpoch].closeEpoch = closeEpoch; + } + } + function voteStartKeygen() public voting currentValidator { require(getNextThreshold() <= getNextParties(), "Invalid threshold number"); diff --git a/src/deploy/deploy-home/migrations/1_deployment.js b/src/deploy/deploy-home/migrations/1_deployment.js index fe88868..05984da 100644 --- a/src/deploy/deploy-home/migrations/1_deployment.js +++ b/src/deploy/deploy-home/migrations/1_deployment.js @@ -5,7 +5,7 @@ const addresses = Object.entries(process.env) .map(([, value]) => value) const { - THRESHOLD, HOME_TOKEN_ADDRESS, MIN_TX_LIMIT, MAX_TX_LIMIT, BLOCKS_RANGE_SIZE + THRESHOLD, HOME_TOKEN_ADDRESS, MIN_TX_LIMIT, MAX_TX_LIMIT, BLOCKS_RANGE_SIZE, CLOSE_EPOCH_FLAG } = process.env module.exports = (deployer) => { @@ -15,6 +15,7 @@ module.exports = (deployer) => { addresses, HOME_TOKEN_ADDRESS, [MIN_TX_LIMIT, MAX_TX_LIMIT], - BLOCKS_RANGE_SIZE + BLOCKS_RANGE_SIZE, + CLOSE_EPOCH_FLAG === 'true' ) } From 7f575238e12449b2ae2618eb782c4fb7ecdd2079 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Thu, 14 Nov 2019 13:29:58 +0300 Subject: [PATCH 094/129] Support of closing epoch in oracle scripts --- src/oracle/ethWatcher/ethWatcher.js | 36 ++++++++- src/oracle/proxy/contractsAbi.js | 4 + src/oracle/proxy/index.js | 27 ++++++- src/oracle/proxy/utils.js | 6 +- src/oracle/tss-sign/signer.js | 42 ++++++++-- src/oracle/tss-sign/tx.js | 121 ++++++++++++++++------------ 6 files changed, 171 insertions(+), 65 deletions(-) diff --git a/src/oracle/ethWatcher/ethWatcher.js b/src/oracle/ethWatcher/ethWatcher.js index a37d412..18f0491 100644 --- a/src/oracle/ethWatcher/ethWatcher.js +++ b/src/oracle/ethWatcher/ethWatcher.js @@ -21,6 +21,8 @@ const bridgeAbi = [ 'event NewEpochCancelled(uint indexed epoch)', 'event NewFundsTransfer(uint indexed oldEpoch, uint indexed newEpoch)', 'event EpochStart(uint indexed epoch, uint x, uint y)', + 'event EpochClose(uint indexed epoch)', + 'event ForceSign()', 'function getThreshold(uint epoch) view returns (uint)', 'function getParties(uint epoch) view returns (uint)', 'function getRangeSize() view returns (uint)', @@ -160,7 +162,6 @@ async function sendSign(event, transactionHash) { } async function sendStartSign() { - redisTx.incr(`foreignNonce${epoch}`) signQueue.send({ epoch, blockNumber, @@ -169,6 +170,7 @@ async function sendStartSign() { parties: (await bridge.getParties(epoch)).toNumber() }) foreignNonce[epoch] += 1 + redisTx.incr(`foreignNonce${epoch}`) } async function processEpochStart(event) { @@ -186,6 +188,19 @@ async function processEpochStart(event) { foreignNonce[epoch] = 0 } +async function sendEpochClose() { + logger.debug(`Consumed epoch ${epoch} close event`) + signQueue.send({ + closeEpoch: epoch, + blockNumber, + nonce: foreignNonce[epoch], + threshold: (await bridge.getThreshold(epoch)).toNumber(), + parties: (await bridge.getParties(epoch)).toNumber() + }) + foreignNonce[epoch] += 1 + redisTx.incr(`foreignNonce${epoch}`) +} + async function initialize() { channel = await connectRabbit(RABBITMQ_URL) exchangeQueue = await assertQueue(channel, 'exchangeQueue') @@ -264,6 +279,8 @@ async function loop() { })) for (let curBlockNumber = blockNumber, i = 0; curBlockNumber <= endBlock; curBlockNumber += 1) { + const rangeOffset = (curBlockNumber + 1 - epochStart) % rangeSize + const rangeStart = curBlockNumber - (rangeOffset || rangeSize) let epochTimeUpdated = false while (i < bridgeEvents.length && bridgeEvents[i].blockNumber === curBlockNumber) { const event = bridge.interface.parseLog(bridgeEvents[i]) @@ -306,6 +323,19 @@ async function loop() { epoch }) break + case 'EpochClose': + if (isCurrentValidator) { + await sendEpochClose() + } + break + case 'ForceSign': + if (isCurrentValidator && lastTransactionBlockNumber > rangeStart) { + logger.debug('Consumed force sign event') + lastTransactionBlockNumber = 0 + redisTx.set('lastTransactionBlockNumber', 0) + await sendStartSign() + } + break default: logger.warn('Unknown event %o', event) } @@ -320,10 +350,10 @@ async function loop() { }) } - if ((curBlockNumber + 1 - epochStart) % rangeSize === 0) { + if (rangeOffset === 0) { logger.info('Reached end of the current block range') - if (lastTransactionBlockNumber > curBlockNumber - rangeSize) { + if (isCurrentValidator && lastTransactionBlockNumber > curBlockNumber - rangeSize) { logger.info('Sending message to start signature generation for the ended range') await sendStartSign() } diff --git a/src/oracle/proxy/contractsAbi.js b/src/oracle/proxy/contractsAbi.js index 312681c..6f80832 100644 --- a/src/oracle/proxy/contractsAbi.js +++ b/src/oracle/proxy/contractsAbi.js @@ -14,17 +14,21 @@ const bridgeAbi = [ 'function getNextThreshold() view returns (uint)', 'function getValidators() view returns (address[])', 'function getNextValidators() view returns (address[])', + 'function getCloseEpoch() view returns (bool)', + 'function getNextCloseEpoch() view returns (bool)', 'function status() view returns (uint)', 'function votesCount(bytes32) view returns (uint)', 'function getNextPartyId(address a) view returns (uint)', 'function confirmKeygen(uint x, uint y)', 'function confirmFundsTransfer()', + 'function confirmCloseEpoch()', 'function startVoting()', 'function voteStartKeygen()', 'function voteCancelKeygen()', 'function voteAddValidator(address validator)', 'function voteRemoveValidator(address validator)', 'function voteChangeThreshold(uint threshold)', + 'function voteChangeCloseEpoch(bool closeEpoch)', 'function transfer(bytes32 hash, address to, uint value)' ] const sharedDbAbi = [ diff --git a/src/oracle/proxy/index.js b/src/oracle/proxy/index.js index 7546cbb..77e9bee 100644 --- a/src/oracle/proxy/index.js +++ b/src/oracle/proxy/index.js @@ -189,6 +189,14 @@ async function confirmFundsTransfer(req, res) { logger.debug('Confirm funds transfer end') } +async function confirmCloseEpoch(req, res) { + logger.debug('Confirm close epoch call') + const query = bridge.interface.functions.confirmCloseEpoch.encode([]) + await homeSendQuery(query) + res.send() + logger.debug('Confirm close epoch end') +} + async function sendVote(query, req, res, waitFlag = false) { try { const sentQuery = await homeSendQuery(query) @@ -257,6 +265,14 @@ async function voteChangeThreshold(req, res) { } } +async function voteChangeCloseEpoch(req, res) { + if (req.params.closeEpoch === 'true' || req.params.closeEpoch === 'false') { + logger.info('Voting for changing close epoch') + const query = bridge.interface.functions.voteChangeCloseEpoch.encode([req.params.closeEpoch === 'true']) + await sendVote(query, req, res) + } +} + async function voteRemoveValidator(req, res) { if (ethers.utils.isHexString(req.params.validator, 20)) { logger.info('Voting for removing validator') @@ -298,14 +314,17 @@ async function info(req, res) { logger.debug('Info start') try { const [ - x, y, epoch, rangeSize, nextRangeSize, epochStartBlock, foreignNonce, nextEpoch, - threshold, nextThreshold, validators, nextValidators, status, homeBalance + x, y, epoch, rangeSize, nextRangeSize, closeEpoch, nextCloseEpoch, epochStartBlock, + foreignNonce, nextEpoch, threshold, nextThreshold, validators, nextValidators, status, + homeBalance ] = await Promise.all([ bridge.getX().then((value) => new BN(value).toString(16)), bridge.getY().then((value) => new BN(value).toString(16)), bridge.epoch().then(boundX), bridge.getRangeSize().then(boundX), bridge.getNextRangeSize().then(boundX), + bridge.getCloseEpoch(), + bridge.getNextCloseEpoch(), bridge.getStartBlock().then(boundX), bridge.getNonce().then(boundX), bridge.nextEpoch().then(boundX), @@ -338,6 +357,8 @@ async function info(req, res) { nextEpoch, threshold, nextThreshold, + closeEpoch, + nextCloseEpoch, homeBridgeAddress: HOME_BRIDGE_ADDRESS, foreignBridgeAddress: foreignAddress, foreignNonce, @@ -371,6 +392,7 @@ app.post('/signupsign', signupSign) app.post('/confirmKeygen', confirmKeygen) app.post('/confirmFundsTransfer', confirmFundsTransfer) +app.post('/confirmCloseEpoch', confirmCloseEpoch) app.post('/transfer', transfer) votesProxyApp.get('/vote/startVoting', voteStartVoting) @@ -379,6 +401,7 @@ votesProxyApp.get('/vote/cancelKeygen', voteCancelKeygen) votesProxyApp.get('/vote/addValidator/:validator', voteAddValidator) votesProxyApp.get('/vote/removeValidator/:validator', voteRemoveValidator) votesProxyApp.get('/vote/changeThreshold/:threshold', voteChangeThreshold) +votesProxyApp.get('/vote/changeCloseEpoch/:closeEpoch', voteChangeCloseEpoch) votesProxyApp.get('/info', info) async function main() { diff --git a/src/oracle/proxy/utils.js b/src/oracle/proxy/utils.js index 72bd8e9..9bbdb58 100644 --- a/src/oracle/proxy/utils.js +++ b/src/oracle/proxy/utils.js @@ -11,10 +11,12 @@ function decodeStatus(status) { case 0: return 'ready' case 1: - return 'voting' + return 'closing_epoch' case 2: - return 'keygen' + return 'voting' case 3: + return 'keygen' + case 4: return 'funds_transfer' default: return 'unknown_state' diff --git a/src/oracle/tss-sign/signer.js b/src/oracle/tss-sign/signer.js index 1123998..69181da 100644 --- a/src/oracle/tss-sign/signer.js +++ b/src/oracle/tss-sign/signer.js @@ -21,6 +21,7 @@ const SIGN_NONCE_CHECK_INTERVAL = parseInt(process.env.SIGN_NONCE_CHECK_INTERVAL const SEND_TIMEOUT = parseInt(process.env.SEND_TIMEOUT, 10) const httpClient = axios.create({ baseURL: FOREIGN_URL }) +const proxyClient = axios.create({ baseURL: PROXY_URL }) const SIGN_OK = 0 const SIGN_NONCE_INTERRUPT = 1 @@ -67,8 +68,12 @@ function restart(req, res) { } } -function confirmFundsTransfer() { - exec.execSync(`curl -X POST -H "Content-Type: application/json" "${PROXY_URL}/confirmFundsTransfer"`, { stdio: 'pipe' }) +async function confirmFundsTransfer() { + await proxyClient.post('/confirmFundsTransfer') +} + +async function confirmCloseEpoch() { + await proxyClient.post('/confirmCloseEpoch') } function getAccountFromFile(file) { @@ -216,10 +221,10 @@ async function main() { logger.info('Consumed sign event: %o', data) const { - nonce, epoch, newEpoch, parties, threshold + nonce, epoch, newEpoch, parties, threshold, closeEpoch } = data - const keysFile = `/keys/keys${epoch}.store` + const keysFile = `/keys/keys${epoch || closeEpoch}.store` const { address: from, publicKey } = getAccountFromFile(keysFile) if (from === '') { logger.info('No keys found, acking message') @@ -236,7 +241,34 @@ async function main() { attempt = 1 - if (!newEpoch) { + if (closeEpoch) { + while (true) { + logger.info(`Building corresponding account flags transaction, nonce ${nonce}`) + + const tx = new Transaction({ + from, + accountNumber: account.account_number, + sequence: nonce, + flags: 0x01, + memo: `Attempt ${attempt}` + }) + + const hash = sha256(tx.getSignBytes()) + logger.info(`Starting signature generation for transaction hash ${hash}`) + const signResult = await sign(keysFile, hash, tx, publicKey, from) + + if (signResult === SIGN_OK || signResult === SIGN_NONCE_INTERRUPT) { + await confirmCloseEpoch() + break + } + + // signer either failed, or timed out after parties signup + attempt = nextAttempt || attempt + 1 + nextAttempt = null + logger.warn(`Sign failed, starting next attempt ${attempt}`) + await delay(1000) + } + } else if (!newEpoch) { const exchanges = await getExchangeMessages(nonce) const exchangesData = exchanges.map((exchangeMsg) => JSON.parse(exchangeMsg.content)) diff --git a/src/oracle/tss-sign/tx.js b/src/oracle/tss-sign/tx.js index ee6cfcc..032d4e8 100644 --- a/src/oracle/tss-sign/tx.js +++ b/src/oracle/tss-sign/tx.js @@ -12,70 +12,84 @@ const BNB_ASSET = 'BNB' class Transaction { constructor(options) { const { - from, accountNumber, sequence, recipients, asset, memo = '' + from, accountNumber, sequence, recipients, asset, memo = '', flags } = options - const totalTokens = recipients.reduce( - (sum, { tokens }) => sum.plus(new BN(tokens || 0)), new BN(0) - ) - const totalBnbs = recipients.reduce( - (sum, { bnbs }) => sum.plus(new BN(bnbs || 0)), new BN(0) - ) - const senderCoins = [] - if (asset && totalTokens.isGreaterThan(0)) { - senderCoins.push({ - denom: asset, - amount: totalTokens.multipliedBy(10 ** 8).toNumber() - }) - } - if (totalBnbs.isGreaterThan(0)) { - senderCoins.push({ - denom: BNB_ASSET, - amount: totalBnbs.multipliedBy(10 ** 8).toNumber() - }) - } - senderCoins.sort((a, b) => a.denom > b.denom) + let msg + if (flags) { + msg = { + from: crypto.decodeAddress(from), + flags, + msgType: 'NewOrderMsg' // until 'SetAccountFlagsMsg' is not available + } - const inputs = [{ - address: from, - coins: senderCoins - }] - const outputs = recipients.map(({ to, tokens, bnbs }) => { - const receiverCoins = [] - if (asset && tokens) { - receiverCoins.push({ + this.signMsg = { + flags, + from + } + } else { + const totalTokens = recipients.reduce( + (sum, { tokens }) => sum.plus(new BN(tokens || 0)), new BN(0) + ) + const totalBnbs = recipients.reduce( + (sum, { bnbs }) => sum.plus(new BN(bnbs || 0)), new BN(0) + ) + const senderCoins = [] + if (asset && totalTokens.isGreaterThan(0)) { + senderCoins.push({ denom: asset, - amount: new BN(tokens).multipliedBy(10 ** 8).toNumber() + amount: totalTokens.multipliedBy(10 ** 8).toNumber() }) } - if (bnbs) { - receiverCoins.push({ + if (totalBnbs.isGreaterThan(0)) { + senderCoins.push({ denom: BNB_ASSET, - amount: new BN(bnbs).multipliedBy(10 ** 8).toNumber() + amount: totalBnbs.multipliedBy(10 ** 8).toNumber() }) } - receiverCoins.sort((a, b) => a.denom > b.denom) - return { - address: to, - coins: receiverCoins + senderCoins.sort((a, b) => a.denom > b.denom) + + const inputs = [{ + address: from, + coins: senderCoins + }] + const outputs = recipients.map(({ to, tokens, bnbs }) => { + const receiverCoins = [] + if (asset && tokens) { + receiverCoins.push({ + denom: asset, + amount: new BN(tokens).multipliedBy(10 ** 8).toNumber() + }) + } + if (bnbs) { + receiverCoins.push({ + denom: BNB_ASSET, + amount: new BN(bnbs).multipliedBy(10 ** 8).toNumber() + }) + } + receiverCoins.sort((a, b) => a.denom > b.denom) + return { + address: to, + coins: receiverCoins + } + }) + + msg = { + inputs: inputs.map((x) => ({ + ...x, + address: crypto.decodeAddress(x.address) + })), + outputs: outputs.map((x) => ({ + ...x, + address: crypto.decodeAddress(x.address) + })), + msgType: 'MsgSend' } - }) - const msg = { - inputs: inputs.map((x) => ({ - ...x, - address: crypto.decodeAddress(x.address) - })), - outputs: outputs.map((x) => ({ - ...x, - address: crypto.decodeAddress(x.address) - })), - msgType: 'MsgSend' - } - - this.signMsg = { - inputs, - outputs + this.signMsg = { + inputs, + outputs + } } this.tx = new TransactionBnc({ @@ -109,6 +123,7 @@ class Transaction { sequence: this.tx.sequence }] return this.tx.serialize() + .replace(/ce6dc043/, 'bea6e301') // until 'SetAccountFlagsMsg' is not available } } From ec9c8e10c2e82777bf278dd26452ba36bfc0026d Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Thu, 14 Nov 2019 13:30:23 +0300 Subject: [PATCH 095/129] Tests coverage for closing bridge --- tests/run.sh | 5 +++ tests/test/addValidator.js | 58 +++++++++++++++++++++++------ tests/test/changeThreshold.js | 37 +++++++++--------- tests/test/index.js | 13 ++++++- tests/test/removeValidator.js | 27 ++++++++------ tests/test/utils/proxyController.js | 3 ++ 6 files changed, 101 insertions(+), 42 deletions(-) diff --git a/tests/run.sh b/tests/run.sh index 7889847..c0ca1b2 100755 --- a/tests/run.sh +++ b/tests/run.sh @@ -22,3 +22,8 @@ docker start -a tests || true echo "Saving test results" docker cp "tests:/tests/results.xml" "./tests/results.xml" > /dev/null 2>&1 || true + +echo "Killing all remaining docker containers" +docker kill $(docker ps | grep validator[1-3]_ | awk '{print $1}') > /dev/null 2>&1 || true +docker kill ganache_home ganache_side > /dev/null 2>&1 || true +docker kill $(docker ps | grep binance-testnet_ | awk '{print $1}') > /dev/null 2>&1 || true diff --git a/tests/test/addValidator.js b/tests/test/addValidator.js index cad94c5..c947d1d 100644 --- a/tests/test/addValidator.js +++ b/tests/test/addValidator.js @@ -17,27 +17,32 @@ module.exports = (newValidator) => { nextValidators = [...initialInfo.validators, newValidator] }) - it('should start voting process', async function () { + it('should start closing epoch process', async function () { await controller1.voteStartVoting() await delay(5000) info = await controller1.getInfo() assert.strictEqual(info.bridgeStatus, 'ready', 'Should not change state after one vote') await controller3.voteStartVoting() - info = await waitPromise(controller1.getInfo, (newInfo) => newInfo.bridgeStatus === 'voting') - assert.deepStrictEqual(info.epoch, initialInfo.epoch, 'Current epoch is not set correctly') - assert.deepStrictEqual(info.nextEpoch, initialInfo.epoch + 1, 'Next epoch is not set correctly') + info = await waitPromise(controller1.getInfo, (newInfo) => newInfo.bridgeStatus === 'closing_epoch') + assert.strictEqual(info.epoch, initialInfo.epoch, 'Current epoch is not set correctly') + assert.strictEqual(info.nextEpoch, initialInfo.epoch + 1, 'Next epoch is not set correctly') assert.deepStrictEqual(info.nextValidators, initialInfo.validators, 'Next validators are not set correctly') await controller3.voteStartVoting() await delay(5000) info = await controller1.getInfo() - assert.strictEqual(info.bridgeStatus, 'voting', 'Should not do anything after duplicate vote') - assert.deepStrictEqual(info.epoch, initialInfo.epoch, 'Current epoch is not set correctly') - assert.deepStrictEqual(info.nextEpoch, initialInfo.epoch + 1, 'Next epoch is not set correctly') + assert.strictEqual(info.bridgeStatus, 'closing_epoch', 'Should not do anything after duplicate vote') + assert.strictEqual(info.epoch, initialInfo.epoch, 'Current epoch is not set correctly') + assert.strictEqual(info.nextEpoch, initialInfo.epoch + 1, 'Next epoch is not set correctly') assert.deepStrictEqual(info.nextValidators, initialInfo.validators, 'Incorrect set of next validators after third vote') }) + it('should finish close epoch process and start voting process', async function () { + this.timeout(120000) + info = await waitPromise(controller1.getInfo, (newInfo) => newInfo.bridgeStatus === 'voting') + }) + it('should add validator', async function () { await controller1.voteAddValidator(newValidator) await delay(5000) @@ -58,12 +63,43 @@ module.exports = (newValidator) => { await delay(5000) info = await controller1.getInfo() assert.strictEqual(info.bridgeStatus, 'voting', 'Should not do anything after duplicate vote') - assert.deepStrictEqual(info.epoch, initialInfo.epoch, 'Current epoch is not set correctly') - assert.deepStrictEqual(info.nextEpoch, initialInfo.epoch + 1, 'Next epoch is not set correctly') + assert.strictEqual(info.epoch, initialInfo.epoch, 'Current epoch is not set correctly') + assert.strictEqual(info.nextEpoch, initialInfo.epoch + 1, 'Next epoch is not set correctly') assert.deepStrictEqual(info.validators, initialInfo.validators, 'Validators are not set correctly') assert.deepStrictEqual(info.nextValidators, nextValidators, 'Incorrect set of next validators after third vote') }) + it('should change close epoch', async function () { + await controller1.voteChangeCloseEpoch(false) + await delay(5000) + info = await controller1.getInfo() + assert.strictEqual(info.bridgeStatus, 'voting', 'Should not change state after one vote') + assert.deepStrictEqual(info.validators, initialInfo.validators, 'Validators are not set correctly') + assert.deepStrictEqual(info.nextValidators, nextValidators, 'Next validators are not set correctly') + assert.strictEqual(info.closeEpoch, true, 'Current close epoch is not set correctly') + assert.strictEqual(info.nextCloseEpoch, true, 'Next close epoch is not set correctly') + + await controller3.voteChangeCloseEpoch(false) + info = await waitPromise( + controller1.getInfo, + (newInfo) => !newInfo.nextCloseEpoch + ) + assert.deepStrictEqual(info.validators, initialInfo.validators, 'Validators are not set correctly') + assert.deepStrictEqual(info.nextValidators, nextValidators, 'Next validators are not set correctly') + assert.strictEqual(info.closeEpoch, true, 'Current close epoch is not set correctly') + + await controller3.voteChangeCloseEpoch(false) + await delay(5000) + info = await controller1.getInfo() + assert.strictEqual(info.bridgeStatus, 'voting', 'Should not do anything after duplicate vote') + assert.strictEqual(info.epoch, initialInfo.epoch, 'Current epoch is not set correctly') + assert.strictEqual(info.nextEpoch, initialInfo.epoch + 1, 'Next epoch is not set correctly') + assert.deepStrictEqual(info.validators, initialInfo.validators, 'Validators are not set correctly') + assert.deepStrictEqual(info.nextValidators, nextValidators, 'Incorrect set of next validators after third vote') + assert.strictEqual(info.closeEpoch, true, 'Current close epoch is not set correctly') + assert.strictEqual(info.nextCloseEpoch, false, 'Next close epoch is not set correctly') + }) + it('should start keygen process', async function () { await controller1.voteStartKeygen() await delay(5000) @@ -77,8 +113,8 @@ module.exports = (newValidator) => { await delay(5000) info = await controller1.getInfo() assert.strictEqual(info.bridgeStatus, 'keygen', 'Should not do anything after duplicate vote') - assert.deepStrictEqual(info.epoch, initialInfo.epoch, 'Current epoch is not set correctly') - assert.deepStrictEqual(info.nextEpoch, initialInfo.epoch + 1, 'Next epoch is not set correctly') + assert.strictEqual(info.epoch, initialInfo.epoch, 'Current epoch is not set correctly') + assert.strictEqual(info.nextEpoch, initialInfo.epoch + 1, 'Next epoch is not set correctly') assert.deepStrictEqual(info.validators, initialInfo.validators, 'Validators are not set correctly') assert.deepStrictEqual(info.nextValidators, nextValidators, 'Incorrect set of next validators after third vote') }) diff --git a/tests/test/changeThreshold.js b/tests/test/changeThreshold.js index 754e7d5..1f6ee8b 100644 --- a/tests/test/changeThreshold.js +++ b/tests/test/changeThreshold.js @@ -22,17 +22,18 @@ module.exports = (newThreshold) => { assert.strictEqual(info.bridgeStatus, 'ready', 'Should not change state after one vote') await controller2.voteStartVoting() - info = await waitPromise(controller1.getInfo, (newInfo) => newInfo.bridgeStatus === 'voting') - assert.deepStrictEqual(info.epoch, initialInfo.epoch, 'Current epoch is not set correctly') - assert.deepStrictEqual(info.nextEpoch, initialInfo.epoch + 1, 'Next epoch is not set correctly') + info = await waitPromise(controller1.getInfo, (newInfo) => newInfo.bridgeStatus === 'closingEpoch' || newInfo.bridgeStatus === 'voting') + assert.strictEqual(info.bridgeStatus, 'voting', 'Should not started closing epoch after previous epoch') + assert.strictEqual(info.epoch, initialInfo.epoch, 'Current epoch is not set correctly') + assert.strictEqual(info.nextEpoch, initialInfo.epoch + 1, 'Next epoch is not set correctly') assert.deepStrictEqual(info.nextValidators, initialInfo.validators, 'Next validators are not set correctly') await controller3.voteStartVoting() await delay(5000) info = await controller1.getInfo() assert.strictEqual(info.bridgeStatus, 'voting', 'Should not do anything after third vote') - assert.deepStrictEqual(info.epoch, initialInfo.epoch, 'Current epoch is not set correctly') - assert.deepStrictEqual(info.nextEpoch, initialInfo.epoch + 1, 'Next epoch is not set correctly') + assert.strictEqual(info.epoch, initialInfo.epoch, 'Current epoch is not set correctly') + assert.strictEqual(info.nextEpoch, initialInfo.epoch + 1, 'Next epoch is not set correctly') assert.deepStrictEqual(info.nextValidators, initialInfo.validators, 'Incorrect set of next validators after third vote') }) @@ -43,8 +44,8 @@ module.exports = (newThreshold) => { assert.strictEqual(info.bridgeStatus, 'voting', 'Should not change state after one vote') assert.deepStrictEqual(info.validators, initialInfo.validators, 'Validators are not set correctly') assert.deepStrictEqual(info.nextValidators, initialInfo.validators, 'Next validators are not set correctly') - assert.deepStrictEqual(info.threshold, initialInfo.threshold, 'Threshold not set correctly') - assert.deepStrictEqual(info.nextThreshold, initialInfo.threshold, 'Next threshold is not set correctly') + assert.strictEqual(info.threshold, initialInfo.threshold, 'Threshold not set correctly') + assert.strictEqual(info.nextThreshold, initialInfo.threshold, 'Next threshold is not set correctly') await controller2.voteChangeThreshold(newThreshold) info = await waitPromise( @@ -53,18 +54,18 @@ module.exports = (newThreshold) => { ) assert.deepStrictEqual(info.validators, initialInfo.validators, 'Validators are not set correctly') assert.deepStrictEqual(info.nextValidators, initialInfo.validators, 'Next validators are not set correctly') - assert.deepStrictEqual(info.threshold, initialInfo.threshold, 'Threshold not set correctly') + assert.strictEqual(info.threshold, initialInfo.threshold, 'Threshold not set correctly') await controller3.voteChangeThreshold(newThreshold) await delay(5000) info = await controller1.getInfo() assert.strictEqual(info.bridgeStatus, 'voting', 'Should not do anything after third vote') - assert.deepStrictEqual(info.epoch, initialInfo.epoch, 'Current epoch is not set correctly') - assert.deepStrictEqual(info.nextEpoch, initialInfo.epoch + 1, 'Next epoch is not set correctly') + assert.strictEqual(info.epoch, initialInfo.epoch, 'Current epoch is not set correctly') + assert.strictEqual(info.nextEpoch, initialInfo.epoch + 1, 'Next epoch is not set correctly') assert.deepStrictEqual(info.validators, initialInfo.validators, 'Validators are not set correctly') assert.deepStrictEqual(info.nextValidators, initialInfo.validators, 'Incorrect set of next validators after third vote') - assert.deepStrictEqual(info.threshold, initialInfo.threshold, 'Threshold not set correctly') - assert.deepStrictEqual(info.nextThreshold, newThreshold, 'Next threshold is not set correctly') + assert.strictEqual(info.threshold, initialInfo.threshold, 'Threshold not set correctly') + assert.strictEqual(info.nextThreshold, newThreshold, 'Next threshold is not set correctly') }) it('should start keygen process', async function () { @@ -80,12 +81,12 @@ module.exports = (newThreshold) => { await delay(5000) info = await controller1.getInfo() assert.strictEqual(info.bridgeStatus, 'keygen', 'Should not do anything after third vote') - assert.deepStrictEqual(info.epoch, initialInfo.epoch, 'Current epoch is not set correctly') - assert.deepStrictEqual(info.nextEpoch, initialInfo.epoch + 1, 'Next epoch is not set correctly') + assert.strictEqual(info.epoch, initialInfo.epoch, 'Current epoch is not set correctly') + assert.strictEqual(info.nextEpoch, initialInfo.epoch + 1, 'Next epoch is not set correctly') assert.deepStrictEqual(info.validators, initialInfo.validators, 'Validators are not set correctly') assert.deepStrictEqual(info.nextValidators, initialInfo.validators, 'Incorrect set of next validators after third vote') - assert.deepStrictEqual(info.threshold, initialInfo.threshold, 'Threshold not set correctly') - assert.deepStrictEqual(info.nextThreshold, newThreshold, 'Next threshold is not set correctly') + assert.strictEqual(info.threshold, initialInfo.threshold, 'Threshold not set correctly') + assert.strictEqual(info.nextThreshold, newThreshold, 'Next threshold is not set correctly') }) it('should finish keygen process and start funds transfer', async function () { @@ -102,8 +103,8 @@ module.exports = (newThreshold) => { assert.deepStrictEqual(info.validators, initialInfo.validators, 'Incorrect set of validators in new epoch') assert.strictEqual(info.nextEpoch, initialInfo.epoch + 1, 'Incorrect next epoch') assert.strictEqual(info.bridgeStatus, 'ready', 'Incorrect bridge state in new epoch') - assert.deepStrictEqual(info.threshold, newThreshold, 'Threshold not set correctly') - assert.deepStrictEqual(info.nextThreshold, newThreshold, 'Next threshold is not set correctly') + assert.strictEqual(info.threshold, newThreshold, 'Threshold not set correctly') + assert.strictEqual(info.nextThreshold, newThreshold, 'Next threshold is not set correctly') await delay(5000) const prevBalance = await getBepBalance(initialInfo.foreignBridgeAddress) const newBalance = await getBepBalance(info.foreignBridgeAddress) diff --git a/tests/test/index.js b/tests/test/index.js index 7b7da2e..aa85b05 100644 --- a/tests/test/index.js +++ b/tests/test/index.js @@ -36,7 +36,7 @@ describe('bridge tests', function () { bncPrefundedUser = await createUser(FOREIGN_PRIVATE_KEY, 'bnc') const bnbBalance = await bncPrefundedUser.getBnbBalance() - assert.ok(bnbBalance >= 1, `Insufficient BNB balance on ${bncPrefundedUser.ethAddress} in Binance network, expected 1 BNB, got ${bnbBalance}`) + assert.ok(bnbBalance >= 10, `Insufficient BNB balance on ${bncPrefundedUser.ethAddress} in Binance network, expected 10 BNB, got ${bnbBalance}`) const bepBalance = await bncPrefundedUser.getBepBalance() assert.ok(bepBalance >= 2000, `Insufficient BEP2 balance on ${bncPrefundedUser.ethAddress} in Binance network, expected 2000 ${FOREIGN_ASSET}, got ${bepBalance}`) @@ -63,8 +63,17 @@ describe('bridge tests', function () { info = await waitPromise(controller1.getInfo, (newInfo) => newInfo.epoch === 1) }) + it('should start correct epoch', async function () { + assert.deepStrictEqual(info.validators, validatorsConfig, 'Validators are not set correctly') + assert.deepStrictEqual(info.nextValidators, validatorsConfig, 'Next validators are not set correctly') + assert.strictEqual(info.closeEpoch, true, 'Current close epoch is not set correctly') + assert.strictEqual(info.nextCloseEpoch, true, 'Next close epoch is not set correctly') + assert.strictEqual(info.threshold, 2, 'Threshold not set correctly') + assert.strictEqual(info.nextThreshold, 2, 'Next threshold is not set correctly') + }) + after(async function () { - await bncPrefundedUser.transferBepBnb(info.foreignBridgeAddress, 1000, 0.1) + await bncPrefundedUser.transferBepBnb(info.foreignBridgeAddress, 1000, 5) await ethPrefundedUser.transferErc(HOME_BRIDGE_ADDRESS, 1000) }) }) diff --git a/tests/test/removeValidator.js b/tests/test/removeValidator.js index b50fe83..1918346 100644 --- a/tests/test/removeValidator.js +++ b/tests/test/removeValidator.js @@ -17,27 +17,32 @@ module.exports = (oldValidator) => { nextValidators = initialInfo.validators.filter((validator) => validator !== oldValidator) }) - it('should start voting process', async function () { + it('should start closing epoch process', async function () { await controller1.voteStartVoting() await delay(5000) info = await controller1.getInfo() assert.strictEqual(info.bridgeStatus, 'ready', 'Should not change state after one vote') await controller2.voteStartVoting() - info = await waitPromise(controller1.getInfo, (newInfo) => newInfo.bridgeStatus === 'voting') - assert.deepStrictEqual(info.epoch, initialInfo.epoch, 'Current epoch is not set correctly') - assert.deepStrictEqual(info.nextEpoch, initialInfo.epoch + 1, 'Next epoch is not set correctly') + info = await waitPromise(controller1.getInfo, (newInfo) => newInfo.bridgeStatus === 'closing_epoch') + assert.strictEqual(info.epoch, initialInfo.epoch, 'Current epoch is not set correctly') + assert.strictEqual(info.nextEpoch, initialInfo.epoch + 1, 'Next epoch is not set correctly') assert.deepStrictEqual(info.nextValidators, initialInfo.validators, 'Next validators are not set correctly') await controller3.voteStartVoting() await delay(5000) info = await controller1.getInfo() - assert.strictEqual(info.bridgeStatus, 'voting', 'Should not do anything after third vote') - assert.deepStrictEqual(info.epoch, initialInfo.epoch, 'Current epoch is not set correctly') - assert.deepStrictEqual(info.nextEpoch, initialInfo.epoch + 1, 'Next epoch is not set correctly') + assert.strictEqual(info.bridgeStatus, 'closing_epoch', 'Should not do anything after third vote') + assert.strictEqual(info.epoch, initialInfo.epoch, 'Current epoch is not set correctly') + assert.strictEqual(info.nextEpoch, initialInfo.epoch + 1, 'Next epoch is not set correctly') assert.deepStrictEqual(info.nextValidators, initialInfo.validators, 'Incorrect set of next validators after third vote') }) + it('should finish close epoch process and start voting process', async function () { + this.timeout(120000) + info = await waitPromise(controller1.getInfo, (newInfo) => newInfo.bridgeStatus === 'voting') + }) + it('should remove validator', async function () { await controller1.voteRemoveValidator(oldValidator) await delay(5000) @@ -58,8 +63,8 @@ module.exports = (oldValidator) => { await delay(5000) info = await controller1.getInfo() assert.strictEqual(info.bridgeStatus, 'voting', 'Should not do anything after third vote') - assert.deepStrictEqual(info.epoch, initialInfo.epoch, 'Current epoch is not set correctly') - assert.deepStrictEqual(info.nextEpoch, initialInfo.epoch + 1, 'Next epoch is not set correctly') + assert.strictEqual(info.epoch, initialInfo.epoch, 'Current epoch is not set correctly') + assert.strictEqual(info.nextEpoch, initialInfo.epoch + 1, 'Next epoch is not set correctly') assert.deepStrictEqual(info.validators, initialInfo.validators, 'Validators are not set correctly') assert.deepStrictEqual(info.nextValidators, nextValidators, 'Incorrect set of next validators after third vote') }) @@ -77,8 +82,8 @@ module.exports = (oldValidator) => { await delay(5000) info = await controller1.getInfo() assert.strictEqual(info.bridgeStatus, 'keygen', 'Should not do anything after third vote') - assert.deepStrictEqual(info.epoch, initialInfo.epoch, 'Current epoch is not set correctly') - assert.deepStrictEqual(info.nextEpoch, initialInfo.epoch + 1, 'Next epoch is not set correctly') + assert.strictEqual(info.epoch, initialInfo.epoch, 'Current epoch is not set correctly') + assert.strictEqual(info.nextEpoch, initialInfo.epoch + 1, 'Next epoch is not set correctly') assert.deepStrictEqual(info.validators, initialInfo.validators, 'Validators are not set correctly') assert.deepStrictEqual(info.nextValidators, nextValidators, 'Incorrect set of next validators after third vote') }) diff --git a/tests/test/utils/proxyController.js b/tests/test/utils/proxyController.js index 3dac478..db028c8 100644 --- a/tests/test/utils/proxyController.js +++ b/tests/test/utils/proxyController.js @@ -28,6 +28,9 @@ function createController(validatorId) { }, async voteChangeThreshold(threshold) { return (await retry(() => proxy.get(`/vote/changeThreshold/${threshold}`))).data + }, + async voteChangeCloseEpoch(closeEpoch) { + return (await retry(() => proxy.get(`/vote/changeCloseEpoch/${closeEpoch}`))).data } } } From fee494e67750b0b063ba71ddc0d715ffb3fa9e9c Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Thu, 14 Nov 2019 13:30:55 +0300 Subject: [PATCH 096/129] Fixed bep12 testnet height --- src/binance-testnet/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/binance-testnet/Dockerfile b/src/binance-testnet/Dockerfile index fa8a813..10a9e73 100644 --- a/src/binance-testnet/Dockerfile +++ b/src/binance-testnet/Dockerfile @@ -15,4 +15,5 @@ RUN git lfs pull -I cli/testnet/${BNC_VERSION}/linux RUN ./fullnode/testnet/${BNC_VERSION}/linux/bnbchaind testnet --acc-prefix tbnb --chain-id Binance-Dev --v 1 RUN sed -i "s/publishTransfer = false/publishTransfer = true/" ./mytestnet/node0/gaiad/config/app.toml && \ - sed -i "s/publishLocal = false/publishLocal = true/" ./mytestnet/node0/gaiad/config/app.toml + sed -i "s/publishLocal = false/publishLocal = true/" ./mytestnet/node0/gaiad/config/app.toml && \ + sed -i "s/BEP12Height = 9223372036854775807/BEP12Height = 1/" ./mytestnet/node0/gaiad/config/app.toml From e04ddb94ca8930bb3d2d7d54668e3dafd05fd051 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Thu, 14 Nov 2019 16:45:04 +0300 Subject: [PATCH 097/129] Added additional checks for bnc account flags --- tests/test/addValidator.js | 4 +++- tests/test/changeThreshold.js | 4 +++- tests/test/removeValidator.js | 4 +++- tests/test/utils/bncController.js | 4 ++++ 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/tests/test/addValidator.js b/tests/test/addValidator.js index c947d1d..e0423dc 100644 --- a/tests/test/addValidator.js +++ b/tests/test/addValidator.js @@ -1,7 +1,7 @@ const assert = require('assert') const { waitPromise, delay } = require('./utils/wait') -const { getBepBalance } = require('./utils/bncController') +const { getBepBalance, getBncFlags } = require('./utils/bncController') const { controller1, controller3 } = require('./utils/proxyController') @@ -41,6 +41,8 @@ module.exports = (newValidator) => { it('should finish close epoch process and start voting process', async function () { this.timeout(120000) info = await waitPromise(controller1.getInfo, (newInfo) => newInfo.bridgeStatus === 'voting') + const flags = await getBncFlags(initialInfo.foreignBridgeAddress) + assert.strictEqual(flags, 1, 'Foreign bridge flags are not set correctly') }) it('should add validator', async function () { diff --git a/tests/test/changeThreshold.js b/tests/test/changeThreshold.js index 1f6ee8b..fc0f357 100644 --- a/tests/test/changeThreshold.js +++ b/tests/test/changeThreshold.js @@ -1,7 +1,7 @@ const assert = require('assert') const { waitPromise, delay } = require('./utils/wait') -const { getBepBalance } = require('./utils/bncController') +const { getBepBalance, getBncFlags } = require('./utils/bncController') const { controller1, controller2, controller3 } = require('./utils/proxyController') @@ -92,6 +92,8 @@ module.exports = (newThreshold) => { it('should finish keygen process and start funds transfer', async function () { this.timeout(120000) info = await waitPromise(controller1.getInfo, (newInfo) => newInfo.bridgeStatus === 'funds_transfer') + const flags = await getBncFlags(initialInfo.foreignBridgeAddress) + assert.strictEqual(flags, 0, 'Foreign bridge flags are not set correctly') }) it('should transfer all funds to new account and start new epoch', async function () { diff --git a/tests/test/removeValidator.js b/tests/test/removeValidator.js index 1918346..befcede 100644 --- a/tests/test/removeValidator.js +++ b/tests/test/removeValidator.js @@ -1,7 +1,7 @@ const assert = require('assert') const { waitPromise, delay } = require('./utils/wait') -const { getBepBalance } = require('./utils/bncController') +const { getBepBalance, getBncFlags } = require('./utils/bncController') const { controller1, controller2, controller3 } = require('./utils/proxyController') @@ -41,6 +41,8 @@ module.exports = (oldValidator) => { it('should finish close epoch process and start voting process', async function () { this.timeout(120000) info = await waitPromise(controller1.getInfo, (newInfo) => newInfo.bridgeStatus === 'voting') + const flags = await getBncFlags(initialInfo.foreignBridgeAddress) + assert.strictEqual(flags, 1, 'Foreign bridge flags are not set correctly') }) it('should remove validator', async function () { diff --git a/tests/test/utils/bncController.js b/tests/test/utils/bncController.js index bb2ca86..93237d7 100644 --- a/tests/test/utils/bncController.js +++ b/tests/test/utils/bncController.js @@ -23,5 +23,9 @@ module.exports = { async getBncSequence(address) { const response = await retry(() => bnc.get(`/api/v1/account/${address}/sequence`)) return response ? response.data.sequence : 0 + }, + async getBncFlags(address) { + const response = await retry(() => bnc.get(`/api/v1/account/${address}`)) + return response.data.flags } } From 74089e9f5cdcd64c3e1d5549a6f99e93a0697847 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Thu, 14 Nov 2019 16:55:57 +0300 Subject: [PATCH 098/129] Accept only empty nonce for memo validation script to work as a blocking script --- src/oracle/bncWatcher/bncWatcher.js | 6 ++---- src/test-services/binanceSend/testBinanceSend.js | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/oracle/bncWatcher/bncWatcher.js b/src/oracle/bncWatcher/bncWatcher.js index 159156c..2393e17 100644 --- a/src/oracle/bncWatcher/bncWatcher.js +++ b/src/oracle/bncWatcher/bncWatcher.js @@ -156,13 +156,11 @@ async function loop() { for (let i = transactions.length - 1; i >= 0; i -= 1) { const tx = transactions[i] - if (tx.memo !== 'funding') { + if (tx.memo === '') { const publicKeyEncoded = (await getTx(tx.txHash)).signatures[0].pub_key.value await proxyHttpClient.post('/transfer', { to: computeAddress(Buffer.from(publicKeyEncoded, 'base64')), - value: new BN(tx.value) - .multipliedBy(10 ** 18) - .integerValue(), + value: new BN(tx.value).multipliedBy(10 ** 18).integerValue(), hash: `0x${tx.txHash}` }) } diff --git a/src/test-services/binanceSend/testBinanceSend.js b/src/test-services/binanceSend/testBinanceSend.js index f0aede3..9dfaee7 100644 --- a/src/test-services/binanceSend/testBinanceSend.js +++ b/src/test-services/binanceSend/testBinanceSend.js @@ -40,7 +40,7 @@ async function main() { receipt = await client.multiSend(from, outputs, 'funding') } else { console.log(`From ${from} to ${to}, ${tokens} ${FOREIGN_ASSET}'`) - receipt = await client.transfer(from, to, tokens, FOREIGN_ASSET, 'exchange') + receipt = await client.transfer(from, to, tokens, FOREIGN_ASSET, '') } if (receipt.status === 200) { From 6665e0e0a537c111d44bf13a48c10e415faf94ef Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Thu, 14 Nov 2019 17:18:56 +0300 Subject: [PATCH 099/129] Added tests for forced sign --- tests/test/addValidator.js | 22 ++++++++++++++++++++-- tests/test/index.js | 2 +- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/tests/test/addValidator.js b/tests/test/addValidator.js index e0423dc..61d89ea 100644 --- a/tests/test/addValidator.js +++ b/tests/test/addValidator.js @@ -1,23 +1,31 @@ const assert = require('assert') const { waitPromise, delay } = require('./utils/wait') -const { getBepBalance, getBncFlags } = require('./utils/bncController') +const { getBepBalance, getBncFlags, getBncSequence } = require('./utils/bncController') const { controller1, controller3 } = require('./utils/proxyController') -module.exports = (newValidator) => { +module.exports = (getUsers, newValidator) => { describe('add validator', function () { let info let initialInfo let nextValidators + let user + let bncBridgeSequence + let bncBalance before(async function () { initialInfo = await controller1.getInfo() + // eslint-disable-next-line prefer-destructuring + user = getUsers()[0] + bncBridgeSequence = await getBncSequence(info.foreignBridgeAddress) + bncBalance = await user.getBepBalance() info = initialInfo nextValidators = [...initialInfo.validators, newValidator] }) it('should start closing epoch process', async function () { + await user.exchangeErc(5) await controller1.voteStartVoting() await delay(5000) info = await controller1.getInfo() @@ -38,6 +46,16 @@ module.exports = (newValidator) => { assert.deepStrictEqual(info.nextValidators, initialInfo.validators, 'Incorrect set of next validators after third vote') }) + it('should make forced sign', async function () { + this.timeout(300000) + await waitPromise( + () => getBncSequence(info.foreignBridgeAddress), + (sequence) => sequence === bncBridgeSequence + 1 + ) + const newBncBalance = await user.getBepBalance() + assert.strictEqual(newBncBalance, bncBalance + 5, `Balance of ${user.bncAddress} did not updated as expected`) + }) + it('should finish close epoch process and start voting process', async function () { this.timeout(120000) info = await waitPromise(controller1.getInfo, (newInfo) => newInfo.bridgeStatus === 'voting') diff --git a/tests/test/index.js b/tests/test/index.js index aa85b05..3acb9bb 100644 --- a/tests/test/index.js +++ b/tests/test/index.js @@ -88,7 +88,7 @@ describe('bridge tests', function () { testBncToEth(() => users) testEthToBnc(() => users) - testAddValidator(validatorsConfig[1]) + testAddValidator(() => users, validatorsConfig[1]) testEthToBnc(() => users) testBncToEth(() => users) From 17cb9e760d1593685a13413c17fe63a9e4e9bfa7 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Thu, 14 Nov 2019 17:44:08 +0300 Subject: [PATCH 100/129] Waiting for funds on bnc side, if not enough for making exchange transaction --- src/oracle/tss-sign/signer.js | 32 ++++++++++++++++----------- tests/test/ethToBnc.js | 41 ++++++++++++++++++++++++----------- tests/test/index.js | 4 ++-- tests/test/utils/bncClient.js | 2 +- 4 files changed, 50 insertions(+), 29 deletions(-) diff --git a/src/oracle/tss-sign/signer.js b/src/oracle/tss-sign/signer.js index 69181da..39d77b4 100644 --- a/src/oracle/tss-sign/signer.js +++ b/src/oracle/tss-sign/signer.js @@ -116,23 +116,29 @@ async function waitForAccountNonce(address, nonce) { return !cancelled } - -function sendTx(tx) { - return httpClient - .post('/api/v1/broadcast?sync=true', tx, { - headers: { - 'Content-Type': 'text/plain' - } - }) - .catch(async (err) => { +async function sendTx(tx) { + while (true) { + try { + return await httpClient + .post('/api/v1/broadcast?sync=true', tx, { + headers: { + 'Content-Type': 'text/plain' + } + }) + } catch (err) { if (err.response.data.message.includes('Tx already exists in cache')) { logger.debug('Tx already exists in cache') return true } - logger.info('Something failed, restarting: %o', err.response) - await delay(1000) - return await sendTx(tx) - }) + if (err.response.data.message.includes(' < ')) { + logger.warn('Insufficient funds, waiting for funds to income') + await delay(60000) + } else { + logger.info('Something failed, restarting: %o', err.response) + await delay(10000) + } + } + } } function sign(keysFile, hash, tx, publicKey, signerAddress) { diff --git a/tests/test/ethToBnc.js b/tests/test/ethToBnc.js index 4bd5e08..4ae6ef6 100644 --- a/tests/test/ethToBnc.js +++ b/tests/test/ethToBnc.js @@ -7,45 +7,60 @@ const { HOME_BRIDGE_ADDRESS } = process.env const { controller1 } = require('./utils/proxyController') -module.exports = (getUsers) => { +module.exports = (getUsers, amount = 5, getBncPrefundedUser = null) => { describe('exchange of tokens in eth => bnc direction', function () { let info let users let ethBalances let bncBalances let bncBridgeSequence + let bncPrefundedUser before(async function () { users = getUsers() info = await controller1.getInfo() ethBalances = await Promise.all(users.map((user) => user.getErcBalance())) bncBalances = await seqMap(users, (user) => user.getBepBalance()) - + if (getBncPrefundedUser) { + bncPrefundedUser = getBncPrefundedUser() + } bncBridgeSequence = await getBncSequence(info.foreignBridgeAddress) - await Promise.all(users.map((user, i) => user.approveErc(HOME_BRIDGE_ADDRESS, 5 + i))) + await Promise.all(users.map((user, i) => user.approveErc(HOME_BRIDGE_ADDRESS, amount + i))) }) it('should accept exchange requests', async function () { - await Promise.all(users.map((user, i) => user.exchangeErc(5 + i))) + await Promise.all(users.map((user, i) => user.exchangeErc(amount + i))) const newEthBalances = await Promise.all(users.map((user) => user.getErcBalance())) for (let i = 0; i < 3; i += 1) { - assert.strictEqual(newEthBalances[i], ethBalances[i] - 5 - i, `Balance of ${users[i].ethAddress} did not updated as expected`) + assert.strictEqual(newEthBalances[i], ethBalances[i] - amount - i, `Balance of ${users[i].ethAddress} did not updated as expected`) } }) - it('should make exchange transaction on bnc side', async function () { - this.timeout(300000) - await waitPromise( - () => getBncSequence(info.foreignBridgeAddress), - (sequence) => sequence === bncBridgeSequence + 1 - ) - }) + if (bncPrefundedUser) { + it('should make exchange transaction on bnc side with waiting for enough funds on bnc side', async function () { + this.timeout(300000) + await delay(120000) + await bncPrefundedUser.transferBepBnb(info.foreignBridgeAddress, amount * 3 + 10, 0) + await waitPromise( + () => getBncSequence(info.foreignBridgeAddress), + (sequence) => sequence === bncBridgeSequence + 1 + ) + }) + } else { + it('should make exchange transaction on bnc side', async function () { + this.timeout(300000) + await waitPromise( + () => getBncSequence(info.foreignBridgeAddress), + (sequence) => sequence === bncBridgeSequence + 1 + ) + }) + } it('should make correct exchange transaction', async function () { await delay(10000) const newBncBalances = await Promise.all(users.map((user) => user.getBepBalance())) for (let i = 0; i < 3; i += 1) { - assert.strictEqual(newBncBalances[i], bncBalances[i] + 5 + i, `Balance of ${users[i].bncAddress} did not updated as expected`) + assert.strictEqual(newBncBalances[i], bncBalances[i] + amount + i, `Balance of ${users[i].bncAddress} did not updated as expected`) } }) }) diff --git a/tests/test/index.js b/tests/test/index.js index 3acb9bb..8ae7840 100644 --- a/tests/test/index.js +++ b/tests/test/index.js @@ -21,6 +21,7 @@ const { controller1 } = require('./utils/proxyController') describe('bridge tests', function () { let users + let bncPrefundedUser before(async function () { users = await seqMap(usersConfig, (user) => createUser(user.privateKey)) @@ -29,7 +30,6 @@ describe('bridge tests', function () { describe('generation of initial epoch keys', function () { let info let ethPrefundedUser - let bncPrefundedUser before(async function () { ethPrefundedUser = await createUser(HOME_PRIVATE_KEY, 'eth') @@ -99,5 +99,5 @@ describe('bridge tests', function () { testEthToBnc(() => users) testBncToEth(() => users) testEthToBncWithRestart(() => users, 2) - testEthToBnc(() => users) + testEthToBnc(() => users, 500, bncPrefundedUser) }) diff --git a/tests/test/utils/bncClient.js b/tests/test/utils/bncClient.js index cd461fb..bd18a30 100644 --- a/tests/test/utils/bncClient.js +++ b/tests/test/utils/bncClient.js @@ -36,7 +36,7 @@ module.exports = async function main(privateKey) { await client.multiSend(from, outputs, 'funding') }, async exchange(to, value) { - await client.transfer(from, to, value.toString(), FOREIGN_ASSET, 'exchange') + await client.transfer(from, to, value.toString(), FOREIGN_ASSET, '') } } } From 73f7dc161230440f886e4b2a578cbabdffb981f8 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Thu, 14 Nov 2019 21:48:32 +0300 Subject: [PATCH 101/129] Fixed waiting for funds in sendTx, fixed correspondent tests. --- .circleci/config.yml | 10 +++++++++- src/binance-testnet/http-api/index.js | 20 +++++++++++++++++++- src/deploy/deploy-home/.env.development | 2 +- src/oracle/tss-sign/signer.js | 14 +++++++------- tests/init.sh | 2 +- tests/test/addValidator.js | 4 ++-- tests/test/ethToBnc.js | 4 ++-- tests/test/index.js | 6 +++--- 8 files changed, 44 insertions(+), 18 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a1e6183..f79f9c3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -125,6 +125,14 @@ orbs: docker logs ganache_home > ./artifacts/logs/ganache/home.log docker logs ganache_side > ./artifacts/logs/ganache/side.log when: always + - run: + name: "Save binance logs" + command: | + mkdir -p ./artifacts/logs/binance + docker logs binance-testnet_node_1 > ./artifacts/logs/binance/node.log + docker logs binance-testnet_api-server_1 > ./artifacts/logs/binance/api-server.log + docker logs binance-testnet_http-api_1 > ./artifacts/logs/binance/http-api.log + when: always - store_artifacts: path: ./artifacts when: always @@ -151,7 +159,7 @@ jobs: name: "Run dev environment, deploy contracts, prefund accounts" command: | BLOCK_TIME=3 ./demo/start-ethereum-environment.sh - cat ./tests/config.json | jq .users[].ethAddress | xargs -I {} ./src/test-services/ethereumSend/run.sh {} 300 + cat ./tests/config.json | jq .users[].ethAddress | xargs -I {} ./src/test-services/ethereumSend/run.sh {} 1000 - run: name: "Stop dev environment" command: docker kill ganache_side ganache_home diff --git a/src/binance-testnet/http-api/index.js b/src/binance-testnet/http-api/index.js index 58d52aa..60feabb 100644 --- a/src/binance-testnet/http-api/index.js +++ b/src/binance-testnet/http-api/index.js @@ -126,7 +126,25 @@ async function handleBroadcast(req, res) { tx: `0x${req.rawBody}` } }) - res.send([response.data.result]) + if (response.data.error) { + res.status(500).send({ + code: 500, + failed_tx_index: 0, + message: 'RPC error -32603 - Internal error: Tx already exists in cache', + success_tx_results: [] + }) + } else if (response.data.result.code === 65546) { + res.status(400).send({ + code: 400, + failed_tx_index: 0, + message: '3417218964BNB < 1000DEV-BA6', + success_tx_results: [] + }) + } else if (response.data.result) { + res.send([response.data.result]) + } else { + res.status(400).end() + } } } diff --git a/src/deploy/deploy-home/.env.development b/src/deploy/deploy-home/.env.development index 7c3f528..b13d306 100644 --- a/src/deploy/deploy-home/.env.development +++ b/src/deploy/deploy-home/.env.development @@ -12,7 +12,7 @@ VALIDATOR_ADDRESS_3=0x6352e3e6038e05b9da00c84ae851308f9774f883 THRESHOLD=2 MIN_TX_LIMIT=10000000000000000 -MAX_TX_LIMIT=100000000000000000000 +MAX_TX_LIMIT=1000000000000000000000 BLOCKS_RANGE_SIZE=10 diff --git a/src/oracle/tss-sign/signer.js b/src/oracle/tss-sign/signer.js index 39d77b4..0e3810d 100644 --- a/src/oracle/tss-sign/signer.js +++ b/src/oracle/tss-sign/signer.js @@ -119,19 +119,19 @@ async function waitForAccountNonce(address, nonce) { async function sendTx(tx) { while (true) { try { - return await httpClient - .post('/api/v1/broadcast?sync=true', tx, { - headers: { - 'Content-Type': 'text/plain' - } - }) + return await httpClient.post('/api/v1/broadcast?sync=true', tx, { + headers: { + 'Content-Type': 'text/plain' + } + }) } catch (err) { + logger.trace('Error, response data %o', err.response.data) if (err.response.data.message.includes('Tx already exists in cache')) { logger.debug('Tx already exists in cache') return true } if (err.response.data.message.includes(' < ')) { - logger.warn('Insufficient funds, waiting for funds to income') + logger.warn('Insufficient funds, waiting for funds') await delay(60000) } else { logger.info('Something failed, restarting: %o', err.response) diff --git a/tests/init.sh b/tests/init.sh index b94a291..d542a16 100755 --- a/tests/init.sh +++ b/tests/init.sh @@ -22,7 +22,7 @@ echo "Starting binance test network" ./demo/start-binance-environment.sh echo "Prefunding ethereum user accounts" -cat ./tests/config.json | jq .users[].ethAddress | xargs -I {} ./src/test-services/ethereumSend/run.sh {} 300 +cat ./tests/config.json | jq .users[].ethAddress | xargs -I {} ./src/test-services/ethereumSend/run.sh {} 1000 echo "Prefunding binance user accounts" cat ./tests/config.json | jq .users[].bncAddress | xargs -I {} ./src/test-services/binanceSend/run.sh {} 300 0.1 diff --git a/tests/test/addValidator.js b/tests/test/addValidator.js index 61d89ea..da0c1d0 100644 --- a/tests/test/addValidator.js +++ b/tests/test/addValidator.js @@ -18,10 +18,10 @@ module.exports = (getUsers, newValidator) => { initialInfo = await controller1.getInfo() // eslint-disable-next-line prefer-destructuring user = getUsers()[0] - bncBridgeSequence = await getBncSequence(info.foreignBridgeAddress) bncBalance = await user.getBepBalance() info = initialInfo - nextValidators = [...initialInfo.validators, newValidator] + bncBridgeSequence = await getBncSequence(info.foreignBridgeAddress) + nextValidators = [...info.validators, newValidator] }) it('should start closing epoch process', async function () { diff --git a/tests/test/ethToBnc.js b/tests/test/ethToBnc.js index 4ae6ef6..c01a5dc 100644 --- a/tests/test/ethToBnc.js +++ b/tests/test/ethToBnc.js @@ -36,8 +36,8 @@ module.exports = (getUsers, amount = 5, getBncPrefundedUser = null) => { } }) - if (bncPrefundedUser) { - it('should make exchange transaction on bnc side with waiting for enough funds on bnc side', async function () { + if (getBncPrefundedUser) { + it('should make exchange transaction on bnc side after already enough funds', async function () { this.timeout(300000) await delay(120000) await bncPrefundedUser.transferBepBnb(info.foreignBridgeAddress, amount * 3 + 10, 0) diff --git a/tests/test/index.js b/tests/test/index.js index 8ae7840..a120c7c 100644 --- a/tests/test/index.js +++ b/tests/test/index.js @@ -50,7 +50,7 @@ describe('bridge tests', function () { const userEthBalance = await users[i].getEthBalance() assert.ok(userEthBalance >= 0.1, `Insufficient ETH balance on ${users[i].ethAddress} in Ethereum network, expected 0.1 ETH, got ${userEthBalance}`) const userErcBalance = await users[i].getErcBalance() - assert.ok(userErcBalance >= 200, `Insufficient ERC20 balance on ${users[i].ethAddress} in Ethereum network, expected 200 ERC20, got ${userErcBalance}`) + assert.ok(userErcBalance >= 1000, `Insufficient ERC20 balance on ${users[i].ethAddress} in Ethereum network, expected 1000 ERC20, got ${userErcBalance}`) const userBnbBalance = await users[i].getBepBalance() assert.ok(userBnbBalance >= 0.1, `Insufficient BNB balance on ${users[i].bncAddress} in Binance network, expected 0.1 BNB, got ${userBnbBalance}`) const userBepBalance = await users[i].getBepBalance() @@ -84,7 +84,7 @@ describe('bridge tests', function () { testRemoveValidator(validatorsConfig[1]) - testEthToBnc(() => users) + testEthToBnc(() => users, 500, () => bncPrefundedUser) testBncToEth(() => users) testEthToBnc(() => users) @@ -99,5 +99,5 @@ describe('bridge tests', function () { testEthToBnc(() => users) testBncToEth(() => users) testEthToBncWithRestart(() => users, 2) - testEthToBnc(() => users, 500, bncPrefundedUser) + testEthToBnc(() => users) }) From a84278f88cba14d1b06db13d3f6c01a271af7e6f Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Thu, 14 Nov 2019 23:29:06 +0300 Subject: [PATCH 102/129] Fixed forced sign test. Improved binance testnet scripts --- demo/clean.sh | 3 ++ demo/start-binance-environment.sh | 52 ++++++++++++++++---------- src/binance-testnet/docker-compose.yml | 10 +++-- tests/test/addValidator.js | 8 +++- 4 files changed, 49 insertions(+), 24 deletions(-) diff --git a/demo/clean.sh b/demo/clean.sh index 1044917..3b819ba 100755 --- a/demo/clean.sh +++ b/demo/clean.sh @@ -12,6 +12,9 @@ echo "Cleaning $TARGET_NETWORK network" if [[ "$TARGET_NETWORK" == "development" ]]; then docker volume rm ganache_side_data > /dev/null 2>&1 || true docker volume rm ganache_home_data > /dev/null 2>&1 || true + docker volume rm binance_data > /dev/null 2>&1 || true + docker volume rm binance_marketdata > /dev/null 2>&1 || true + docker volume rm binance_marketdata > /dev/null 2>&1 || true fi for (( I = 1; I < 4; ++I )); do diff --git a/demo/start-binance-environment.sh b/demo/start-binance-environment.sh index 86ca927..783b179 100755 --- a/demo/start-binance-environment.sh +++ b/demo/start-binance-environment.sh @@ -8,12 +8,22 @@ tbnbcli() { echo 12345678 | docker exec -i binance-testnet_node_1 ./tbnbcli $@ --from node0 --node http://node:26657 --chain-id Binance-Dev --json } -echo "Removing old environment" -docker kill $(docker ps -a | grep binance-testnet_ | awk '{print $1}') > /dev/null 2>&1 || true -docker rm $(docker ps -a | grep binance-testnet_ | awk '{print $1}') > /dev/null 2>&1 || true -docker volume rm binance-testnet_marketdata > /dev/null 2>&1 || true +if [[ "$(docker volume ls | grep binance_data)" ]]; then + echo "Restarting binance test network" +else + echo "Creating new binance test network" -docker network create binance_net > /dev/null 2>&1 || true + echo "Removing old environment" + docker kill $(docker ps -a | grep binance-testnet_ | awk '{print $1}') > /dev/null 2>&1 || true + docker rm $(docker ps -a | grep binance-testnet_ | awk '{print $1}') > /dev/null 2>&1 || true + docker volume rm binance_marketdata > /dev/null 2>&1 || true + + docker network create binance_net > /dev/null 2>&1 || true + docker volume create binance_marketdata > /dev/null 2>&1 || true + docker volume create binance_data > /dev/null 2>&1 || true + + need_to_deploy=true +fi echo "Building required binaries" docker build -t testnet-binaries ../src/binance-testnet > /dev/null 2>&1 || true @@ -23,21 +33,25 @@ docker-compose -f ../src/binance-testnet/docker-compose.yml up --build -d sleep 2 -echo "Issuing test asset" -ISSUED_LOG=$(tbnbcli token issue --symbol DEV --total-supply 1000000000000 --token-name "DEV Token" | jq .Response.log) -TOKEN_SYMBOL=${ISSUED_LOG:(-8):7} -echo "Issued $TOKEN_SYMBOL" +if [[ -n "$need_to_deploy" ]]; then + echo "Issuing test asset" + ISSUED_LOG=$(tbnbcli token issue --symbol DEV --total-supply 1000000000000 --token-name "DEV Token" | jq .Response.log) + TOKEN_SYMBOL=${ISSUED_LOG:(-8):7} + echo "Issued $TOKEN_SYMBOL" -sed -i 's/FOREIGN_ASSET=.*$/FOREIGN_ASSET='"$TOKEN_SYMBOL"'/' ../src/test-services/binanceBalance/.env.development -sed -i 's/FOREIGN_ASSET=.*$/FOREIGN_ASSET='"$TOKEN_SYMBOL"'/' ../src/test-services/binanceSend/.env.development -sed -i 's/FOREIGN_ASSET=.*$/FOREIGN_ASSET='"$TOKEN_SYMBOL"'/' ../tests/.env -for file in ./validator*/.env.development; do - sed -i 's/FOREIGN_ASSET=.*$/FOREIGN_ASSET='"$TOKEN_SYMBOL"'/' "$file" -done + sed -i 's/FOREIGN_ASSET=.*$/FOREIGN_ASSET='"$TOKEN_SYMBOL"'/' ../src/test-services/binanceBalance/.env.development + sed -i 's/FOREIGN_ASSET=.*$/FOREIGN_ASSET='"$TOKEN_SYMBOL"'/' ../src/test-services/binanceSend/.env.development + sed -i 's/FOREIGN_ASSET=.*$/FOREIGN_ASSET='"$TOKEN_SYMBOL"'/' ../tests/.env + for file in ./validator*/.env.development; do + sed -i 's/FOREIGN_ASSET=.*$/FOREIGN_ASSET='"$TOKEN_SYMBOL"'/' "$file" + done -sleep 2 + sleep 2 -echo "Sending tokens to controlled address" -tbnbcli token multi-send --transfers '[{"to":"tbnb1z7u9f8mcuwxanns9xa6qgjtlka0d392epc0m9x","amount":"1000000000000:BNB,1000000000000:'"$TOKEN_SYMBOL"'"}]' + echo "Sending tokens to controlled address" + tbnbcli token multi-send --transfers '[{"to":"tbnb1z7u9f8mcuwxanns9xa6qgjtlka0d392epc0m9x","amount":"1000000000000:BNB,1000000000000:'"$TOKEN_SYMBOL"'"}]' -sleep 2 \ No newline at end of file + sleep 2 +else + echo "Tokens are already issued, run clean.sh first if you want to redeploy everything" +fi diff --git a/src/binance-testnet/docker-compose.yml b/src/binance-testnet/docker-compose.yml index f4917b5..ebe2cff 100644 --- a/src/binance-testnet/docker-compose.yml +++ b/src/binance-testnet/docker-compose.yml @@ -8,7 +8,8 @@ services: ports: - '26657:26657' volumes: - - 'marketdata:/root/.bnbchaind/marketdata' + - 'binance_marketdata:/root/.bnbchaind/marketdata' + - 'binance_data:/root/.bnbchaind/data' api-server: build: api-server image: bnc-api-server @@ -28,10 +29,13 @@ services: ports: - '8000:8000' volumes: - - 'marketdata:/http-api/marketdata' + - 'binance_marketdata:/http-api/marketdata' networks: binance_net: external: true binance_rpc_net: volumes: - marketdata: + binance_marketdata: + external: true + binance_data: + external: true diff --git a/tests/test/addValidator.js b/tests/test/addValidator.js index da0c1d0..f30bb53 100644 --- a/tests/test/addValidator.js +++ b/tests/test/addValidator.js @@ -5,6 +5,8 @@ const { getBepBalance, getBncFlags, getBncSequence } = require('./utils/bncContr const { controller1, controller3 } = require('./utils/proxyController') +const { HOME_BRIDGE_ADDRESS } = process.env + module.exports = (getUsers, newValidator) => { describe('add validator', function () { let info @@ -25,12 +27,14 @@ module.exports = (getUsers, newValidator) => { }) it('should start closing epoch process', async function () { - await user.exchangeErc(5) await controller1.voteStartVoting() await delay(5000) info = await controller1.getInfo() assert.strictEqual(info.bridgeStatus, 'ready', 'Should not change state after one vote') + await user.approveErc(HOME_BRIDGE_ADDRESS, 5) + await user.exchangeErc(5) + await controller3.voteStartVoting() info = await waitPromise(controller1.getInfo, (newInfo) => newInfo.bridgeStatus === 'closing_epoch') assert.strictEqual(info.epoch, initialInfo.epoch, 'Current epoch is not set correctly') @@ -157,7 +161,7 @@ module.exports = (getUsers, newValidator) => { const prevBalance = await getBepBalance(initialInfo.foreignBridgeAddress) const newBalance = await getBepBalance(info.foreignBridgeAddress) assert.strictEqual(prevBalance, 0, 'Did not transfer all funds') - assert.strictEqual(newBalance, initialInfo.foreignBalanceTokens, 'Funds are lost somewhere') + assert.strictEqual(newBalance, initialInfo.foreignBalanceTokens - 5, 'Funds are lost somewhere') }) }) } From 3fa391cef51c634ce07c00a67f78684d831a4209 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Thu, 14 Nov 2019 23:44:47 +0300 Subject: [PATCH 103/129] Fixed docker rm commands --- demo/clean.sh | 8 +++++++- tests/init.sh | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/demo/clean.sh b/demo/clean.sh index 3b819ba..0b5586d 100755 --- a/demo/clean.sh +++ b/demo/clean.sh @@ -9,12 +9,18 @@ TARGET_NETWORK=${TARGET_NETWORK:=development} echo "Cleaning $TARGET_NETWORK network" +docker kill $(docker ps | grep validator[1-3]_ | awk '{print $1}') > /dev/null 2>&1 || true +docker rm $(docker ps -a | grep validator[1-3]_ | awk '{print $1}') > /dev/null 2>&1 || true +docker kill ganache_home ganache_side > /dev/null 2>&1 || true +docker rm ganache_home ganache_side > /dev/null 2>&1 || true +docker kill $(docker ps | grep binance-testnet_ | awk '{print $1}') > /dev/null 2>&1 || true +docker rm $(docker ps -a | grep binance-testnet_ | awk '{print $1}') > /dev/null 2>&1 || true + if [[ "$TARGET_NETWORK" == "development" ]]; then docker volume rm ganache_side_data > /dev/null 2>&1 || true docker volume rm ganache_home_data > /dev/null 2>&1 || true docker volume rm binance_data > /dev/null 2>&1 || true docker volume rm binance_marketdata > /dev/null 2>&1 || true - docker volume rm binance_marketdata > /dev/null 2>&1 || true fi for (( I = 1; I < 4; ++I )); do diff --git a/tests/init.sh b/tests/init.sh index d542a16..62d3a64 100755 --- a/tests/init.sh +++ b/tests/init.sh @@ -4,11 +4,11 @@ set -e echo "Killing all remaining docker containers" docker kill $(docker ps | grep validator[1-3]_ | awk '{print $1}') > /dev/null 2>&1 || true -docker rm $(docker ps | grep validator[1-3]_ | awk '{print $1}') > /dev/null 2>&1 || true +docker rm $(docker ps -a | grep validator[1-3]_ | awk '{print $1}') > /dev/null 2>&1 || true docker kill ganache_home ganache_side > /dev/null 2>&1 || true docker rm ganache_home ganache_side > /dev/null 2>&1 || true docker kill $(docker ps | grep binance-testnet_ | awk '{print $1}') > /dev/null 2>&1 || true -docker rm $(docker ps | grep binance-testnet_ | awk '{print $1}') > /dev/null 2>&1 || true +docker rm $(docker ps -a | grep binance-testnet_ | awk '{print $1}') > /dev/null 2>&1 || true echo "Cleaning previous demo environment" ./demo/clean.sh From c953c8c21b4590b532a4e6562ee2d0a25a3fe0b0 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Fri, 15 Nov 2019 10:01:41 +0300 Subject: [PATCH 104/129] Optimized a little bit dockerfiles for deploying --- src/deploy/deploy-home/Dockerfile | 3 +-- src/deploy/deploy-side/Dockerfile | 3 +-- src/deploy/deploy-test/Dockerfile | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/deploy/deploy-home/Dockerfile b/src/deploy/deploy-home/Dockerfile index cbdf66a..a769574 100644 --- a/src/deploy/deploy-home/Dockerfile +++ b/src/deploy/deploy-home/Dockerfile @@ -9,8 +9,6 @@ RUN npm install truffle-hdwallet-provider RUN truffle obtain --solc 0.5.9 -COPY truffle-config-build.js /build/truffle-config.js - RUN mkdir temp \ && cd temp \ && truffle init \ @@ -19,6 +17,7 @@ RUN mkdir temp \ && cd .. \ && rm -rf temp +COPY truffle-config-build.js /build/truffle-config.js COPY contracts/openzeppelin-solidity /build/contracts/openzeppelin-solidity RUN truffle compile diff --git a/src/deploy/deploy-side/Dockerfile b/src/deploy/deploy-side/Dockerfile index c94da4c..fce9bf2 100644 --- a/src/deploy/deploy-side/Dockerfile +++ b/src/deploy/deploy-side/Dockerfile @@ -9,8 +9,6 @@ RUN npm install truffle-hdwallet-provider RUN truffle obtain --solc 0.5.9 -COPY truffle-config-build.js /build/truffle-config.js - RUN mkdir temp \ && cd temp \ && truffle init \ @@ -19,6 +17,7 @@ RUN mkdir temp \ && cd .. \ && rm -rf temp +COPY truffle-config-build.js /build/truffle-config.js COPY contracts /build/contracts RUN truffle compile diff --git a/src/deploy/deploy-test/Dockerfile b/src/deploy/deploy-test/Dockerfile index cbdf66a..a769574 100644 --- a/src/deploy/deploy-test/Dockerfile +++ b/src/deploy/deploy-test/Dockerfile @@ -9,8 +9,6 @@ RUN npm install truffle-hdwallet-provider RUN truffle obtain --solc 0.5.9 -COPY truffle-config-build.js /build/truffle-config.js - RUN mkdir temp \ && cd temp \ && truffle init \ @@ -19,6 +17,7 @@ RUN mkdir temp \ && cd .. \ && rm -rf temp +COPY truffle-config-build.js /build/truffle-config.js COPY contracts/openzeppelin-solidity /build/contracts/openzeppelin-solidity RUN truffle compile From d79215073235eca8f6981f27f819096b50150d6d Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Fri, 15 Nov 2019 10:02:46 +0300 Subject: [PATCH 105/129] Moved prefunding in tests before hook --- demo/start-binance-environment.sh | 5 ++-- tests/init.sh | 13 --------- tests/test/index.js | 44 +++++++++---------------------- 3 files changed, 15 insertions(+), 47 deletions(-) diff --git a/demo/start-binance-environment.sh b/demo/start-binance-environment.sh index 783b179..5d56c69 100755 --- a/demo/start-binance-environment.sh +++ b/demo/start-binance-environment.sh @@ -35,7 +35,7 @@ sleep 2 if [[ -n "$need_to_deploy" ]]; then echo "Issuing test asset" - ISSUED_LOG=$(tbnbcli token issue --symbol DEV --total-supply 1000000000000 --token-name "DEV Token" | jq .Response.log) + ISSUED_LOG=$(tbnbcli token issue --symbol DEV --total-supply 10000000000000000 --token-name "DEV Token" | jq .Response.log) TOKEN_SYMBOL=${ISSUED_LOG:(-8):7} echo "Issued $TOKEN_SYMBOL" @@ -49,7 +49,8 @@ if [[ -n "$need_to_deploy" ]]; then sleep 2 echo "Sending tokens to controlled address" - tbnbcli token multi-send --transfers '[{"to":"tbnb1z7u9f8mcuwxanns9xa6qgjtlka0d392epc0m9x","amount":"1000000000000:BNB,1000000000000:'"$TOKEN_SYMBOL"'"}]' + tbnbcli token multi-send \ + --transfers '[{"to":"tbnb1z7u9f8mcuwxanns9xa6qgjtlka0d392epc0m9x","amount":"10000000000000000:BNB,10000000000000000:'"$TOKEN_SYMBOL"'"}]' sleep 2 else diff --git a/tests/init.sh b/tests/init.sh index 62d3a64..0261b56 100755 --- a/tests/init.sh +++ b/tests/init.sh @@ -2,14 +2,6 @@ set -e -echo "Killing all remaining docker containers" -docker kill $(docker ps | grep validator[1-3]_ | awk '{print $1}') > /dev/null 2>&1 || true -docker rm $(docker ps -a | grep validator[1-3]_ | awk '{print $1}') > /dev/null 2>&1 || true -docker kill ganache_home ganache_side > /dev/null 2>&1 || true -docker rm ganache_home ganache_side > /dev/null 2>&1 || true -docker kill $(docker ps | grep binance-testnet_ | awk '{print $1}') > /dev/null 2>&1 || true -docker rm $(docker ps -a | grep binance-testnet_ | awk '{print $1}') > /dev/null 2>&1 || true - echo "Cleaning previous demo environment" ./demo/clean.sh @@ -21,11 +13,6 @@ BLOCK_TIME=3 ./demo/start-ethereum-environment.sh echo "Starting binance test network" ./demo/start-binance-environment.sh -echo "Prefunding ethereum user accounts" -cat ./tests/config.json | jq .users[].ethAddress | xargs -I {} ./src/test-services/ethereumSend/run.sh {} 1000 -echo "Prefunding binance user accounts" -cat ./tests/config.json | jq .users[].bncAddress | xargs -I {} ./src/test-services/binanceSend/run.sh {} 300 0.1 - echo "Starting validator daemons" N=1 ./demo/validator-demo.sh -d N=2 ./demo/validator-demo.sh -d diff --git a/tests/test/index.js b/tests/test/index.js index a120c7c..b5bb877 100644 --- a/tests/test/index.js +++ b/tests/test/index.js @@ -13,50 +13,30 @@ const testChangeThreshold = require('./changeThreshold') const usersConfig = require('../config').users const validatorsConfig = require('../config').validators -const { - HOME_PRIVATE_KEY, FOREIGN_PRIVATE_KEY, HOME_BRIDGE_ADDRESS, FOREIGN_ASSET -} = process.env +const { HOME_PRIVATE_KEY, FOREIGN_PRIVATE_KEY, HOME_BRIDGE_ADDRESS } = process.env const { controller1 } = require('./utils/proxyController') describe('bridge tests', function () { let users let bncPrefundedUser + let ethPrefundedUser before(async function () { + ethPrefundedUser = await createUser(HOME_PRIVATE_KEY, 'eth') + bncPrefundedUser = await createUser(FOREIGN_PRIVATE_KEY, 'bnc') + + for (let i = 0; i < 3; i += 1) { + // user eth balance is already prefunded with 100 eth in genesis block + await ethPrefundedUser.transferErc(usersConfig[i].ethAddress, 10000) + await bncPrefundedUser.transferBepBnb(usersConfig[i].bncAddress, 10000, 100) + } + users = await seqMap(usersConfig, (user) => createUser(user.privateKey)) }) describe('generation of initial epoch keys', function () { let info - let ethPrefundedUser - - before(async function () { - ethPrefundedUser = await createUser(HOME_PRIVATE_KEY, 'eth') - bncPrefundedUser = await createUser(FOREIGN_PRIVATE_KEY, 'bnc') - - const bnbBalance = await bncPrefundedUser.getBnbBalance() - assert.ok(bnbBalance >= 10, `Insufficient BNB balance on ${bncPrefundedUser.ethAddress} in Binance network, expected 10 BNB, got ${bnbBalance}`) - const bepBalance = await bncPrefundedUser.getBepBalance() - assert.ok(bepBalance >= 2000, `Insufficient BEP2 balance on ${bncPrefundedUser.ethAddress} in Binance network, expected 2000 ${FOREIGN_ASSET}, got ${bepBalance}`) - - const ethBalance = await ethPrefundedUser.getEthBalance() - assert.ok(ethBalance >= 1, `Insufficient ETH balance on ${ethPrefundedUser.ethAddress} in Ethereum network, expected 1 ETH, got ${ethBalance}`) - const ercBalance = await ethPrefundedUser.getErcBalance() - assert.ok(ercBalance >= 2000, `Insufficient ERC20 balance on ${ethPrefundedUser.ethAddress} in Ethereum network, expected 2000 ERC20, got ${ercBalance}`) - - - for (let i = 0; i < 3; i += 1) { - const userEthBalance = await users[i].getEthBalance() - assert.ok(userEthBalance >= 0.1, `Insufficient ETH balance on ${users[i].ethAddress} in Ethereum network, expected 0.1 ETH, got ${userEthBalance}`) - const userErcBalance = await users[i].getErcBalance() - assert.ok(userErcBalance >= 1000, `Insufficient ERC20 balance on ${users[i].ethAddress} in Ethereum network, expected 1000 ERC20, got ${userErcBalance}`) - const userBnbBalance = await users[i].getBepBalance() - assert.ok(userBnbBalance >= 0.1, `Insufficient BNB balance on ${users[i].bncAddress} in Binance network, expected 0.1 BNB, got ${userBnbBalance}`) - const userBepBalance = await users[i].getBepBalance() - assert.ok(userErcBalance >= 200, `Insufficient BEP2 balance on ${users[i].bncAddress} in Binance network, expected 200 ${FOREIGN_ASSET}, got ${userBepBalance}`) - } - }) it('should generate keys', async function () { this.timeout(120000) @@ -73,7 +53,7 @@ describe('bridge tests', function () { }) after(async function () { - await bncPrefundedUser.transferBepBnb(info.foreignBridgeAddress, 1000, 5) + await bncPrefundedUser.transferBepBnb(info.foreignBridgeAddress, 1000, 50) await ethPrefundedUser.transferErc(HOME_BRIDGE_ADDRESS, 1000) }) }) From 642ea4e9a5529724a80ff65b8f1e751c082a2655 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Fri, 15 Nov 2019 10:20:12 +0300 Subject: [PATCH 106/129] Updated configs, removed init_blockchains separate step --- .circleci/config.yml | 51 ------------------------------ demo/start-ethereum-environment.sh | 12 +++---- tests/init.sh | 6 ++-- 3 files changed, 9 insertions(+), 60 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f79f9c3..b3ef664 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -21,35 +21,6 @@ orbs: - setup_remote_docker: version: 18.09.3 docker_layer_caching: true - save_ganache_data: - description: "Save dev environment in workspace" - steps: - - run: - name: "Backup blockchains data using temporary container" - command: | - mkdir -p ./workspace/ganache_side_data - mkdir -p ./workspace/ganache_home_data - docker run --rm -v "ganache_side_data:/ganache_side_data" -v "ganache_home_data:/ganache_home_data" -itd --name tmp alpine:3.9.4 - docker cp "tmp:/ganache_side_data/." "./workspace/ganache_side_data" - docker cp "tmp:/ganache_home_data/." "./workspace/ganache_home_data" - docker kill tmp - - persist_to_workspace: - root: ./workspace - paths: - - ganache_side_data - - ganache_home_data - restore_ganache_data: - description: "Restore dev environment from workspace" - steps: - - run: - name: "Restore blockchains data from backup using temporary container" - command: | - docker volume create ganache_side_data - docker volume create ganache_home_data - docker run --rm -v "ganache_side_data:/ganache_side_data" -v "ganache_home_data:/ganache_home_data" -itd --name tmp alpine:3.9.4 - docker cp "./workspace/ganache_side_data/." "tmp:/ganache_side_data" - docker cp "./workspace/ganache_home_data/." "tmp:/ganache_home_data" - docker kill tmp restore_tss_image: description: "Restores tss image from cache" steps: @@ -147,23 +118,6 @@ jobs: name: "Build tss image" command: docker build --cache-from tss -t tss ./src/tss || docker build -t tss ./src/tss - bridge/save_tss - init_blockchains: - executor: bridge/node-dev - steps: - - bridge/fetch_repo - - bridge/setup_docker - - run: - name: "Stub .keys file" - command: touch ./src/test-services/.keys.$TARGET_NETWORK - - run: - name: "Run dev environment, deploy contracts, prefund accounts" - command: | - BLOCK_TIME=3 ./demo/start-ethereum-environment.sh - cat ./tests/config.json | jq .users[].ethAddress | xargs -I {} ./src/test-services/ethereumSend/run.sh {} 1000 - - run: - name: "Stop dev environment" - command: docker kill ganache_side ganache_home - - bridge/save_ganache_data run_tests: executor: bridge/node-dev steps: @@ -172,17 +126,14 @@ jobs: - attach_workspace: at: ./workspace - bridge/load_tss - - bridge/restore_ganache_data - run: name: "Init tests environment" command: | BLOCK_TIME=3 ./demo/start-ethereum-environment.sh ./demo/start-binance-environment.sh - cat ./tests/config.json | jq .users[].bncAddress | xargs -I {} ./src/test-services/binanceSend/run.sh {} 300 0.1 N=1 ./demo/validator-demo.sh -d N=2 ./demo/validator-demo.sh -d N=3 ./demo/validator-demo.sh -d - docker ps - run: name: "Wait until validator nodes are ready" command: | @@ -214,8 +165,6 @@ workflows: main: jobs: - init_tss - - init_blockchains - run_tests: requires: - init_tss - - init_blockchains diff --git a/demo/start-ethereum-environment.sh b/demo/start-ethereum-environment.sh index 760c6f3..3396f86 100755 --- a/demo/start-ethereum-environment.sh +++ b/demo/start-ethereum-environment.sh @@ -45,13 +45,13 @@ deploy_token() { echo "Deploying" if [[ "$TARGET_NETWORK" == "development" ]]; then - TOKEN_ADDRESS=$(docker run --network blockchain_home --rm -v "$DEPLOY_DIR/deploy-test/build:/build/build" --env-file "$DEPLOY_DIR/deploy-test/.env.$TARGET_NETWORK" \ + TOKEN_ADDRESS=$(docker run --network blockchain_home --rm -v "$DEPLOY_DIR/deploy-test/build:/build/build" --env-file "$DEPLOY_DIR/deploy-test/.env.development" \ deploy_test \ --network home 2>&1 \ | grep "contract address" \ | awk '{print $4}') else - TOKEN_ADDRESS=$(docker run --rm -v "$DEPLOY_DIR/deploy-test/build:/build/build" --env-file "$DEPLOY_DIR/deploy-test/.env.$TARGET_NETWORK" --env-file "$DEPLOY_DIR/.keys.$TARGET_NETWORK" \ + TOKEN_ADDRESS=$(docker run --rm -v "$DEPLOY_DIR/deploy-test/build:/build/build" --env-file "$DEPLOY_DIR/deploy-test/.env.staging" --env-file "$DEPLOY_DIR/.keys.staging" \ deploy_test \ --network home 2>&1 \ | grep "contract address" \ @@ -67,13 +67,13 @@ deploy_bridge() { echo "Deploying" if [[ "$TARGET_NETWORK" == "development" ]]; then - BRIDGE_ADDRESS=$(docker run --network blockchain_home --rm -v "$DEPLOY_DIR/deploy-home/build:/build/build" --env-file "$DEPLOY_DIR/deploy-home/.env.$TARGET_NETWORK" \ + BRIDGE_ADDRESS=$(docker run --network blockchain_home --rm -v "$DEPLOY_DIR/deploy-home/build:/build/build" --env-file "$DEPLOY_DIR/deploy-home/.env.development" \ deploy_home \ --network home 2>&1 \ | grep "contract address" \ | awk '{print $4}') else - BRIDGE_ADDRESS=$(docker run --rm -v "$DEPLOY_DIR/deploy-home/build:/build/build" --env-file "$DEPLOY_DIR/deploy-home/.env.$TARGET_NETWORK" --env-file "$DEPLOY_DIR/.keys.$TARGET_NETWORK" \ + BRIDGE_ADDRESS=$(docker run --rm -v "$DEPLOY_DIR/deploy-home/build:/build/build" --env-file "$DEPLOY_DIR/deploy-home/.env.staging" --env-file "$DEPLOY_DIR/.keys.staging" \ deploy_home \ --network home 2>&1 \ | grep "contract address" \ @@ -89,13 +89,13 @@ deploy_db() { echo "Deploying" if [[ "$TARGET_NETWORK" == "development" ]]; then - SHARED_DB_ADDRESS=$(docker run --network blockchain_side --rm -v "$DEPLOY_DIR/deploy-side/build:/build/build" --env-file "$DEPLOY_DIR/deploy-side/.env.$TARGET_NETWORK" \ + SHARED_DB_ADDRESS=$(docker run --network blockchain_side --rm -v "$DEPLOY_DIR/deploy-side/build:/build/build" --env-file "$DEPLOY_DIR/deploy-side/.env.development" \ deploy_side \ --network side 2>&1 \ | grep "contract address" \ | awk '{print $4}') else - SHARED_DB_ADDRESS=$(docker run --rm -v "$DEPLOY_DIR/deploy-side/build:/build/build" --env-file "$DEPLOY_DIR/deploy-side/.env.$TARGET_NETWORK" --env-file "$DEPLOY_DIR/.keys.$TARGET_NETWORK" \ + SHARED_DB_ADDRESS=$(docker run --rm -v "$DEPLOY_DIR/deploy-side/build:/build/build" --env-file "$DEPLOY_DIR/deploy-side/.env.staging" --env-file "$DEPLOY_DIR/.keys.staging" \ deploy_side \ --network side 2>&1 \ | grep "contract address" \ diff --git a/tests/init.sh b/tests/init.sh index 0261b56..eea9c62 100755 --- a/tests/init.sh +++ b/tests/init.sh @@ -19,6 +19,6 @@ N=2 ./demo/validator-demo.sh -d N=3 ./demo/validator-demo.sh -d echo "Waiting until validators are ready" -until curl -X GET http://localhost:5001 > /dev/null 2>&1; do sleep 1; done -until curl -X GET http://localhost:5002 > /dev/null 2>&1; do sleep 1; done -until curl -X GET http://localhost:5003 > /dev/null 2>&1; do sleep 1; done +until curl -X GET http://localhost:5001/info > /dev/null 2>&1; do sleep 1; done +until curl -X GET http://localhost:5002/info > /dev/null 2>&1; do sleep 1; done +until curl -X GET http://localhost:5003/info > /dev/null 2>&1; do sleep 1; done From 6606fbab350a36b3becf5762b627a23fa218fd00 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Mon, 18 Nov 2019 19:54:41 +0300 Subject: [PATCH 107/129] Updated contracts to support signature collection in side chain --- src/deploy/deploy-home/contracts/Bridge.sol | 65 +++++++++++++++++-- .../deploy-side/contracts/KeyValueStorage.sol | 17 +++++ src/deploy/deploy-side/contracts/SharedDB.sol | 43 ++---------- .../contracts/SignedMessageStorage.sol | 43 ++++++++++++ .../deploy-side/contracts/SignupStorage.sol | 33 ++++++++++ 5 files changed, 157 insertions(+), 44 deletions(-) create mode 100644 src/deploy/deploy-side/contracts/KeyValueStorage.sol create mode 100644 src/deploy/deploy-side/contracts/SignedMessageStorage.sol create mode 100644 src/deploy/deploy-side/contracts/SignupStorage.sol diff --git a/src/deploy/deploy-home/contracts/Bridge.sol b/src/deploy/deploy-home/contracts/Bridge.sol index cdd3f7f..8be1986 100644 --- a/src/deploy/deploy-home/contracts/Bridge.sol +++ b/src/deploy/deploy-home/contracts/Bridge.sol @@ -54,6 +54,7 @@ contract Bridge { mapping(bytes32 => uint) public votesCount; mapping(bytes32 => bool) public votes; mapping(bytes32 => bool) public usedRange; + mapping(bytes32 => bool) public handledTx; Status public status; @@ -146,9 +147,59 @@ contract Bridge { emit ExchangeRequest(value, getNonce()); } - function transfer(bytes32 hash, address to, uint value) public readyOrClosing currentValidator { - if (tryVote(Vote.TRANSFER, hash, to, value)) { - tokenContract.transfer(to, value); + function transfer(bytes memory message, bytes memory signatures) public { + require(message.length == 116, "Incorrect message length"); + require(signatures.length % 65 == 0, "Incorrect signatures length"); + + uint msgEpoch; + bytes32 msgId; + address msgTo; + uint msgValue; + + assembly { + msgEpoch := mload(add(message, 32)) + msgId := mload(add(message, 64)) + msgTo := mload(add(message, 84)) + msgValue := mload(add(message, 116)) + } + + require(msgEpoch <= epoch, "Invalid epoch number"); + require(!handledTx[msgId], "Tx was already handled"); + handledTx[msgId] = true; + + address[] memory msgValidators = getValidatorsInEpoch(msgEpoch); + + require(signatures.length / 65 >= getThreshold(msgEpoch), "Not enough signatures"); + + bytes32 msgHash = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n116", message)); + + bytes32 r; + bytes32 s; + uint8 v; + + for (uint i = 0; i < signatures.length / 65; i++) { + uint offset = i * 65; + + assembly { + r := mload(add(add(signatures,32),offset)) + s := mload(add(add(signatures,64),offset)) + v := byte(0, mload(add(add(signatures,96),offset))) + } + + address signer = ecrecover(msgHash, v, r, s); + uint j; + for (j = 0; j < msgValidators.length; j++) { + if (msgValidators[j] == signer) { + delete msgValidators[j]; + break; + } + } + require(j != msgValidators.length); + } + if (tokenContract.balanceOf(address(this)) >= msgValue) { + tokenContract.transfer(msgTo, msgValue); + } else { + tokenContract.approve(msgTo, msgValue); } } @@ -282,11 +333,15 @@ contract Bridge { } function getValidators() view public returns (address[] memory) { - return states[epoch].validators; + return getValidatorsInEpoch(epoch); } function getNextValidators() view public returns (address[] memory) { - return states[nextEpoch].validators; + return getValidatorsInEpoch(nextEpoch); + } + + function getValidatorsInEpoch(uint _epoch) view public returns (address[] memory) { + return states[_epoch].validators; } function startVoting() public readyOrVoting currentValidator { diff --git a/src/deploy/deploy-side/contracts/KeyValueStorage.sol b/src/deploy/deploy-side/contracts/KeyValueStorage.sol new file mode 100644 index 0000000..54cff21 --- /dev/null +++ b/src/deploy/deploy-side/contracts/KeyValueStorage.sol @@ -0,0 +1,17 @@ +pragma solidity ^0.5.0; + +contract KeyValueStorage { + mapping(bytes32 => bytes) public db; + + function setData(bytes32 id, bytes32 key, bytes memory data) public { + db[encodeKey(msg.sender, id, key)] = data; + } + + function getData(address from, bytes32 id, bytes32 key) view public returns (bytes memory) { + return db[encodeKey(from, id, key)]; + } + + function encodeKey(address sender, bytes32 id, bytes32 key) private pure returns (bytes32 hash) { + return keccak256(abi.encodePacked(sender, id, key)); + } +} diff --git a/src/deploy/deploy-side/contracts/SharedDB.sol b/src/deploy/deploy-side/contracts/SharedDB.sol index 16bda1b..9bcfd5c 100644 --- a/src/deploy/deploy-side/contracts/SharedDB.sol +++ b/src/deploy/deploy-side/contracts/SharedDB.sol @@ -1,42 +1,7 @@ pragma solidity ^0.5.0; -contract SharedDB { - mapping(bytes32 => bytes) public db; - mapping(bytes32 => uint) public signupsCount; - mapping(bytes32 => uint) public dbSignups; +import "./KeyValueStorage.sol"; +import "./SignedMessageStorage.sol"; +import "./SignupStorage.sol"; - function signupSign(bytes32 hash) public { - require(dbSignups[keccak256(abi.encodePacked(msg.sender, hash))] == 0, "Already signuped"); - - dbSignups[keccak256(abi.encodePacked(msg.sender, hash))] = ++signupsCount[hash]; - } - - function getSignupNumber(bytes32 hash, address[] memory validators, address validator) view public returns (uint) { - if (dbSignups[keccak256(abi.encodePacked(validator, hash))] == 0) - return 0; - uint id = 1; - for (uint i = 0; i < validators.length; i++) { - uint vid = dbSignups[keccak256(abi.encodePacked(validators[i], hash))]; - if (vid > 0 && vid < dbSignups[keccak256(abi.encodePacked(validator, hash))]) - id++; - } - return id; - } - - function getSignupAddress(bytes32 hash, address[] memory validators, uint signupNumber) view public returns (address) { - for (uint i = 0; i < validators.length; i++) { - if (getSignupNumber(hash, validators, validators[i]) == signupNumber) { - return validators[i]; - } - } - return address(0); - } - - function setData(bytes32 hash, bytes32 key, bytes memory data) public { - db[keccak256(abi.encodePacked(msg.sender, hash, key))] = data; - } - - function getData(address from, bytes32 hash, bytes32 key) view public returns (bytes memory) { - return db[keccak256(abi.encodePacked(from, hash, key))]; - } -} +contract SharedDB is KeyValueStorage, SignedMessageStorage, SignupStorage {} diff --git a/src/deploy/deploy-side/contracts/SignedMessageStorage.sol b/src/deploy/deploy-side/contracts/SignedMessageStorage.sol new file mode 100644 index 0000000..bbbb675 --- /dev/null +++ b/src/deploy/deploy-side/contracts/SignedMessageStorage.sol @@ -0,0 +1,43 @@ +pragma solidity ^0.5.0; + +contract SignedMessageStorage { + struct SignedMessage { + bytes message; + mapping(address => bytes) signatures; + } + + mapping(bytes32 => SignedMessage) signedMessages; + + function addSignature(bytes memory message, bytes memory rsv) public { + require(message.length == 116, "Incorrect message length"); + require(rsv.length == 65, "Incorrect signature length"); + + bytes32 msgHash = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n116", message)); + + bytes32 r; + bytes32 s; + uint8 v; + + assembly { + r := mload(add(rsv, 32)) + s := mload(add(rsv, 64)) + v := byte(0, mload(add(rsv, 96))) + } + + require(ecrecover(msgHash, v, r, s) == msg.sender); + + if (signedMessages[msgHash].message.length == 0) { + signedMessages[msgHash].message = message; + } + signedMessages[msgHash].signatures[msg.sender] = rsv; + } + + function getSignatures(bytes32 msgHash, address[] memory validators) public view returns (bytes memory) { + bytes memory result; + for (uint i = 0; i < validators.length; i++) { + result = abi.encodePacked(result, signedMessages[msgHash].signatures[validators[i]]); + } + return result; + } + +} diff --git a/src/deploy/deploy-side/contracts/SignupStorage.sol b/src/deploy/deploy-side/contracts/SignupStorage.sol new file mode 100644 index 0000000..4b932f2 --- /dev/null +++ b/src/deploy/deploy-side/contracts/SignupStorage.sol @@ -0,0 +1,33 @@ +pragma solidity ^0.5.0; + +contract SignupStorage { + mapping(bytes32 => uint) public signupsCount; + mapping(bytes32 => mapping(address => uint)) public signups; + + function signup(bytes32 hash) public { + require(signups[hash][msg.sender] == 0, "Already signuped"); + + signups[hash][msg.sender] = ++signupsCount[hash]; + } + + function getSignupNumber(bytes32 hash, address[] memory validators, address validator) view public returns (uint) { + if (signups[hash][validator] == 0) + return 0; + uint id = 1; + for (uint i = 0; i < validators.length; i++) { + uint vid = signups[hash][validators[i]]; + if (vid > 0 && vid < signups[hash][validator]) + id++; + } + return id; + } + + function getSignupAddress(bytes32 hash, address[] memory validators, uint signupNumber) view public returns (address) { + for (uint i = 0; i < validators.length; i++) { + if (getSignupNumber(hash, validators, validators[i]) == signupNumber) { + return validators[i]; + } + } + return address(0); + } +} From bad32ea86136f7f51650a5fb06f2cf8c6e7799e5 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Mon, 18 Nov 2019 19:55:37 +0300 Subject: [PATCH 108/129] Updated docker configs for binance testnet --- src/binance-testnet/Dockerfile | 2 +- src/binance-testnet/api-server/Dockerfile | 6 +++--- src/binance-testnet/docker-compose.yml | 1 + src/binance-testnet/node/Dockerfile | 1 - 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/binance-testnet/Dockerfile b/src/binance-testnet/Dockerfile index 10a9e73..b4b0a92 100644 --- a/src/binance-testnet/Dockerfile +++ b/src/binance-testnet/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:19.10 as build +FROM ubuntu:19.10 ARG BNC_VERSION=0.6.2 diff --git a/src/binance-testnet/api-server/Dockerfile b/src/binance-testnet/api-server/Dockerfile index 1ea7aef..17be5fa 100644 --- a/src/binance-testnet/api-server/Dockerfile +++ b/src/binance-testnet/api-server/Dockerfile @@ -1,4 +1,4 @@ -FROM node:10.16.0-alpine +FROM alpine:3.9.4 ARG BNC_VERSION=0.6.2 @@ -6,8 +6,8 @@ WORKDIR /api-server COPY --from=testnet-binaries /binaries/cli/testnet/${BNC_VERSION}/linux/tbnbcli ./ -RUN echo 12345678 | ./tbnbcli keys add key +RUN echo 12345678 | ./tbnbcli keys add key --no-backup EXPOSE 8080 -ENTRYPOINT ["./tbnbcli", "api-server", "--chain-id", "Binance-Dev", "--node", "http://node:26657", "--laddr", "tcp://0.0.0.0:8080"] +ENTRYPOINT ["./tbnbcli", "api-server", "--chain-id", "Binance-Dev", "--laddr", "tcp://0.0.0.0:8080", "--node"] diff --git a/src/binance-testnet/docker-compose.yml b/src/binance-testnet/docker-compose.yml index ebe2cff..b2ad8f1 100644 --- a/src/binance-testnet/docker-compose.yml +++ b/src/binance-testnet/docker-compose.yml @@ -17,6 +17,7 @@ services: - binance_rpc_net ports: - '8080:8080' + command: ["http://node:26657"] http-api: build: http-api image: bnc-http-api diff --git a/src/binance-testnet/node/Dockerfile b/src/binance-testnet/node/Dockerfile index fabf1b2..0ee5779 100644 --- a/src/binance-testnet/node/Dockerfile +++ b/src/binance-testnet/node/Dockerfile @@ -1,4 +1,3 @@ -#echo 12345678 | docker exec -i 5f6f653730442d81b6e34a82ac3dc8a82f071c1eec130bc09a0dca803ad00bd2 ./tbnbcli send --to tbnb1efjg7xt98t67ql2cmwjc5860lgayet9l8m55ym --amount 100:BNB --from node0 --chain-id Binance-Dev --json FROM alpine:3.9.4 ARG BNC_VERSION=0.6.2 From 31ccce5020fea54962bf81a6fa824bbaea03c178 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Mon, 18 Nov 2019 19:56:51 +0300 Subject: [PATCH 109/129] Support of collecting signatures in side chain for oracle --- src/oracle/bncWatcher/bncWatcher.js | 5 +++-- src/oracle/proxy/contractsAbi.js | 7 +++++-- src/oracle/proxy/index.js | 23 +++++++++++++++++------ src/oracle/proxy/sendTx.js | 2 +- 4 files changed, 26 insertions(+), 11 deletions(-) diff --git a/src/oracle/bncWatcher/bncWatcher.js b/src/oracle/bncWatcher/bncWatcher.js index 2393e17..c66ba36 100644 --- a/src/oracle/bncWatcher/bncWatcher.js +++ b/src/oracle/bncWatcher/bncWatcher.js @@ -160,8 +160,9 @@ async function loop() { const publicKeyEncoded = (await getTx(tx.txHash)).signatures[0].pub_key.value await proxyHttpClient.post('/transfer', { to: computeAddress(Buffer.from(publicKeyEncoded, 'base64')), - value: new BN(tx.value).multipliedBy(10 ** 18).integerValue(), - hash: `0x${tx.txHash}` + value: new BN(tx.value).multipliedBy(10 ** 18).toString(16), + hash: tx.txHash, + epoch }) } } diff --git a/src/oracle/proxy/contractsAbi.js b/src/oracle/proxy/contractsAbi.js index 6f80832..b9b7524 100644 --- a/src/oracle/proxy/contractsAbi.js +++ b/src/oracle/proxy/contractsAbi.js @@ -14,6 +14,7 @@ const bridgeAbi = [ 'function getNextThreshold() view returns (uint)', 'function getValidators() view returns (address[])', 'function getNextValidators() view returns (address[])', + 'function getValidatorsInEpoch(uint _epoch) view returns (address[])', 'function getCloseEpoch() view returns (bool)', 'function getNextCloseEpoch() view returns (bool)', 'function status() view returns (uint)', @@ -29,14 +30,16 @@ const bridgeAbi = [ 'function voteRemoveValidator(address validator)', 'function voteChangeThreshold(uint threshold)', 'function voteChangeCloseEpoch(bool closeEpoch)', - 'function transfer(bytes32 hash, address to, uint value)' + 'function transfer(bytes message, bytes signatures)' ] const sharedDbAbi = [ 'function getSignupAddress(bytes32 hash, address[] validators, uint signupNumber) view returns (address)', 'function getData(address from, bytes32 hash, bytes32 key) view returns (bytes)', 'function getSignupNumber(bytes32 hash, address[] validators, address validator) view returns (uint)', 'function setData(bytes32 hash, bytes32 key, bytes data)', - 'function signupSign(bytes32 hash)' + 'function signup(bytes32 hash)', + 'function addSignature(bytes message, bytes rsv)', + 'function getSignatures(bytes32 msgHash, address[] validators) view returns (bytes)' ] module.exports = { diff --git a/src/oracle/proxy/index.js b/src/oracle/proxy/index.js index 77e9bee..cff78bc 100644 --- a/src/oracle/proxy/index.js +++ b/src/oracle/proxy/index.js @@ -12,7 +12,8 @@ const encode = require('./encode') const decode = require('./decode') const { createSender, waitForReceipt } = require('./sendTx') const logger = require('./logger') -const { publicKeyToAddress } = require('./crypto') +const { publicKeyToAddress, padZeros } = require('./crypto') +const { delay } = require('./wait') const { HOME_RPC_URL, HOME_BRIDGE_ADDRESS, SIDE_RPC_URL, SIDE_SHARED_DB_ADDRESS, VALIDATOR_PRIVATE_KEY, @@ -148,7 +149,7 @@ async function signupKeygen(req, res) { async function signupSign(req, res) { logger.debug('SignupSign call') const hash = ethers.utils.id(req.body.third) - const query = sharedDb.interface.functions.signupSign.encode([hash]) + const query = sharedDb.interface.functions.signup.encode([hash]) const { txHash } = await sideSendQuery(query) const receipt = await waitForReceipt(SIDE_RPC_URL, txHash) @@ -283,11 +284,21 @@ async function voteRemoveValidator(req, res) { async function transfer(req, res) { logger.info('Transfer start') - const { hash, to, value } = req.body + const { + hash, to, value, epoch + } = req.body if (ethers.utils.isHexString(to, 20)) { - logger.info(`Calling transfer to ${to}, ${value} tokens`) - const query = bridge.interface.functions.transfer.encode([hash, to, `0x${new BN(value).toString(16)}`]) - await homeSendQuery(query) + logger.info(`Calling transfer to ${to}, 0x${value} tokens`) + const message = Buffer.from(padZeros(epoch.toString(16), 64) + hash + to.slice(2) + padZeros(value, 64), 'hex') + const signature = await sideWallet.signMessage(message) + const query = sharedDb.interface.functions.addSignature.encode([`0x${message.toString('hex')}`, signature]) + await sideSendQuery(query) + await delay(5000) + const validators = await bridge.getValidatorsInEpoch(epoch) + const signatures = await sharedDb.getSignatures(ethers.utils.hashMessage(message), validators) + logger.debug(`Transfer call, message 0x${message.toString('hex')}, signatures ${signatures}`) + const query1 = bridge.interface.functions.transfer.encode([`0x${message.toString('hex')}`, signatures]) + await homeSendQuery(query1) } res.send() logger.info('Transfer end') diff --git a/src/oracle/proxy/sendTx.js b/src/oracle/proxy/sendTx.js index f00188e..f73adf3 100644 --- a/src/oracle/proxy/sendTx.js +++ b/src/oracle/proxy/sendTx.js @@ -68,7 +68,7 @@ async function createSender(url, privateKey) { return { txHash: result, - gasLimit: tx.gasLimit + gasLimit: newTx.gasLimit } } catch (e) { logger.warn('Something failed, %o', e) From cad2d3b16cdc0f10276af6c5110f9eda58588207 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Mon, 18 Nov 2019 19:57:16 +0300 Subject: [PATCH 110/129] Increased bnc => eth timeout --- tests/test/bncToEth.js | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test/bncToEth.js b/tests/test/bncToEth.js index 143b3d0..da41899 100644 --- a/tests/test/bncToEth.js +++ b/tests/test/bncToEth.js @@ -17,6 +17,7 @@ module.exports = (getUsers) => { }) it('should make correct exchange transactions on eth side', async function () { + this.timeout(120000) for (let i = 0; i < 3; i += 1) { const user = users[i] await waitPromise( From 3e86eca6f58f2b4145f7dd04cc23623d958419b4 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Thu, 21 Nov 2019 15:16:01 +0300 Subject: [PATCH 111/129] Restart bep token issue on fail --- demo/start-binance-environment.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/demo/start-binance-environment.sh b/demo/start-binance-environment.sh index 5d56c69..1b3a121 100755 --- a/demo/start-binance-environment.sh +++ b/demo/start-binance-environment.sh @@ -31,12 +31,15 @@ docker build -t testnet-binaries ../src/binance-testnet > /dev/null 2>&1 || true echo "Running environment" docker-compose -f ../src/binance-testnet/docker-compose.yml up --build -d -sleep 2 - if [[ -n "$need_to_deploy" ]]; then echo "Issuing test asset" - ISSUED_LOG=$(tbnbcli token issue --symbol DEV --total-supply 10000000000000000 --token-name "DEV Token" | jq .Response.log) - TOKEN_SYMBOL=${ISSUED_LOG:(-8):7} + TOKEN_SYMBOL='' + while [[ -z "$TOKEN_SYMBOL" ]]; do + sleep 2 + ISSUED_LOG=$(tbnbcli token issue --symbol DEV --total-supply 10000000000000000 --token-name "DEV Token" | jq .Response.log) + TOKEN_SYMBOL=${ISSUED_LOG:(-8):7} + done + echo "Issued $TOKEN_SYMBOL" sed -i 's/FOREIGN_ASSET=.*$/FOREIGN_ASSET='"$TOKEN_SYMBOL"'/' ../src/test-services/binanceBalance/.env.development From 11c396e674f6c85494781a1b2df65e4d0f15fce3 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Fri, 22 Nov 2019 13:39:30 +0300 Subject: [PATCH 112/129] Separate docker-compose for ethereum testnet and side oracle --- .circleci/config.yml | 4 +- DEMO.md | 18 +-- demo/clean.sh | 11 ++ demo/start-ethereum-environment.sh | 57 ++++------ src/ethereum-testnet/docker-compose.yml | 37 ++++++ .../side-oracle/.env.development | 9 ++ src/ethereum-testnet/side-oracle/Dockerfile | 14 +++ src/ethereum-testnet/side-oracle/index.js | 107 ++++++++++++++++++ src/ethereum-testnet/side-oracle/package.json | 10 ++ src/oracle/docker-compose-test.yml | 10 +- src/test-services/ethereumBalance/run.sh | 2 +- src/test-services/ethereumSend/run.sh | 2 +- src/test-services/sidePrefund/run.sh | 2 +- tests/run.sh | 4 +- 14 files changed, 230 insertions(+), 57 deletions(-) create mode 100644 src/ethereum-testnet/docker-compose.yml create mode 100644 src/ethereum-testnet/side-oracle/.env.development create mode 100644 src/ethereum-testnet/side-oracle/Dockerfile create mode 100644 src/ethereum-testnet/side-oracle/index.js create mode 100644 src/ethereum-testnet/side-oracle/package.json diff --git a/.circleci/config.yml b/.circleci/config.yml index b3ef664..18daaeb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -147,8 +147,8 @@ jobs: docker build -t tests ./tests docker create --env-file ./tests/.env --name tests tests docker network connect binance_net tests - docker network connect blockchain_side tests - docker network connect blockchain_home tests + docker network connect ethereum_side_rpc_net tests + docker network connect ethereum_home_rpc_net tests docker network connect validator1_test_network tests docker network connect validator2_test_network tests docker network connect validator3_test_network tests diff --git a/DEMO.md b/DEMO.md index 9dde9b6..2d5a5f4 100644 --- a/DEMO.md +++ b/DEMO.md @@ -331,21 +331,13 @@ Make sure, to first run demo in development mode, before trying to run it in the docker kill binance-testnet_http-api_1 docker kill binance-testnet_node_1 docker kill binance-testnet_api-server_1 - docker kill ganache_home - docker kill ganache_side + docker kill ethereum-testnet_ganache_home_1 + docker kill ethereum-testnet_ganache_side_1 + docker kill ethereum-testnet_side_oracle_1 ``` -3. Remove virtual networks: +3. Remove testnets and validators data: ``` - docker network rm binance_net - docker network rm blockchain_home - docker network rm blockchain_side - docker network rm validator1_test_network - docker network rm validator2_test_network - docker network rm validator3_test_network - ``` -4. Remove testnets and validators data: - ``` - TARGET_NETWORK= ./demo/clean.sh + TARGET_NETWORK=development ./demo/clean.sh ``` #### Testing tools for both sides of the bridge diff --git a/demo/clean.sh b/demo/clean.sh index 0b5586d..bf59570 100755 --- a/demo/clean.sh +++ b/demo/clean.sh @@ -15,14 +15,25 @@ docker kill ganache_home ganache_side > /dev/null 2>&1 || true docker rm ganache_home ganache_side > /dev/null 2>&1 || true docker kill $(docker ps | grep binance-testnet_ | awk '{print $1}') > /dev/null 2>&1 || true docker rm $(docker ps -a | grep binance-testnet_ | awk '{print $1}') > /dev/null 2>&1 || true +docker kill $(docker ps | grep ethereum-testnet_ | awk '{print $1}') > /dev/null 2>&1 || true +docker rm $(docker ps -a | grep ethereum-testnet_ | awk '{print $1}') > /dev/null 2>&1 || true if [[ "$TARGET_NETWORK" == "development" ]]; then docker volume rm ganache_side_data > /dev/null 2>&1 || true docker volume rm ganache_home_data > /dev/null 2>&1 || true docker volume rm binance_data > /dev/null 2>&1 || true docker volume rm binance_marketdata > /dev/null 2>&1 || true + + docker network rm ethereum_side_rpc_net > /dev/null 2>&1 || true + docker network rm ethereum_home_rpc_net > /dev/null 2>&1 || true + docker network rm binance_net > /dev/null 2>&1 || true + docker network rm binance-testnet_binance_rpc_net > /dev/null 2>&1 || true fi +docker network rm validator1_test_network > /dev/null 2>&1 || true +docker network rm validator2_test_network > /dev/null 2>&1 || true +docker network rm validator3_test_network > /dev/null 2>&1 || true + for (( I = 1; I < 4; ++I )); do DIRNAME="validator$I" rm -rf "$DIRNAME/$TARGET_NETWORK" diff --git a/demo/start-ethereum-environment.sh b/demo/start-ethereum-environment.sh index 3396f86..19a3800 100755 --- a/demo/start-ethereum-environment.sh +++ b/demo/start-ethereum-environment.sh @@ -13,29 +13,8 @@ DEPLOY_DIR="`pwd`/src/deploy" TEST_SERVICES_DIR="`pwd`/src/test-services" DEMO_DIR="`pwd`/demo" -start_dev_blockchain_networks() { - echo "Starting side test blockchain" - - docker kill ganache_side > /dev/null 2>&1 || true - docker network create blockchain_side > /dev/null 2>&1 || true - docker volume create ganache_side_data > /dev/null 2>&1 || true - docker run -d --network blockchain_side --rm --name ganache_side -v "ganache_side_data:/app/db" \ - -p "7545:8545" \ - trufflesuite/ganache-cli:latest \ - -m "shrug dwarf easily blade trigger lucky reopen cage lake scatter desk boat" -i 33 --db /app/db -b "$BLOCK_TIME" --noVMErrorsOnRPCResponse - - echo "Starting home test blockchain" - - docker kill ganache_home > /dev/null 2>&1 || true - docker network create blockchain_home > /dev/null 2>&1 || true - docker volume create ganache_home_data > /dev/null 2>&1 || true - docker run -d --network blockchain_home --rm --name ganache_home -v "ganache_home_data:/app/db" \ - -p "8545:8545" \ - trufflesuite/ganache-cli:latest \ - -m "shrug dwarf easily blade trigger lucky reopen cage lake scatter desk boat" -i 44 --db /app/db -b "$BLOCK_TIME" --noVMErrorsOnRPCResponse - - sleep 4 -} +HOME_NETWORK="ethereum_home_rpc_net" +SIDE_NETWORK="ethereum_side_rpc_net" deploy_token() { echo "Compiling and deploying erc20" @@ -45,7 +24,7 @@ deploy_token() { echo "Deploying" if [[ "$TARGET_NETWORK" == "development" ]]; then - TOKEN_ADDRESS=$(docker run --network blockchain_home --rm -v "$DEPLOY_DIR/deploy-test/build:/build/build" --env-file "$DEPLOY_DIR/deploy-test/.env.development" \ + TOKEN_ADDRESS=$(docker run --network "$HOME_NETWORK" --rm -v "$DEPLOY_DIR/deploy-test/build:/build/build" --env-file "$DEPLOY_DIR/deploy-test/.env.development" \ deploy_test \ --network home 2>&1 \ | grep "contract address" \ @@ -67,7 +46,7 @@ deploy_bridge() { echo "Deploying" if [[ "$TARGET_NETWORK" == "development" ]]; then - BRIDGE_ADDRESS=$(docker run --network blockchain_home --rm -v "$DEPLOY_DIR/deploy-home/build:/build/build" --env-file "$DEPLOY_DIR/deploy-home/.env.development" \ + BRIDGE_ADDRESS=$(docker run --network "$HOME_NETWORK" --rm -v "$DEPLOY_DIR/deploy-home/build:/build/build" --env-file "$DEPLOY_DIR/deploy-home/.env.development" \ deploy_home \ --network home 2>&1 \ | grep "contract address" \ @@ -89,7 +68,7 @@ deploy_db() { echo "Deploying" if [[ "$TARGET_NETWORK" == "development" ]]; then - SHARED_DB_ADDRESS=$(docker run --network blockchain_side --rm -v "$DEPLOY_DIR/deploy-side/build:/build/build" --env-file "$DEPLOY_DIR/deploy-side/.env.development" \ + SHARED_DB_ADDRESS=$(docker run --network "$SIDE_NETWORK" --rm -v "$DEPLOY_DIR/deploy-side/build:/build/build" --env-file "$DEPLOY_DIR/deploy-side/.env.development" \ deploy_side \ --network side 2>&1 \ | grep "contract address" \ @@ -131,25 +110,39 @@ deploy_all() { sed -i 's/HOME_TOKEN_ADDRESS=.*$/HOME_TOKEN_ADDRESS='"$TOKEN_ADDRESS"'/' "$TEST_SERVICES_DIR/ethereumSend/.env.$TARGET_NETWORK" } - - - if [[ "$TARGET_NETWORK" == "development" ]]; then if [[ "$(docker volume ls | grep ganache_side_data)" ]] || [[ "$(docker volume ls | grep ganache_home_data)" ]]; then - echo "Restarting dev blockchain networks" + echo "Restarting ethereum test network" else - echo "Starting dev blockchain networks and deploying contracts" + echo "Creating new ethereum test network" + + echo "Removing old environment" + docker kill $(docker ps -a | grep ethereum-testnet_ | awk '{print $1}') > /dev/null 2>&1 || true + docker rm $(docker ps -a | grep ethereum-testnet_ | awk '{print $1}') > /dev/null 2>&1 || true + docker volume rm ganache_side_data > /dev/null 2>&1 || true + docker volume rm ganache_home_data > /dev/null 2>&1 || true + + docker network create ethereum_side_rpc_net > /dev/null 2>&1 || true + docker network create ethereum_home_rpc_net > /dev/null 2>&1 || true + docker volume create ganache_side_data > /dev/null 2>&1 || true + docker volume create ganache_home_data > /dev/null 2>&1 || true + need_to_deploy=true fi - start_dev_blockchain_networks + echo "Starting ethereum test environment" + + BLOCK_TIME="$BLOCK_TIME" docker-compose -f ./src/ethereum-testnet/docker-compose.yml up --build -d + + sleep 4 if [[ -n "$need_to_deploy" ]]; then deploy_all else echo "Contracts are already deployed, run clean.sh first if you want to redeploy everything" fi + else echo "Deploying to the staging blockchain environment" diff --git a/src/ethereum-testnet/docker-compose.yml b/src/ethereum-testnet/docker-compose.yml new file mode 100644 index 0000000..4003362 --- /dev/null +++ b/src/ethereum-testnet/docker-compose.yml @@ -0,0 +1,37 @@ +version: '3.0' +services: + ganache_side: + image: trufflesuite/ganache-cli:latest + command: ["-m", "shrug dwarf easily blade trigger lucky reopen cage lake scatter desk boat", "-i", "33", "--db", "/app/db", "-b", "${BLOCK_TIME}", "--noVMErrorsOnRPCResponse"] + networks: + - ethereum_side_rpc_net + ports: + - '7545:8545' + volumes: + - 'ganache_side_data:/app/db' + ganache_home: + image: trufflesuite/ganache-cli:latest + command: ["-m", "shrug dwarf easily blade trigger lucky reopen cage lake scatter desk boat", "-i", "44", "--db", "/app/db", "-b", "${BLOCK_TIME}", "--noVMErrorsOnRPCResponse"] + networks: + - ethereum_home_rpc_net + ports: + - '8545:8545' + volumes: + - 'ganache_home_data:/app/db' + side_oracle: + build: side-oracle + image: side-oracle + env_file: side-oracle/.env.development + networks: + - ethereum_side_rpc_net + - ethereum_home_rpc_net +networks: + ethereum_side_rpc_net: + external: true + ethereum_home_rpc_net: + external: true +volumes: + ganache_side_data: + external: true + ganache_home_data: + external: true diff --git a/src/ethereum-testnet/side-oracle/.env.development b/src/ethereum-testnet/side-oracle/.env.development new file mode 100644 index 0000000..08ced61 --- /dev/null +++ b/src/ethereum-testnet/side-oracle/.env.development @@ -0,0 +1,9 @@ +HOME_RPC_URL=http://ganache_home:8545 +HOME_BRIDGE_ADDRESS=0x44c158FE850821ae69DaF37AADF5c539e9d0025B + +HOME_PRIVATE_KEY=e2aeb24eaa63102d0c0821717c3b6384abdabd7af2ad4ec8e650dce300798b27 + +SIDE_RPC_URL=http://ganache_side:8545 +SIDE_SHARED_DB_ADDRESS=0xd5fE0D28e058D375b0b038fFbB446Da37E85fFdc +SIDE_MAX_FETCH_RANGE_SIZE=100 + diff --git a/src/ethereum-testnet/side-oracle/Dockerfile b/src/ethereum-testnet/side-oracle/Dockerfile new file mode 100644 index 0000000..ad6c12d --- /dev/null +++ b/src/ethereum-testnet/side-oracle/Dockerfile @@ -0,0 +1,14 @@ +FROM node:10.16.0-alpine + +WORKDIR /side-oracle + +RUN apk update && \ + apk add libssl1.1 libressl-dev curl + +COPY ./package.json /side-oracle/ + +RUN npm install + +COPY ./index.js ./ + +ENTRYPOINT ["node", "index.js"] diff --git a/src/ethereum-testnet/side-oracle/index.js b/src/ethereum-testnet/side-oracle/index.js new file mode 100644 index 0000000..f567bb7 --- /dev/null +++ b/src/ethereum-testnet/side-oracle/index.js @@ -0,0 +1,107 @@ +const ethers = require('ethers') + +const { + HOME_PRIVATE_KEY, HOME_RPC_URL, HOME_BRIDGE_ADDRESS, SIDE_RPC_URL, SIDE_SHARED_DB_ADDRESS +} = process.env +const SIDE_MAX_FETCH_RANGE_SIZE = parseInt(process.env.SIDE_MAX_FETCH_RANGE_SIZE, 10) + +const bridgeAbi = [ + 'function applyMessage(bytes message, bytes signatures)', + 'function getThreshold(uint epoch) view returns (uint)', + 'function getValidatorsInEpoch(uint epoch) view returns (address[])' +] +const sharedDbAbi = [ + 'event NewMessage(bytes32 msgHash)', + 'function getSignatures(bytes32 msgHash, address[] validators) view returns (bytes)' +] + +let homeProvider +let sideProvider +let bridge +let sharedDb +let homeWallet +let nonce +let blockNumber = 0 + +async function delay(ms) { + await new Promise((res) => setTimeout(res, ms)) +} + +async function handleNewMessage(event) { + const { msgHash } = event.values + const message = (await sharedDb.signedMessages(msgHash))[0] + const epoch = parseInt(message.slice(30, 3).toString('hex'), 16) + const [threshold, validators] = await Promise.all([ + bridge.getThreshold(epoch), + bridge.getValidatorsInEpoch(epoch) + ]) + + while (true) { + const signatures = await sharedDb.getSignatures(msgHash, validators) + if (signatures.length / 65 >= threshold) { + const tx = await bridge.applyMessage(message, signatures, { + gasLimit: 1000000, + nonce + }) + await tx.wait() + nonce += 1 + break + } + } +} + +async function initialize() { + await delay(5000) + sideProvider = new ethers.providers.JsonRpcProvider(SIDE_RPC_URL) + homeProvider = new ethers.providers.JsonRpcProvider(HOME_RPC_URL) + bridge = new ethers.Contract(HOME_BRIDGE_ADDRESS, bridgeAbi, homeProvider) + sharedDb = new ethers.Contract(SIDE_SHARED_DB_ADDRESS, sharedDbAbi, sideProvider) + + homeWallet = new ethers.Wallet(HOME_PRIVATE_KEY, homeProvider) + + nonce = await homeWallet.getTransactionCount() +} + +async function loop() { + const latestBlockNumber = await sideProvider.getBlockNumber() + if (latestBlockNumber < blockNumber) { + console.log(`No block after ${latestBlockNumber}`) + return + } + + const endBlock = Math.min(latestBlockNumber, blockNumber + SIDE_MAX_FETCH_RANGE_SIZE - 1) + + console.log(`Watching events in blocks #${blockNumber}-${endBlock}`) + + const bridgeEvents = (await sideProvider.getLogs({ + address: SIDE_SHARED_DB_ADDRESS, + fromBlock: blockNumber, + toBlock: endBlock, + topics: [] + })) + + for (let i = 0; i < bridgeEvents.length; i += 1) { + const event = bridge.interface.parseLog(bridgeEvents[i]) + console.log('Consumed event', event, bridgeEvents[i]) + switch (event.name) { + case 'NewMessage': + await handleNewMessage(event) + break + default: + console.log('Unknown event %o', event) + } + } + + blockNumber = endBlock + 1 +} + +async function main() { + await initialize() + + while (true) { + await delay(2000) + await loop() + } +} + +main() diff --git a/src/ethereum-testnet/side-oracle/package.json b/src/ethereum-testnet/side-oracle/package.json new file mode 100644 index 0000000..f09b986 --- /dev/null +++ b/src/ethereum-testnet/side-oracle/package.json @@ -0,0 +1,10 @@ +{ + "name": "side-oracle", + "version": "0.0.1", + "dependencies": { + "ethers": "4.0.33" + }, + "engines": { + "node": ">=10.6.0" + } +} diff --git a/src/oracle/docker-compose-test.yml b/src/oracle/docker-compose-test.yml index 939f22f..4dbadd6 100644 --- a/src/oracle/docker-compose-test.yml +++ b/src/oracle/docker-compose-test.yml @@ -23,8 +23,8 @@ services: test_network: aliases: - local_proxy - blockchain_home: - blockchain_side: + ethereum_home_rpc_net: + ethereum_side_rpc_net: binance_net: keygen: image: keygen-client @@ -96,7 +96,7 @@ services: - LOG_LEVEL networks: - test_network - - blockchain_home + - ethereum_home_rpc_net bnc-watcher: build: dockerfile: bncWatcher/Dockerfile @@ -118,9 +118,9 @@ services: - binance_net networks: test_network: - blockchain_side: + ethereum_side_rpc_net: external: true - blockchain_home: + ethereum_home_rpc_net: external: true binance_net: external: true diff --git a/src/test-services/ethereumBalance/run.sh b/src/test-services/ethereumBalance/run.sh index 9dbef3f..58dc621 100755 --- a/src/test-services/ethereumBalance/run.sh +++ b/src/test-services/ethereumBalance/run.sh @@ -10,7 +10,7 @@ TARGET_NETWORK=${TARGET_NETWORK:=development} docker build -t ethereum-balance . > /dev/null if [[ "$TARGET_NETWORK" == "development" ]]; then - docker run --network blockchain_home --rm --env-file ".env.$TARGET_NETWORK" ethereum-balance $@ + docker run --network ethereum_home_rpc_net --rm --env-file ".env.$TARGET_NETWORK" ethereum-balance $@ else docker run --rm --env-file ".env.$TARGET_NETWORK" ethereum-balance $@ fi diff --git a/src/test-services/ethereumSend/run.sh b/src/test-services/ethereumSend/run.sh index 3808257..8980f27 100755 --- a/src/test-services/ethereumSend/run.sh +++ b/src/test-services/ethereumSend/run.sh @@ -10,7 +10,7 @@ TARGET_NETWORK=${TARGET_NETWORK:=development} docker build -t ethereum-send . > /dev/null if [[ "$TARGET_NETWORK" == "development" ]]; then - docker run --network blockchain_home --rm --env-file ".env.$TARGET_NETWORK" -e "PRIVATE_KEY=$PRIVATE_KEY" ethereum-send $@ + docker run --network ethereum_home_rpc_net --rm --env-file ".env.$TARGET_NETWORK" -e "PRIVATE_KEY=$PRIVATE_KEY" ethereum-send $@ else docker run --rm --env-file ".env.$TARGET_NETWORK" --env-file "../.keys.$TARGET_NETWORK" -e "PRIVATE_KEY=$PRIVATE_KEY" ethereum-send $@ fi diff --git a/src/test-services/sidePrefund/run.sh b/src/test-services/sidePrefund/run.sh index 3955564..c63a220 100755 --- a/src/test-services/sidePrefund/run.sh +++ b/src/test-services/sidePrefund/run.sh @@ -12,7 +12,7 @@ echo "Using $TARGET_NETWORK network" docker build -t side-prefund . > /dev/null if [[ "$TARGET_NETWORK" == "development" ]]; then - docker run --network blockchain_side --rm --env-file ".env.$TARGET_NETWORK" side-prefund $@ + docker run --network ethereum_side_rpc_net --rm --env-file ".env.$TARGET_NETWORK" side-prefund $@ else docker run --rm --env-file ".env.$TARGET_NETWORK" --env-file "../.keys.$TARGET_NETWORK" side-prefund $@ fi diff --git a/tests/run.sh b/tests/run.sh index c0ca1b2..35799b7 100755 --- a/tests/run.sh +++ b/tests/run.sh @@ -11,8 +11,8 @@ docker create --name tests --env-file ./tests/.env tests $@ echo "Connecting tests container to test networks" docker network connect binance_net tests -docker network connect blockchain_home tests -docker network connect blockchain_side tests +docker network connect ethereum_home_rpc_net tests +docker network connect ethereum_side_rpc_net tests docker network connect validator1_test_network tests docker network connect validator2_test_network tests docker network connect validator3_test_network tests From ebf5e61821ed31e435fe5035020cc9b2f45c7764 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Sun, 24 Nov 2019 18:18:47 +0300 Subject: [PATCH 113/129] Updated contracts to suuport managment of signatures in side chain --- src/deploy/deploy-home/.solhint.json | 3 + .../deploy-home/contracts/BasicBridge.sol | 189 +++++++ src/deploy/deploy-home/contracts/Bridge.sol | 468 +----------------- .../deploy-home/contracts/Government.sol | 126 +++++ .../deploy-home/contracts/MessageDecoder.sol | 39 ++ .../deploy-home/contracts/MessageHandler.sol | 135 +++++ src/deploy/deploy-side/.solhint.json | 3 + .../contracts/SignedMessageStorage.sol | 39 +- .../deploy-side/contracts/SignupStorage.sol | 12 +- 9 files changed, 556 insertions(+), 458 deletions(-) create mode 100644 src/deploy/deploy-home/.solhint.json create mode 100644 src/deploy/deploy-home/contracts/BasicBridge.sol create mode 100644 src/deploy/deploy-home/contracts/Government.sol create mode 100644 src/deploy/deploy-home/contracts/MessageDecoder.sol create mode 100644 src/deploy/deploy-home/contracts/MessageHandler.sol create mode 100644 src/deploy/deploy-side/.solhint.json diff --git a/src/deploy/deploy-home/.solhint.json b/src/deploy/deploy-home/.solhint.json new file mode 100644 index 0000000..d7c3de9 --- /dev/null +++ b/src/deploy/deploy-home/.solhint.json @@ -0,0 +1,3 @@ +{ + "extends": "solhint:default" +} diff --git a/src/deploy/deploy-home/contracts/BasicBridge.sol b/src/deploy/deploy-home/contracts/BasicBridge.sol new file mode 100644 index 0000000..fa8bcf8 --- /dev/null +++ b/src/deploy/deploy-home/contracts/BasicBridge.sol @@ -0,0 +1,189 @@ +pragma solidity ^0.5.0; + +import './openzeppelin-solidity/contracts/token/ERC20/IERC20.sol'; + +contract BasicBridge { + uint constant UPPER_BOUND = uint(-1); + + event EpochEnd(uint indexed epoch); + event EpochClose(uint indexed epoch); + event ForceSign(); + event NewEpoch(uint indexed oldEpoch, uint indexed newEpoch); + event NewEpochCancelled(uint indexed epoch); + event NewFundsTransfer(uint indexed oldEpoch, uint indexed newEpoch); + event EpochStart(uint indexed epoch, uint x, uint y); + + struct State { + address[] validators; + uint threshold; + uint rangeSize; + uint startBlock; + uint endBlock; + uint nonce; + uint x; + uint y; + bool closeEpoch; + } + + enum Status { + READY, // bridge is in ready to perform operations + CLOSING_EPOCH, // generating transaction for blocking binance side of the bridge + VOTING, // voting for changing in next epoch, but still ready + KEYGEN, //keygen, can be cancelled + FUNDS_TRANSFER // funds transfer, cannot be cancelled + } + + mapping(uint => State) states; + + Status public status; + + uint public epoch; + uint public nextEpoch; + + uint minTxLimit; + uint maxTxLimit; + + IERC20 public tokenContract; + + modifier ready { + require(status == Status.READY, "Not in ready state"); + _; + } + + modifier closingEpoch { + require(status == Status.CLOSING_EPOCH, "Not in closing epoch state"); + _; + } + + modifier readyOrClosing { + require(status == Status.READY || status == Status.CLOSING_EPOCH, "Not in ready or closing epoch state"); + _; + } + + modifier voting { + require(status == Status.VOTING, "Not in voting state"); + _; + } + + modifier readyOrVoting { + require(status == Status.READY || status == Status.VOTING, "Not in ready or voting state"); + _; + } + + modifier keygen { + require(status == Status.KEYGEN, "Not in keygen state"); + _; + } + + modifier fundsTransfer { + require(status == Status.FUNDS_TRANSFER, "Not in funds transfer state"); + _; + } + + modifier currentValidator { + require(getPartyId() != 0, "Not a current validator"); + _; + } + + function getParties() view public returns (uint) { + return getParties(epoch); + } + + function getNextParties() view public returns (uint) { + return getParties(nextEpoch); + } + + function getParties(uint _epoch) view public returns (uint) { + return states[_epoch].validators.length; + } + + function getThreshold() view public returns (uint) { + return getThreshold(epoch); + } + + function getNextThreshold() view public returns (uint) { + return getThreshold(nextEpoch); + } + + function getThreshold(uint _epoch) view public returns (uint) { + return states[_epoch].threshold; + } + + function getStartBlock() view public returns (uint) { + return getStartBlock(epoch); + } + + function getStartBlock(uint _epoch) view public returns (uint) { + return states[_epoch].startBlock; + } + + function getRangeSize() view public returns (uint) { + return getRangeSize(epoch); + } + + function getNextRangeSize() view public returns (uint) { + return getRangeSize(nextEpoch); + } + + function getRangeSize(uint _epoch) view public returns (uint) { + return states[_epoch].rangeSize; + } + + function getNonce() view public returns (uint) { + return getNonce(epoch); + } + + function getNonce(uint _epoch) view public returns (uint) { + return states[_epoch].nonce; + } + + function getX() view public returns (uint) { + return states[epoch].x; + } + + function getY() view public returns (uint) { + return states[epoch].y; + } + + function getCloseEpoch() view public returns (bool) { + return getCloseEpoch(epoch); + } + + function getNextCloseEpoch() view public returns (bool) { + return getCloseEpoch(nextEpoch); + } + + function getCloseEpoch(uint _epoch) view public returns (bool) { + return states[_epoch].closeEpoch; + } + + function getPartyId() view public returns (uint) { + address[] memory validators = getValidators(); + for (uint i = 0; i < getParties(); i++) { + if (validators[i] == msg.sender) + return i + 1; + } + return 0; + } + + function getNextPartyId(address a) view public returns (uint) { + address[] memory validators = getNextValidators(); + for (uint i = 0; i < getNextParties(); i++) { + if (validators[i] == a) + return i + 1; + } + return 0; + } + + function getValidators() view public returns (address[] memory) { + return getValidators(epoch); + } + + function getNextValidators() view public returns (address[] memory) { + return getValidators(nextEpoch); + } + + function getValidators(uint _epoch) view public returns (address[] memory) { + return states[_epoch].validators; + } +} diff --git a/src/deploy/deploy-home/contracts/Bridge.sol b/src/deploy/deploy-home/contracts/Bridge.sol index 8be1986..3b202b3 100644 --- a/src/deploy/deploy-home/contracts/Bridge.sol +++ b/src/deploy/deploy-home/contracts/Bridge.sol @@ -1,70 +1,21 @@ pragma solidity ^0.5.0; import './openzeppelin-solidity/contracts/token/ERC20/IERC20.sol'; +import "./MessageHandler.sol"; -contract Bridge { +contract Bridge is MessageHandler { event ExchangeRequest(uint value, uint nonce); - event EpochEnd(uint indexed epoch); - event EpochClose(uint indexed epoch); - event ForceSign(); - event NewEpoch(uint indexed oldEpoch, uint indexed newEpoch); - event NewEpochCancelled(uint indexed epoch); - event NewFundsTransfer(uint indexed oldEpoch, uint indexed newEpoch); - event EpochStart(uint indexed epoch, uint x, uint y); - struct State { - address[] validators; - uint threshold; - uint rangeSize; - uint startBlock; - uint endBlock; - uint nonce; - uint x; - uint y; - bool closeEpoch; - } + mapping(bytes32 => bool) usedExchangeRanges; - enum Status { - READY, // bridge is in ready to perform operations - CLOSING_EPOCH, // generating transaction for blocking binance side of the bridge - VOTING, // voting for changing in next epoch, but still ready - KEYGEN, //keygen, can be cancelled - FUNDS_TRANSFER // funds transfer, cannot be cancelled - } - - enum Vote { - CONFIRM_KEYGEN, - CONFIRM_FUNDS_TRANSFER, - CONFIRM_CLOSE_EPOCH, - START_VOTING, - ADD_VALIDATOR, - REMOVE_VALIDATOR, - CHANGE_THRESHOLD, - CHANGE_RANGE_SIZE, - CHANGE_CLOSE_EPOCH, - START_KEYGEN, - CANCEL_KEYGEN, - TRANSFER - } - - mapping(uint => State) states; - - mapping(bytes32 => uint) public dbTransferCount; - mapping(bytes32 => bool) public dbTransfer; - mapping(bytes32 => uint) public votesCount; - mapping(bytes32 => bool) public votes; - mapping(bytes32 => bool) public usedRange; - mapping(bytes32 => bool) public handledTx; - - Status public status; - - uint public epoch; - uint public nextEpoch; - - uint minTxLimit; - uint maxTxLimit; - - constructor(uint threshold, address[] memory validators, address _tokenContract, uint[2] memory limits, uint rangeSize, bool closeEpoch) public { + constructor( + uint threshold, + address[] memory validators, + address _tokenContract, + uint[2] memory limits, + uint rangeSize, + bool closeEpoch + ) public { require(validators.length > 0); require(threshold <= validators.length); @@ -79,12 +30,12 @@ contract Bridge { threshold : threshold, rangeSize : rangeSize, startBlock : 0, - endBlock : uint(- 1), - nonce : uint(- 1), + endBlock : UPPER_BOUND, + nonce : UPPER_BOUND, x : 0, y : 0, closeEpoch : closeEpoch - }); + }); minTxLimit = limits[0]; maxTxLimit = limits[1]; @@ -92,403 +43,16 @@ contract Bridge { emit NewEpoch(0, 1); } - IERC20 public tokenContract; - - modifier ready { - require(status == Status.READY, "Not in ready state"); - _; - } - - modifier closingEpoch { - require(status == Status.CLOSING_EPOCH, "Not in closing epoch state"); - _; - } - - modifier readyOrClosing { - require(status == Status.READY || status == Status.CLOSING_EPOCH, "Not in ready or closing epoch state"); - _; - } - - modifier voting { - require(status == Status.VOTING, "Not in voting state"); - _; - } - - modifier readyOrVoting { - require(status == Status.READY || status == Status.VOTING, "Not in ready or voting state"); - _; - } - - modifier keygen { - require(status == Status.KEYGEN, "Not in keygen state"); - _; - } - - modifier fundsTransfer { - require(status == Status.FUNDS_TRANSFER, "Not in funds transfer state"); - _; - } - - modifier currentValidator { - require(getPartyId() != 0, "Not a current validator"); - _; - } - function exchange(uint value) public ready { require(value >= minTxLimit && value >= 10 ** 10 && value <= maxTxLimit); uint txRange = (block.number - getStartBlock()) / getRangeSize(); - if (!usedRange[keccak256(abi.encodePacked(txRange, epoch))]) { - usedRange[keccak256(abi.encodePacked(txRange, epoch))] = true; + if (!usedExchangeRanges[keccak256(abi.encodePacked(txRange, epoch))]) { + usedExchangeRanges[keccak256(abi.encodePacked(txRange, epoch))] = true; states[epoch].nonce++; } tokenContract.transferFrom(msg.sender, address(this), value); emit ExchangeRequest(value, getNonce()); } - - function transfer(bytes memory message, bytes memory signatures) public { - require(message.length == 116, "Incorrect message length"); - require(signatures.length % 65 == 0, "Incorrect signatures length"); - - uint msgEpoch; - bytes32 msgId; - address msgTo; - uint msgValue; - - assembly { - msgEpoch := mload(add(message, 32)) - msgId := mload(add(message, 64)) - msgTo := mload(add(message, 84)) - msgValue := mload(add(message, 116)) - } - - require(msgEpoch <= epoch, "Invalid epoch number"); - require(!handledTx[msgId], "Tx was already handled"); - handledTx[msgId] = true; - - address[] memory msgValidators = getValidatorsInEpoch(msgEpoch); - - require(signatures.length / 65 >= getThreshold(msgEpoch), "Not enough signatures"); - - bytes32 msgHash = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n116", message)); - - bytes32 r; - bytes32 s; - uint8 v; - - for (uint i = 0; i < signatures.length / 65; i++) { - uint offset = i * 65; - - assembly { - r := mload(add(add(signatures,32),offset)) - s := mload(add(add(signatures,64),offset)) - v := byte(0, mload(add(add(signatures,96),offset))) - } - - address signer = ecrecover(msgHash, v, r, s); - uint j; - for (j = 0; j < msgValidators.length; j++) { - if (msgValidators[j] == signer) { - delete msgValidators[j]; - break; - } - } - require(j != msgValidators.length); - } - if (tokenContract.balanceOf(address(this)) >= msgValue) { - tokenContract.transfer(msgTo, msgValue); - } else { - tokenContract.approve(msgTo, msgValue); - } - } - - function confirmKeygen(uint x, uint y) public keygen { - require(getNextPartyId(msg.sender) != 0, "Not a next validator"); - - if (tryConfirm(Vote.CONFIRM_KEYGEN, x, y)) { - states[nextEpoch].x = x; - states[nextEpoch].y = y; - if (nextEpoch == 1) { - status = Status.READY; - states[nextEpoch].startBlock = block.number; - states[nextEpoch].nonce = uint(- 1); - epoch = nextEpoch; - emit EpochStart(epoch, x, y); - } - else { - status = Status.FUNDS_TRANSFER; - emit NewFundsTransfer(epoch, nextEpoch); - } - } - } - - function confirmFundsTransfer() public fundsTransfer currentValidator { - require(epoch > 0, "First epoch does not need funds transfer"); - - if (tryConfirm(Vote.CONFIRM_FUNDS_TRANSFER)) { - status = Status.READY; - states[nextEpoch].startBlock = block.number; - states[nextEpoch].nonce = uint(- 1); - epoch = nextEpoch; - emit EpochStart(epoch, getX(), getY()); - } - } - - function confirmCloseEpoch() public closingEpoch currentValidator { - if (tryConfirm(Vote.CONFIRM_CLOSE_EPOCH)) { - status = Status.VOTING; - emit EpochEnd(epoch); - } - } - - function getParties() view public returns (uint) { - return getParties(epoch); - } - - function getNextParties() view public returns (uint) { - return getParties(nextEpoch); - } - - function getParties(uint _epoch) view public returns (uint) { - return states[_epoch].validators.length; - } - - function getThreshold() view public returns (uint) { - return getThreshold(epoch); - } - - function getNextThreshold() view public returns (uint) { - return getThreshold(nextEpoch); - } - - function getThreshold(uint _epoch) view public returns (uint) { - return states[_epoch].threshold; - } - - function getStartBlock() view public returns (uint) { - return getStartBlock(epoch); - } - - function getStartBlock(uint _epoch) view public returns (uint) { - return states[_epoch].startBlock; - } - - function getRangeSize() view public returns (uint) { - return getRangeSize(epoch); - } - - function getNextRangeSize() view public returns (uint) { - return getRangeSize(nextEpoch); - } - - function getRangeSize(uint _epoch) view public returns (uint) { - return states[_epoch].rangeSize; - } - - function getNonce() view public returns (uint) { - return getNonce(epoch); - } - - function getNonce(uint _epoch) view public returns (uint) { - return states[_epoch].nonce; - } - - function getX() view public returns (uint) { - return states[epoch].x; - } - - function getY() view public returns (uint) { - return states[epoch].y; - } - - function getCloseEpoch() view public returns (bool) { - return getCloseEpoch(epoch); - } - - function getNextCloseEpoch() view public returns (bool) { - return getCloseEpoch(nextEpoch); - } - - function getCloseEpoch(uint _epoch) view public returns (bool) { - return states[_epoch].closeEpoch; - } - - function getPartyId() view public returns (uint) { - address[] memory validators = getValidators(); - for (uint i = 0; i < getParties(); i++) { - if (validators[i] == msg.sender) - return i + 1; - } - return 0; - } - - function getNextPartyId(address a) view public returns (uint) { - address[] memory validators = getNextValidators(); - for (uint i = 0; i < getNextParties(); i++) { - if (validators[i] == a) - return i + 1; - } - return 0; - } - - function getValidators() view public returns (address[] memory) { - return getValidatorsInEpoch(epoch); - } - - function getNextValidators() view public returns (address[] memory) { - return getValidatorsInEpoch(nextEpoch); - } - - function getValidatorsInEpoch(uint _epoch) view public returns (address[] memory) { - return states[_epoch].validators; - } - - function startVoting() public readyOrVoting currentValidator { - if (tryVote(Vote.START_VOTING, epoch)) { - nextEpoch++; - states[nextEpoch].endBlock = block.number; - states[nextEpoch].threshold = getThreshold(); - states[nextEpoch].validators = getValidators(); - states[nextEpoch].rangeSize = getRangeSize(); - states[nextEpoch].closeEpoch = getCloseEpoch(); - - if (status == Status.READY && getCloseEpoch()) { - status = Status.CLOSING_EPOCH; - emit ForceSign(); - emit EpochClose(epoch); - } else { - status = Status.VOTING; - emit ForceSign(); - emit EpochEnd(epoch); - } - } - } - - function voteAddValidator(address validator) public voting currentValidator { - require(getNextPartyId(validator) == 0, "Already a validator"); - - if (tryVote(Vote.ADD_VALIDATOR, validator)) { - states[nextEpoch].validators.push(validator); - } - } - - function voteRemoveValidator(address validator) public voting currentValidator { - require(getNextPartyId(validator) != 0, "Already not a validator"); - - if (tryVote(Vote.REMOVE_VALIDATOR, validator)) { - _removeValidator(validator); - } - } - - function _removeValidator(address validator) private { - for (uint i = 0; i < getNextParties() - 1; i++) { - if (states[nextEpoch].validators[i] == validator) { - states[nextEpoch].validators[i] = getNextValidators()[getNextParties() - 1]; - break; - } - } - delete states[nextEpoch].validators[getNextParties() - 1]; - states[nextEpoch].validators.length--; - } - - function voteChangeThreshold(uint threshold) public voting currentValidator { - require(threshold > 0 && threshold <= getParties(), "Invalid threshold value"); - - if (tryVote(Vote.CHANGE_THRESHOLD, threshold)) { - states[nextEpoch].threshold = threshold; - } - } - - function voteChangeRangeSize(uint rangeSize) public voting currentValidator { - if (tryVote(Vote.CHANGE_RANGE_SIZE, rangeSize)) { - states[nextEpoch].rangeSize = rangeSize; - } - } - - function voteChangeCloseEpoch(bool closeEpoch) public voting currentValidator { - if (tryVote(Vote.CHANGE_CLOSE_EPOCH, closeEpoch ? 1 : 0)) { - states[nextEpoch].closeEpoch = closeEpoch; - } - } - - function voteStartKeygen() public voting currentValidator { - require(getNextThreshold() <= getNextParties(), "Invalid threshold number"); - - if (tryVote(Vote.START_KEYGEN)) { - status = Status.KEYGEN; - - emit NewEpoch(epoch, nextEpoch); - } - } - - function voteCancelKeygen() public keygen currentValidator { - if (tryVote(Vote.CANCEL_KEYGEN)) { - status = Status.VOTING; - - emit NewEpochCancelled(nextEpoch); - } - } - - function tryVote(Vote voteType) private returns (bool) { - bytes32 vote = keccak256(abi.encodePacked(voteType, nextEpoch)); - return putVote(vote); - } - - function tryVote(Vote voteType, address addr) private returns (bool) { - bytes32 vote = keccak256(abi.encodePacked(voteType, nextEpoch, addr)); - return putVote(vote); - } - - function tryVote(Vote voteType, uint num) private returns (bool) { - bytes32 vote = keccak256(abi.encodePacked(voteType, nextEpoch, num)); - return putVote(vote); - } - - function tryVote(Vote voteType, bytes32 hash, address to, uint value) private returns (bool) { - bytes32 vote = keccak256(abi.encodePacked(voteType, hash, to, value)); - return putVote(vote); - } - - function tryConfirm(Vote voteType) private returns (bool) { - bytes32 vote = keccak256(abi.encodePacked(voteType, nextEpoch)); - return putConfirm(vote); - } - - function tryConfirm(Vote voteType, uint x, uint y) private returns (bool) { - bytes32 vote = keccak256(abi.encodePacked(voteType, nextEpoch, x, y)); - return putConfirm(vote); - } - - function putVote(bytes32 vote) private returns (bool) { - bytes32 personalVote = personalizeVote(vote); - require(!votes[personalVote], "Voted already"); - - votes[personalVote] = true; - if (votesCount[vote] + 1 == getThreshold()) { - votesCount[vote] = 2 ** 255; - return true; - } else { - votesCount[vote]++; - return false; - } - } - - function putConfirm(bytes32 vote) private returns (bool) { - bytes32 personalVote = personalizeVote(vote); - require(!votes[personalVote], "Confirmed already"); - - votes[personalVote] = true; - if (votesCount[vote] + 1 == getNextThreshold()) { - votesCount[vote] = 2 ** 255; - return true; - } else { - votesCount[vote]++; - return false; - } - } - - function personalizeVote(bytes32 vote) private view returns (bytes32) { - return keccak256(abi.encodePacked(vote, msg.sender)); - } } diff --git a/src/deploy/deploy-home/contracts/Government.sol b/src/deploy/deploy-home/contracts/Government.sol new file mode 100644 index 0000000..0696a3c --- /dev/null +++ b/src/deploy/deploy-home/contracts/Government.sol @@ -0,0 +1,126 @@ +pragma solidity ^0.5.0; + +import "./BasicBridge.sol"; + +contract Government is BasicBridge { + enum Action { + CONFIRM_KEYGEN, + CONFIRM_FUNDS_TRANSFER, + CONFIRM_CLOSE_EPOCH, + VOTE_START_VOTING, + VOTE_ADD_VALIDATOR, + VOTE_REMOVE_VALIDATOR, + VOTE_CHANGE_THRESHOLD, + VOTE_CHANGE_RANGE_SIZE, + VOTE_CHANGE_CLOSE_EPOCH, + VOTE_START_KEYGEN, + VOTE_CANCEL_KEYGEN, + TRANSFER + } + + function _confirmKeygen(uint x, uint y) internal keygen { + states[nextEpoch].x = x; + states[nextEpoch].y = y; + states[nextEpoch].nonce = UPPER_BOUND; + if (nextEpoch == 1) { + status = Status.READY; + states[nextEpoch].startBlock = block.number; + epoch = nextEpoch; + emit EpochStart(epoch, x, y); + } + else { + status = Status.FUNDS_TRANSFER; + emit NewFundsTransfer(epoch, nextEpoch); + } + } + + function _confirmFundsTransfer() internal fundsTransfer { + require(epoch > 0, "First epoch does not need funds transfer"); + + status = Status.READY; + states[nextEpoch].startBlock = block.number; + epoch = nextEpoch; + emit EpochStart(epoch, getX(), getY()); + } + + function _confirmCloseEpoch() internal closingEpoch { + status = Status.VOTING; + emit EpochEnd(epoch); + } + + function _startVoting() internal ready { + states[epoch].endBlock = block.number; + nextEpoch++; + states[nextEpoch].threshold = getThreshold(); + states[nextEpoch].validators = getValidators(); + states[nextEpoch].rangeSize = getRangeSize(); + states[nextEpoch].closeEpoch = getCloseEpoch(); + + if (getCloseEpoch()) { + status = Status.CLOSING_EPOCH; + emit ForceSign(); + emit EpochClose(epoch); + } else { + status = Status.VOTING; + emit ForceSign(); + emit EpochEnd(epoch); + } + } + + function _addValidator(address validator) internal voting { + require(getNextPartyId(validator) == 0, "Already a validator"); + + states[nextEpoch].validators.push(validator); + } + + function _removeValidator(address validator) internal voting { + require(getNextPartyId(validator) != 0, "Already not a validator"); + + for (uint i = 0; i < getNextParties() - 1; i++) { + if (states[nextEpoch].validators[i] == validator) { + states[nextEpoch].validators[i] = getNextValidators()[getNextParties() - 1]; + break; + } + } + delete states[nextEpoch].validators[getNextParties() - 1]; + states[nextEpoch].validators.length--; + } + + function _changeThreshold(uint threshold) internal voting { + require(threshold > 0, "Invalid threshold value"); + + states[nextEpoch].threshold = threshold; + } + + function _changeRangeSize(uint rangeSize) internal voting { + require(rangeSize > 0, "Invalid range size"); + + states[nextEpoch].rangeSize = rangeSize; + } + + function _changeCloseEpoch(bool closeEpoch) internal voting { + states[nextEpoch].closeEpoch = closeEpoch; + } + + function _startKeygen() internal voting { + require(getNextThreshold() <= getNextParties(), "Invalid threshold number"); + + status = Status.KEYGEN; + + emit NewEpoch(epoch, nextEpoch); + } + + function _cancelKeygen() internal keygen { + status = Status.VOTING; + + emit NewEpochCancelled(nextEpoch); + } + + function _transfer(address to, uint value) internal { + if (tokenContract.balanceOf(address(this)) >= value) { + tokenContract.transfer(to, value); + } else { + tokenContract.approve(to, value); + } + } +} diff --git a/src/deploy/deploy-home/contracts/MessageDecoder.sol b/src/deploy/deploy-home/contracts/MessageDecoder.sol new file mode 100644 index 0000000..12dd463 --- /dev/null +++ b/src/deploy/deploy-home/contracts/MessageDecoder.sol @@ -0,0 +1,39 @@ +pragma solidity ^0.5.0; + + +contract MessageDecoder { + // [0] - action type + // [1..32] - epoch + // [33..] - payload + function _decodeNumber(bytes memory message) pure internal returns (uint a) { + assembly { + a := mload(add(message, 65)) + } + } + + function _decodeBoolean(bytes memory message) pure internal returns (bool a) { + assembly { + a := mload(add(message, 34)) + } + } + + function _decodeAddress(bytes memory message) pure internal returns (address a) { + assembly { + a := mload(add(message, 53)) + } + } + + function _decodeKeygen(bytes memory message) pure internal returns (uint a, uint b) { + assembly { + a := mload(add(message, 65)) + b := mload(add(message, 97)) + } + } + + function _decodeTransfer(bytes memory message) pure internal returns (address a, uint b) { + assembly { + a := mload(add(message, 85)) + b := mload(add(message, 117)) + } + } +} diff --git a/src/deploy/deploy-home/contracts/MessageHandler.sol b/src/deploy/deploy-home/contracts/MessageHandler.sol new file mode 100644 index 0000000..7a8676d --- /dev/null +++ b/src/deploy/deploy-home/contracts/MessageHandler.sol @@ -0,0 +1,135 @@ +pragma solidity ^0.5.0; + +import "./Government.sol"; +import "./MessageDecoder.sol"; + +contract MessageHandler is Government, MessageDecoder { + uint constant SIGNATURE_SIZE = 65; + + mapping(bytes32 => bool) public handledMessages; + + function applyMessage(bytes memory message, bytes memory signatures) public { + (bytes32 msgHash, uint msgEpoch) = checkSignedMessage(message, signatures); + handledMessages[msgHash] = true; + + Action msgAction = Action(uint8(message[0])); + + if (msgAction == Action.CONFIRM_KEYGEN || msgAction == Action.VOTE_CANCEL_KEYGEN) { + require(msgEpoch == nextEpoch, "Incorrect message epoch"); + } else if (msgAction == Action.TRANSFER) { + require(msgEpoch <= epoch, "Incorrect message epoch"); + } else { + require(msgEpoch == epoch, "Incorrect message epoch"); + } + + if (msgAction == Action.CONFIRM_KEYGEN) { + require(message.length == 97, "Incorrect message length"); + (uint x, uint y) = _decodeKeygen(message); + _confirmKeygen(x, y); + } else if (msgAction == Action.CONFIRM_FUNDS_TRANSFER) { + require(message.length == 33, "Incorrect message length"); + _confirmFundsTransfer(); + } else if (msgAction == Action.CONFIRM_CLOSE_EPOCH) { + require(message.length == 33, "Incorrect message length"); + _confirmCloseEpoch(); + } else if (msgAction == Action.VOTE_START_VOTING) { + require(message.length == 33, "Incorrect message length"); + _startVoting(); + } else if (msgAction == Action.VOTE_ADD_VALIDATOR) { + require(message.length == 53, "Incorrect message length"); + address validator = _decodeAddress(message); + _addValidator(validator); + } else if (msgAction == Action.VOTE_REMOVE_VALIDATOR) { + require(message.length == 53, "Incorrect message length"); + address validator = _decodeAddress(message); + _removeValidator(validator); + } else if (msgAction == Action.VOTE_CHANGE_THRESHOLD) { + require(message.length == 65, "Incorrect message length"); + uint threshold = _decodeNumber(message); + _changeThreshold(threshold); + } else if (msgAction == Action.VOTE_CHANGE_RANGE_SIZE) { + require(message.length == 65, "Incorrect message length"); + uint rangeSize = _decodeNumber(message); + _changeRangeSize(rangeSize); + } else if (msgAction == Action.VOTE_CHANGE_CLOSE_EPOCH) { + require(message.length == 34, "Incorrect message length"); + bool closeEpoch = _decodeBoolean(message); + _changeCloseEpoch(closeEpoch); + } else if (msgAction == Action.VOTE_START_KEYGEN) { + require(message.length == 33, "Incorrect message length"); + _startKeygen(); + } else if (msgAction == Action.VOTE_CANCEL_KEYGEN) { + require(message.length == 33, "Incorrect message length"); + _cancelKeygen(); + } else if (msgAction == Action.TRANSFER) { + require(message.length == 117, "Incorrect message length"); + (address to, uint value) = _decodeTransfer(message); + _transfer(to, value); + // 0b + // 0000000000000000000000000000000000000000000000000000000000000001 + // 73824c9dc9318568f803a7fd6a147d67f0c1c328f0ed955456ed7357e6b470f8 + // ad6c8127143032d843a260c5d379d8d9b3d51f15 + // 0000000000000000000000000000000000000000000000004563918244f40000 + } else { + revert("Unknown message action"); + } + } + + function checkSignedMessage(bytes memory message, bytes memory signatures) view public returns (bytes32, uint) { + require(signatures.length % SIGNATURE_SIZE == 0, "Incorrect signatures length"); + + bytes32 msgHash; + if (message.length == 33) { + msgHash = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n33", message)); + } else if (message.length == 34) { + msgHash = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n34", message)); + } else if (message.length == 53) { + msgHash = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n53", message)); + } else if (message.length == 65) { + msgHash = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n65", message)); + } else if (message.length == 97) { + msgHash = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n97", message)); + } else if (message.length == 117) { + msgHash = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n117", message)); + } else { + revert("Incorrect message length"); + } + require(!handledMessages[msgHash], "Tx was already handled"); + + uint msgEpoch; + assembly { + msgEpoch := mload(add(message, 33)) + } + require(msgEpoch <= nextEpoch, "Invalid epoch number"); + + uint signaturesNum = signatures.length / SIGNATURE_SIZE; + require(signaturesNum >= getThreshold(msgEpoch), "Not enough signatures"); + + address[] memory possibleValidators = getValidators(msgEpoch); + + bytes32 r; + bytes32 s; + uint8 v; + + for (uint i = 0; i < signaturesNum; i++) { + uint offset = i * SIGNATURE_SIZE; + + assembly { + r := mload(add(add(signatures, 32), offset)) + s := mload(add(add(signatures, 64), offset)) + v := byte(0, mload(add(add(signatures, 96), offset))) + } + + address signer = ecrecover(msgHash, v, r, s); + uint j; + for (j = 0; j < possibleValidators.length; j++) { + if (possibleValidators[j] == signer) { + delete possibleValidators[j]; + break; + } + } + require(j != possibleValidators.length, "Not a validator signature"); + } + return (msgHash, msgEpoch); + } +} diff --git a/src/deploy/deploy-side/.solhint.json b/src/deploy/deploy-side/.solhint.json new file mode 100644 index 0000000..d7c3de9 --- /dev/null +++ b/src/deploy/deploy-side/.solhint.json @@ -0,0 +1,3 @@ +{ + "extends": "solhint:default" +} diff --git a/src/deploy/deploy-side/contracts/SignedMessageStorage.sol b/src/deploy/deploy-side/contracts/SignedMessageStorage.sol index bbbb675..037e670 100644 --- a/src/deploy/deploy-side/contracts/SignedMessageStorage.sol +++ b/src/deploy/deploy-side/contracts/SignedMessageStorage.sol @@ -1,18 +1,47 @@ pragma solidity ^0.5.0; contract SignedMessageStorage { + event NewMessage(bytes32 msgHash); + struct SignedMessage { bytes message; mapping(address => bytes) signatures; } - mapping(bytes32 => SignedMessage) signedMessages; - + mapping(bytes32 => SignedMessage) public signedMessages; + // 0xc17c720a + // 0000000000000000000000000000000000000000000000000000000000000040 + // 00000000000000000000000000000000000000000000000000000000000000e0 + // 0000000000000000000000000000000000000000000000000000000000000061 + // 00 + // 0000000000000000000000000000000000000000000000000000000000000001 + // 7681bd587db2576708db7085c2704c84e19db65f5b8a90897866c411a4002f86 + // 6c66695a8595b4b41f779877b2a177c79969bfd627bd691bcd14f27eaab7ad3c + // 00000000000000000000000000000000000000000000000000000000000000 + // 0000000000000000000000000000000000000000000000000000000000000041 + // 82b4f5c4211ca2c5a0a5ec8d5476da5d537e282b852108bcfb006058b942d6a1 + // 51ca56bfe41529215fe1f6b8a56b69ecb1357d588bfb38a9f7bd858df82d8038 + // 1c00000000000000000000000000000000000000000000000000000000000000 function addSignature(bytes memory message, bytes memory rsv) public { - require(message.length == 116, "Incorrect message length"); + require(message.length > 0, "Incorrect message length"); require(rsv.length == 65, "Incorrect signature length"); - bytes32 msgHash = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n116", message)); + bytes32 msgHash; + if (message.length == 33) { + msgHash = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n33", message)); + } else if (message.length == 34) { + msgHash = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n34", message)); + } else if (message.length == 53) { + msgHash = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n53", message)); + } else if (message.length == 65) { + msgHash = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n65", message)); + } else if (message.length == 97) { + msgHash = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n97", message)); + } else if (message.length == 117) { + msgHash = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n117", message)); + } else { + revert("Incorrect message length"); + } bytes32 r; bytes32 s; @@ -28,6 +57,8 @@ contract SignedMessageStorage { if (signedMessages[msgHash].message.length == 0) { signedMessages[msgHash].message = message; + + emit NewMessage(msgHash); } signedMessages[msgHash].signatures[msg.sender] = rsv; } diff --git a/src/deploy/deploy-side/contracts/SignupStorage.sol b/src/deploy/deploy-side/contracts/SignupStorage.sol index 4b932f2..7fe62fd 100644 --- a/src/deploy/deploy-side/contracts/SignupStorage.sol +++ b/src/deploy/deploy-side/contracts/SignupStorage.sol @@ -10,7 +10,11 @@ contract SignupStorage { signups[hash][msg.sender] = ++signupsCount[hash]; } - function getSignupNumber(bytes32 hash, address[] memory validators, address validator) view public returns (uint) { + function getSignupNumber( + bytes32 hash, + address[] memory validators, + address validator + ) view public returns (uint) { if (signups[hash][validator] == 0) return 0; uint id = 1; @@ -22,7 +26,11 @@ contract SignupStorage { return id; } - function getSignupAddress(bytes32 hash, address[] memory validators, uint signupNumber) view public returns (address) { + function getSignupAddress( + bytes32 hash, + address[] memory validators, + uint signupNumber + ) view public returns (address) { for (uint i = 0; i < validators.length; i++) { if (getSignupNumber(hash, validators, validators[i]) == signupNumber) { return validators[i]; From 15e31bec2a2c4f4b9c398f39b1488abb0806c66d Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Sun, 24 Nov 2019 18:19:53 +0300 Subject: [PATCH 114/129] Fixed side propagation oracle --- src/ethereum-testnet/side-oracle/index.js | 35 ++++++++++++----------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/src/ethereum-testnet/side-oracle/index.js b/src/ethereum-testnet/side-oracle/index.js index f567bb7..d77be3f 100644 --- a/src/ethereum-testnet/side-oracle/index.js +++ b/src/ethereum-testnet/side-oracle/index.js @@ -8,10 +8,11 @@ const SIDE_MAX_FETCH_RANGE_SIZE = parseInt(process.env.SIDE_MAX_FETCH_RANGE_SIZE const bridgeAbi = [ 'function applyMessage(bytes message, bytes signatures)', 'function getThreshold(uint epoch) view returns (uint)', - 'function getValidatorsInEpoch(uint epoch) view returns (address[])' + 'function getValidators(uint epoch) view returns (address[])' ] const sharedDbAbi = [ 'event NewMessage(bytes32 msgHash)', + 'function signedMessages(bytes32 hash) view returns (bytes)', 'function getSignatures(bytes32 msgHash, address[] validators) view returns (bytes)' ] @@ -29,16 +30,21 @@ async function delay(ms) { async function handleNewMessage(event) { const { msgHash } = event.values - const message = (await sharedDb.signedMessages(msgHash))[0] - const epoch = parseInt(message.slice(30, 3).toString('hex'), 16) + const message = await sharedDb.signedMessages(msgHash) + const epoch = parseInt(message.slice(4, 68), 16) const [threshold, validators] = await Promise.all([ bridge.getThreshold(epoch), - bridge.getValidatorsInEpoch(epoch) + bridge.getValidators(epoch) ]) while (true) { const signatures = await sharedDb.getSignatures(msgHash, validators) - if (signatures.length / 65 >= threshold) { + if (signatures.length === 2) { + console.log('Skipping event') + break + } + if ((signatures.length - 2) / 130 >= threshold) { + console.log('Sending applyMessage request') const tx = await bridge.applyMessage(message, signatures, { gasLimit: 1000000, nonce @@ -54,10 +60,9 @@ async function initialize() { await delay(5000) sideProvider = new ethers.providers.JsonRpcProvider(SIDE_RPC_URL) homeProvider = new ethers.providers.JsonRpcProvider(HOME_RPC_URL) - bridge = new ethers.Contract(HOME_BRIDGE_ADDRESS, bridgeAbi, homeProvider) - sharedDb = new ethers.Contract(SIDE_SHARED_DB_ADDRESS, sharedDbAbi, sideProvider) - homeWallet = new ethers.Wallet(HOME_PRIVATE_KEY, homeProvider) + bridge = new ethers.Contract(HOME_BRIDGE_ADDRESS, bridgeAbi, homeWallet) + sharedDb = new ethers.Contract(SIDE_SHARED_DB_ADDRESS, sharedDbAbi, sideProvider) nonce = await homeWallet.getTransactionCount() } @@ -77,19 +82,15 @@ async function loop() { address: SIDE_SHARED_DB_ADDRESS, fromBlock: blockNumber, toBlock: endBlock, - topics: [] + topics: [ + sharedDb.interface.events.NewMessage.topic + ] })) for (let i = 0; i < bridgeEvents.length; i += 1) { - const event = bridge.interface.parseLog(bridgeEvents[i]) + const event = sharedDb.interface.parseLog(bridgeEvents[i]) console.log('Consumed event', event, bridgeEvents[i]) - switch (event.name) { - case 'NewMessage': - await handleNewMessage(event) - break - default: - console.log('Unknown event %o', event) - } + await handleNewMessage(event) } blockNumber = endBlock + 1 From 4de478390b33463c5aa31780bfa12af869f95b68 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Sun, 24 Nov 2019 18:20:56 +0300 Subject: [PATCH 115/129] Updated oracle codebase to use signatures management contract --- src/oracle/proxy/contractsAbi.js | 4 +- src/oracle/proxy/index.js | 202 ++++++++++++++--------------- src/oracle/tss-keygen/keygen.js | 13 +- src/oracle/tss-keygen/package.json | 1 + src/oracle/tss-sign/signer.js | 16 ++- 5 files changed, 120 insertions(+), 116 deletions(-) diff --git a/src/oracle/proxy/contractsAbi.js b/src/oracle/proxy/contractsAbi.js index b9b7524..609f911 100644 --- a/src/oracle/proxy/contractsAbi.js +++ b/src/oracle/proxy/contractsAbi.js @@ -14,7 +14,6 @@ const bridgeAbi = [ 'function getNextThreshold() view returns (uint)', 'function getValidators() view returns (address[])', 'function getNextValidators() view returns (address[])', - 'function getValidatorsInEpoch(uint _epoch) view returns (address[])', 'function getCloseEpoch() view returns (bool)', 'function getNextCloseEpoch() view returns (bool)', 'function status() view returns (uint)', @@ -29,8 +28,7 @@ const bridgeAbi = [ 'function voteAddValidator(address validator)', 'function voteRemoveValidator(address validator)', 'function voteChangeThreshold(uint threshold)', - 'function voteChangeCloseEpoch(bool closeEpoch)', - 'function transfer(bytes message, bytes signatures)' + 'function voteChangeCloseEpoch(bool closeEpoch)' ] const sharedDbAbi = [ 'function getSignupAddress(bytes32 hash, address[] validators, uint signupNumber) view returns (address)', diff --git a/src/oracle/proxy/index.js b/src/oracle/proxy/index.js index cff78bc..a529a10 100644 --- a/src/oracle/proxy/index.js +++ b/src/oracle/proxy/index.js @@ -13,13 +13,27 @@ const decode = require('./decode') const { createSender, waitForReceipt } = require('./sendTx') const logger = require('./logger') const { publicKeyToAddress, padZeros } = require('./crypto') -const { delay } = require('./wait') const { HOME_RPC_URL, HOME_BRIDGE_ADDRESS, SIDE_RPC_URL, SIDE_SHARED_DB_ADDRESS, VALIDATOR_PRIVATE_KEY, HOME_TOKEN_ADDRESS, FOREIGN_URL, FOREIGN_ASSET } = process.env +const Action = { + CONFIRM_KEYGEN: 0, + CONFIRM_FUNDS_TRANSFER: 1, + CONFIRM_CLOSE_EPOCH: 2, + VOTE_START_VOTING: 3, + VOTE_ADD_VALIDATOR: 4, + VOTE_REMOVE_VALIDATOR: 5, + VOTE_CHANGE_THRESHOLD: 6, + VOTE_CHANGE_RANGE_SIZE: 7, + VOTE_CHANGE_CLOSE_EPOCH: 8, + VOTE_START_KEYGEN: 9, + VOTE_CANCEL_KEYGEN: 10, + TRANSFER: 11 +} + const homeProvider = new ethers.providers.JsonRpcProvider(HOME_RPC_URL) const sideProvider = new ethers.providers.JsonRpcProvider(SIDE_RPC_URL) const homeWallet = new ethers.Wallet(VALIDATOR_PRIVATE_KEY, homeProvider) @@ -35,9 +49,7 @@ const httpClient = axios.create({ baseURL: FOREIGN_URL }) const lock = new AsyncLock() -let homeValidatorNonce let sideValidatorNonce -let homeSender let sideSender const app = express() @@ -61,21 +73,6 @@ function sideSendQuery(query) { }) } -function homeSendQuery(query) { - return lock.acquire('home', async () => { - logger.debug('Sending home query') - const senderResponse = await homeSender({ - data: query, - to: HOME_BRIDGE_ADDRESS, - nonce: homeValidatorNonce - }) - if (senderResponse !== true) { - homeValidatorNonce += 1 - } - return senderResponse - }) -} - async function get(req, res) { logger.debug('Get call, %o', req.body.key) const round = req.body.key.second @@ -173,112 +170,136 @@ async function signupSign(req, res) { logger.debug('SignupSign end') } +function encodeParam(param) { + switch (typeof param) { + case 'string': + if (param.startsWith('0x')) { + return Buffer.from(param.slice(2), 'hex') + } + return Buffer.from(padZeros(param, 64), 'hex') + case 'number': + return Buffer.from(padZeros(new BN(param).toString(16), 64), 'hex') + case 'boolean': + return Buffer.from([param ? 1 : 0]) + default: + return null + } +} + +function buildMessage(type, ...params) { + logger.debug(`${type}, %o`, params) + return Buffer.concat([ + Buffer.from([type]), + ...params.map(encodeParam) + ]) +} + +async function processMessage(message) { + const signature = await sideWallet.signMessage(message) + logger.debug('Adding signature to shared db contract') + const query = sharedDb.interface.functions.addSignature.encode([`0x${message.toString('hex')}`, signature]) + await sideSendQuery(query) +} + async function confirmKeygen(req, res) { logger.debug('Confirm keygen call') - const { x, y } = req.body[5] - const query = bridge.interface.functions.confirmKeygen.encode([`0x${x}`, `0x${y}`]) - await homeSendQuery(query) + const { x, y, epoch } = req.body + const message = buildMessage(Action.CONFIRM_KEYGEN, epoch, x, y) + await processMessage(message) res.send() logger.debug('Confirm keygen end') } async function confirmFundsTransfer(req, res) { logger.debug('Confirm funds transfer call') - const query = bridge.interface.functions.confirmFundsTransfer.encode([]) - await homeSendQuery(query) + const { epoch } = req.body + const message = buildMessage(Action.CONFIRM_FUNDS_TRANSFER, epoch) + await processMessage(message) res.send() logger.debug('Confirm funds transfer end') } async function confirmCloseEpoch(req, res) { logger.debug('Confirm close epoch call') - const query = bridge.interface.functions.confirmCloseEpoch.encode([]) - await homeSendQuery(query) + const { epoch } = req.body + const message = buildMessage(Action.CONFIRM_CLOSE_EPOCH, epoch) + await processMessage(message) res.send() logger.debug('Confirm close epoch end') } -async function sendVote(query, req, res, waitFlag = false) { - try { - const sentQuery = await homeSendQuery(query) - let { txHash, gasLimit } = sentQuery - if (txHash) { - while (waitFlag) { - const { status, gasUsed } = await waitForReceipt(HOME_RPC_URL, txHash) - if (status === '0x1') { - logger.debug('Receipt status is OK') - break - } - if (gasLimit === gasUsed) { - logger.info('Sending vote failed due to out of gas revert, retrying with more gas') - const nextTx = await homeSendQuery(query) - txHash = nextTx.txHash - gasLimit = nextTx.gasLimit - } else { - logger.warn(`Vote tx was reverted, txHash ${txHash}`) - break - } - } - } - if (sentQuery) { - res.send('Voted\n') - logger.info('Voted successfully') - } else { - res.send('Failed\n') - logger.info('Failed to vote') - } - } catch (e) { - logger.debug(e) - } -} - async function voteStartVoting(req, res) { logger.info('Voting for starting new epoch voting process') - const query = bridge.interface.functions.startVoting.encode([]) - await sendVote(query, req, res, true) + const epoch = boundX(await bridge.epoch()) + const message = buildMessage(Action.VOTE_START_VOTING, epoch) + await processMessage(message) + res.send('Voted\n') + logger.info('Voted successfully') } async function voteStartKeygen(req, res) { logger.info('Voting for starting new epoch keygen') - const query = bridge.interface.functions.voteStartKeygen.encode([]) - await sendVote(query, req, res) + const epoch = boundX(await bridge.epoch()) + const message = buildMessage(Action.VOTE_START_KEYGEN, epoch) + await processMessage(message) + res.send('Voted\n') + logger.info('Voted successfully') } async function voteCancelKeygen(req, res) { logger.info('Voting for cancelling new epoch keygen') - const query = bridge.interface.functions.voteCancelKeygen.encode([]) - await sendVote(query, req, res) + const epoch = boundX(await bridge.nextEpoch()) + const message = buildMessage(Action.VOTE_CANCEL_KEYGEN, epoch) + await processMessage(message) + res.send('Voted\n') + logger.info('Voted successfully') } async function voteAddValidator(req, res) { if (ethers.utils.isHexString(req.params.validator, 20)) { logger.info('Voting for adding new validator') - const query = bridge.interface.functions.voteAddValidator.encode([req.params.validator]) - await sendVote(query, req, res) + const epoch = boundX(await bridge.epoch()) + const message = buildMessage(Action.VOTE_ADD_VALIDATOR, epoch, req.params.validator) + await processMessage(message) + res.send('Voted\n') + logger.info('Voted successfully') } } async function voteChangeThreshold(req, res) { if (/^[0-9]+$/.test(req.params.threshold)) { logger.info('Voting for changing threshold') - const query = bridge.interface.functions.voteChangeThreshold.encode([req.params.threshold]) - await sendVote(query, req, res) + const epoch = boundX(await bridge.epoch()) + const message = buildMessage( + Action.VOTE_CHANGE_THRESHOLD, + epoch, + parseInt(req.params.threshold, 10) + ) + await processMessage(message) + res.send('Voted\n') + logger.info('Voted successfully') } } async function voteChangeCloseEpoch(req, res) { if (req.params.closeEpoch === 'true' || req.params.closeEpoch === 'false') { logger.info('Voting for changing close epoch') - const query = bridge.interface.functions.voteChangeCloseEpoch.encode([req.params.closeEpoch === 'true']) - await sendVote(query, req, res) + const epoch = boundX(await bridge.epoch()) + const message = buildMessage(Action.VOTE_CHANGE_CLOSE_EPOCH, epoch, req.params.closeEpoch === 'true') + await processMessage(message) + res.send('Voted\n') + logger.info('Voted successfully') } } async function voteRemoveValidator(req, res) { if (ethers.utils.isHexString(req.params.validator, 20)) { logger.info('Voting for removing validator') - const query = bridge.interface.functions.voteRemoveValidator.encode([req.params.validator]) - await sendVote(query, req, res, true) + const epoch = boundX(await bridge.epoch()) + const message = buildMessage(Action.VOTE_REMOVE_VALIDATOR, epoch, req.params.validator) + await processMessage(message) + res.send('Voted\n') + logger.info('Voted successfully') } } @@ -289,16 +310,9 @@ async function transfer(req, res) { } = req.body if (ethers.utils.isHexString(to, 20)) { logger.info(`Calling transfer to ${to}, 0x${value} tokens`) - const message = Buffer.from(padZeros(epoch.toString(16), 64) + hash + to.slice(2) + padZeros(value, 64), 'hex') - const signature = await sideWallet.signMessage(message) - const query = sharedDb.interface.functions.addSignature.encode([`0x${message.toString('hex')}`, signature]) - await sideSendQuery(query) - await delay(5000) - const validators = await bridge.getValidatorsInEpoch(epoch) - const signatures = await sharedDb.getSignatures(ethers.utils.hashMessage(message), validators) - logger.debug(`Transfer call, message 0x${message.toString('hex')}, signatures ${signatures}`) - const query1 = bridge.interface.functions.transfer.encode([`0x${message.toString('hex')}`, signatures]) - await homeSendQuery(query1) + const message = buildMessage(Action.TRANSFER, epoch, hash, to, value) + logger.info(`Message for sign: ${message.toString('hex')}`) + await processMessage(message) } res.send() logger.info('Transfer end') @@ -315,12 +329,6 @@ function getForeignBalances(address) { .catch(() => ({})) } -function getVotesCount(nextEpoch, voteType) { - return bridge.votesCount( - ethers.utils.keccak256(ethers.utils.solidityPack(['uint8', 'uint256'], [voteType, nextEpoch])) - ).then(boundX) -} - async function info(req, res) { logger.debug('Info start') try { @@ -347,14 +355,6 @@ async function info(req, res) { token.balanceOf(HOME_BRIDGE_ADDRESS) .then((value) => parseFloat(new BN(value).dividedBy(10 ** 18).toFixed(8, 3))) ]) - const [ - confirmationsForFundsTransfer, votesForVoting, votesForKeygen, votesForCancelKeygen - ] = await Promise.all([ - getVotesCount(nextEpoch, 1), - getVotesCount(nextEpoch, 2), - getVotesCount(nextEpoch, 7), - getVotesCount(nextEpoch, 8) - ]) const foreignAddress = publicKeyToAddress({ x, y @@ -378,11 +378,7 @@ async function info(req, res) { homeBalance, foreignBalanceTokens: parseFloat(balances[FOREIGN_ASSET]) || 0, foreignBalanceNative: parseFloat(balances.BNB) || 0, - bridgeStatus: decodeStatus(status), - votesForVoting, - votesForKeygen, - votesForCancelKeygen, - confirmationsForFundsTransfer + bridgeStatus: decodeStatus(status) } logger.trace('%o', msg) res.send(msg) @@ -416,10 +412,8 @@ votesProxyApp.get('/vote/changeCloseEpoch/:closeEpoch', voteChangeCloseEpoch) votesProxyApp.get('/info', info) async function main() { - homeValidatorNonce = await homeWallet.getTransactionCount() sideValidatorNonce = await sideWallet.getTransactionCount() - homeSender = await createSender(HOME_RPC_URL, VALIDATOR_PRIVATE_KEY) sideSender = await createSender(SIDE_RPC_URL, VALIDATOR_PRIVATE_KEY) logger.warn(`My validator address in home and side networks is ${validatorAddress}`) diff --git a/src/oracle/tss-keygen/keygen.js b/src/oracle/tss-keygen/keygen.js index 0f16b9e..4504b4c 100644 --- a/src/oracle/tss-keygen/keygen.js +++ b/src/oracle/tss-keygen/keygen.js @@ -1,6 +1,7 @@ const exec = require('child_process') const fs = require('fs') const express = require('express') +const axios = require('axios') const logger = require('./logger') const { connectRabbit, assertQueue } = require('./amqp') @@ -11,11 +12,17 @@ const { RABBITMQ_URL, PROXY_URL } = process.env const app = express() +const proxyClient = axios.create({ baseURL: PROXY_URL }) + let currentKeygenEpoch = null let ready = false -async function confirmKeygen(keysFile) { - exec.execSync(`curl -X POST -H "Content-Type: application/json" -d @"${keysFile}" "${PROXY_URL}/confirmKeygen"`, { stdio: 'pipe' }) +async function confirmKeygen({ x, y }, epoch) { + await proxyClient.post('/confirmKeygen', { + x, + y, + epoch + }) } async function main() { @@ -51,7 +58,7 @@ async function main() { logger.warn(`Generated multisig account in binance chain: ${publicKeyToAddress(publicKey)}`) logger.info('Sending keys confirmation') - await confirmKeygen(keysFile) + await confirmKeygen(publicKey, epoch) } else { logger.warn(`Keygen for epoch ${epoch} failed`) } diff --git a/src/oracle/tss-keygen/package.json b/src/oracle/tss-keygen/package.json index ba4680e..fb1d8db 100644 --- a/src/oracle/tss-keygen/package.json +++ b/src/oracle/tss-keygen/package.json @@ -3,6 +3,7 @@ "version": "0.0.1", "dependencies": { "amqplib": "0.5.3", + "axios": "0.19.0", "bech32": "1.1.3", "pino": "5.13.4", "pino-pretty": "3.2.1", diff --git a/src/oracle/tss-sign/signer.js b/src/oracle/tss-sign/signer.js index 0e3810d..94e0b0a 100644 --- a/src/oracle/tss-sign/signer.js +++ b/src/oracle/tss-sign/signer.js @@ -68,12 +68,16 @@ function restart(req, res) { } } -async function confirmFundsTransfer() { - await proxyClient.post('/confirmFundsTransfer') +async function confirmFundsTransfer(epoch) { + await proxyClient.post('/confirmFundsTransfer', { + epoch + }) } -async function confirmCloseEpoch() { - await proxyClient.post('/confirmCloseEpoch') +async function confirmCloseEpoch(epoch) { + await proxyClient.post('/confirmCloseEpoch', { + epoch + }) } function getAccountFromFile(file) { @@ -264,7 +268,7 @@ async function main() { const signResult = await sign(keysFile, hash, tx, publicKey, from) if (signResult === SIGN_OK || signResult === SIGN_NONCE_INTERRUPT) { - await confirmCloseEpoch() + await confirmCloseEpoch(closeEpoch) break } @@ -338,7 +342,7 @@ async function main() { const signResult = await sign(keysFile, hash, tx, publicKey, from) if (signResult === SIGN_OK || signResult === SIGN_NONCE_INTERRUPT) { - await confirmFundsTransfer() + await confirmFundsTransfer(epoch) break } From 8ad02bcab44b5597cddae8c7d3aeae77388bddfe Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Sun, 24 Nov 2019 18:43:09 +0300 Subject: [PATCH 116/129] Using new private key for side oracle transactions --- src/ethereum-testnet/side-oracle/.env.development | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ethereum-testnet/side-oracle/.env.development b/src/ethereum-testnet/side-oracle/.env.development index 08ced61..56f1de7 100644 --- a/src/ethereum-testnet/side-oracle/.env.development +++ b/src/ethereum-testnet/side-oracle/.env.development @@ -1,7 +1,7 @@ HOME_RPC_URL=http://ganache_home:8545 HOME_BRIDGE_ADDRESS=0x44c158FE850821ae69DaF37AADF5c539e9d0025B -HOME_PRIVATE_KEY=e2aeb24eaa63102d0c0821717c3b6384abdabd7af2ad4ec8e650dce300798b27 +HOME_PRIVATE_KEY=fd5c416a8d497a343d4ee1ac7a8f407450ae115b0001cdd6f2dad715baa3bc25 SIDE_RPC_URL=http://ganache_side:8545 SIDE_SHARED_DB_ADDRESS=0xd5fE0D28e058D375b0b038fFbB446Da37E85fFdc From 73ccd306888a4725e3799d90694cd7d4884be12e Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Sun, 24 Nov 2019 20:06:45 +0300 Subject: [PATCH 117/129] Fixed _decodeBoolean --- .../deploy-home/contracts/MessageDecoder.sol | 2 +- .../deploy-home/contracts/MessageHandler.sol | 5 ----- .../deploy-side/contracts/SignedMessageStorage.sol | 14 +------------- 3 files changed, 2 insertions(+), 19 deletions(-) diff --git a/src/deploy/deploy-home/contracts/MessageDecoder.sol b/src/deploy/deploy-home/contracts/MessageDecoder.sol index 12dd463..903a2b0 100644 --- a/src/deploy/deploy-home/contracts/MessageDecoder.sol +++ b/src/deploy/deploy-home/contracts/MessageDecoder.sol @@ -13,7 +13,7 @@ contract MessageDecoder { function _decodeBoolean(bytes memory message) pure internal returns (bool a) { assembly { - a := mload(add(message, 34)) + a := and(mload(add(message, 34)), 1) } } diff --git a/src/deploy/deploy-home/contracts/MessageHandler.sol b/src/deploy/deploy-home/contracts/MessageHandler.sol index 7a8676d..3554ad9 100644 --- a/src/deploy/deploy-home/contracts/MessageHandler.sol +++ b/src/deploy/deploy-home/contracts/MessageHandler.sol @@ -65,11 +65,6 @@ contract MessageHandler is Government, MessageDecoder { require(message.length == 117, "Incorrect message length"); (address to, uint value) = _decodeTransfer(message); _transfer(to, value); - // 0b - // 0000000000000000000000000000000000000000000000000000000000000001 - // 73824c9dc9318568f803a7fd6a147d67f0c1c328f0ed955456ed7357e6b470f8 - // ad6c8127143032d843a260c5d379d8d9b3d51f15 - // 0000000000000000000000000000000000000000000000004563918244f40000 } else { revert("Unknown message action"); } diff --git a/src/deploy/deploy-side/contracts/SignedMessageStorage.sol b/src/deploy/deploy-side/contracts/SignedMessageStorage.sol index 037e670..aeca9fd 100644 --- a/src/deploy/deploy-side/contracts/SignedMessageStorage.sol +++ b/src/deploy/deploy-side/contracts/SignedMessageStorage.sol @@ -9,19 +9,7 @@ contract SignedMessageStorage { } mapping(bytes32 => SignedMessage) public signedMessages; - // 0xc17c720a - // 0000000000000000000000000000000000000000000000000000000000000040 - // 00000000000000000000000000000000000000000000000000000000000000e0 - // 0000000000000000000000000000000000000000000000000000000000000061 - // 00 - // 0000000000000000000000000000000000000000000000000000000000000001 - // 7681bd587db2576708db7085c2704c84e19db65f5b8a90897866c411a4002f86 - // 6c66695a8595b4b41f779877b2a177c79969bfd627bd691bcd14f27eaab7ad3c - // 00000000000000000000000000000000000000000000000000000000000000 - // 0000000000000000000000000000000000000000000000000000000000000041 - // 82b4f5c4211ca2c5a0a5ec8d5476da5d537e282b852108bcfb006058b942d6a1 - // 51ca56bfe41529215fe1f6b8a56b69ecb1357d588bfb38a9f7bd858df82d8038 - // 1c00000000000000000000000000000000000000000000000000000000000000 + function addSignature(bytes memory message, bytes memory rsv) public { require(message.length > 0, "Incorrect message length"); require(rsv.length == 65, "Incorrect signature length"); From 5efe01db6543af008b8f2d2da5078e49c002ba82 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Mon, 25 Nov 2019 15:02:20 +0300 Subject: [PATCH 118/129] Eslint for side oracle --- src/ethereum-testnet/.eslintrc | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 src/ethereum-testnet/.eslintrc diff --git a/src/ethereum-testnet/.eslintrc b/src/ethereum-testnet/.eslintrc new file mode 100644 index 0000000..3703c0a --- /dev/null +++ b/src/ethereum-testnet/.eslintrc @@ -0,0 +1,8 @@ +{ + "extends": [ + "../../.eslintrc" + ], + "rules": { + "no-console": 0 + } +} From 93563cfa8ad19a5206082b93f062ff267143ba3d Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Mon, 25 Nov 2019 15:04:03 +0300 Subject: [PATCH 119/129] Used more convinient uintX types for numbers in contracts --- .../deploy-home/contracts/BasicBridge.sol | 91 ++++++++----------- src/deploy/deploy-home/contracts/Bridge.sol | 12 +-- .../deploy-home/contracts/Government.sol | 19 ++-- .../deploy-home/contracts/MessageDecoder.sol | 22 ++--- .../deploy-home/contracts/MessageHandler.sol | 63 ++++++------- .../contracts/SignedMessageStorage.sol | 18 ++-- .../deploy-side/contracts/SignupStorage.sol | 12 +-- src/ethereum-testnet/side-oracle/index.js | 11 ++- src/oracle/ethWatcher/ethWatcher.js | 53 ++++++----- src/oracle/proxy/contractsAbi.js | 40 +++----- src/oracle/proxy/index.js | 60 ++++++------ src/oracle/proxy/utils.js | 11 +-- .../ethereumSend/testEthereumSend.js | 2 +- tests/test/utils/homeContracts.js | 2 +- 14 files changed, 187 insertions(+), 229 deletions(-) diff --git a/src/deploy/deploy-home/contracts/BasicBridge.sol b/src/deploy/deploy-home/contracts/BasicBridge.sol index fa8bcf8..86a2e08 100644 --- a/src/deploy/deploy-home/contracts/BasicBridge.sol +++ b/src/deploy/deploy-home/contracts/BasicBridge.sol @@ -3,26 +3,26 @@ pragma solidity ^0.5.0; import './openzeppelin-solidity/contracts/token/ERC20/IERC20.sol'; contract BasicBridge { - uint constant UPPER_BOUND = uint(-1); + uint32 constant UPPER_BOUND = 0xffffffff; - event EpochEnd(uint indexed epoch); - event EpochClose(uint indexed epoch); + event EpochEnd(uint16 indexed epoch); + event EpochClose(uint16 indexed epoch); event ForceSign(); - event NewEpoch(uint indexed oldEpoch, uint indexed newEpoch); - event NewEpochCancelled(uint indexed epoch); - event NewFundsTransfer(uint indexed oldEpoch, uint indexed newEpoch); - event EpochStart(uint indexed epoch, uint x, uint y); + event NewEpoch(uint16 indexed oldEpoch, uint16 indexed newEpoch); + event NewEpochCancelled(uint16 indexed epoch); + event NewFundsTransfer(uint16 indexed oldEpoch, uint16 indexed newEpoch); + event EpochStart(uint16 indexed epoch, uint x, uint y); struct State { address[] validators; - uint threshold; - uint rangeSize; - uint startBlock; - uint endBlock; - uint nonce; + uint32 startBlock; + uint32 endBlock; + uint32 nonce; + uint16 threshold; + uint16 rangeSize; + bool closeEpoch; uint x; uint y; - bool closeEpoch; } enum Status { @@ -33,15 +33,15 @@ contract BasicBridge { FUNDS_TRANSFER // funds transfer, cannot be cancelled } - mapping(uint => State) states; + mapping(uint16 => State) public states; Status public status; - uint public epoch; - uint public nextEpoch; + uint16 public epoch; + uint16 public nextEpoch; - uint minTxLimit; - uint maxTxLimit; + uint96 minTxLimit; + uint96 maxTxLimit; IERC20 public tokenContract; @@ -55,21 +55,11 @@ contract BasicBridge { _; } - modifier readyOrClosing { - require(status == Status.READY || status == Status.CLOSING_EPOCH, "Not in ready or closing epoch state"); - _; - } - modifier voting { require(status == Status.VOTING, "Not in voting state"); _; } - modifier readyOrVoting { - require(status == Status.READY || status == Status.VOTING, "Not in ready or voting state"); - _; - } - modifier keygen { require(status == Status.KEYGEN, "Not in keygen state"); _; @@ -80,60 +70,55 @@ contract BasicBridge { _; } - modifier currentValidator { - require(getPartyId() != 0, "Not a current validator"); - _; - } - - function getParties() view public returns (uint) { + function getParties() view public returns (uint16) { return getParties(epoch); } - function getNextParties() view public returns (uint) { + function getNextParties() view public returns (uint16) { return getParties(nextEpoch); } - function getParties(uint _epoch) view public returns (uint) { - return states[_epoch].validators.length; + function getParties(uint16 _epoch) view public returns (uint16) { + return uint16(states[_epoch].validators.length); } - function getThreshold() view public returns (uint) { + function getThreshold() view public returns (uint16) { return getThreshold(epoch); } - function getNextThreshold() view public returns (uint) { + function getNextThreshold() view public returns (uint16) { return getThreshold(nextEpoch); } - function getThreshold(uint _epoch) view public returns (uint) { + function getThreshold(uint16 _epoch) view public returns (uint16) { return states[_epoch].threshold; } - function getStartBlock() view public returns (uint) { + function getStartBlock() view public returns (uint32) { return getStartBlock(epoch); } - function getStartBlock(uint _epoch) view public returns (uint) { + function getStartBlock(uint16 _epoch) view public returns (uint32) { return states[_epoch].startBlock; } - function getRangeSize() view public returns (uint) { + function getRangeSize() view public returns (uint16) { return getRangeSize(epoch); } - function getNextRangeSize() view public returns (uint) { + function getNextRangeSize() view public returns (uint16) { return getRangeSize(nextEpoch); } - function getRangeSize(uint _epoch) view public returns (uint) { + function getRangeSize(uint16 _epoch) view public returns (uint16) { return states[_epoch].rangeSize; } - function getNonce() view public returns (uint) { + function getNonce() view public returns (uint32) { return getNonce(epoch); } - function getNonce(uint _epoch) view public returns (uint) { + function getNonce(uint16 _epoch) view public returns (uint32) { return states[_epoch].nonce; } @@ -153,24 +138,24 @@ contract BasicBridge { return getCloseEpoch(nextEpoch); } - function getCloseEpoch(uint _epoch) view public returns (bool) { + function getCloseEpoch(uint16 _epoch) view public returns (bool) { return states[_epoch].closeEpoch; } - function getPartyId() view public returns (uint) { + function getPartyId() view public returns (uint16) { address[] memory validators = getValidators(); for (uint i = 0; i < getParties(); i++) { if (validators[i] == msg.sender) - return i + 1; + return uint16(i + 1); } return 0; } - function getNextPartyId(address a) view public returns (uint) { + function getNextPartyId(address a) view public returns (uint16) { address[] memory validators = getNextValidators(); for (uint i = 0; i < getNextParties(); i++) { if (validators[i] == a) - return i + 1; + return uint16(i + 1); } return 0; } @@ -183,7 +168,7 @@ contract BasicBridge { return getValidators(nextEpoch); } - function getValidators(uint _epoch) view public returns (address[] memory) { + function getValidators(uint16 _epoch) view public returns (address[] memory) { return states[_epoch].validators; } } diff --git a/src/deploy/deploy-home/contracts/Bridge.sol b/src/deploy/deploy-home/contracts/Bridge.sol index 3b202b3..027d53f 100644 --- a/src/deploy/deploy-home/contracts/Bridge.sol +++ b/src/deploy/deploy-home/contracts/Bridge.sol @@ -4,16 +4,16 @@ import './openzeppelin-solidity/contracts/token/ERC20/IERC20.sol'; import "./MessageHandler.sol"; contract Bridge is MessageHandler { - event ExchangeRequest(uint value, uint nonce); + event ExchangeRequest(uint96 value, uint32 nonce); mapping(bytes32 => bool) usedExchangeRanges; constructor( - uint threshold, + uint16 threshold, address[] memory validators, address _tokenContract, - uint[2] memory limits, - uint rangeSize, + uint96[2] memory limits, + uint16 rangeSize, bool closeEpoch ) public { require(validators.length > 0); @@ -43,10 +43,10 @@ contract Bridge is MessageHandler { emit NewEpoch(0, 1); } - function exchange(uint value) public ready { + function exchange(uint96 value) public ready { require(value >= minTxLimit && value >= 10 ** 10 && value <= maxTxLimit); - uint txRange = (block.number - getStartBlock()) / getRangeSize(); + uint32 txRange = (uint32(block.number) - getStartBlock()) / uint32(getRangeSize()); if (!usedExchangeRanges[keccak256(abi.encodePacked(txRange, epoch))]) { usedExchangeRanges[keccak256(abi.encodePacked(txRange, epoch))] = true; states[epoch].nonce++; diff --git a/src/deploy/deploy-home/contracts/Government.sol b/src/deploy/deploy-home/contracts/Government.sol index 0696a3c..e7fdaf9 100644 --- a/src/deploy/deploy-home/contracts/Government.sol +++ b/src/deploy/deploy-home/contracts/Government.sol @@ -24,7 +24,7 @@ contract Government is BasicBridge { states[nextEpoch].nonce = UPPER_BOUND; if (nextEpoch == 1) { status = Status.READY; - states[nextEpoch].startBlock = block.number; + states[nextEpoch].startBlock = uint32(block.number); epoch = nextEpoch; emit EpochStart(epoch, x, y); } @@ -38,7 +38,7 @@ contract Government is BasicBridge { require(epoch > 0, "First epoch does not need funds transfer"); status = Status.READY; - states[nextEpoch].startBlock = block.number; + states[nextEpoch].startBlock = uint32(block.number); epoch = nextEpoch; emit EpochStart(epoch, getX(), getY()); } @@ -49,7 +49,7 @@ contract Government is BasicBridge { } function _startVoting() internal ready { - states[epoch].endBlock = block.number; + states[epoch].endBlock = uint32(block.number); nextEpoch++; states[nextEpoch].threshold = getThreshold(); states[nextEpoch].validators = getValidators(); @@ -76,23 +76,24 @@ contract Government is BasicBridge { function _removeValidator(address validator) internal voting { require(getNextPartyId(validator) != 0, "Already not a validator"); - for (uint i = 0; i < getNextParties() - 1; i++) { + uint16 lastPartyId = getNextParties() - 1; + for (uint i = 0; i < lastPartyId; i++) { if (states[nextEpoch].validators[i] == validator) { - states[nextEpoch].validators[i] = getNextValidators()[getNextParties() - 1]; + states[nextEpoch].validators[i] = getNextValidators()[lastPartyId]; break; } } - delete states[nextEpoch].validators[getNextParties() - 1]; + delete states[nextEpoch].validators[lastPartyId]; states[nextEpoch].validators.length--; } - function _changeThreshold(uint threshold) internal voting { + function _changeThreshold(uint16 threshold) internal voting { require(threshold > 0, "Invalid threshold value"); states[nextEpoch].threshold = threshold; } - function _changeRangeSize(uint rangeSize) internal voting { + function _changeRangeSize(uint16 rangeSize) internal voting { require(rangeSize > 0, "Invalid range size"); states[nextEpoch].rangeSize = rangeSize; @@ -116,7 +117,7 @@ contract Government is BasicBridge { emit NewEpochCancelled(nextEpoch); } - function _transfer(address to, uint value) internal { + function _transfer(address to, uint96 value) internal { if (tokenContract.balanceOf(address(this)) >= value) { tokenContract.transfer(to, value); } else { diff --git a/src/deploy/deploy-home/contracts/MessageDecoder.sol b/src/deploy/deploy-home/contracts/MessageDecoder.sol index 903a2b0..56e94b9 100644 --- a/src/deploy/deploy-home/contracts/MessageDecoder.sol +++ b/src/deploy/deploy-home/contracts/MessageDecoder.sol @@ -3,37 +3,37 @@ pragma solidity ^0.5.0; contract MessageDecoder { // [0] - action type - // [1..32] - epoch - // [33..] - payload - function _decodeNumber(bytes memory message) pure internal returns (uint a) { + // [1,2] - epoch + // [3..] - payload + function _decodeUint16(bytes memory message) pure internal returns (uint16 a) { assembly { - a := mload(add(message, 65)) + a := mload(add(message, 5)) } } function _decodeBoolean(bytes memory message) pure internal returns (bool a) { assembly { - a := and(mload(add(message, 34)), 1) + a := and(mload(add(message, 4)), 1) } } function _decodeAddress(bytes memory message) pure internal returns (address a) { assembly { - a := mload(add(message, 53)) + a := mload(add(message, 23)) } } function _decodeKeygen(bytes memory message) pure internal returns (uint a, uint b) { assembly { - a := mload(add(message, 65)) - b := mload(add(message, 97)) + a := mload(add(message, 35)) + b := mload(add(message, 67)) } } - function _decodeTransfer(bytes memory message) pure internal returns (address a, uint b) { + function _decodeTransfer(bytes memory message) pure internal returns (address a, uint96 b) { assembly { - a := mload(add(message, 85)) - b := mload(add(message, 117)) + a := mload(add(message, 55)) + b := mload(add(message, 67)) } } } diff --git a/src/deploy/deploy-home/contracts/MessageHandler.sol b/src/deploy/deploy-home/contracts/MessageHandler.sol index 3554ad9..0c691e6 100644 --- a/src/deploy/deploy-home/contracts/MessageHandler.sol +++ b/src/deploy/deploy-home/contracts/MessageHandler.sol @@ -9,7 +9,7 @@ contract MessageHandler is Government, MessageDecoder { mapping(bytes32 => bool) public handledMessages; function applyMessage(bytes memory message, bytes memory signatures) public { - (bytes32 msgHash, uint msgEpoch) = checkSignedMessage(message, signatures); + (bytes32 msgHash, uint16 msgEpoch) = checkSignedMessage(message, signatures); handledMessages[msgHash] = true; Action msgAction = Action(uint8(message[0])); @@ -23,77 +23,78 @@ contract MessageHandler is Government, MessageDecoder { } if (msgAction == Action.CONFIRM_KEYGEN) { - require(message.length == 97, "Incorrect message length"); + // [3,34] - x, [35,66] - y + require(message.length == 67, "Incorrect message length"); (uint x, uint y) = _decodeKeygen(message); _confirmKeygen(x, y); } else if (msgAction == Action.CONFIRM_FUNDS_TRANSFER) { - require(message.length == 33, "Incorrect message length"); + require(message.length == 3, "Incorrect message length"); _confirmFundsTransfer(); } else if (msgAction == Action.CONFIRM_CLOSE_EPOCH) { - require(message.length == 33, "Incorrect message length"); + require(message.length == 3, "Incorrect message length"); _confirmCloseEpoch(); } else if (msgAction == Action.VOTE_START_VOTING) { - require(message.length == 33, "Incorrect message length"); + require(message.length == 3, "Incorrect message length"); _startVoting(); } else if (msgAction == Action.VOTE_ADD_VALIDATOR) { - require(message.length == 53, "Incorrect message length"); + // [3,22] - address, [23,31] - extra data + require(message.length == 32, "Incorrect message length"); address validator = _decodeAddress(message); _addValidator(validator); } else if (msgAction == Action.VOTE_REMOVE_VALIDATOR) { - require(message.length == 53, "Incorrect message length"); + // [3,22] - address, [23,31] - extra data + require(message.length == 32, "Incorrect message length"); address validator = _decodeAddress(message); _removeValidator(validator); } else if (msgAction == Action.VOTE_CHANGE_THRESHOLD) { - require(message.length == 65, "Incorrect message length"); - uint threshold = _decodeNumber(message); + // [3,4] - threshold, [5,31] - extra data + require(message.length == 32, "Incorrect message length"); + uint16 threshold = _decodeUint16(message); _changeThreshold(threshold); } else if (msgAction == Action.VOTE_CHANGE_RANGE_SIZE) { - require(message.length == 65, "Incorrect message length"); - uint rangeSize = _decodeNumber(message); + // [3,4] - rangeSize, [5,31] - extra data + require(message.length == 32, "Incorrect message length"); + uint16 rangeSize = _decodeUint16(message); _changeRangeSize(rangeSize); } else if (msgAction == Action.VOTE_CHANGE_CLOSE_EPOCH) { - require(message.length == 34, "Incorrect message length"); + // [3] - closeEpoch, [4,31] - extra data + require(message.length == 32, "Incorrect message length"); bool closeEpoch = _decodeBoolean(message); _changeCloseEpoch(closeEpoch); } else if (msgAction == Action.VOTE_START_KEYGEN) { - require(message.length == 33, "Incorrect message length"); + require(message.length == 3, "Incorrect message length"); _startKeygen(); } else if (msgAction == Action.VOTE_CANCEL_KEYGEN) { - require(message.length == 33, "Incorrect message length"); + require(message.length == 3, "Incorrect message length"); _cancelKeygen(); } else if (msgAction == Action.TRANSFER) { - require(message.length == 117, "Incorrect message length"); - (address to, uint value) = _decodeTransfer(message); + // [3,34] - txHash, [35,54] - address, [55,66] - value + require(message.length == 67, "Incorrect message length"); + (address to, uint96 value) = _decodeTransfer(message); _transfer(to, value); } else { revert("Unknown message action"); } } - function checkSignedMessage(bytes memory message, bytes memory signatures) view public returns (bytes32, uint) { + function checkSignedMessage(bytes memory message, bytes memory signatures) view public returns (bytes32, uint16) { require(signatures.length % SIGNATURE_SIZE == 0, "Incorrect signatures length"); bytes32 msgHash; - if (message.length == 33) { - msgHash = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n33", message)); - } else if (message.length == 34) { - msgHash = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n34", message)); - } else if (message.length == 53) { - msgHash = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n53", message)); - } else if (message.length == 65) { - msgHash = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n65", message)); - } else if (message.length == 97) { - msgHash = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n97", message)); - } else if (message.length == 117) { - msgHash = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n117", message)); + if (message.length == 3) { + msgHash = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n3", message)); + } else if (message.length == 32) { + msgHash = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", message)); + } else if (message.length == 67) { + msgHash = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n67", message)); } else { revert("Incorrect message length"); } require(!handledMessages[msgHash], "Tx was already handled"); - uint msgEpoch; + uint16 msgEpoch; assembly { - msgEpoch := mload(add(message, 33)) + msgEpoch := mload(add(message, 3)) } require(msgEpoch <= nextEpoch, "Invalid epoch number"); diff --git a/src/deploy/deploy-side/contracts/SignedMessageStorage.sol b/src/deploy/deploy-side/contracts/SignedMessageStorage.sol index aeca9fd..a24dfd4 100644 --- a/src/deploy/deploy-side/contracts/SignedMessageStorage.sol +++ b/src/deploy/deploy-side/contracts/SignedMessageStorage.sol @@ -15,18 +15,12 @@ contract SignedMessageStorage { require(rsv.length == 65, "Incorrect signature length"); bytes32 msgHash; - if (message.length == 33) { - msgHash = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n33", message)); - } else if (message.length == 34) { - msgHash = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n34", message)); - } else if (message.length == 53) { - msgHash = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n53", message)); - } else if (message.length == 65) { - msgHash = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n65", message)); - } else if (message.length == 97) { - msgHash = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n97", message)); - } else if (message.length == 117) { - msgHash = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n117", message)); + if (message.length == 3) { + msgHash = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n3", message)); + } else if (message.length == 32) { + msgHash = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", message)); + } else if (message.length == 67) { + msgHash = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n67", message)); } else { revert("Incorrect message length"); } diff --git a/src/deploy/deploy-side/contracts/SignupStorage.sol b/src/deploy/deploy-side/contracts/SignupStorage.sol index 7fe62fd..911adf1 100644 --- a/src/deploy/deploy-side/contracts/SignupStorage.sol +++ b/src/deploy/deploy-side/contracts/SignupStorage.sol @@ -1,8 +1,8 @@ pragma solidity ^0.5.0; contract SignupStorage { - mapping(bytes32 => uint) public signupsCount; - mapping(bytes32 => mapping(address => uint)) public signups; + mapping(bytes32 => uint16) public signupsCount; + mapping(bytes32 => mapping(address => uint16)) public signups; function signup(bytes32 hash) public { require(signups[hash][msg.sender] == 0, "Already signuped"); @@ -14,12 +14,12 @@ contract SignupStorage { bytes32 hash, address[] memory validators, address validator - ) view public returns (uint) { + ) view public returns (uint16) { if (signups[hash][validator] == 0) return 0; - uint id = 1; + uint16 id = 1; for (uint i = 0; i < validators.length; i++) { - uint vid = signups[hash][validators[i]]; + uint16 vid = signups[hash][validators[i]]; if (vid > 0 && vid < signups[hash][validator]) id++; } @@ -29,7 +29,7 @@ contract SignupStorage { function getSignupAddress( bytes32 hash, address[] memory validators, - uint signupNumber + uint16 signupNumber ) view public returns (address) { for (uint i = 0; i < validators.length; i++) { if (getSignupNumber(hash, validators, validators[i]) == signupNumber) { diff --git a/src/ethereum-testnet/side-oracle/index.js b/src/ethereum-testnet/side-oracle/index.js index d77be3f..30632a3 100644 --- a/src/ethereum-testnet/side-oracle/index.js +++ b/src/ethereum-testnet/side-oracle/index.js @@ -7,8 +7,8 @@ const SIDE_MAX_FETCH_RANGE_SIZE = parseInt(process.env.SIDE_MAX_FETCH_RANGE_SIZE const bridgeAbi = [ 'function applyMessage(bytes message, bytes signatures)', - 'function getThreshold(uint epoch) view returns (uint)', - 'function getValidators(uint epoch) view returns (address[])' + 'function getThreshold(uint16 epoch) view returns (uint16)', + 'function getValidators(uint16 epoch) view returns (address[])' ] const sharedDbAbi = [ 'event NewMessage(bytes32 msgHash)', @@ -31,7 +31,7 @@ async function delay(ms) { async function handleNewMessage(event) { const { msgHash } = event.values const message = await sharedDb.signedMessages(msgHash) - const epoch = parseInt(message.slice(4, 68), 16) + const epoch = parseInt(message.slice(4, 8), 16) const [threshold, validators] = await Promise.all([ bridge.getThreshold(epoch), bridge.getValidators(epoch) @@ -49,7 +49,8 @@ async function handleNewMessage(event) { gasLimit: 1000000, nonce }) - await tx.wait() + const receipt = await tx.wait() + console.log(`Used gas: ${receipt.gasUsed.toNumber()}`) nonce += 1 break } @@ -89,7 +90,7 @@ async function loop() { for (let i = 0; i < bridgeEvents.length; i += 1) { const event = sharedDb.interface.parseLog(bridgeEvents[i]) - console.log('Consumed event', event, bridgeEvents[i]) + console.log('Consumed event', event) await handleNewMessage(event) } diff --git a/src/oracle/ethWatcher/ethWatcher.js b/src/oracle/ethWatcher/ethWatcher.js index 18f0491..e835852 100644 --- a/src/oracle/ethWatcher/ethWatcher.js +++ b/src/oracle/ethWatcher/ethWatcher.js @@ -15,17 +15,17 @@ const HOME_MAX_FETCH_RANGE_SIZE = parseInt(process.env.HOME_MAX_FETCH_RANGE_SIZE const provider = new ethers.providers.JsonRpcProvider(HOME_RPC_URL) const bridgeAbi = [ - 'event ExchangeRequest(uint value, uint nonce)', - 'event EpochEnd(uint indexed epoch)', - 'event NewEpoch(uint indexed oldEpoch, uint indexed newEpoch)', - 'event NewEpochCancelled(uint indexed epoch)', - 'event NewFundsTransfer(uint indexed oldEpoch, uint indexed newEpoch)', - 'event EpochStart(uint indexed epoch, uint x, uint y)', - 'event EpochClose(uint indexed epoch)', + 'event ExchangeRequest(uint96 value, uint32 nonce)', + 'event EpochEnd(uint16 indexed epoch)', + 'event NewEpoch(uint16 indexed oldEpoch, uint16 indexed newEpoch)', + 'event NewEpochCancelled(uint16 indexed epoch)', + 'event NewFundsTransfer(uint16 indexed oldEpoch, uint16 indexed newEpoch)', + 'event EpochStart(uint16 indexed epoch, uint256 x, uint256 y)', + 'event EpochClose(uint16 indexed epoch)', 'event ForceSign()', - 'function getThreshold(uint epoch) view returns (uint)', - 'function getParties(uint epoch) view returns (uint)', - 'function getRangeSize() view returns (uint)', + 'function getThreshold(uint16 epoch) view returns (uint16)', + 'function getParties(uint16 epoch) view returns (uint16)', + 'function getRangeSize() view returns (uint16)', 'function getValidators() view returns (address[])' ] const bridge = new ethers.Contract(HOME_BRIDGE_ADDRESS, bridgeAbi, provider) @@ -91,18 +91,18 @@ async function resetFutureMessages(queue) { } async function sendKeygen(event) { - const newEpoch = event.values.newEpoch.toNumber() + const { newEpoch } = event.values keygenQueue.send({ epoch: newEpoch, blockNumber, - threshold: (await bridge.getThreshold(newEpoch)).toNumber(), - parties: (await bridge.getParties(newEpoch)).toNumber() + threshold: await bridge.getThreshold(newEpoch), + parties: await bridge.getParties(newEpoch) }) logger.debug('Sent keygen start event') } function sendKeygenCancellation(event) { - const eventEpoch = event.values.epoch.toNumber() + const eventEpoch = event.values.epoch cancelKeygenQueue.send({ epoch: eventEpoch, blockNumber @@ -111,15 +111,14 @@ function sendKeygenCancellation(event) { } async function sendSignFundsTransfer(event) { - const newEpoch = event.values.newEpoch.toNumber() - const oldEpoch = event.values.oldEpoch.toNumber() + const { newEpoch, oldEpoch } = event.values signQueue.send({ epoch: oldEpoch, blockNumber, newEpoch, nonce: foreignNonce[oldEpoch], - threshold: (await bridge.getThreshold(oldEpoch)).toNumber(), - parties: (await bridge.getParties(oldEpoch)).toNumber() + threshold: await bridge.getThreshold(oldEpoch), + parties: await bridge.getParties(oldEpoch) }) logger.debug('Sent sign funds transfer event') foreignNonce[oldEpoch] += 1 @@ -150,7 +149,7 @@ async function sendSign(event, transactionHash) { y: publicKey.substr(68, 64) }), value: (new BN(event.values.value)).dividedBy(10 ** 18).toFixed(8, 3), - nonce: event.values.nonce.toNumber() + nonce: event.values.nonce } exchangeQueue.send(msgToQueue) @@ -166,18 +165,18 @@ async function sendStartSign() { epoch, blockNumber, nonce: foreignNonce[epoch], - threshold: (await bridge.getThreshold(epoch)).toNumber(), - parties: (await bridge.getParties(epoch)).toNumber() + threshold: await bridge.getThreshold(epoch), + parties: await bridge.getParties(epoch) }) foreignNonce[epoch] += 1 redisTx.incr(`foreignNonce${epoch}`) } async function processEpochStart(event) { - epoch = event.values.epoch.toNumber() + epoch = event.values.epoch epochStart = blockNumber logger.info(`Epoch ${epoch} started`) - rangeSize = (await bridge.getRangeSize()).toNumber() + rangeSize = await bridge.getRangeSize() isCurrentValidator = (await bridge.getValidators()).includes(validatorAddress) if (isCurrentValidator) { logger.info(`${validatorAddress} is a current validator`) @@ -194,8 +193,8 @@ async function sendEpochClose() { closeEpoch: epoch, blockNumber, nonce: foreignNonce[epoch], - threshold: (await bridge.getThreshold(epoch)).toNumber(), - parties: (await bridge.getParties(epoch)).toNumber() + threshold: await bridge.getThreshold(epoch), + parties: await bridge.getParties(epoch) }) foreignNonce[epoch] += 1 redisTx.incr(`foreignNonce${epoch}`) @@ -220,7 +219,7 @@ async function initialize() { topics: bridge.filters.EpochStart().topics })).map((log) => bridge.interface.parseLog(log)) - epoch = events.length ? events[events.length - 1].values.epoch.toNumber() : 0 + epoch = events.length ? events[events.length - 1].values.epoch : 0 logger.info(`Current epoch ${epoch}`) epochStart = events.length ? events[events.length - 1].blockNumber : 1 const saved = (parseInt(await redis.get('homeBlock'), 10) + 1) || parseInt(HOME_START_BLOCK, 10) @@ -237,7 +236,7 @@ async function initialize() { blockNumber = saved foreignNonce[epoch] = parseInt(await redis.get(`foreignNonce${epoch}`), 10) || 0 } - rangeSize = (await bridge.getRangeSize()).toNumber() + rangeSize = await bridge.getRangeSize() logger.debug(`Range size ${rangeSize}`) logger.debug('Checking if current validator') isCurrentValidator = (await bridge.getValidators()).includes(validatorAddress) diff --git a/src/oracle/proxy/contractsAbi.js b/src/oracle/proxy/contractsAbi.js index 609f911..6199fa1 100644 --- a/src/oracle/proxy/contractsAbi.js +++ b/src/oracle/proxy/contractsAbi.js @@ -2,38 +2,28 @@ const tokenAbi = [ 'function balanceOf(address account) view returns (uint256)' ] const bridgeAbi = [ - 'function getX() view returns (uint)', - 'function getY() view returns (uint)', - 'function epoch() view returns (uint)', - 'function getRangeSize() view returns (uint)', - 'function getNextRangeSize() view returns (uint)', - 'function getStartBlock() view returns (uint)', - 'function getNonce() view returns (uint)', - 'function nextEpoch() view returns (uint)', - 'function getThreshold() view returns (uint)', - 'function getNextThreshold() view returns (uint)', + 'function getX() view returns (uint256)', + 'function getY() view returns (uint256)', + 'function epoch() view returns (uint16)', + 'function getRangeSize() view returns (uint16)', + 'function getNextRangeSize() view returns (uint16)', + 'function getStartBlock() view returns (uint32)', + 'function getNonce() view returns (uint16)', + 'function nextEpoch() view returns (uint16)', + 'function getThreshold() view returns (uint16)', + 'function getNextThreshold() view returns (uint16)', 'function getValidators() view returns (address[])', 'function getNextValidators() view returns (address[])', 'function getCloseEpoch() view returns (bool)', 'function getNextCloseEpoch() view returns (bool)', - 'function status() view returns (uint)', - 'function votesCount(bytes32) view returns (uint)', - 'function getNextPartyId(address a) view returns (uint)', - 'function confirmKeygen(uint x, uint y)', - 'function confirmFundsTransfer()', - 'function confirmCloseEpoch()', - 'function startVoting()', - 'function voteStartKeygen()', - 'function voteCancelKeygen()', - 'function voteAddValidator(address validator)', - 'function voteRemoveValidator(address validator)', - 'function voteChangeThreshold(uint threshold)', - 'function voteChangeCloseEpoch(bool closeEpoch)' + 'function status() view returns (uint8)', + 'function votesCount(bytes32) view returns (uint16)', + 'function getNextPartyId(address a) view returns (uint16)' ] const sharedDbAbi = [ - 'function getSignupAddress(bytes32 hash, address[] validators, uint signupNumber) view returns (address)', + 'function getSignupAddress(bytes32 hash, address[] validators, uint16 signupNumber) view returns (address)', 'function getData(address from, bytes32 hash, bytes32 key) view returns (bytes)', - 'function getSignupNumber(bytes32 hash, address[] validators, address validator) view returns (uint)', + 'function getSignupNumber(bytes32 hash, address[] validators, address validator) view returns (uint16)', 'function setData(bytes32 hash, bytes32 key, bytes data)', 'function signup(bytes32 hash)', 'function addSignature(bytes message, bytes rsv)', diff --git a/src/oracle/proxy/index.js b/src/oracle/proxy/index.js index a529a10..ea68158 100644 --- a/src/oracle/proxy/index.js +++ b/src/oracle/proxy/index.js @@ -6,7 +6,7 @@ const ethers = require('ethers') const { tokenAbi, bridgeAbi, sharedDbAbi } = require('./contractsAbi') const { - Ok, Err, decodeStatus, boundX + Ok, Err, decodeStatus } = require('./utils') const encode = require('./encode') const decode = require('./decode') @@ -128,8 +128,8 @@ async function set(req, res) { async function signupKeygen(req, res) { logger.debug('SignupKeygen call') - const epoch = (await bridge.nextEpoch()).toNumber() - const partyId = (await bridge.getNextPartyId(validatorAddress)).toNumber() + const epoch = await bridge.nextEpoch() + const partyId = await bridge.getNextPartyId(validatorAddress) if (partyId === 0) { res.send(Err({ message: 'Not a validator' })) @@ -161,7 +161,7 @@ async function signupSign(req, res) { } const validators = await bridge.getValidators() - const id = (await sharedDb.getSignupNumber(hash, validators, validatorAddress)).toNumber() + const id = await sharedDb.getSignupNumber(hash, validators, validatorAddress) res.send(Ok({ uuid: hash, @@ -176,9 +176,9 @@ function encodeParam(param) { if (param.startsWith('0x')) { return Buffer.from(param.slice(2), 'hex') } - return Buffer.from(padZeros(param, 64), 'hex') + return Buffer.from(param, 'hex') case 'number': - return Buffer.from(padZeros(new BN(param).toString(16), 64), 'hex') + return Buffer.from(padZeros(param.toString(16), 4), 'hex') case 'boolean': return Buffer.from([param ? 1 : 0]) default: @@ -204,7 +204,7 @@ async function processMessage(message) { async function confirmKeygen(req, res) { logger.debug('Confirm keygen call') const { x, y, epoch } = req.body - const message = buildMessage(Action.CONFIRM_KEYGEN, epoch, x, y) + const message = buildMessage(Action.CONFIRM_KEYGEN, epoch, padZeros(x, 64), padZeros(y, 64)) await processMessage(message) res.send() logger.debug('Confirm keygen end') @@ -230,7 +230,7 @@ async function confirmCloseEpoch(req, res) { async function voteStartVoting(req, res) { logger.info('Voting for starting new epoch voting process') - const epoch = boundX(await bridge.epoch()) + const epoch = await bridge.epoch() const message = buildMessage(Action.VOTE_START_VOTING, epoch) await processMessage(message) res.send('Voted\n') @@ -239,7 +239,7 @@ async function voteStartVoting(req, res) { async function voteStartKeygen(req, res) { logger.info('Voting for starting new epoch keygen') - const epoch = boundX(await bridge.epoch()) + const epoch = await bridge.epoch() const message = buildMessage(Action.VOTE_START_KEYGEN, epoch) await processMessage(message) res.send('Voted\n') @@ -248,7 +248,7 @@ async function voteStartKeygen(req, res) { async function voteCancelKeygen(req, res) { logger.info('Voting for cancelling new epoch keygen') - const epoch = boundX(await bridge.nextEpoch()) + const epoch = await bridge.nextEpoch() const message = buildMessage(Action.VOTE_CANCEL_KEYGEN, epoch) await processMessage(message) res.send('Voted\n') @@ -258,8 +258,8 @@ async function voteCancelKeygen(req, res) { async function voteAddValidator(req, res) { if (ethers.utils.isHexString(req.params.validator, 20)) { logger.info('Voting for adding new validator') - const epoch = boundX(await bridge.epoch()) - const message = buildMessage(Action.VOTE_ADD_VALIDATOR, epoch, req.params.validator) + const epoch = await bridge.epoch() + const message = buildMessage(Action.VOTE_ADD_VALIDATOR, epoch, req.params.validator, padZeros('', 18)) await processMessage(message) res.send('Voted\n') logger.info('Voted successfully') @@ -269,12 +269,8 @@ async function voteAddValidator(req, res) { async function voteChangeThreshold(req, res) { if (/^[0-9]+$/.test(req.params.threshold)) { logger.info('Voting for changing threshold') - const epoch = boundX(await bridge.epoch()) - const message = buildMessage( - Action.VOTE_CHANGE_THRESHOLD, - epoch, - parseInt(req.params.threshold, 10) - ) + const epoch = await bridge.epoch() + const message = buildMessage(Action.VOTE_CHANGE_THRESHOLD, epoch, parseInt(req.params.threshold, 10), padZeros('', 54)) await processMessage(message) res.send('Voted\n') logger.info('Voted successfully') @@ -284,8 +280,8 @@ async function voteChangeThreshold(req, res) { async function voteChangeCloseEpoch(req, res) { if (req.params.closeEpoch === 'true' || req.params.closeEpoch === 'false') { logger.info('Voting for changing close epoch') - const epoch = boundX(await bridge.epoch()) - const message = buildMessage(Action.VOTE_CHANGE_CLOSE_EPOCH, epoch, req.params.closeEpoch === 'true') + const epoch = await bridge.epoch() + const message = buildMessage(Action.VOTE_CHANGE_CLOSE_EPOCH, epoch, req.params.closeEpoch === 'true', padZeros('', 56)) await processMessage(message) res.send('Voted\n') logger.info('Voted successfully') @@ -295,8 +291,8 @@ async function voteChangeCloseEpoch(req, res) { async function voteRemoveValidator(req, res) { if (ethers.utils.isHexString(req.params.validator, 20)) { logger.info('Voting for removing validator') - const epoch = boundX(await bridge.epoch()) - const message = buildMessage(Action.VOTE_REMOVE_VALIDATOR, epoch, req.params.validator) + const epoch = await bridge.epoch() + const message = buildMessage(Action.VOTE_REMOVE_VALIDATOR, epoch, req.params.validator, padZeros('', 18)) await processMessage(message) res.send('Voted\n') logger.info('Voted successfully') @@ -310,7 +306,7 @@ async function transfer(req, res) { } = req.body if (ethers.utils.isHexString(to, 20)) { logger.info(`Calling transfer to ${to}, 0x${value} tokens`) - const message = buildMessage(Action.TRANSFER, epoch, hash, to, value) + const message = buildMessage(Action.TRANSFER, epoch, hash, to, padZeros(value, 24)) logger.info(`Message for sign: ${message.toString('hex')}`) await processMessage(message) } @@ -339,19 +335,19 @@ async function info(req, res) { ] = await Promise.all([ bridge.getX().then((value) => new BN(value).toString(16)), bridge.getY().then((value) => new BN(value).toString(16)), - bridge.epoch().then(boundX), - bridge.getRangeSize().then(boundX), - bridge.getNextRangeSize().then(boundX), + bridge.epoch(), + bridge.getRangeSize(), + bridge.getNextRangeSize(), bridge.getCloseEpoch(), bridge.getNextCloseEpoch(), - bridge.getStartBlock().then(boundX), - bridge.getNonce().then(boundX), - bridge.nextEpoch().then(boundX), - bridge.getThreshold().then(boundX), - bridge.getNextThreshold().then(boundX), + bridge.getStartBlock(), + bridge.getNonce(), + bridge.nextEpoch(), + bridge.getThreshold(), + bridge.getNextThreshold(), bridge.getValidators(), bridge.getNextValidators(), - bridge.status().then(boundX), + bridge.status(), token.balanceOf(HOME_BRIDGE_ADDRESS) .then((value) => parseFloat(new BN(value).dividedBy(10 ** 18).toFixed(8, 3))) ]) diff --git a/src/oracle/proxy/utils.js b/src/oracle/proxy/utils.js index 9bbdb58..2ae74d1 100644 --- a/src/oracle/proxy/utils.js +++ b/src/oracle/proxy/utils.js @@ -23,17 +23,8 @@ function decodeStatus(status) { } } -function boundX(x) { - try { - return x.toNumber() - } catch (e) { - return -1 - } -} - module.exports = { Ok, Err, - decodeStatus, - boundX + decodeStatus } diff --git a/src/test-services/ethereumSend/testEthereumSend.js b/src/test-services/ethereumSend/testEthereumSend.js index 76f0468..7d3397d 100644 --- a/src/test-services/ethereumSend/testEthereumSend.js +++ b/src/test-services/ethereumSend/testEthereumSend.js @@ -9,7 +9,7 @@ const tokenAbi = [ 'function approve(address to, uint256 value)' ] const bridgeAbi = [ - 'function exchange(uint value)' + 'function exchange(uint96 value)' ] const PRIVATE_KEY = process.env.PRIVATE_KEY || HOME_PRIVATE_KEY diff --git a/tests/test/utils/homeContracts.js b/tests/test/utils/homeContracts.js index 6912273..b753e47 100644 --- a/tests/test/utils/homeContracts.js +++ b/tests/test/utils/homeContracts.js @@ -9,7 +9,7 @@ const abiToken = [ 'function allowance(address owner, address spender) view returns (uint)' ] const abiBridge = [ - 'function exchange(uint value)' + 'function exchange(uint96 value)' ] const provider = new ethers.providers.JsonRpcProvider(HOME_RPC_URL) From 56b59fdfd3faecf49859d88dbd01a28592318d86 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Mon, 25 Nov 2019 15:30:35 +0300 Subject: [PATCH 120/129] Extra data query parameter for some of the votes --- src/oracle/proxy/index.js | 36 ++++++++++++++++++++++++++++++++---- tests/run.sh | 2 +- 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/src/oracle/proxy/index.js b/src/oracle/proxy/index.js index ea68158..da4231c 100644 --- a/src/oracle/proxy/index.js +++ b/src/oracle/proxy/index.js @@ -259,7 +259,12 @@ async function voteAddValidator(req, res) { if (ethers.utils.isHexString(req.params.validator, 20)) { logger.info('Voting for adding new validator') const epoch = await bridge.epoch() - const message = buildMessage(Action.VOTE_ADD_VALIDATOR, epoch, req.params.validator, padZeros('', 18)) + const message = buildMessage( + Action.VOTE_ADD_VALIDATOR, + epoch, + req.params.validator, + padZeros(req.attempt, 18) + ) await processMessage(message) res.send('Voted\n') logger.info('Voted successfully') @@ -270,7 +275,12 @@ async function voteChangeThreshold(req, res) { if (/^[0-9]+$/.test(req.params.threshold)) { logger.info('Voting for changing threshold') const epoch = await bridge.epoch() - const message = buildMessage(Action.VOTE_CHANGE_THRESHOLD, epoch, parseInt(req.params.threshold, 10), padZeros('', 54)) + const message = buildMessage( + Action.VOTE_CHANGE_THRESHOLD, + epoch, + parseInt(req.params.threshold, 10), + padZeros(req.attempt, 54) + ) await processMessage(message) res.send('Voted\n') logger.info('Voted successfully') @@ -281,7 +291,12 @@ async function voteChangeCloseEpoch(req, res) { if (req.params.closeEpoch === 'true' || req.params.closeEpoch === 'false') { logger.info('Voting for changing close epoch') const epoch = await bridge.epoch() - const message = buildMessage(Action.VOTE_CHANGE_CLOSE_EPOCH, epoch, req.params.closeEpoch === 'true', padZeros('', 56)) + const message = buildMessage( + Action.VOTE_CHANGE_CLOSE_EPOCH, + epoch, + req.params.closeEpoch === 'true', + padZeros(req.attempt, 56) + ) await processMessage(message) res.send('Voted\n') logger.info('Voted successfully') @@ -292,7 +307,12 @@ async function voteRemoveValidator(req, res) { if (ethers.utils.isHexString(req.params.validator, 20)) { logger.info('Voting for removing validator') const epoch = await bridge.epoch() - const message = buildMessage(Action.VOTE_REMOVE_VALIDATOR, epoch, req.params.validator, padZeros('', 18)) + const message = buildMessage( + Action.VOTE_REMOVE_VALIDATOR, + epoch, + req.params.validator, + padZeros(req.attempt, 18) + ) await processMessage(message) res.send('Voted\n') logger.info('Voted successfully') @@ -407,6 +427,14 @@ votesProxyApp.get('/vote/changeThreshold/:threshold', voteChangeThreshold) votesProxyApp.get('/vote/changeCloseEpoch/:closeEpoch', voteChangeCloseEpoch) votesProxyApp.get('/info', info) +votesProxyApp.use('/vote', (req, res, next) => { + if (/^[0-9]*$/.test(req.query.attempt)) { + req.attempt = req.query.attempt ? parseInt(req.query.attempt, 10).toString(16) : '0' + logger.debug(`Vote attempt 0x${req.attempt}`) + next() + } +}) + async function main() { sideValidatorNonce = await sideWallet.getTransactionCount() diff --git a/tests/run.sh b/tests/run.sh index 35799b7..23b28be 100755 --- a/tests/run.sh +++ b/tests/run.sh @@ -25,5 +25,5 @@ docker cp "tests:/tests/results.xml" "./tests/results.xml" > /dev/null 2>&1 || t echo "Killing all remaining docker containers" docker kill $(docker ps | grep validator[1-3]_ | awk '{print $1}') > /dev/null 2>&1 || true -docker kill ganache_home ganache_side > /dev/null 2>&1 || true +docker kill $(docker ps | grep ethereum-testnet_ | awk '{print $1}') > /dev/null 2>&1 || true docker kill $(docker ps | grep binance-testnet_ | awk '{print $1}') > /dev/null 2>&1 || true From 799004c159bd066c72d9963e6f9e06fd7f775d35 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Mon, 25 Nov 2019 15:34:19 +0300 Subject: [PATCH 121/129] Explicit epoch in contract calls --- src/oracle/ethWatcher/ethWatcher.js | 12 ++++++------ src/oracle/proxy/index.js | 21 +++++++++++++-------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/src/oracle/ethWatcher/ethWatcher.js b/src/oracle/ethWatcher/ethWatcher.js index e835852..1e71fc5 100644 --- a/src/oracle/ethWatcher/ethWatcher.js +++ b/src/oracle/ethWatcher/ethWatcher.js @@ -25,8 +25,8 @@ const bridgeAbi = [ 'event ForceSign()', 'function getThreshold(uint16 epoch) view returns (uint16)', 'function getParties(uint16 epoch) view returns (uint16)', - 'function getRangeSize() view returns (uint16)', - 'function getValidators() view returns (address[])' + 'function getRangeSize(uint16 epoch) view returns (uint16)', + 'function getValidators(uint16 epoch) view returns (address[])' ] const bridge = new ethers.Contract(HOME_BRIDGE_ADDRESS, bridgeAbi, provider) const validatorAddress = ethers.utils.computeAddress(`0x${VALIDATOR_PRIVATE_KEY}`) @@ -176,8 +176,8 @@ async function processEpochStart(event) { epoch = event.values.epoch epochStart = blockNumber logger.info(`Epoch ${epoch} started`) - rangeSize = await bridge.getRangeSize() - isCurrentValidator = (await bridge.getValidators()).includes(validatorAddress) + rangeSize = await bridge.getRangeSize(epoch) + isCurrentValidator = (await bridge.getValidators(epoch)).includes(validatorAddress) if (isCurrentValidator) { logger.info(`${validatorAddress} is a current validator`) } else { @@ -236,10 +236,10 @@ async function initialize() { blockNumber = saved foreignNonce[epoch] = parseInt(await redis.get(`foreignNonce${epoch}`), 10) || 0 } - rangeSize = await bridge.getRangeSize() + rangeSize = await bridge.getRangeSize(epoch) logger.debug(`Range size ${rangeSize}`) logger.debug('Checking if current validator') - isCurrentValidator = (await bridge.getValidators()).includes(validatorAddress) + isCurrentValidator = (await bridge.getValidators(epoch)).includes(validatorAddress) if (isCurrentValidator) { logger.info(`${validatorAddress} is a current validator`) } else { diff --git a/src/oracle/proxy/index.js b/src/oracle/proxy/index.js index da4231c..f7da425 100644 --- a/src/oracle/proxy/index.js +++ b/src/oracle/proxy/index.js @@ -421,20 +421,25 @@ app.post('/transfer', transfer) votesProxyApp.get('/vote/startVoting', voteStartVoting) votesProxyApp.get('/vote/startKeygen', voteStartKeygen) votesProxyApp.get('/vote/cancelKeygen', voteCancelKeygen) + +votesProxyApp.use('/vote', (req, res, next) => { + if (/^[0-9]+$/.test(req.query.attempt)) { + req.attempt = parseInt(req.query.attempt, 10).toString(16) + logger.debug(`Vote attempt 0x${req.attempt}`) + next() + } else if (!req.query.attempt) { + req.attempt = '0' + logger.debug('Vote attempt 0x00') + next() + } +}) + votesProxyApp.get('/vote/addValidator/:validator', voteAddValidator) votesProxyApp.get('/vote/removeValidator/:validator', voteRemoveValidator) votesProxyApp.get('/vote/changeThreshold/:threshold', voteChangeThreshold) votesProxyApp.get('/vote/changeCloseEpoch/:closeEpoch', voteChangeCloseEpoch) votesProxyApp.get('/info', info) -votesProxyApp.use('/vote', (req, res, next) => { - if (/^[0-9]*$/.test(req.query.attempt)) { - req.attempt = req.query.attempt ? parseInt(req.query.attempt, 10).toString(16) : '0' - logger.debug(`Vote attempt 0x${req.attempt}`) - next() - } -}) - async function main() { sideValidatorNonce = await sideWallet.getTransactionCount() From fd549fe6ab07a32d3d7df91f649c76fa7e4b1cb9 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Mon, 25 Nov 2019 17:25:53 +0300 Subject: [PATCH 122/129] Refactored signer and keygen clients --- src/oracle/tss-keygen/keygen.js | 73 +++++---- src/oracle/tss-sign/signer.js | 262 ++++++++++++++++---------------- 2 files changed, 167 insertions(+), 168 deletions(-) diff --git a/src/oracle/tss-keygen/keygen.js b/src/oracle/tss-keygen/keygen.js index 4504b4c..256eded 100644 --- a/src/oracle/tss-keygen/keygen.js +++ b/src/oracle/tss-keygen/keygen.js @@ -14,6 +14,7 @@ const app = express() const proxyClient = axios.create({ baseURL: PROXY_URL }) +let channel let currentKeygenEpoch = null let ready = false @@ -25,8 +26,45 @@ async function confirmKeygen({ x, y }, epoch) { }) } +function writeParams(parties, threshold) { + logger.debug('Writing params') + fs.writeFileSync('./params', JSON.stringify({ + parties: parties.toString(), + threshold: (threshold - 1).toString() + })) +} + +async function keygenConsumer(msg) { + const { epoch, parties, threshold } = JSON.parse(msg.content) + logger.info(`Consumed new epoch event, starting keygen for epoch ${epoch}`) + + const keysFile = `/keys/keys${epoch}.store` + + logger.info('Running ./keygen-entrypoint.sh') + currentKeygenEpoch = epoch + + writeParams(parties, threshold) + const cmd = exec.execFile('./keygen-entrypoint.sh', [PROXY_URL, keysFile], async () => { + currentKeygenEpoch = null + if (fs.existsSync(keysFile)) { + logger.info(`Finished keygen for epoch ${epoch}`) + const publicKey = JSON.parse(fs.readFileSync(keysFile))[5] + logger.warn(`Generated multisig account in binance chain: ${publicKeyToAddress(publicKey)}`) + + logger.info('Sending keys confirmation') + await confirmKeygen(publicKey, epoch) + } else { + logger.warn(`Keygen for epoch ${epoch} failed`) + } + logger.debug('Ack for keygen message') + channel.ack(msg) + }) + cmd.stdout.on('data', (data) => logger.debug(data.toString())) + cmd.stderr.on('data', (data) => logger.debug(data.toString())) +} + async function main() { - const channel = await connectRabbit(RABBITMQ_URL) + channel = await connectRabbit(RABBITMQ_URL) logger.info('Connecting to epoch events queue') const keygenQueue = await assertQueue(channel, 'keygenQueue') const cancelKeygenQueue = await assertQueue(channel, 'cancelKeygenQueue') @@ -36,38 +74,7 @@ async function main() { } channel.prefetch(1) - keygenQueue.consume((msg) => { - const { epoch, parties, threshold } = JSON.parse(msg.content) - logger.info(`Consumed new epoch event, starting keygen for epoch ${epoch}`) - - const keysFile = `/keys/keys${epoch}.store` - - logger.info('Running ./keygen-entrypoint.sh') - currentKeygenEpoch = epoch - - logger.debug('Writing params') - fs.writeFileSync('./params', JSON.stringify({ - parties: parties.toString(), - threshold: (threshold - 1).toString() - })) - const cmd = exec.execFile('./keygen-entrypoint.sh', [PROXY_URL, keysFile], async () => { - currentKeygenEpoch = null - if (fs.existsSync(keysFile)) { - logger.info(`Finished keygen for epoch ${epoch}`) - const publicKey = JSON.parse(fs.readFileSync(keysFile))[5] - logger.warn(`Generated multisig account in binance chain: ${publicKeyToAddress(publicKey)}`) - - logger.info('Sending keys confirmation') - await confirmKeygen(publicKey, epoch) - } else { - logger.warn(`Keygen for epoch ${epoch} failed`) - } - logger.debug('Ack for keygen message') - channel.ack(msg) - }) - cmd.stdout.on('data', (data) => logger.debug(data.toString())) - cmd.stderr.on('data', (data) => logger.debug(data.toString())) - }) + keygenQueue.consume(keygenConsumer) cancelKeygenQueue.consume(async (msg) => { const { epoch } = JSON.parse(msg.content) diff --git a/src/oracle/tss-sign/signer.js b/src/oracle/tss-sign/signer.js index 94e0b0a..1e8ae81 100644 --- a/src/oracle/tss-sign/signer.js +++ b/src/oracle/tss-sign/signer.js @@ -27,7 +27,6 @@ const SIGN_OK = 0 const SIGN_NONCE_INTERRUPT = 1 const SIGN_FAILED = 2 -let attempt let nextAttempt = null let cancelled let ready = false @@ -102,7 +101,8 @@ async function getAccount(address) { async function getFee() { logger.info('Getting fees') const response = await retry(() => httpClient.get('/api/v1/fees')) - return response.data.filter((fee) => fee.multi_transfer_fee)[0].multi_transfer_fee * 2 + const multiTransferFee = response.data.find((fee) => fee.multi_transfer_fee).multi_transfer_fee + return new BN(multiTransferFee * 2).div(10 ** 8) } async function waitForAccountNonce(address, nonce) { @@ -145,10 +145,14 @@ async function sendTx(tx) { } } -function sign(keysFile, hash, tx, publicKey, signerAddress) { +function sign(keysFile, tx, publicKey, signerAddress) { let restartTimeoutId let nonceDaemonIntervalId let nonceInterrupt = false + + const hash = sha256(tx.getSignBytes()) + logger.info(`Starting signature generation for transaction hash ${hash}`) + return new Promise((resolve) => { const cmd = exec.execFile('./sign-entrypoint.sh', [PROXY_URL, keysFile, hash], async (error) => { logger.trace('Sign entrypoint exited, %o', error) @@ -215,6 +219,125 @@ function sign(keysFile, hash, tx, publicKey, signerAddress) { }) } +function getAccountBalance(account, asset) { + return account.balances.find((token) => token.symbol === asset).free +} + +async function buildTx(from, account, data, txAttempt) { + const { closeEpoch, newEpoch, nonce } = data + + const txOptions = { + from, + accountNumber: account.account_number, + sequence: nonce, + asset: FOREIGN_ASSET, + memo: `Attempt ${txAttempt}` + } + let exchanges + + if (closeEpoch) { + logger.info(`Building corresponding account flags transaction, nonce ${nonce}`) + + txOptions.flags = 0x01 + } else if (newEpoch) { + const newKeysFile = `/keys/keys${newEpoch}.store` + const to = getAccountFromFile(newKeysFile).address + + if (to === '') { + return { tx: null } + } + + logger.info(`Building corresponding transaction for transferring all funds, nonce ${nonce}, recipient ${to}`) + const fee = await getFee() + + txOptions.recipients = [{ + to, + tokens: getAccountBalance(account, FOREIGN_ASSET), + bnbs: new BN(getAccountBalance(account, 'BNB')).minus(fee) + }] + } else { + logger.info(`Building corresponding transfer transaction, nonce ${nonce}`) + exchanges = await getExchangeMessages(nonce) + const exchangesData = exchanges.map((exchangeMsg) => JSON.parse(exchangeMsg.content)) + + txOptions.recipients = exchangesData.map(({ value, recipient }) => ({ + to: recipient, + tokens: value + })) + } + + const tx = new Transaction(txOptions) + + return { + tx, + exchanges + } +} + +function writeParams(parties, threshold) { + logger.debug('Writing params') + fs.writeFileSync('./params', JSON.stringify({ + parties: parties.toString(), + threshold: (threshold - 1).toString() + })) +} + +async function consumer(msg) { + const data = JSON.parse(msg.content) + + logger.info('Consumed sign event: %o', data) + const { + nonce, epoch, newEpoch, parties, threshold, closeEpoch + } = data + + const keysFile = `/keys/keys${epoch || closeEpoch}.store` + const { address: from, publicKey } = getAccountFromFile(keysFile) + if (from === '') { + logger.info('No keys found, acking message') + channel.ack(msg) + return + } + const account = await getAccount(from) + + if (nonce > account.sequence) { + logger.debug('Tx has been already sent') + logger.info('Acking message (skipped nonce)') + channel.ack(msg) + return + } + + writeParams(parties, threshold) + let attempt = 1 + + const { tx, exchanges } = buildTx(from, account, data, attempt) + + while (tx !== null) { + const signResult = await sign(keysFile, tx, publicKey, from) + + if (signResult === SIGN_OK || signResult === SIGN_NONCE_INTERRUPT) { + if (closeEpoch) { + await confirmCloseEpoch(closeEpoch) + } else if (newEpoch) { + await confirmFundsTransfer(epoch) + } else { + // eslint-disable-next-line no-loop-func + exchanges.forEach((exchangeMsg) => channel.ack(exchangeMsg)) + } + break + } + + // signer either failed, or timed out after parties signup + attempt = nextAttempt || attempt + 1 + nextAttempt = null + logger.warn(`Sign failed, starting next attempt ${attempt}`) + tx.tx.memo = `Attempt ${attempt}` + await delay(1000) + } + logger.info('Acking message') + channel.ack(msg) +} + + async function main() { channel = await connectRabbit(RABBITMQ_URL) logger.info('Connecting to signature events queue') @@ -226,138 +349,7 @@ async function main() { } channel.prefetch(1) - signQueue.consume(async (msg) => { - const data = JSON.parse(msg.content) - - logger.info('Consumed sign event: %o', data) - const { - nonce, epoch, newEpoch, parties, threshold, closeEpoch - } = data - - const keysFile = `/keys/keys${epoch || closeEpoch}.store` - const { address: from, publicKey } = getAccountFromFile(keysFile) - if (from === '') { - logger.info('No keys found, acking message') - channel.ack(msg) - return - } - const account = await getAccount(from) - - logger.debug('Writing params') - fs.writeFileSync('./params', JSON.stringify({ - parties: parties.toString(), - threshold: (threshold - 1).toString() - })) - - attempt = 1 - - if (closeEpoch) { - while (true) { - logger.info(`Building corresponding account flags transaction, nonce ${nonce}`) - - const tx = new Transaction({ - from, - accountNumber: account.account_number, - sequence: nonce, - flags: 0x01, - memo: `Attempt ${attempt}` - }) - - const hash = sha256(tx.getSignBytes()) - logger.info(`Starting signature generation for transaction hash ${hash}`) - const signResult = await sign(keysFile, hash, tx, publicKey, from) - - if (signResult === SIGN_OK || signResult === SIGN_NONCE_INTERRUPT) { - await confirmCloseEpoch(closeEpoch) - break - } - - // signer either failed, or timed out after parties signup - attempt = nextAttempt || attempt + 1 - nextAttempt = null - logger.warn(`Sign failed, starting next attempt ${attempt}`) - await delay(1000) - } - } else if (!newEpoch) { - const exchanges = await getExchangeMessages(nonce) - const exchangesData = exchanges.map((exchangeMsg) => JSON.parse(exchangeMsg.content)) - - if (exchanges.length > 0 && account.sequence <= nonce) { - const recipients = exchangesData.map(({ value, recipient }) => ({ - to: recipient, - tokens: value - })) - - while (true) { - logger.info(`Building corresponding transfer transaction, nonce ${nonce}`) - - const tx = new Transaction({ - from, - accountNumber: account.account_number, - sequence: nonce, - recipients, - asset: FOREIGN_ASSET, - memo: `Attempt ${attempt}` - }) - - const hash = sha256(tx.getSignBytes()) - logger.info(`Starting signature generation for transaction hash ${hash}`) - const signResult = await sign(keysFile, hash, tx, publicKey, from) - - if (signResult === SIGN_OK || signResult === SIGN_NONCE_INTERRUPT) { - // eslint-disable-next-line no-loop-func - exchanges.forEach((exchangeMsg) => channel.ack(exchangeMsg)) - break - } - - // signer either failed, or timed out after parties signup - attempt = nextAttempt || attempt + 1 - nextAttempt = null - logger.warn(`Sign failed, starting next attempt ${attempt}`) - await delay(1000) - } - } - } else if (account.sequence <= nonce) { - const newKeysFile = `/keys/keys${newEpoch}.store` - const { address: to } = getAccountFromFile(newKeysFile) - - while (to !== '') { - logger.info(`Building corresponding transaction for transferring all funds, nonce ${nonce}, recipient ${to}`) - const fee = await getFee() - const tx = new Transaction({ - from, - accountNumber: account.account_number, - sequence: nonce, - recipients: [{ - to, - tokens: account.balances.find((token) => token.symbol === FOREIGN_ASSET).free, - bnbs: new BN(account.balances.find((token) => token.symbol === 'BNB').free).minus(new BN(fee).div(10 ** 8)) - }], - asset: FOREIGN_ASSET, - memo: `Attempt ${attempt}` - }) - - const hash = sha256(tx.getSignBytes()) - logger.info(`Starting signature generation for transaction hash ${hash}`) - const signResult = await sign(keysFile, hash, tx, publicKey, from) - - if (signResult === SIGN_OK || signResult === SIGN_NONCE_INTERRUPT) { - await confirmFundsTransfer(epoch) - break - } - - // signer either failed, or timed out after parties signup - attempt = nextAttempt || attempt + 1 - nextAttempt = null - logger.warn(`Sign failed, starting next attempt ${attempt}`) - await delay(1000) - } - } else { - logger.debug('Tx has been already sent') - } - logger.info('Acking message') - channel.ack(msg) - }) + signQueue.consume(consumer) } app.get('/restart/:attempt', restart) From dc5b415b9718ea08ec8d9ffe06878ff366c1339d Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Mon, 25 Nov 2019 17:32:31 +0300 Subject: [PATCH 123/129] Updated configs --- .circleci/config.yml | 7 ++++--- DEMO.md | 2 +- src/ethereum-testnet/docker-compose.yml | 2 +- src/oracle/tss-sign/signer.js | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 18daaeb..41ffaa4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -92,9 +92,10 @@ orbs: - run: name: "Save ganache logs" command: | - mkdir -p ./artifacts/logs/ganache - docker logs ganache_home > ./artifacts/logs/ganache/home.log - docker logs ganache_side > ./artifacts/logs/ganache/side.log + mkdir -p ./artifacts/logs/ethereum + docker logs ethereum-testnet_side-oracle_1 > ./artifacts/logs/ethereum/side-oracle.log + docker logs ethereum-testnet_ganache_home_1 > ./artifacts/logs/ganache/ganache_home.log + docker logs ethereum-testnet_ganache_side_1 > ./artifacts/logs/ganache/ganache_side.log when: always - run: name: "Save binance logs" diff --git a/DEMO.md b/DEMO.md index 2d5a5f4..f225671 100644 --- a/DEMO.md +++ b/DEMO.md @@ -333,7 +333,7 @@ Make sure, to first run demo in development mode, before trying to run it in the docker kill binance-testnet_api-server_1 docker kill ethereum-testnet_ganache_home_1 docker kill ethereum-testnet_ganache_side_1 - docker kill ethereum-testnet_side_oracle_1 + docker kill ethereum-testnet_side-oracle_1 ``` 3. Remove testnets and validators data: ``` diff --git a/src/ethereum-testnet/docker-compose.yml b/src/ethereum-testnet/docker-compose.yml index 4003362..cb1af7d 100644 --- a/src/ethereum-testnet/docker-compose.yml +++ b/src/ethereum-testnet/docker-compose.yml @@ -18,7 +18,7 @@ services: - '8545:8545' volumes: - 'ganache_home_data:/app/db' - side_oracle: + side-oracle: build: side-oracle image: side-oracle env_file: side-oracle/.env.development diff --git a/src/oracle/tss-sign/signer.js b/src/oracle/tss-sign/signer.js index 1e8ae81..058383a 100644 --- a/src/oracle/tss-sign/signer.js +++ b/src/oracle/tss-sign/signer.js @@ -309,7 +309,7 @@ async function consumer(msg) { writeParams(parties, threshold) let attempt = 1 - const { tx, exchanges } = buildTx(from, account, data, attempt) + const { tx, exchanges } = await buildTx(from, account, data, attempt) while (tx !== null) { const signResult = await sign(keysFile, tx, publicKey, from) From 11e22b3bc0bd25c214b64ebcbcc9b802aee0516d Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Mon, 25 Nov 2019 23:41:36 +0300 Subject: [PATCH 124/129] Keygen automatic restart possibility --- demo/validator1/.env.development | 5 +- demo/validator1/.env.staging | 3 ++ demo/validator2/.env.development | 5 +- demo/validator2/.env.staging | 3 ++ demo/validator3/.env.development | 5 +- demo/validator3/.env.staging | 3 ++ src/oracle/docker-compose-test.yml | 2 + src/oracle/docker-compose.yml | 2 + src/oracle/proxy/index.js | 52 +++++++++++++++++-- src/oracle/tss-keygen/keygen.js | 81 +++++++++++++++++++++++++----- src/oracle/tss-sign/signer.js | 2 + src/tss/multi-party-ecdsa | 2 +- 12 files changed, 146 insertions(+), 19 deletions(-) diff --git a/demo/validator1/.env.development b/demo/validator1/.env.development index 54e7248..fea34dc 100644 --- a/demo/validator1/.env.development +++ b/demo/validator1/.env.development @@ -9,7 +9,7 @@ SIDE_SHARED_DB_ADDRESS=0xd5fE0D28e058D375b0b038fFbB446Da37E85fFdc FOREIGN_URL=http://http-api:8000 FOREIGN_CHAIN_ID=Binance-Dev -FOREIGN_ASSET=DEV-BA8 +FOREIGN_ASSET=DEV-9BA FOREIGN_FETCH_MAX_TIME_INTERVAL=60000 FOREIGN_FETCH_INTERVAL=5000 FOREIGN_FETCH_BLOCK_TIME_OFFSET=10000 @@ -18,6 +18,9 @@ SIGN_ATTEMPT_TIMEOUT=120000 SIGN_NONCE_CHECK_INTERVAL=10000 SEND_TIMEOUT=60000 +KEYGEN_ATTEMPT_TIMEOUT=120000 +KEYGEN_EPOCH_CHECK_INTERVAL=10000 + VALIDATOR_PRIVATE_KEY=2be3f252e16541bf1bb2d4a517d2bf173e6d09f2d765d32c64dc50515aec63ea VOTES_PROXY_PORT=5001 diff --git a/demo/validator1/.env.staging b/demo/validator1/.env.staging index 89e3609..aef801b 100644 --- a/demo/validator1/.env.staging +++ b/demo/validator1/.env.staging @@ -18,6 +18,9 @@ SIGN_ATTEMPT_TIMEOUT=120000 SIGN_NONCE_CHECK_INTERVAL=10000 SEND_TIMEOUT=60000 +KEYGEN_ATTEMPT_TIMEOUT=120000 +KEYGEN_EPOCH_CHECK_INTERVAL=10000 + #VALIDATOR_PRIVATE_KEY is taken from .keys VOTES_PROXY_PORT=5001 diff --git a/demo/validator2/.env.development b/demo/validator2/.env.development index 532206d..ced9a6e 100644 --- a/demo/validator2/.env.development +++ b/demo/validator2/.env.development @@ -9,7 +9,7 @@ SIDE_SHARED_DB_ADDRESS=0xd5fE0D28e058D375b0b038fFbB446Da37E85fFdc FOREIGN_URL=http://http-api:8000 FOREIGN_CHAIN_ID=Binance-Dev -FOREIGN_ASSET=DEV-BA8 +FOREIGN_ASSET=DEV-9BA FOREIGN_FETCH_MAX_TIME_INTERVAL=60000 FOREIGN_FETCH_INTERVAL=5000 FOREIGN_FETCH_BLOCK_TIME_OFFSET=10000 @@ -18,6 +18,9 @@ SIGN_ATTEMPT_TIMEOUT=120000 SIGN_NONCE_CHECK_INTERVAL=10000 SEND_TIMEOUT=60000 +KEYGEN_ATTEMPT_TIMEOUT=120000 +KEYGEN_EPOCH_CHECK_INTERVAL=10000 + VALIDATOR_PRIVATE_KEY=e59d58c77b791f98f10187117374ae9c589d48a62720ec6a5e142b0cc134f685 VOTES_PROXY_PORT=5002 diff --git a/demo/validator2/.env.staging b/demo/validator2/.env.staging index 4e97765..8d064dd 100644 --- a/demo/validator2/.env.staging +++ b/demo/validator2/.env.staging @@ -18,6 +18,9 @@ SIGN_ATTEMPT_TIMEOUT=120000 SIGN_NONCE_CHECK_INTERVAL=10000 SEND_TIMEOUT=60000 +KEYGEN_ATTEMPT_TIMEOUT=120000 +KEYGEN_EPOCH_CHECK_INTERVAL=10000 + #VALIDATOR_PRIVATE_KEY is taken from .keys VOTES_PROXY_PORT=5002 diff --git a/demo/validator3/.env.development b/demo/validator3/.env.development index cdf7303..d8eff01 100644 --- a/demo/validator3/.env.development +++ b/demo/validator3/.env.development @@ -9,7 +9,7 @@ SIDE_SHARED_DB_ADDRESS=0xd5fE0D28e058D375b0b038fFbB446Da37E85fFdc FOREIGN_URL=http://http-api:8000 FOREIGN_CHAIN_ID=Binance-Dev -FOREIGN_ASSET=DEV-BA8 +FOREIGN_ASSET=DEV-9BA FOREIGN_FETCH_MAX_TIME_INTERVAL=60000 FOREIGN_FETCH_INTERVAL=5000 FOREIGN_FETCH_BLOCK_TIME_OFFSET=10000 @@ -18,6 +18,9 @@ SIGN_ATTEMPT_TIMEOUT=120000 SIGN_NONCE_CHECK_INTERVAL=10000 SEND_TIMEOUT=60000 +KEYGEN_ATTEMPT_TIMEOUT=120000 +KEYGEN_EPOCH_CHECK_INTERVAL=10000 + VALIDATOR_PRIVATE_KEY=afaa4d4d6e54d25b0bf0361e3fd6cef562f6311bf6200de2dd0aa4cab63ae3b5 VOTES_PROXY_PORT=5003 diff --git a/demo/validator3/.env.staging b/demo/validator3/.env.staging index 9de99d3..2eef51d 100644 --- a/demo/validator3/.env.staging +++ b/demo/validator3/.env.staging @@ -18,6 +18,9 @@ SIGN_ATTEMPT_TIMEOUT=120000 SIGN_NONCE_CHECK_INTERVAL=10000 SEND_TIMEOUT=60000 +KEYGEN_ATTEMPT_TIMEOUT=120000 +KEYGEN_EPOCH_CHECK_INTERVAL=10000 + #VALIDATOR_PRIVATE_KEY is taken from .keys VOTES_PROXY_PORT=5003 diff --git a/src/oracle/docker-compose-test.yml b/src/oracle/docker-compose-test.yml index 4dbadd6..7923909 100644 --- a/src/oracle/docker-compose-test.yml +++ b/src/oracle/docker-compose-test.yml @@ -34,6 +34,8 @@ services: environment: - 'RABBITMQ_URL=amqp://rabbitmq:5672' - 'PROXY_URL=http://local_proxy:8001' + - KEYGEN_ATTEMPT_TIMEOUT + - KEYGEN_EPOCH_CHECK_INTERVAL - LOG_LEVEL volumes: - '${PWD}/${TARGET_NETWORK}/keys:/keys' diff --git a/src/oracle/docker-compose.yml b/src/oracle/docker-compose.yml index 2867def..034b5b6 100644 --- a/src/oracle/docker-compose.yml +++ b/src/oracle/docker-compose.yml @@ -31,6 +31,8 @@ services: environment: - 'RABBITMQ_URL=amqp://rabbitmq:5672' - 'PROXY_URL=http://proxy:8001' + - KEYGEN_ATTEMPT_TIMEOUT + - KEYGEN_EPOCH_CHECK_INTERVAL - LOG_LEVEL volumes: - '${PWD}/${TARGET_NETWORK}/keys:/keys' diff --git a/src/oracle/proxy/index.js b/src/oracle/proxy/index.js index f7da425..466956d 100644 --- a/src/oracle/proxy/index.js +++ b/src/oracle/proxy/index.js @@ -73,6 +73,19 @@ function sideSendQuery(query) { }) } +async function status(req, res) { + logger.debug('Status call') + const [bridgeEpoch, bridgeStatus] = await Promise.all([ + bridge.epoch(), + bridge.status() + ]) + res.send({ + bridgeEpoch, + bridgeStatus + }) + logger.debug('Status end') +} + async function get(req, res) { logger.debug('Get call, %o', req.body.key) const round = req.body.key.second @@ -131,12 +144,26 @@ async function signupKeygen(req, res) { const epoch = await bridge.nextEpoch() const partyId = await bridge.getNextPartyId(validatorAddress) + logger.debug('Checking previous attempts') + let attempt = 1 + let uuid + while (true) { + uuid = `k${epoch}_${attempt}` + const data = await sharedDb.getData(validatorAddress, ethers.utils.id(uuid), ethers.utils.id('round1_0')) + if (data.length === 2) { + break + } + logger.trace(`Attempt ${attempt} is already used`) + attempt += 1 + } + logger.debug(`Using attempt ${attempt}`) + if (partyId === 0) { res.send(Err({ message: 'Not a validator' })) logger.debug('Not a validator') } else { res.send(Ok({ - uuid: `k${epoch}`, + uuid, number: partyId })) logger.debug('SignupKeygen end') @@ -287,6 +314,22 @@ async function voteChangeThreshold(req, res) { } } +async function voteChangeRangeSize(req, res) { + if (/^[0-9]+$/.test(req.params.rangeSize)) { + logger.info('Voting for changing range size') + const epoch = await bridge.epoch() + const message = buildMessage( + Action.VOTE_CHANGE_RANGE_SIZE, + epoch, + parseInt(req.params.rangeSize, 10), + padZeros(req.attempt, 54) + ) + await processMessage(message) + res.send('Voted\n') + logger.info('Voted successfully') + } +} + async function voteChangeCloseEpoch(req, res) { if (req.params.closeEpoch === 'true' || req.params.closeEpoch === 'false') { logger.info('Voting for changing close epoch') @@ -350,7 +393,7 @@ async function info(req, res) { try { const [ x, y, epoch, rangeSize, nextRangeSize, closeEpoch, nextCloseEpoch, epochStartBlock, - foreignNonce, nextEpoch, threshold, nextThreshold, validators, nextValidators, status, + foreignNonce, nextEpoch, threshold, nextThreshold, validators, nextValidators, bridgeStatus, homeBalance ] = await Promise.all([ bridge.getX().then((value) => new BN(value).toString(16)), @@ -394,7 +437,7 @@ async function info(req, res) { homeBalance, foreignBalanceTokens: parseFloat(balances[FOREIGN_ASSET]) || 0, foreignBalanceNative: parseFloat(balances.BNB) || 0, - bridgeStatus: decodeStatus(status) + bridgeStatus: decodeStatus(bridgeStatus) } logger.trace('%o', msg) res.send(msg) @@ -408,6 +451,8 @@ async function info(req, res) { logger.debug('Info end') } +app.get('/status', status) + app.post('/get', get) app.post('/set', set) app.post('/signupkeygen', signupKeygen) @@ -437,6 +482,7 @@ votesProxyApp.use('/vote', (req, res, next) => { votesProxyApp.get('/vote/addValidator/:validator', voteAddValidator) votesProxyApp.get('/vote/removeValidator/:validator', voteRemoveValidator) votesProxyApp.get('/vote/changeThreshold/:threshold', voteChangeThreshold) +votesProxyApp.get('/vote/changeRangeSize/:rangeSize', voteChangeRangeSize) votesProxyApp.get('/vote/changeCloseEpoch/:closeEpoch', voteChangeCloseEpoch) votesProxyApp.get('/info', info) diff --git a/src/oracle/tss-keygen/keygen.js b/src/oracle/tss-keygen/keygen.js index 256eded..f2e9828 100644 --- a/src/oracle/tss-keygen/keygen.js +++ b/src/oracle/tss-keygen/keygen.js @@ -9,6 +9,12 @@ const { publicKeyToAddress } = require('./crypto') const { delay } = require('./wait') const { RABBITMQ_URL, PROXY_URL } = process.env +const KEYGEN_ATTEMPT_TIMEOUT = parseInt(process.env.KEYGEN_ATTEMPT_TIMEOUT, 10) +const KEYGEN_EPOCH_CHECK_INTERVAL = parseInt(process.env.KEYGEN_EPOCH_CHECK_INTERVAL, 10) + +const KEYGEN_OK = 0 +const KEYGEN_EPOCH_INTERRUPT = 1 +const KEYGEN_FAILED = 2 const app = express() @@ -34,6 +40,54 @@ function writeParams(parties, threshold) { })) } +function killKeygen() { + exec.execSync('pkill gg18_keygen || true') +} + +function keygen(keysFile, epoch) { + let restartTimeoutId + let epochDaemonIntervalId + let epochInterrupt + + return new Promise((resolve) => { + const cmd = exec.execFile('./keygen-entrypoint.sh', [PROXY_URL, keysFile], (error) => { + logger.trace('Keygen entrypoint exited, %o', error) + clearTimeout(restartTimeoutId) + clearInterval(epochDaemonIntervalId) + currentKeygenEpoch = null + if (fs.existsSync(keysFile)) { + logger.info(`Finished keygen for epoch ${epoch}`) + resolve(KEYGEN_OK) + } else { + logger.warn(`Keygen for epoch ${epoch} failed, will start new attempt`) + resolve(epochInterrupt ? KEYGEN_EPOCH_INTERRUPT : KEYGEN_FAILED) + } + }) + cmd.stdout.on('data', (data) => { + const str = data.toString() + if (str.includes('Got all party signups')) { + restartTimeoutId = setTimeout(killKeygen, KEYGEN_ATTEMPT_TIMEOUT) + } + logger.debug(str) + }) + cmd.stderr.on('data', (data) => logger.debug(data.toString())) + + // Kill keygen if keygen for current epoch is already confirmed + epochDaemonIntervalId = setInterval(async () => { + logger.info(`Checking if bridge has confirmations keygen for epoch ${epoch}`) + const { bridgeEpoch, bridgeStatus } = (await proxyClient.get('/status')).data + logger.trace(`Current bridge epoch: ${bridgeEpoch}, current bridge status: ${bridgeStatus}`) + if (bridgeEpoch > epoch || bridgeStatus > 3) { + logger.info(`Bridge has already confirmed keygen for epoch ${epoch}`) + epochInterrupt = true + // Additional delay, maybe keygen will eventually finish + await delay(5000) + killKeygen() + } + }, KEYGEN_EPOCH_CHECK_INTERVAL) + }) +} + async function keygenConsumer(msg) { const { epoch, parties, threshold } = JSON.parse(msg.content) logger.info(`Consumed new epoch event, starting keygen for epoch ${epoch}`) @@ -44,23 +98,26 @@ async function keygenConsumer(msg) { currentKeygenEpoch = epoch writeParams(parties, threshold) - const cmd = exec.execFile('./keygen-entrypoint.sh', [PROXY_URL, keysFile], async () => { - currentKeygenEpoch = null - if (fs.existsSync(keysFile)) { - logger.info(`Finished keygen for epoch ${epoch}`) + + while (true) { + const keygenResult = await keygen(keysFile, epoch) + + if (keygenResult === KEYGEN_OK) { const publicKey = JSON.parse(fs.readFileSync(keysFile))[5] logger.warn(`Generated multisig account in binance chain: ${publicKeyToAddress(publicKey)}`) logger.info('Sending keys confirmation') await confirmKeygen(publicKey, epoch) - } else { - logger.warn(`Keygen for epoch ${epoch} failed`) + break + } else if (keygenResult === KEYGEN_EPOCH_INTERRUPT) { + logger.warn('Keygen was interrupted by epoch daemon') + break } - logger.debug('Ack for keygen message') - channel.ack(msg) - }) - cmd.stdout.on('data', (data) => logger.debug(data.toString())) - cmd.stderr.on('data', (data) => logger.debug(data.toString())) + + await delay(1000) + } + logger.info('Acking message') + channel.ack(msg) } async function main() { @@ -81,7 +138,7 @@ async function main() { logger.info(`Consumed new cancel event for epoch ${epoch} keygen`) if (currentKeygenEpoch === epoch) { logger.info('Cancelling current keygen') - exec.execSync('pkill gg18_keygen || true') + killKeygen() } channel.ack(msg) }) diff --git a/src/oracle/tss-sign/signer.js b/src/oracle/tss-sign/signer.js index 058383a..b380ca5 100644 --- a/src/oracle/tss-sign/signer.js +++ b/src/oracle/tss-sign/signer.js @@ -213,6 +213,8 @@ function sign(keysFile, tx, publicKey, signerAddress) { if (sequence > tx.tx.sequence) { logger.info('Account already has needed nonce, cancelling current sign process') nonceInterrupt = true + // Additional delay, maybe signer will eventually finish + await delay(5000) killSigner() } }, SIGN_NONCE_CHECK_INTERVAL) diff --git a/src/tss/multi-party-ecdsa b/src/tss/multi-party-ecdsa index f67cc7f..1eb620d 160000 --- a/src/tss/multi-party-ecdsa +++ b/src/tss/multi-party-ecdsa @@ -1 +1 @@ -Subproject commit f67cc7ffab0f460807f6e112ad93b5ce58e47ac6 +Subproject commit 1eb620d9a37f9839d3c391a3765062846e07039f From b2f7d035f27a051fb7828e775b8aa2e0433c3dab Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Tue, 26 Nov 2019 15:03:55 +0300 Subject: [PATCH 125/129] Fixed circle ci config. Additional checks on next validator --- .circleci/config.yml | 5 +++-- src/oracle/ethWatcher/ethWatcher.js | 8 ++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 41ffaa4..cb370fa 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -94,8 +94,8 @@ orbs: command: | mkdir -p ./artifacts/logs/ethereum docker logs ethereum-testnet_side-oracle_1 > ./artifacts/logs/ethereum/side-oracle.log - docker logs ethereum-testnet_ganache_home_1 > ./artifacts/logs/ganache/ganache_home.log - docker logs ethereum-testnet_ganache_side_1 > ./artifacts/logs/ganache/ganache_side.log + docker logs ethereum-testnet_ganache_home_1 > ./artifacts/logs/ethereum/ganache_home.log + docker logs ethereum-testnet_ganache_side_1 > ./artifacts/logs/ethereum/ganache_side.log when: always - run: name: "Save binance logs" @@ -107,6 +107,7 @@ orbs: when: always - store_artifacts: path: ./artifacts + destination: artifacts when: always jobs: init_tss: diff --git a/src/oracle/ethWatcher/ethWatcher.js b/src/oracle/ethWatcher/ethWatcher.js index 1e71fc5..e26d430 100644 --- a/src/oracle/ethWatcher/ethWatcher.js +++ b/src/oracle/ethWatcher/ethWatcher.js @@ -286,10 +286,14 @@ async function loop() { logger.trace('Consumed event %o %o', event, bridgeEvents[i]) switch (event.name) { case 'NewEpoch': - await sendKeygen(event) + if ((await bridge.getValidators(event.values.newEpoch)).includes(validatorAddress)) { + await sendKeygen(event) + } break case 'NewEpochCancelled': - sendKeygenCancellation(event) + if ((await bridge.getValidators(event.values.epoch)).includes(validatorAddress)) { + sendKeygenCancellation(event) + } break case 'NewFundsTransfer': if (isCurrentValidator) { From 751c52eac2326a00b98cfc631c93dbbd99ab6b4b Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Tue, 26 Nov 2019 16:52:38 +0300 Subject: [PATCH 126/129] Up-to-date tests readme --- tests/README.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/README.md b/tests/README.md index c6aa152..ca6edab 100644 --- a/tests/README.md +++ b/tests/README.md @@ -17,9 +17,7 @@ To run the bridge tests, you first need to clean old test environment, and then ./tests/init.sh ``` This will create a clean development environment, using `./demo/start-environment.sh`. -This will also prefund user accounts from `./tests/config.json` for both networks. -Prefunding process uses `./src/test-services` scripts. -Finally, this command will start 3 validators in daemon mode (using `./demo/validator-demo.sh`), +Then, this command will start 3 validators in daemon mode (using `./demo/validator-demo.sh`), and wait until they are ready. Next, you can run the tests: @@ -27,9 +25,10 @@ Next, you can run the tests: ./tests/run.sh ``` -After tests are done, all active docker containers can be killed. +After tests are done, all active docker containers should be killed automatically. +Or you can do it manually: ```bash docker kill $(docker ps | grep validator[1-3]_ | awk '{print $1}') -docker kill ganache_side ganache_home -docker kill binance-testnet_http-api_1 binance-testnet_node_1 binance-testnet_api-server_1 +docker kill $(docker ps | grep ethereum-testnet_ | awk '{print $1}') +docker kill $(docker ps | grep binance-testnet_ | awk '{print $1}') ``` From 2d444a8cd27855bb1577eb7ab9020c712282ca1c Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Tue, 26 Nov 2019 16:53:35 +0300 Subject: [PATCH 127/129] Simplier approach for attempts tracking in signer --- .../deploy-side/contracts/SignupStorage.sol | 25 ++++++++++++----- src/oracle/proxy/contractsAbi.js | 1 + src/oracle/proxy/index.js | 19 ++++++++++++- src/oracle/tss-sign/signer.js | 28 ++++++------------- tests/test/ethToBncWithRestart.js | 6 ++-- tests/test/index.js | 4 +-- tests/test/utils/signerController.js | 4 +-- 7 files changed, 53 insertions(+), 34 deletions(-) diff --git a/src/deploy/deploy-side/contracts/SignupStorage.sol b/src/deploy/deploy-side/contracts/SignupStorage.sol index 911adf1..69d1477 100644 --- a/src/deploy/deploy-side/contracts/SignupStorage.sol +++ b/src/deploy/deploy-side/contracts/SignupStorage.sol @@ -1,13 +1,24 @@ pragma solidity ^0.5.0; contract SignupStorage { - mapping(bytes32 => uint16) public signupsCount; - mapping(bytes32 => mapping(address => uint16)) public signups; + struct SignupsCounter { + uint16 count; + mapping(address => uint16) id; + } + mapping(bytes32 => SignupsCounter) public signups; function signup(bytes32 hash) public { - require(signups[hash][msg.sender] == 0, "Already signuped"); + require(signups[hash].id[msg.sender] == 0, "Already signuped"); - signups[hash][msg.sender] = ++signupsCount[hash]; + signups[hash].id[msg.sender] = ++signups[hash].count; + } + + function isSignuped(bytes32 hash) public view returns (bool) { + return isSignuped(hash, msg.sender); + } + + function isSignuped(bytes32 hash, address validator) public view returns (bool) { + return signups[hash].id[validator] > 0; } function getSignupNumber( @@ -15,12 +26,12 @@ contract SignupStorage { address[] memory validators, address validator ) view public returns (uint16) { - if (signups[hash][validator] == 0) + if (signups[hash].id[validator] == 0) return 0; uint16 id = 1; for (uint i = 0; i < validators.length; i++) { - uint16 vid = signups[hash][validators[i]]; - if (vid > 0 && vid < signups[hash][validator]) + uint16 vid = signups[hash].id[validators[i]]; + if (vid > 0 && vid < signups[hash].id[validator]) id++; } return id; diff --git a/src/oracle/proxy/contractsAbi.js b/src/oracle/proxy/contractsAbi.js index 6199fa1..1a63694 100644 --- a/src/oracle/proxy/contractsAbi.js +++ b/src/oracle/proxy/contractsAbi.js @@ -24,6 +24,7 @@ const sharedDbAbi = [ 'function getSignupAddress(bytes32 hash, address[] validators, uint16 signupNumber) view returns (address)', 'function getData(address from, bytes32 hash, bytes32 key) view returns (bytes)', 'function getSignupNumber(bytes32 hash, address[] validators, address validator) view returns (uint16)', + 'function isSignuped(bytes32 hash) view returns (bool)', 'function setData(bytes32 hash, bytes32 key, bytes data)', 'function signup(bytes32 hash)', 'function addSignature(bytes message, bytes rsv)', diff --git a/src/oracle/proxy/index.js b/src/oracle/proxy/index.js index 466956d..6a12894 100644 --- a/src/oracle/proxy/index.js +++ b/src/oracle/proxy/index.js @@ -172,7 +172,24 @@ async function signupKeygen(req, res) { async function signupSign(req, res) { logger.debug('SignupSign call') - const hash = ethers.utils.id(req.body.third) + const msgHash = req.body.third + + logger.debug('Checking previous attempts') + let attempt = 1 + let uuid + let hash + while (true) { + uuid = `${msgHash}_${attempt}` + hash = ethers.utils.id(uuid) + const data = await sharedDb.isSignuped(hash) + if (!data) { + break + } + logger.trace(`Attempt ${attempt} is already used`) + attempt += 1 + } + logger.debug(`Using attempt ${attempt}`) + const query = sharedDb.interface.functions.signup.encode([hash]) const { txHash } = await sideSendQuery(query) const receipt = await waitForReceipt(SIDE_RPC_URL, txHash) diff --git a/src/oracle/tss-sign/signer.js b/src/oracle/tss-sign/signer.js index b380ca5..b7e0d14 100644 --- a/src/oracle/tss-sign/signer.js +++ b/src/oracle/tss-sign/signer.js @@ -27,7 +27,6 @@ const SIGN_OK = 0 const SIGN_NONCE_INTERRUPT = 1 const SIGN_FAILED = 2 -let nextAttempt = null let cancelled let ready = false let exchangeQueue @@ -58,13 +57,10 @@ function killSigner() { } function restart(req, res) { - if (/^[0-9]+$/.test(req.params.attempt)) { - logger.info(`Manual cancelling current sign attempt, starting ${req.params.attempt} attempt`) - nextAttempt = parseInt(req.params.attempt, 10) - killSigner() - cancelled = true - res.send('Done') - } + logger.info('Manual cancelling current sign attempt') + killSigner() + cancelled = true + res.send('Done') } async function confirmFundsTransfer(epoch) { @@ -225,15 +221,14 @@ function getAccountBalance(account, asset) { return account.balances.find((token) => token.symbol === asset).free } -async function buildTx(from, account, data, txAttempt) { +async function buildTx(from, account, data) { const { closeEpoch, newEpoch, nonce } = data const txOptions = { from, accountNumber: account.account_number, sequence: nonce, - asset: FOREIGN_ASSET, - memo: `Attempt ${txAttempt}` + asset: FOREIGN_ASSET } let exchanges @@ -309,9 +304,8 @@ async function consumer(msg) { } writeParams(parties, threshold) - let attempt = 1 - const { tx, exchanges } = await buildTx(from, account, data, attempt) + const { tx, exchanges } = await buildTx(from, account, data) while (tx !== null) { const signResult = await sign(keysFile, tx, publicKey, from) @@ -328,11 +322,7 @@ async function consumer(msg) { break } - // signer either failed, or timed out after parties signup - attempt = nextAttempt || attempt + 1 - nextAttempt = null - logger.warn(`Sign failed, starting next attempt ${attempt}`) - tx.tx.memo = `Attempt ${attempt}` + logger.warn('Sign failed, starting next attempt') await delay(1000) } logger.info('Acking message') @@ -354,7 +344,7 @@ async function main() { signQueue.consume(consumer) } -app.get('/restart/:attempt', restart) +app.get('/restart', restart) app.get('/start', (req, res) => { logger.info('Ready to start') ready = true diff --git a/tests/test/ethToBncWithRestart.js b/tests/test/ethToBncWithRestart.js index ed6c3f9..8f5aa1e 100644 --- a/tests/test/ethToBncWithRestart.js +++ b/tests/test/ethToBncWithRestart.js @@ -11,7 +11,7 @@ const { validators } = require('../config') const { HOME_BRIDGE_ADDRESS } = process.env -module.exports = (getUsers, newAttempt) => { +module.exports = (getUsers) => { describe('exchange of tokens in eth => bnc direction with restart', function () { let info let users @@ -53,9 +53,9 @@ module.exports = (getUsers, newAttempt) => { it('should restart signature generation and regenerate signature properly', async function () { this.timeout(360000) if (newValidatorNonces[0] > validatorNonces[0] + 2) { - await signerController1.restart(newAttempt) + await signerController1.restart() } else { - await signerController2.restart(newAttempt) + await signerController2.restart() } await waitPromise( () => getBncSequence(info.foreignBridgeAddress), diff --git a/tests/test/index.js b/tests/test/index.js index b5bb877..52841d4 100644 --- a/tests/test/index.js +++ b/tests/test/index.js @@ -72,12 +72,12 @@ describe('bridge tests', function () { testEthToBnc(() => users) testBncToEth(() => users) - testEthToBncWithRestart(() => users, 99) + testEthToBncWithRestart(() => users) testChangeThreshold(3) testEthToBnc(() => users) testBncToEth(() => users) - testEthToBncWithRestart(() => users, 2) + testEthToBncWithRestart(() => users) testEthToBnc(() => users) }) diff --git a/tests/test/utils/signerController.js b/tests/test/utils/signerController.js index 12cfb1c..6a22a84 100644 --- a/tests/test/utils/signerController.js +++ b/tests/test/utils/signerController.js @@ -9,8 +9,8 @@ function createController(validatorId) { }) return { - async restart(attempt) { - return (await sideClient.get(`/restart/${attempt}`)).data + async restart() { + await sideClient.get('/restart') } } } From 3b6e64b7846359047a555ef4a3b9ee0326705201 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Tue, 26 Nov 2019 17:41:59 +0300 Subject: [PATCH 128/129] Keygen restart tests --- demo/validator1/.env.development | 2 ++ demo/validator1/.env.staging | 2 ++ demo/validator2/.env.development | 2 ++ demo/validator2/.env.staging | 2 ++ demo/validator3/.env.development | 2 ++ demo/validator3/.env.staging | 2 ++ src/oracle/docker-compose-test.yml | 2 ++ src/oracle/docker-compose.yml | 2 ++ src/oracle/tss-keygen/keygen.js | 8 ++++++- .../binanceBalance/.env.development | 2 +- .../binanceSend/.env.development | 2 +- tests/.env | 2 +- tests/test/changeThreshold.js | 18 +++++++++++++-- tests/test/utils/keygenController.js | 22 +++++++++++++++++++ tests/test/utils/signerController.js | 4 ++-- 15 files changed, 66 insertions(+), 8 deletions(-) create mode 100644 tests/test/utils/keygenController.js diff --git a/demo/validator1/.env.development b/demo/validator1/.env.development index fea34dc..b27189a 100644 --- a/demo/validator1/.env.development +++ b/demo/validator1/.env.development @@ -27,4 +27,6 @@ VOTES_PROXY_PORT=5001 SIGN_RESTART_PORT=6001 +KEYGEN_RESTART_PORT=7001 + LOG_LEVEL=trace diff --git a/demo/validator1/.env.staging b/demo/validator1/.env.staging index aef801b..b3c1acf 100644 --- a/demo/validator1/.env.staging +++ b/demo/validator1/.env.staging @@ -27,4 +27,6 @@ VOTES_PROXY_PORT=5001 SIGN_RESTART_PORT=6001 +KEYGEN_RESTART_PORT=7001 + LOG_LEVEL=info diff --git a/demo/validator2/.env.development b/demo/validator2/.env.development index ced9a6e..2ac5ed6 100644 --- a/demo/validator2/.env.development +++ b/demo/validator2/.env.development @@ -27,4 +27,6 @@ VOTES_PROXY_PORT=5002 SIGN_RESTART_PORT=6002 +KEYGEN_RESTART_PORT=7002 + LOG_LEVEL=trace diff --git a/demo/validator2/.env.staging b/demo/validator2/.env.staging index 8d064dd..7d0bf69 100644 --- a/demo/validator2/.env.staging +++ b/demo/validator2/.env.staging @@ -27,4 +27,6 @@ VOTES_PROXY_PORT=5002 SIGN_RESTART_PORT=6002 +KEYGEN_RESTART_PORT=7002 + LOG_LEVEL=info diff --git a/demo/validator3/.env.development b/demo/validator3/.env.development index d8eff01..2f3f501 100644 --- a/demo/validator3/.env.development +++ b/demo/validator3/.env.development @@ -27,4 +27,6 @@ VOTES_PROXY_PORT=5003 SIGN_RESTART_PORT=6003 +KEYGEN_RESTART_PORT=7003 + LOG_LEVEL=trace diff --git a/demo/validator3/.env.staging b/demo/validator3/.env.staging index 2eef51d..5ea48ed 100644 --- a/demo/validator3/.env.staging +++ b/demo/validator3/.env.staging @@ -27,4 +27,6 @@ VOTES_PROXY_PORT=5003 SIGN_RESTART_PORT=6003 +KEYGEN_RESTART_PORT=7003 + LOG_LEVEL=info diff --git a/src/oracle/docker-compose-test.yml b/src/oracle/docker-compose-test.yml index 7923909..6daadfa 100644 --- a/src/oracle/docker-compose-test.yml +++ b/src/oracle/docker-compose-test.yml @@ -39,6 +39,8 @@ services: - LOG_LEVEL volumes: - '${PWD}/${TARGET_NETWORK}/keys:/keys' + ports: + - '${KEYGEN_RESTART_PORT}:8001' networks: - test_network signer: diff --git a/src/oracle/docker-compose.yml b/src/oracle/docker-compose.yml index 034b5b6..3532066 100644 --- a/src/oracle/docker-compose.yml +++ b/src/oracle/docker-compose.yml @@ -36,6 +36,8 @@ services: - LOG_LEVEL volumes: - '${PWD}/${TARGET_NETWORK}/keys:/keys' + ports: + - '${KEYGEN_RESTART_PORT}:8001' networks: - keygen-proxy-net - rabbit-keygen-net diff --git a/src/oracle/tss-keygen/keygen.js b/src/oracle/tss-keygen/keygen.js index f2e9828..18fcfc4 100644 --- a/src/oracle/tss-keygen/keygen.js +++ b/src/oracle/tss-keygen/keygen.js @@ -44,6 +44,12 @@ function killKeygen() { exec.execSync('pkill gg18_keygen || true') } +function restart(req, res) { + logger.info('Manual cancelling current keygen attempt') + killKeygen() + res.send('Done') +} + function keygen(keysFile, epoch) { let restartTimeoutId let epochDaemonIntervalId @@ -144,7 +150,7 @@ async function main() { }) } - +app.get('/restart', restart) app.get('/start', (req, res) => { logger.info('Ready to start') ready = true diff --git a/src/test-services/binanceBalance/.env.development b/src/test-services/binanceBalance/.env.development index 9169981..b6021c1 100644 --- a/src/test-services/binanceBalance/.env.development +++ b/src/test-services/binanceBalance/.env.development @@ -1,2 +1,2 @@ FOREIGN_URL=http://http-api:8000 -FOREIGN_ASSET=DEV-BA8 +FOREIGN_ASSET=DEV-9BA diff --git a/src/test-services/binanceSend/.env.development b/src/test-services/binanceSend/.env.development index db94446..9de3d9e 100644 --- a/src/test-services/binanceSend/.env.development +++ b/src/test-services/binanceSend/.env.development @@ -1,4 +1,4 @@ FOREIGN_URL=http://http-api:8000 -FOREIGN_ASSET=DEV-BA8 +FOREIGN_ASSET=DEV-9BA FOREIGN_PRIVATE_KEY=dd5ec5a7abe9d1fff21170ae591085f000fc6fd9ca0107fe047593f44e328e40 diff --git a/tests/.env b/tests/.env index f4cca67..a7cb16f 100644 --- a/tests/.env +++ b/tests/.env @@ -7,5 +7,5 @@ SIDE_RPC_URL=http://ganache_side:8545 FOREIGN_URL=http://http-api:8000 FOREIGN_CHAIN_ID=Binance-Dev -FOREIGN_ASSET=DEV-BA8 +FOREIGN_ASSET=DEV-9BA FOREIGN_PRIVATE_KEY=dd5ec5a7abe9d1fff21170ae591085f000fc6fd9ca0107fe047593f44e328e40 diff --git a/tests/test/changeThreshold.js b/tests/test/changeThreshold.js index fc0f357..6090f42 100644 --- a/tests/test/changeThreshold.js +++ b/tests/test/changeThreshold.js @@ -2,16 +2,21 @@ const assert = require('assert') const { waitPromise, delay } = require('./utils/wait') const { getBepBalance, getBncFlags } = require('./utils/bncController') - +const { getNonce } = require('./utils/sideController') const { controller1, controller2, controller3 } = require('./utils/proxyController') +const { keygenController1 } = require('./utils/keygenController') + +const { validators } = require('../config') module.exports = (newThreshold) => { describe('change threshold', function () { let info let initialInfo + let validatorNonce before(async function () { initialInfo = await controller1.getInfo() + validatorNonce = await getNonce(validators[0]) info = initialInfo }) @@ -89,8 +94,17 @@ module.exports = (newThreshold) => { assert.strictEqual(info.nextThreshold, newThreshold, 'Next threshold is not set correctly') }) - it('should finish keygen process and start funds transfer', async function () { + it('should start keys generation', async function () { this.timeout(120000) + await waitPromise( + () => getNonce(validators[0]), + (nonce) => nonce > validatorNonce + 2 + ) + }) + + it('should restart keygen generation and regenerate keys properly, should start funds transfer', async function () { + this.timeout(360000) + await keygenController1.restart() info = await waitPromise(controller1.getInfo, (newInfo) => newInfo.bridgeStatus === 'funds_transfer') const flags = await getBncFlags(initialInfo.foreignBridgeAddress) assert.strictEqual(flags, 0, 'Foreign bridge flags are not set correctly') diff --git a/tests/test/utils/keygenController.js b/tests/test/utils/keygenController.js new file mode 100644 index 0000000..e670eaa --- /dev/null +++ b/tests/test/utils/keygenController.js @@ -0,0 +1,22 @@ +const axios = require('axios') + +function createController(validatorId) { + const url = `http://validator${validatorId}_keygen_1:8001/` + + const keygenClient = axios.create({ + baseURL: url, + timeout: 10000 + }) + + return { + async restart() { + await keygenClient.get('/restart') + } + } +} + +module.exports = { + keygenController1: createController(1), + keygenController2: createController(2), + keygenController3: createController(3) +} diff --git a/tests/test/utils/signerController.js b/tests/test/utils/signerController.js index 6a22a84..98f3eed 100644 --- a/tests/test/utils/signerController.js +++ b/tests/test/utils/signerController.js @@ -3,14 +3,14 @@ const axios = require('axios') function createController(validatorId) { const url = `http://validator${validatorId}_signer_1:8001/` - const sideClient = axios.create({ + const signerClient = axios.create({ baseURL: url, timeout: 10000 }) return { async restart() { - await sideClient.get('/restart') + await signerClient.get('/restart') } } } From 20c540529d99da18d5ff0bfb13bbbeefcd33eff7 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Tue, 26 Nov 2019 18:35:05 +0300 Subject: [PATCH 129/129] Waiting in side oracle until connection with rpc is successful --- .circleci/config.yml | 2 +- src/ethereum-testnet/side-oracle/index.js | 22 +++++++++++++++------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index cb370fa..bccbbec 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -90,7 +90,7 @@ orbs: - save_docker_logs: validator: 3 - run: - name: "Save ganache logs" + name: "Save ethereum logs" command: | mkdir -p ./artifacts/logs/ethereum docker logs ethereum-testnet_side-oracle_1 > ./artifacts/logs/ethereum/side-oracle.log diff --git a/src/ethereum-testnet/side-oracle/index.js b/src/ethereum-testnet/side-oracle/index.js index 30632a3..d90ecfc 100644 --- a/src/ethereum-testnet/side-oracle/index.js +++ b/src/ethereum-testnet/side-oracle/index.js @@ -58,14 +58,22 @@ async function handleNewMessage(event) { } async function initialize() { - await delay(5000) - sideProvider = new ethers.providers.JsonRpcProvider(SIDE_RPC_URL) - homeProvider = new ethers.providers.JsonRpcProvider(HOME_RPC_URL) - homeWallet = new ethers.Wallet(HOME_PRIVATE_KEY, homeProvider) - bridge = new ethers.Contract(HOME_BRIDGE_ADDRESS, bridgeAbi, homeWallet) - sharedDb = new ethers.Contract(SIDE_SHARED_DB_ADDRESS, sharedDbAbi, sideProvider) + while (true) { + try { + sideProvider = new ethers.providers.JsonRpcProvider(SIDE_RPC_URL) + homeProvider = new ethers.providers.JsonRpcProvider(HOME_RPC_URL) - nonce = await homeWallet.getTransactionCount() + homeWallet = new ethers.Wallet(HOME_PRIVATE_KEY, homeProvider) + bridge = new ethers.Contract(HOME_BRIDGE_ADDRESS, bridgeAbi, homeWallet) + sharedDb = new ethers.Contract(SIDE_SHARED_DB_ADDRESS, sharedDbAbi, sideProvider) + + nonce = await homeWallet.getTransactionCount() + break + } catch (e) { + console.log('Cannot create providers') + await delay(1000) + } + } } async function loop() {