From 8a528e631c1d4f42f90cc821fabf3521f3470c8b Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Sun, 7 Jul 2019 22:58:35 +0300 Subject: [PATCH] Demo of ETH-to-BNC bridge --- .gitignore | 10 +- .gitmodules | 11 +- demo/start-environment.sh | 34 +- demo/{full-demo.sh => validator-demo.sh} | 0 demo/validator1/.env | 15 + demo/validator2/.env | 15 + demo/validator3/.env | 15 + package-lock.json | 11 +- src/deploy/build/contracts/Migrations.json | 1392 -- src/deploy/build/contracts/SharedDB.json | 18327 ---------------- src/deploy/contracts/Bridge.sol | 20 - src/deploy/contracts/SharedDB.sol | 143 - src/deploy/{ => deploy-home}/.env | 2 +- src/deploy/deploy-home/contracts/Bridge.sol | 177 + .../deploy-home}/contracts/Migrations.sol | 0 .../contracts/openzeppelin-solidity | 0 .../migrations/1_initial_migration.js | 0 .../migrations/2_deployment.js | 4 +- .../{ => deploy-home}/truffle-config.js | 2 +- src/{deploy-test => deploy/deploy-side}/.env | 4 +- .../contracts/Migrations.sol | 0 src/deploy/deploy-side/contracts/SharedDB.sol | 50 + .../migrations/1_initial_migration.js | 0 .../deploy-side/migrations/2_deployment.js | 5 + .../deploy-side}/truffle-config.js | 0 src/deploy/deploy-test/.env | 5 + .../deploy-test/contracts/Migrations.sol | 24 + .../contracts/openzeppelin-solidity | 0 .../migrations/1_initial_migration.js | 5 + .../deploy-test/migrations/2_deployment.js | 0 src/deploy/deploy-test/truffle-config.js | 29 + src/oracle/.env | 20 +- src/oracle/bncWatcher/Dockerfile | 14 + src/oracle/bncWatcher/bncWatcher.js | 92 + src/oracle/{watcher => bncWatcher}/db.js | 0 src/oracle/bncWatcher/package.json | 12 + src/oracle/docker-compose.yml | 96 +- src/oracle/{watcher => ethWatcher}/Dockerfile | 0 src/oracle/ethWatcher/db.js | 21 + .../{watcher => ethWatcher}/ethWatcher.js | 10 +- .../{watcher => ethWatcher}/package.json | 0 src/oracle/proxy/index.js | 267 +- src/oracle/proxy/package.json | 4 +- src/oracle/testApprove.js | 24 +- src/oracle/testBinanceSend.js | 25 +- src/oracle/tss-keygen/keygen-entrypoint.sh | 8 +- src/oracle/tss-keygen/keygen.js | 48 +- src/oracle/tss-sign/package.json | 3 +- src/oracle/tss-sign/sign-entrypoint.sh | 4 +- src/oracle/tss-sign/signer.js | 226 +- src/oracle/tss-sign/tx.js | 18 +- src/oracle/watcher/config.json | 20 - src/tss/multi-party-ecdsa | 1 + 53 files changed, 1002 insertions(+), 20211 deletions(-) rename demo/{full-demo.sh => validator-demo.sh} (100%) create mode 100644 demo/validator1/.env create mode 100644 demo/validator2/.env create mode 100644 demo/validator3/.env delete mode 100644 src/deploy/build/contracts/Migrations.json delete mode 100644 src/deploy/build/contracts/SharedDB.json delete mode 100644 src/deploy/contracts/Bridge.sol delete mode 100644 src/deploy/contracts/SharedDB.sol rename src/deploy/{ => deploy-home}/.env (95%) create mode 100644 src/deploy/deploy-home/contracts/Bridge.sol rename src/{deploy-test => deploy/deploy-home}/contracts/Migrations.sol (100%) rename src/{deploy-test => deploy/deploy-home}/contracts/openzeppelin-solidity (100%) rename src/{deploy-test => deploy/deploy-home}/migrations/1_initial_migration.js (100%) rename src/deploy/{ => deploy-home}/migrations/2_deployment.js (89%) rename src/deploy/{ => deploy-home}/truffle-config.js (96%) rename src/{deploy-test => deploy/deploy-side}/.env (66%) rename src/deploy/{ => deploy-side}/contracts/Migrations.sol (100%) create mode 100644 src/deploy/deploy-side/contracts/SharedDB.sol rename src/deploy/{ => deploy-side}/migrations/1_initial_migration.js (100%) create mode 100644 src/deploy/deploy-side/migrations/2_deployment.js rename src/{deploy-test => deploy/deploy-side}/truffle-config.js (100%) create mode 100644 src/deploy/deploy-test/.env create mode 100644 src/deploy/deploy-test/contracts/Migrations.sol rename src/deploy/{ => deploy-test}/contracts/openzeppelin-solidity (100%) create mode 100644 src/deploy/deploy-test/migrations/1_initial_migration.js rename src/{ => deploy}/deploy-test/migrations/2_deployment.js (100%) create mode 100644 src/deploy/deploy-test/truffle-config.js create mode 100644 src/oracle/bncWatcher/Dockerfile create mode 100644 src/oracle/bncWatcher/bncWatcher.js rename src/oracle/{watcher => bncWatcher}/db.js (100%) create mode 100644 src/oracle/bncWatcher/package.json rename src/oracle/{watcher => ethWatcher}/Dockerfile (100%) create mode 100644 src/oracle/ethWatcher/db.js rename src/oracle/{watcher => ethWatcher}/ethWatcher.js (93%) rename src/oracle/{watcher => ethWatcher}/package.json (100%) delete mode 100644 src/oracle/watcher/config.json create mode 160000 src/tss/multi-party-ecdsa diff --git a/.gitignore b/.gitignore index 9b81342..b98cf41 100644 --- a/.gitignore +++ b/.gitignore @@ -4,8 +4,12 @@ node_modules/ **/keys*.store **/signature **/params -src/tss/multi-party-ecdsa/ data/ -demo/validator*/ +demo/validator*/db +demo/validator*/keys +demo/validator*/queue demo/ganache_data/ -src/deploy*/build/ +demo/ganache_data_side/ +src/deploy/deploy-home/build/ +src/deploy/deploy-side/build/ +src/deploy/deploy-test/build/ diff --git a/.gitmodules b/.gitmodules index 5358512..d7c4c68 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,9 @@ -[submodule "src/deploy/contracts/openzeppelin-solidity"] - path = src/deploy/contracts/openzeppelin-solidity +[submodule "src/deploy/deploy-home/contracts/openzeppelin-solidity"] + path = src/deploy/deploy-home/contracts/openzeppelin-solidity url = https://github.com/OpenZeppelin/openzeppelin-solidity.git -[submodule "src/deploy-test/contracts/openzeppelin-solidity"] - path = src/deploy-test/contracts/openzeppelin-solidity +[submodule "src/deploy/deploy-test/contracts/openzeppelin-solidity"] + path = src/deploy/deploy-test/contracts/openzeppelin-solidity url = https://github.com/OpenZeppelin/openzeppelin-solidity.git +[submodule "src/tss/multi-party-ecdsa"] + path = src/tss/multi-party-ecdsa + url = https://github.com/k1rill-fedoseev/multi-party-ecdsa.git diff --git a/demo/start-environment.sh b/demo/start-environment.sh index 56a15b2..a9e9387 100755 --- a/demo/start-environment.sh +++ b/demo/start-environment.sh @@ -4,26 +4,44 @@ set -e cd $(dirname "$0") -echo "Starting blockchain" +echo "Starting side test blockchain" -rm -r ./ganache_data +rm -rf ./ganache_data_side + +mkdir ganache_data_side + +kill $(lsof -t -i:3333) > /dev/null 2>&1 || true + +ganache-cli --db ./ganache_data_side -p 3333 -m "shrug dwarf easily blade trigger lucky reopen cage lake scatter desk boat" -i 33 -q & + +echo "Starting home test blockchain" + +rm -rf ./ganache_data mkdir ganache_data -kill $(sudo lsof -t -i:7545) +kill $(lsof -t -i:4444) > /dev/null 2>&1 || true -ganache-cli --db ./ganache_data -p 7545 -m "shrug dwarf easily blade trigger lucky reopen cage lake scatter desk boat" -i 33 -q & +ganache-cli -a 20 --db ./ganache_data -p 4444 -m "shrug dwarf easily blade trigger lucky reopen cage lake scatter desk boat" -i 44 -q & -sleep 3 +sleep 4 echo "Deploying erc20" -cd ../src/deploy-test +cd ../src/deploy/deploy-test truffle deploy --network development --reset > /dev/null -echo "Deploying main part" +echo "Deploying home part" -cd ../deploy +cd ../deploy-home truffle deploy --network development --reset > /dev/null + +echo "Deploying side part" + +cd ../deploy-side + +truffle deploy --network development --reset > /dev/null + +echo "Done" diff --git a/demo/full-demo.sh b/demo/validator-demo.sh similarity index 100% rename from demo/full-demo.sh rename to demo/validator-demo.sh diff --git a/demo/validator1/.env b/demo/validator1/.env new file mode 100644 index 0000000..5fceabf --- /dev/null +++ b/demo/validator1/.env @@ -0,0 +1,15 @@ +HOME_RPC_URL=http://host.docker.internal:4444 +HOME_CHAIN_ID=44 +HOME_BRIDGE_ADDRESS=0x94b40CC641Ed7db241A1f04C8896ba6f6cC36b85 +HOME_TOKEN_ADDRESS=0x44c158FE850821ae69DaF37AADF5c539e9d0025B + +SIDE_RPC_URL=http://host.docker.internal:3333 +SIDE_CHAIN_ID=33 +SIDE_SHARED_DB_ADDRESS=0x44c158FE850821ae69DaF37AADF5c539e9d0025B + +FOREIGN_URL=https://testnet-dex.binance.org/ +FOREIGN_CHAIN_ID=Binance-Chain-Nile + +VALIDATOR_PRIVATE_KEY=2be3f252e16541bf1bb2d4a517d2bf173e6d09f2d765d32c64dc50515aec63ea + +VOTES_PROXY_PORT=5001 diff --git a/demo/validator2/.env b/demo/validator2/.env new file mode 100644 index 0000000..8a6f1eb --- /dev/null +++ b/demo/validator2/.env @@ -0,0 +1,15 @@ +HOME_RPC_URL=http://host.docker.internal:4444 +HOME_CHAIN_ID=44 +HOME_BRIDGE_ADDRESS=0x94b40CC641Ed7db241A1f04C8896ba6f6cC36b85 +HOME_TOKEN_ADDRESS=0x44c158FE850821ae69DaF37AADF5c539e9d0025B + +SIDE_RPC_URL=http://host.docker.internal:3333 +SIDE_CHAIN_ID=33 +SIDE_SHARED_DB_ADDRESS=0x44c158FE850821ae69DaF37AADF5c539e9d0025B + +FOREIGN_URL=https://testnet-dex.binance.org/ +FOREIGN_CHAIN_ID=Binance-Chain-Nile + +VALIDATOR_PRIVATE_KEY=e59d58c77b791f98f10187117374ae9c589d48a62720ec6a5e142b0cc134f685 + +VOTES_PROXY_PORT=5002 diff --git a/demo/validator3/.env b/demo/validator3/.env new file mode 100644 index 0000000..a5507fe --- /dev/null +++ b/demo/validator3/.env @@ -0,0 +1,15 @@ +HOME_RPC_URL=http://host.docker.internal:4444 +HOME_CHAIN_ID=44 +HOME_BRIDGE_ADDRESS=0x94b40CC641Ed7db241A1f04C8896ba6f6cC36b85 +HOME_TOKEN_ADDRESS=0x44c158FE850821ae69DaF37AADF5c539e9d0025B + +SIDE_RPC_URL=http://host.docker.internal:3333 +SIDE_CHAIN_ID=33 +SIDE_SHARED_DB_ADDRESS=0x44c158FE850821ae69DaF37AADF5c539e9d0025B + +FOREIGN_URL=https://testnet-dex.binance.org/ +FOREIGN_CHAIN_ID=Binance-Chain-Nile + +VALIDATOR_PRIVATE_KEY=afaa4d4d6e54d25b0bf0361e3fd6cef562f6311bf6200de2dd0aa4cab63ae3b5 + +VOTES_PROXY_PORT=5003 diff --git a/package-lock.json b/package-lock.json index 9ecf242..8edc807 100644 --- a/package-lock.json +++ b/package-lock.json @@ -78,7 +78,6 @@ "version": "4.63.2", "resolved": "https://registry.npmjs.org/@ledgerhq/hw-transport-node-hid/-/hw-transport-node-hid-4.63.2.tgz", "integrity": "sha512-8sMI7KTXQk6UIVrlSfli7KcqZV+sy/BKZ4/RAzqLY1JVrV5qYt6UGPifZD9T99kJut8EgfdV0HETjhdUAy8EgA==", - "optional": true, "requires": { "@ledgerhq/devices": "^4.63.2", "@ledgerhq/errors": "^4.63.2", @@ -94,7 +93,6 @@ "version": "4.63.2", "resolved": "https://registry.npmjs.org/@ledgerhq/hw-transport-node-hid-noevents/-/hw-transport-node-hid-noevents-4.63.2.tgz", "integrity": "sha512-KKq3QE3/CBZkO2FpW5SMI9UJ/L3rhFwA3l1N/AQhBuzqIEdXhr/eCoxEcT9GC2Xy4TPwguTiDDcZMBwLuPOafQ==", - "optional": true, "requires": { "@ledgerhq/devices": "^4.63.2", "@ledgerhq/errors": "^4.63.2", @@ -286,6 +284,11 @@ "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==" }, + "bignumber.js": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.0.tgz", + "integrity": "sha512-t/OYhhJ2SD+YGBQcjY8GzzDHEk9f3nerxjtfa6tlMXfe7frs/WozhvCNoGvpM0P3bNf3Gq5ZRMlGr5f3r4/N8A==" + }, "bindings": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", @@ -3338,7 +3341,6 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/usb/-/usb-1.6.0.tgz", "integrity": "sha512-52DyWlCk9K+iw3LnvY95WXSnpHjxJoI++aGkV8HiMNPc4zmvDQlYvWAzrkbJ2JH3oUcx26XfU5sZcG4RAcVkMg==", - "optional": true, "requires": { "bindings": "^1.4.0", "nan": "2.13.2", @@ -3348,8 +3350,7 @@ "nan": { "version": "2.13.2", "resolved": "https://registry.npmjs.org/nan/-/nan-2.13.2.tgz", - "integrity": "sha512-TghvYc72wlMGMVMluVo9WRJc0mB8KxxF/gZ4YYFy7V2ZQX9l7rgbPg7vjS9mt6U5HXODVFVI2bOduCzwOMv/lw==", - "optional": true + "integrity": "sha512-TghvYc72wlMGMVMluVo9WRJc0mB8KxxF/gZ4YYFy7V2ZQX9l7rgbPg7vjS9mt6U5HXODVFVI2bOduCzwOMv/lw==" } } }, diff --git a/src/deploy/build/contracts/Migrations.json b/src/deploy/build/contracts/Migrations.json deleted file mode 100644 index fdecfc9..0000000 --- a/src/deploy/build/contracts/Migrations.json +++ /dev/null @@ -1,1392 +0,0 @@ -{ - "contractName": "Migrations", - "abi": [ - { - "constant": true, - "inputs": [], - "name": "last_completed_migration", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "owner", - "outputs": [ - { - "name": "", - "type": "address" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "constant": false, - "inputs": [ - { - "name": "completed", - "type": "uint256" - } - ], - "name": "setCompleted", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "new_address", - "type": "address" - } - ], - "name": "upgrade", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - } - ], - "metadata": "{\"compiler\":{\"version\":\"0.5.9+commit.e560f70d\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":false,\"inputs\":[{\"name\":\"new_address\",\"type\":\"address\"}],\"name\":\"upgrade\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"last_completed_migration\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"completed\",\"type\":\"uint256\"}],\"name\":\"setCompleted\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/Users/kirillfedoseev/Innopolis/My own projects/bridge/bridge/src/deploy/contracts/Migrations.sol\":\"Migrations\"},\"evmVersion\":\"petersburg\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":3},\"remappings\":[]},\"sources\":{\"/Users/kirillfedoseev/Innopolis/My own projects/bridge/bridge/src/deploy/contracts/Migrations.sol\":{\"keccak256\":\"0xc880be5661483402e4e5015965ce74d890cec8e7c6e19e5d3f9cdae5cb2e2132\",\"urls\":[\"bzzr://380f9b6d54c6760b2a469b310f5993da5e25089d503e7deef870a24085fae0ef\",\"dweb:/ipfs/QmUDtTu4cumtRwD3G6rLvrEYAoY7Te8v3wGsWD43S1KAPo\"]}},\"version\":1}", - "bytecode": "0x608060405234801561001057600080fd5b50600080546001600160a01b031916331790556101b3806100326000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80630900f01014610051578063445df0ac146100795780638da5cb5b14610093578063fdacd576146100b7575b600080fd5b6100776004803603602081101561006757600080fd5b50356001600160a01b03166100d4565b005b610081610151565b60408051918252519081900360200190f35b61009b610157565b604080516001600160a01b039092168252519081900360200190f35b610077600480360360208110156100cd57600080fd5b5035610166565b6000546001600160a01b031633141561014e576000819050806001600160a01b031663fdacd5766001546040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561013457600080fd5b505af1158015610148573d6000803e3d6000fd5b50505050505b50565b60015481565b6000546001600160a01b031681565b6000546001600160a01b031633141561014e5760015556fea265627a7a723058207b82efe11634eefc93659f6e965346dfa8d329831b0c932a8bf00110ef550c9064736f6c63430005090032", - "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061004c5760003560e01c80630900f01014610051578063445df0ac146100795780638da5cb5b14610093578063fdacd576146100b7575b600080fd5b6100776004803603602081101561006757600080fd5b50356001600160a01b03166100d4565b005b610081610151565b60408051918252519081900360200190f35b61009b610157565b604080516001600160a01b039092168252519081900360200190f35b610077600480360360208110156100cd57600080fd5b5035610166565b6000546001600160a01b031633141561014e576000819050806001600160a01b031663fdacd5766001546040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561013457600080fd5b505af1158015610148573d6000803e3d6000fd5b50505050505b50565b60015481565b6000546001600160a01b031681565b6000546001600160a01b031633141561014e5760015556fea265627a7a723058207b82efe11634eefc93659f6e965346dfa8d329831b0c932a8bf00110ef550c9064736f6c63430005090032", - "sourceMap": "25:521:2:-;;;192:56;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;223:5:2;:18;;-1:-1:-1;;;;;;223:18:2;231:10;223:18;;;25:521;;;;;;", - "deployedSourceMap": "25:521:2:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;25:521:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;369:175;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;369:175:2;-1:-1:-1;;;;;369:175:2;;:::i;:::-;;78:36;;;:::i;:::-;;;;;;;;;;;;;;;;51:20;;;:::i;:::-;;;;-1:-1:-1;;;;;51:20:2;;;;;;;;;;;;;;254:109;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;254:109:2;;:::i;369:175::-;171:5;;-1:-1:-1;;;;;171:5:2;157:10;:19;153:26;;;435:19;468:11;435:45;;490:8;-1:-1:-1;;;;;490:21:2;;512:24;;490:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;490:47:2;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;490:47:2;;;;178:1;153:26;369:175;:::o;78:36::-;;;;:::o;51:20::-;;;-1:-1:-1;;;;;51:20:2;;:::o;254:109::-;171:5;;-1:-1:-1;;;;;171:5:2;157:10;:19;153:26;;;320:24;:36;254:109::o", - "source": "pragma solidity ^0.5.9;\n\ncontract Migrations {\n address public owner;\n\n uint public last_completed_migration;\n\n modifier restricted() {\n if (msg.sender == owner) _;\n }\n\n constructor() public {\n owner = msg.sender;\n }\n\n function setCompleted(uint completed) restricted public {\n last_completed_migration = completed;\n }\n\n function upgrade(address new_address) restricted public {\n Migrations upgraded = Migrations(new_address);\n upgraded.setCompleted(last_completed_migration);\n }\n}\n", - "sourcePath": "/Users/kirillfedoseev/Innopolis/My own projects/bridge/bridge/src/deploy/contracts/Migrations.sol", - "ast": { - "absolutePath": "/Users/kirillfedoseev/Innopolis/My own projects/bridge/bridge/src/deploy/contracts/Migrations.sol", - "exportedSymbols": { - "Migrations": [ - 175 - ] - }, - "id": 176, - "nodeType": "SourceUnit", - "nodes": [ - { - "id": 120, - "literals": [ - "solidity", - "^", - "0.5", - ".9" - ], - "nodeType": "PragmaDirective", - "src": "0:23:2" - }, - { - "baseContracts": [], - "contractDependencies": [], - "contractKind": "contract", - "documentation": null, - "fullyImplemented": true, - "id": 175, - "linearizedBaseContracts": [ - 175 - ], - "name": "Migrations", - "nodeType": "ContractDefinition", - "nodes": [ - { - "constant": false, - "id": 122, - "name": "owner", - "nodeType": "VariableDeclaration", - "scope": 175, - "src": "51:20:2", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 121, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "51:7:2", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 124, - "name": "last_completed_migration", - "nodeType": "VariableDeclaration", - "scope": 175, - "src": "78:36:2", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 123, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "78:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "public" - }, - { - "body": { - "id": 132, - "nodeType": "Block", - "src": "143:43:2", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 129, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 126, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 786, - "src": "157:3:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 127, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "157:10:2", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "id": 128, - "name": "owner", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 122, - "src": "171:5:2", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "157:19:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 131, - "nodeType": "IfStatement", - "src": "153:26:2", - "trueBody": { - "id": 130, - "nodeType": "PlaceholderStatement", - "src": "178:1:2" - } - } - ] - }, - "documentation": null, - "id": 133, - "name": "restricted", - "nodeType": "ModifierDefinition", - "parameters": { - "id": 125, - "nodeType": "ParameterList", - "parameters": [], - "src": "140:2:2" - }, - "src": "121:65:2", - "visibility": "internal" - }, - { - "body": { - "id": 141, - "nodeType": "Block", - "src": "213:35:2", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 139, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 136, - "name": "owner", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 122, - "src": "223:5:2", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 137, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 786, - "src": "231:3:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 138, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "231:10:2", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "src": "223:18:2", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 140, - "nodeType": "ExpressionStatement", - "src": "223:18:2" - } - ] - }, - "documentation": null, - "id": 142, - "implemented": true, - "kind": "constructor", - "modifiers": [], - "name": "", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 134, - "nodeType": "ParameterList", - "parameters": [], - "src": "203:2:2" - }, - "returnParameters": { - "id": 135, - "nodeType": "ParameterList", - "parameters": [], - "src": "213:0:2" - }, - "scope": 175, - "src": "192:56:2", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 153, - "nodeType": "Block", - "src": "310:53:2", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 151, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 149, - "name": "last_completed_migration", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 124, - "src": "320:24:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 150, - "name": "completed", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 144, - "src": "347:9:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "320:36:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 152, - "nodeType": "ExpressionStatement", - "src": "320:36:2" - } - ] - }, - "documentation": null, - "id": 154, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 147, - "modifierName": { - "argumentTypes": null, - "id": 146, - "name": "restricted", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 133, - "src": "292:10:2", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "292:10:2" - } - ], - "name": "setCompleted", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 145, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 144, - "name": "completed", - "nodeType": "VariableDeclaration", - "scope": 154, - "src": "276:14:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 143, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "276:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "275:16:2" - }, - "returnParameters": { - "id": 148, - "nodeType": "ParameterList", - "parameters": [], - "src": "310:0:2" - }, - "scope": 175, - "src": "254:109:2", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 173, - "nodeType": "Block", - "src": "425:119:2", - "statements": [ - { - "assignments": [ - 162 - ], - "declarations": [ - { - "constant": false, - "id": 162, - "name": "upgraded", - "nodeType": "VariableDeclaration", - "scope": 173, - "src": "435:19:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_contract$_Migrations_$175", - "typeString": "contract Migrations" - }, - "typeName": { - "contractScope": null, - "id": 161, - "name": "Migrations", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 175, - "src": "435:10:2", - "typeDescriptions": { - "typeIdentifier": "t_contract$_Migrations_$175", - "typeString": "contract Migrations" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 166, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 164, - "name": "new_address", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 156, - "src": "468:11:2", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 163, - "name": "Migrations", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 175, - "src": "457:10:2", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_Migrations_$175_$", - "typeString": "type(contract Migrations)" - } - }, - "id": 165, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "457:23:2", - "typeDescriptions": { - "typeIdentifier": "t_contract$_Migrations_$175", - "typeString": "contract Migrations" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "435:45:2" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 170, - "name": "last_completed_migration", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 124, - "src": "512:24:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 167, - "name": "upgraded", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 162, - "src": "490:8:2", - "typeDescriptions": { - "typeIdentifier": "t_contract$_Migrations_$175", - "typeString": "contract Migrations" - } - }, - "id": 169, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "setCompleted", - "nodeType": "MemberAccess", - "referencedDeclaration": 154, - "src": "490:21:2", - "typeDescriptions": { - "typeIdentifier": "t_function_external_nonpayable$_t_uint256_$returns$__$", - "typeString": "function (uint256) external" - } - }, - "id": 171, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "490:47:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 172, - "nodeType": "ExpressionStatement", - "src": "490:47:2" - } - ] - }, - "documentation": null, - "id": 174, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 159, - "modifierName": { - "argumentTypes": null, - "id": 158, - "name": "restricted", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 133, - "src": "407:10:2", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "407:10:2" - } - ], - "name": "upgrade", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 157, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 156, - "name": "new_address", - "nodeType": "VariableDeclaration", - "scope": 174, - "src": "386:19:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 155, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "386:7:2", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "385:21:2" - }, - "returnParameters": { - "id": 160, - "nodeType": "ParameterList", - "parameters": [], - "src": "425:0:2" - }, - "scope": 175, - "src": "369:175:2", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - } - ], - "scope": 176, - "src": "25:521:2" - } - ], - "src": "0:547:2" - }, - "legacyAST": { - "absolutePath": "/Users/kirillfedoseev/Innopolis/My own projects/bridge/bridge/src/deploy/contracts/Migrations.sol", - "exportedSymbols": { - "Migrations": [ - 175 - ] - }, - "id": 176, - "nodeType": "SourceUnit", - "nodes": [ - { - "id": 120, - "literals": [ - "solidity", - "^", - "0.5", - ".9" - ], - "nodeType": "PragmaDirective", - "src": "0:23:2" - }, - { - "baseContracts": [], - "contractDependencies": [], - "contractKind": "contract", - "documentation": null, - "fullyImplemented": true, - "id": 175, - "linearizedBaseContracts": [ - 175 - ], - "name": "Migrations", - "nodeType": "ContractDefinition", - "nodes": [ - { - "constant": false, - "id": 122, - "name": "owner", - "nodeType": "VariableDeclaration", - "scope": 175, - "src": "51:20:2", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 121, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "51:7:2", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 124, - "name": "last_completed_migration", - "nodeType": "VariableDeclaration", - "scope": 175, - "src": "78:36:2", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 123, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "78:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "public" - }, - { - "body": { - "id": 132, - "nodeType": "Block", - "src": "143:43:2", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 129, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 126, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 786, - "src": "157:3:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 127, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "157:10:2", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "id": 128, - "name": "owner", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 122, - "src": "171:5:2", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "157:19:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 131, - "nodeType": "IfStatement", - "src": "153:26:2", - "trueBody": { - "id": 130, - "nodeType": "PlaceholderStatement", - "src": "178:1:2" - } - } - ] - }, - "documentation": null, - "id": 133, - "name": "restricted", - "nodeType": "ModifierDefinition", - "parameters": { - "id": 125, - "nodeType": "ParameterList", - "parameters": [], - "src": "140:2:2" - }, - "src": "121:65:2", - "visibility": "internal" - }, - { - "body": { - "id": 141, - "nodeType": "Block", - "src": "213:35:2", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 139, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 136, - "name": "owner", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 122, - "src": "223:5:2", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 137, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 786, - "src": "231:3:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 138, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "231:10:2", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "src": "223:18:2", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 140, - "nodeType": "ExpressionStatement", - "src": "223:18:2" - } - ] - }, - "documentation": null, - "id": 142, - "implemented": true, - "kind": "constructor", - "modifiers": [], - "name": "", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 134, - "nodeType": "ParameterList", - "parameters": [], - "src": "203:2:2" - }, - "returnParameters": { - "id": 135, - "nodeType": "ParameterList", - "parameters": [], - "src": "213:0:2" - }, - "scope": 175, - "src": "192:56:2", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 153, - "nodeType": "Block", - "src": "310:53:2", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 151, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 149, - "name": "last_completed_migration", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 124, - "src": "320:24:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 150, - "name": "completed", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 144, - "src": "347:9:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "320:36:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 152, - "nodeType": "ExpressionStatement", - "src": "320:36:2" - } - ] - }, - "documentation": null, - "id": 154, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 147, - "modifierName": { - "argumentTypes": null, - "id": 146, - "name": "restricted", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 133, - "src": "292:10:2", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "292:10:2" - } - ], - "name": "setCompleted", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 145, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 144, - "name": "completed", - "nodeType": "VariableDeclaration", - "scope": 154, - "src": "276:14:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 143, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "276:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "275:16:2" - }, - "returnParameters": { - "id": 148, - "nodeType": "ParameterList", - "parameters": [], - "src": "310:0:2" - }, - "scope": 175, - "src": "254:109:2", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 173, - "nodeType": "Block", - "src": "425:119:2", - "statements": [ - { - "assignments": [ - 162 - ], - "declarations": [ - { - "constant": false, - "id": 162, - "name": "upgraded", - "nodeType": "VariableDeclaration", - "scope": 173, - "src": "435:19:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_contract$_Migrations_$175", - "typeString": "contract Migrations" - }, - "typeName": { - "contractScope": null, - "id": 161, - "name": "Migrations", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 175, - "src": "435:10:2", - "typeDescriptions": { - "typeIdentifier": "t_contract$_Migrations_$175", - "typeString": "contract Migrations" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 166, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 164, - "name": "new_address", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 156, - "src": "468:11:2", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 163, - "name": "Migrations", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 175, - "src": "457:10:2", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_Migrations_$175_$", - "typeString": "type(contract Migrations)" - } - }, - "id": 165, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "457:23:2", - "typeDescriptions": { - "typeIdentifier": "t_contract$_Migrations_$175", - "typeString": "contract Migrations" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "435:45:2" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 170, - "name": "last_completed_migration", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 124, - "src": "512:24:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 167, - "name": "upgraded", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 162, - "src": "490:8:2", - "typeDescriptions": { - "typeIdentifier": "t_contract$_Migrations_$175", - "typeString": "contract Migrations" - } - }, - "id": 169, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "setCompleted", - "nodeType": "MemberAccess", - "referencedDeclaration": 154, - "src": "490:21:2", - "typeDescriptions": { - "typeIdentifier": "t_function_external_nonpayable$_t_uint256_$returns$__$", - "typeString": "function (uint256) external" - } - }, - "id": 171, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "490:47:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 172, - "nodeType": "ExpressionStatement", - "src": "490:47:2" - } - ] - }, - "documentation": null, - "id": 174, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 159, - "modifierName": { - "argumentTypes": null, - "id": 158, - "name": "restricted", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 133, - "src": "407:10:2", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "407:10:2" - } - ], - "name": "upgrade", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 157, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 156, - "name": "new_address", - "nodeType": "VariableDeclaration", - "scope": 174, - "src": "386:19:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 155, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "386:7:2", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "385:21:2" - }, - "returnParameters": { - "id": 160, - "nodeType": "ParameterList", - "parameters": [], - "src": "425:0:2" - }, - "scope": 175, - "src": "369:175:2", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - } - ], - "scope": 176, - "src": "25:521:2" - } - ], - "src": "0:547:2" - }, - "compiler": { - "name": "solc", - "version": "0.5.9+commit.e560f70d.Emscripten.clang" - }, - "networks": { - "33": { - "events": {}, - "links": {}, - "address": "0x25Fb15dE8a4bf7fb179e9bE111D0b9fAdb518E0C", - "transactionHash": "0xe900f9df95872646e836e5a0ec9c5c7e1101f70ec35c6cca1b684512e334cfb0" - }, - "77": { - "events": {}, - "links": {}, - "address": "0xeeFA839a17cf5a141b651557A2f7C3a21B410741", - "transactionHash": "0x1bb817c1342068620ca5ddb442b6fd55637de84214c269495fecf2562df2444b" - } - }, - "schemaVersion": "3.0.10", - "updatedAt": "2019-07-03T18:43:48.340Z", - "devdoc": { - "methods": {} - }, - "userdoc": { - "methods": {} - } -} \ No newline at end of file diff --git a/src/deploy/build/contracts/SharedDB.json b/src/deploy/build/contracts/SharedDB.json deleted file mode 100644 index 312503a..0000000 --- a/src/deploy/build/contracts/SharedDB.json +++ /dev/null @@ -1,18327 +0,0 @@ -{ - "contractName": "SharedDB", - "abi": [ - { - "constant": true, - "inputs": [], - "name": "x", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "", - "type": "bytes32" - } - ], - "name": "confirmationsCount", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "", - "type": "uint256" - } - ], - "name": "threshold", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "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": "", - "type": "bytes32" - } - ], - "name": "dbSign", - "outputs": [ - { - "name": "", - "type": "bytes" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "ready", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "", - "type": "uint256" - } - ], - "name": "parties", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "", - "type": "bytes32" - } - ], - "name": "dbSignups", - "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": true, - "inputs": [ - { - "name": "", - "type": "bytes32" - } - ], - "name": "signupsCount", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "y", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "", - "type": "bytes32" - } - ], - "name": "dbValidator", - "outputs": [ - { - "name": "addr", - "type": "address" - }, - { - "name": "partyId", - "type": "uint256" - }, - { - "name": "next", - "type": "bytes32" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "", - "type": "bytes32" - } - ], - "name": "dbKeygen", - "outputs": [ - { - "name": "", - "type": "bytes" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "", - "type": "bytes32" - } - ], - "name": "confirmations", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "name": "_threshold", - "type": "uint32" - }, - { - "name": "_parties", - "type": "uint32" - }, - { - "name": "validators", - "type": "address[]" - }, - { - "name": "_tokenContract", - "type": "address" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "epoch", - "type": "uint256" - } - ], - "name": "NewEpoch", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "epoch", - "type": "uint256" - }, - { - "indexed": false, - "name": "x", - "type": "uint256" - }, - { - "indexed": false, - "name": "y", - "type": "uint256" - } - ], - "name": "KeygenCompleted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "from", - "type": "address" - }, - { - "indexed": true, - "name": "hash", - "type": "bytes32" - }, - { - "indexed": false, - "name": "epoch", - "type": "uint256" - }, - { - "indexed": false, - "name": "partyId", - "type": "uint256" - } - ], - "name": "Signup", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "name": "from", - "type": "address" - }, - { - "indexed": false, - "name": "recipient", - "type": "string" - }, - { - "indexed": false, - "name": "value", - "type": "uint256" - } - ], - "name": "ReceivedTokens", - "type": "event" - }, - { - "constant": false, - "inputs": [ - { - "name": "value", - "type": "uint256" - }, - { - "name": "recipient", - "type": "string" - } - ], - "name": "requestAffirmation", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "_x", - "type": "uint256" - }, - { - "name": "_y", - "type": "uint256" - } - ], - "name": "confirm", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "key", - "type": "bytes32" - }, - { - "name": "data", - "type": "bytes" - } - ], - "name": "setKeygenData", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "fromPartyId", - "type": "uint256" - }, - { - "name": "key", - "type": "bytes32" - } - ], - "name": "getKeygenData", - "outputs": [ - { - "name": "", - "type": "bytes" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "hash", - "type": "bytes32" - }, - { - "name": "_epoch", - "type": "uint256" - } - ], - "name": "signupSign", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "hash", - "type": "bytes32" - } - ], - "name": "signupSign", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "hash", - "type": "bytes32" - }, - { - "name": "key", - "type": "bytes32" - }, - { - "name": "data", - "type": "bytes" - } - ], - "name": "setSignData", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "signupId", - "type": "uint256" - }, - { - "name": "hash", - "type": "bytes32" - }, - { - "name": "key", - "type": "bytes32" - } - ], - "name": "getSignData", - "outputs": [ - { - "name": "", - "type": "bytes" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "getPartyId", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - } - ], - "metadata": "{\"compiler\":{\"version\":\"0.5.9+commit.e560f70d\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":true,\"inputs\":[],\"name\":\"x\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"key\",\"type\":\"bytes32\"},{\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"setKeygenData\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"confirmationsCount\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"hash\",\"type\":\"bytes32\"},{\"name\":\"_epoch\",\"type\":\"uint256\"}],\"name\":\"signupSign\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getPartyId\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"threshold\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"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\":\"\",\"type\":\"bytes32\"}],\"name\":\"dbSign\",\"outputs\":[{\"name\":\"\",\"type\":\"bytes\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"signupId\",\"type\":\"uint256\"},{\"name\":\"hash\",\"type\":\"bytes32\"},{\"name\":\"key\",\"type\":\"bytes32\"}],\"name\":\"getSignData\",\"outputs\":[{\"name\":\"\",\"type\":\"bytes\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"ready\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"parties\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"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\":false,\"inputs\":[{\"name\":\"_x\",\"type\":\"uint256\"},{\"name\":\"_y\",\"type\":\"uint256\"}],\"name\":\"confirm\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"epoch\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"value\",\"type\":\"uint256\"},{\"name\":\"recipient\",\"type\":\"string\"}],\"name\":\"requestAffirmation\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"signupsCount\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"hash\",\"type\":\"bytes32\"},{\"name\":\"key\",\"type\":\"bytes32\"},{\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"setSignData\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"y\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"dbValidator\",\"outputs\":[{\"name\":\"addr\",\"type\":\"address\"},{\"name\":\"partyId\",\"type\":\"uint256\"},{\"name\":\"next\",\"type\":\"bytes32\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"dbKeygen\",\"outputs\":[{\"name\":\"\",\"type\":\"bytes\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"confirmations\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"fromPartyId\",\"type\":\"uint256\"},{\"name\":\"key\",\"type\":\"bytes32\"}],\"name\":\"getKeygenData\",\"outputs\":[{\"name\":\"\",\"type\":\"bytes\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"_threshold\",\"type\":\"uint32\"},{\"name\":\"_parties\",\"type\":\"uint32\"},{\"name\":\"validators\",\"type\":\"address[]\"},{\"name\":\"_tokenContract\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"epoch\",\"type\":\"uint256\"}],\"name\":\"NewEpoch\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"epoch\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"x\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"y\",\"type\":\"uint256\"}],\"name\":\"KeygenCompleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"hash\",\"type\":\"bytes32\"},{\"indexed\":false,\"name\":\"epoch\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"partyId\",\"type\":\"uint256\"}],\"name\":\"Signup\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"recipient\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"ReceivedTokens\",\"type\":\"event\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/Users/kirillfedoseev/Innopolis/My own projects/bridge/bridge/src/deploy/contracts/SharedDB.sol\":\"SharedDB\"},\"evmVersion\":\"petersburg\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":3},\"remappings\":[]},\"sources\":{\"/Users/kirillfedoseev/Innopolis/My own projects/bridge/bridge/src/deploy/contracts/SharedDB.sol\":{\"keccak256\":\"0x9c1d2e39b3288d2958986425d561a548ec6b87d2bb10cdda2fd24ed2bd4a8fd3\",\"urls\":[\"bzzr://ac9ae31e48571cbf9416109efa8d78b7e1e82388923945dc8cda516032e87007\",\"dweb:/ipfs/QmNRcMSunsuKR5dGpMceBAN5UPiNeQuFiuStuySTdfWJDr\"]},\"/Users/kirillfedoseev/Innopolis/My own projects/bridge/bridge/src/deploy/contracts/openzeppelin-solidity/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0x90e8c2521653bbb1768b05889c5760031e688d9cd361f167489b89215e201b95\",\"urls\":[\"bzzr://aa8b45b57edafc3d67bc5d916327ea16807fae33f753ca163ae0c4061b789766\",\"dweb:/ipfs/QmP5NaEwZthQeM2ESz4WTT3osrP7jhbvu7ocbttBi2JAw6\"]}},\"version\":1}", - "bytecode": "0x60806040523480156200001157600080fd5b50604051620014cf380380620014cf833981810160405260808110156200003757600080fd5b81516020830151604084018051929491938201926401000000008111156200005e57600080fd5b820160208101848111156200007257600080fd5b81518560208202830111640100000000821117156200009057600080fd5b5050602090910151909250905063ffffffff8316620000ae57600080fd5b8263ffffffff168463ffffffff1610620000c757600080fd5b8263ffffffff16825114620000db57600080fd5b601080546001600160a01b0319166001600160a01b0383161790556001600f819055600c805460ff19169055600090815263ffffffff8581167ffd54ff1ed53f34a900b24c5ba64f85761163b5d82d98a47b9bd80e45466993c555600e60205284167fa7c5ba7114a813b50159add3a36832908dc83db71d0b9a24c2ad0f83be9582075560408051606081019091528351909182918591906200017a57fe5b6020908102919091018101516001600160a01b039081168352600183830181905260006040948501819052855181546001600160a01b03191693169290921782559184015190915591015160025582516200021d918491620001d857fe5b602090810291909101810151604080516060810182526000546001600160a01b031681526001549381019390935260025490830152906001600160e01b036200035616565b60015b8363ffffffff168110156200031f57620002928382815181106200024057fe5b602002602001015160405180606001604052808685815181106200026057fe5b60200260200101516001600160a01b031681526020018460010181526020016000801b8152506200035660201b60201c565b6000620002bc846001840381518110620002a857fe5b6020026020010151620003d060201b60201c565b9050600f54848381518110620002ce57fe5b602090810291909101810151604080518084019490945260609190911b6001600160601b03191683820152805180840360340181526054909301905281519101206002919091015560010162000220565b50600f546040517febad8099c467528a56c98b63c8d476d251cf1ffb4c75db94b4d23fa2b6a1e33590600090a25050505062000435565b600f546040805160208082019390935260609490941b6001600160601b031916848201528051808503603401815260549094018152835193820193909320600090815260038252839020825181546001600160a01b0319166001600160a01b03909116178155908201516001820155910151600290910155565b6000620003e682600f54620003ec60201b60201c565b92915050565b6040805160208082019390935260609390931b6001600160601b031916838201528051808403603401815260549093018152825192820192909220600090815260039091522090565b61108a80620004456000396000f3fe608060405234801561001057600080fd5b506004361061011d5760003560e01c80630c55699c146101225780630d8d64c31461013c5780632591018b146101e95780632c63b321146102065780632fb0fc6f1461022957806331eb7a1a1461023157806355a373d61461024e57806361dd123e146102725780636de0fb4a146103045780636defbf801461032d57806370651a181461034957806374ce45e1146103665780637ad5f33d146103835780638651dc1e146103a0578063900cf0cf146103c357806393daa26a146103cb57806399648b32146104765780639f2a394914610493578063a56dfe4a14610543578063c0fa5e061461054b578063ddc42ebc14610590578063ec95bfe7146105ad578063ff112667146105ca575b600080fd5b61012a6105ed565b60408051918252519081900360200190f35b6101e76004803603604081101561015257600080fd5b81359190810190604081016020820135600160201b81111561017357600080fd5b82018360208201111561018557600080fd5b803590602001918460018302840111600160201b831117156101a657600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506105f3945050505050565b005b61012a600480360360208110156101ff57600080fd5b503561067c565b6101e76004803603604081101561021c57600080fd5b508035906020013561068e565b61012a610837565b61012a6004803603602081101561024757600080fd5b503561084c565b61025661085e565b604080516001600160a01b039092168252519081900360200190f35b61028f6004803603602081101561028857600080fd5b503561086d565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102c95781810151838201526020016102b1565b50505050905090810190601f1680156102f65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61028f6004803603606081101561031a57600080fd5b5080359060208101359060400135610908565b6103356109e6565b604080519115158252519081900360200190f35b61012a6004803603602081101561035f57600080fd5b50356109ef565b6101e76004803603602081101561037c57600080fd5b5035610a01565b61012a6004803603602081101561039957600080fd5b5035610a10565b6101e7600480360360408110156103b657600080fd5b5080359060200135610a22565b61012a610bae565b6101e7600480360360408110156103e157600080fd5b81359190810190604081016020820135600160201b81111561040257600080fd5b82018360208201111561041457600080fd5b803590602001918460018302840111600160201b8311171561043557600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610bb4945050505050565b61012a6004803603602081101561048c57600080fd5b5035610cef565b6101e7600480360360608110156104a957600080fd5b813591602081013591810190606081016040820135600160201b8111156104cf57600080fd5b8201836020820111156104e157600080fd5b803590602001918460018302840111600160201b8311171561050257600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610d01945050505050565b61012a610dde565b6105686004803603602081101561056157600080fd5b5035610de4565b604080516001600160a01b039094168452602084019290925282820152519081900360600190f35b61028f600480360360208110156105a657600080fd5b5035610e0f565b610335600480360360208110156105c357600080fd5b5035610e77565b61028f600480360360408110156105e057600080fd5b5080359060200135610e8c565b600a5481565b60006105fe33610f60565b905080600101546000141561061257600080fd5b600c5460ff161561062257600080fd5b600f5460018201546040805160208082019490945280820187905260608082019390935281518082039093018352608001815281519183019190912060009081526004835220835161067692850190610fbd565b50505050565b60056020526000908152604090205481565b600061069a3383610f74565b90508060010154600014156106ae57600080fd5b600c5460ff166106bd57600080fd5b6000828152600d60209081526040808320548151808401879052808301889052825180820384018152606090910183528051908401208452600790925290912054111561074a576040805162461bcd60e51b8152602060048201526016602482015275416c726561647920656e6f756768207369676e65727360501b604482015290519081900360640190fd5b6040805160208082018590528183018690528251808303840181526060830184528051908201206000908152600780835284822080546001908101918290558701546080860189905260a086018a905260c0808701919091528651808703909101815260e0860187528051908501208352600984528583205561010084018790526101208085018990528551808603909101815261014085018087528151918501919091208352925283902054908590526101608201529051849133917f0241f8405c07cef23d7f0c436e722ead63bf1d1a54f5e956d61c4d49abe9161a918190036101800190a3505050565b600061084233610f60565b6001015490505b90565b600d6020526000908152604090205481565b6010546001600160a01b031681565b60066020908152600091825260409182902080548351601f6002600019610100600186161502019093169290920491820184900484028101840190945280845290918301828280156109005780601f106108d557610100808354040283529160200191610900565b820191906000526020600020905b8154815290600101906020018083116108e357829003601f168201915b505050505081565b600f5460408051602080820193909352808201859052606080820187905260808083018690528351808403909101815260a08301808552815191860191909120600090815260068652849020805460026001821615610100026000190190911604601f8101879004909602840160c0908101909552858252919490939192909101828280156109d85780601f106109ad576101008083540402835291602001916109d8565b820191906000526020600020905b8154815290600101906020018083116109bb57829003601f168201915b505050505090509392505050565b600c5460ff1681565b600e6020526000908152604090205481565b610a0d81600f5461068e565b50565b60096020526000908152604090205481565b6000610a2d33610f60565b9050806001015460001415610a4157600080fd5b600f54600182015460408051602080820194909452808201929092526060820186905260808083018690528151808403909101815260a090920181528151918301919091206000908152600890925290205460ff1615610aa057600080fd5b600f805460018381015460408051602080820195909552808201929092526060820188905260808083018890528151808403909101815260a083018252805190850120600090815260088552818120805460ff1916851790559454808652600e85528186205460c084019190915260e0830189905261010080840189905282518085039091018152610120909301825282519285019290922085526005909352919092208054909201918290551415610ba957600a839055600b829055600c805460ff19166001179055600f54604080518581526020810185905281517fd5142d1199af83907992e45da5956bcd2b7656960404acb6b52c57f2001d4c34929181900390910190a25b505050565b600f5481565b601054604080516323b872dd60e01b81523360048201523060248201526044810185905290516001600160a01b03909216916323b872dd916064808201926020929091908290030181600087803b158015610c0e57600080fd5b505af1158015610c22573d6000803e3d6000fd5b505050506040513d6020811015610c3857600080fd5b505060408051338082529181018490526060602082810182815285519284019290925284517ff5c740acde48c0facbccbf48e65351e42a1e79e6cb26cd5bbb80a545cb38fdc79493869388939192909160808401919086019080838360005b83811015610caf578181015183820152602001610c97565b50505050905090810190601f168015610cdc5780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a15050565b60076020526000908152604090205481565b6000610d0c33610f60565b9050806001015460001415610d2057600080fd5b600c5460ff16610d2f57600080fd5b600f546001820154604080516020808201949094528082018890526060808201939093528151808203909301835260800181528151918301919091206000908152600990925290205480610d8257600080fd5b600f54604080516020808201939093528082018890526060810184905260808082018890528251808303909101815260a09091018252805190830120600090815260068352208451610dd692860190610fbd565b505050505050565b600b5481565b6003602052600090815260409020805460018201546002909201546001600160a01b03909116919083565b60046020908152600091825260409182902080548351601f6002600019610100600186161502019093169290920491820184900484028101840190945280845290918301828280156109005780601f106108d557610100808354040283529160200191610900565b60086020526000908152604090205460ff1681565b600f5460408051602080820193909352808201849052606080820186905282518083038201815260808301808552815191860191909120600090815260048652849020805460026001821615610100026000190190911604601f8101879004909602840160a090810190955285825291949093919290910182828015610f535780601f10610f2857610100808354040283529160200191610f53565b820191906000526020600020905b815481529060010190602001808311610f3657829003601f168201915b5050505050905092915050565b6000610f6e82600f54610f74565b92915050565b6040805160208082019390935260609390931b6001600160601b031916838201528051808403603401815260549093018152825192820192909220600090815260039091522090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10610ffe57805160ff191683800117855561102b565b8280016001018555821561102b579182015b8281111561102b578251825591602001919060010190611010565b5061103792915061103b565b5090565b61084991905b80821115611037576000815560010161104156fea265627a7a72305820ab8330caf125a47759a427b25b2eca3175d4f84173a19ed2c2ecaba788842ec364736f6c63430005090032", - "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061011d5760003560e01c80630c55699c146101225780630d8d64c31461013c5780632591018b146101e95780632c63b321146102065780632fb0fc6f1461022957806331eb7a1a1461023157806355a373d61461024e57806361dd123e146102725780636de0fb4a146103045780636defbf801461032d57806370651a181461034957806374ce45e1146103665780637ad5f33d146103835780638651dc1e146103a0578063900cf0cf146103c357806393daa26a146103cb57806399648b32146104765780639f2a394914610493578063a56dfe4a14610543578063c0fa5e061461054b578063ddc42ebc14610590578063ec95bfe7146105ad578063ff112667146105ca575b600080fd5b61012a6105ed565b60408051918252519081900360200190f35b6101e76004803603604081101561015257600080fd5b81359190810190604081016020820135600160201b81111561017357600080fd5b82018360208201111561018557600080fd5b803590602001918460018302840111600160201b831117156101a657600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506105f3945050505050565b005b61012a600480360360208110156101ff57600080fd5b503561067c565b6101e76004803603604081101561021c57600080fd5b508035906020013561068e565b61012a610837565b61012a6004803603602081101561024757600080fd5b503561084c565b61025661085e565b604080516001600160a01b039092168252519081900360200190f35b61028f6004803603602081101561028857600080fd5b503561086d565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102c95781810151838201526020016102b1565b50505050905090810190601f1680156102f65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61028f6004803603606081101561031a57600080fd5b5080359060208101359060400135610908565b6103356109e6565b604080519115158252519081900360200190f35b61012a6004803603602081101561035f57600080fd5b50356109ef565b6101e76004803603602081101561037c57600080fd5b5035610a01565b61012a6004803603602081101561039957600080fd5b5035610a10565b6101e7600480360360408110156103b657600080fd5b5080359060200135610a22565b61012a610bae565b6101e7600480360360408110156103e157600080fd5b81359190810190604081016020820135600160201b81111561040257600080fd5b82018360208201111561041457600080fd5b803590602001918460018302840111600160201b8311171561043557600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610bb4945050505050565b61012a6004803603602081101561048c57600080fd5b5035610cef565b6101e7600480360360608110156104a957600080fd5b813591602081013591810190606081016040820135600160201b8111156104cf57600080fd5b8201836020820111156104e157600080fd5b803590602001918460018302840111600160201b8311171561050257600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610d01945050505050565b61012a610dde565b6105686004803603602081101561056157600080fd5b5035610de4565b604080516001600160a01b039094168452602084019290925282820152519081900360600190f35b61028f600480360360208110156105a657600080fd5b5035610e0f565b610335600480360360208110156105c357600080fd5b5035610e77565b61028f600480360360408110156105e057600080fd5b5080359060200135610e8c565b600a5481565b60006105fe33610f60565b905080600101546000141561061257600080fd5b600c5460ff161561062257600080fd5b600f5460018201546040805160208082019490945280820187905260608082019390935281518082039093018352608001815281519183019190912060009081526004835220835161067692850190610fbd565b50505050565b60056020526000908152604090205481565b600061069a3383610f74565b90508060010154600014156106ae57600080fd5b600c5460ff166106bd57600080fd5b6000828152600d60209081526040808320548151808401879052808301889052825180820384018152606090910183528051908401208452600790925290912054111561074a576040805162461bcd60e51b8152602060048201526016602482015275416c726561647920656e6f756768207369676e65727360501b604482015290519081900360640190fd5b6040805160208082018590528183018690528251808303840181526060830184528051908201206000908152600780835284822080546001908101918290558701546080860189905260a086018a905260c0808701919091528651808703909101815260e0860187528051908501208352600984528583205561010084018790526101208085018990528551808603909101815261014085018087528151918501919091208352925283902054908590526101608201529051849133917f0241f8405c07cef23d7f0c436e722ead63bf1d1a54f5e956d61c4d49abe9161a918190036101800190a3505050565b600061084233610f60565b6001015490505b90565b600d6020526000908152604090205481565b6010546001600160a01b031681565b60066020908152600091825260409182902080548351601f6002600019610100600186161502019093169290920491820184900484028101840190945280845290918301828280156109005780601f106108d557610100808354040283529160200191610900565b820191906000526020600020905b8154815290600101906020018083116108e357829003601f168201915b505050505081565b600f5460408051602080820193909352808201859052606080820187905260808083018690528351808403909101815260a08301808552815191860191909120600090815260068652849020805460026001821615610100026000190190911604601f8101879004909602840160c0908101909552858252919490939192909101828280156109d85780601f106109ad576101008083540402835291602001916109d8565b820191906000526020600020905b8154815290600101906020018083116109bb57829003601f168201915b505050505090509392505050565b600c5460ff1681565b600e6020526000908152604090205481565b610a0d81600f5461068e565b50565b60096020526000908152604090205481565b6000610a2d33610f60565b9050806001015460001415610a4157600080fd5b600f54600182015460408051602080820194909452808201929092526060820186905260808083018690528151808403909101815260a090920181528151918301919091206000908152600890925290205460ff1615610aa057600080fd5b600f805460018381015460408051602080820195909552808201929092526060820188905260808083018890528151808403909101815260a083018252805190850120600090815260088552818120805460ff1916851790559454808652600e85528186205460c084019190915260e0830189905261010080840189905282518085039091018152610120909301825282519285019290922085526005909352919092208054909201918290551415610ba957600a839055600b829055600c805460ff19166001179055600f54604080518581526020810185905281517fd5142d1199af83907992e45da5956bcd2b7656960404acb6b52c57f2001d4c34929181900390910190a25b505050565b600f5481565b601054604080516323b872dd60e01b81523360048201523060248201526044810185905290516001600160a01b03909216916323b872dd916064808201926020929091908290030181600087803b158015610c0e57600080fd5b505af1158015610c22573d6000803e3d6000fd5b505050506040513d6020811015610c3857600080fd5b505060408051338082529181018490526060602082810182815285519284019290925284517ff5c740acde48c0facbccbf48e65351e42a1e79e6cb26cd5bbb80a545cb38fdc79493869388939192909160808401919086019080838360005b83811015610caf578181015183820152602001610c97565b50505050905090810190601f168015610cdc5780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a15050565b60076020526000908152604090205481565b6000610d0c33610f60565b9050806001015460001415610d2057600080fd5b600c5460ff16610d2f57600080fd5b600f546001820154604080516020808201949094528082018890526060808201939093528151808203909301835260800181528151918301919091206000908152600990925290205480610d8257600080fd5b600f54604080516020808201939093528082018890526060810184905260808082018890528251808303909101815260a09091018252805190830120600090815260068352208451610dd692860190610fbd565b505050505050565b600b5481565b6003602052600090815260409020805460018201546002909201546001600160a01b03909116919083565b60046020908152600091825260409182902080548351601f6002600019610100600186161502019093169290920491820184900484028101840190945280845290918301828280156109005780601f106108d557610100808354040283529160200191610900565b60086020526000908152604090205460ff1681565b600f5460408051602080820193909352808201849052606080820186905282518083038201815260808301808552815191860191909120600090815260048652849020805460026001821615610100026000190190911604601f8101879004909602840160a090810190955285825291949093919290910182828015610f535780601f10610f2857610100808354040283529160200191610f53565b820191906000526020600020905b815481529060010190602001808311610f3657829003601f168201915b5050505050905092915050565b6000610f6e82600f54610f74565b92915050565b6040805160208082019390935260609390931b6001600160601b031916838201528051808403603401815260549093018152825192820192909220600090815260039091522090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10610ffe57805160ff191683800117855561102b565b8280016001018555821561102b579182015b8281111561102b578251825591602001919060010190611010565b5061103792915061103b565b5090565b61084991905b80821115611037576000815560010161104156fea265627a7a72305820ab8330caf125a47759a427b25b2eca3175d4f84173a19ed2c2ecaba788842ec364736f6c63430005090032", - "sourceMap": "92:5021:2:-;;;954:892;8:9:-1;5:2;;;30:1;27;20:12;5:2;954:892:2;;;;;;;;;;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;954:892:2;;;;;;;;;;;;;;;;;;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;;954:892:2;;;;;;;-1:-1:-1;954:892:2;-1:-1:-1;1080:12:2;;;1072:21;;;;;;1124:8;1111:21;;:10;:21;;;1103:30;;;;;;1172:8;1151:29;;:10;:17;:29;1143:38;;;;;;1192:13;:38;;-1:-1:-1;;;;;;1192:38:2;-1:-1:-1;;;;;1192:38:2;;;;;-1:-1:-1;1241:5:2;:9;;;1260:5;:13;;-1:-1:-1;;1260:13:2;;;-1:-1:-1;1284:16:2;;;:29;;;;:16;:29;1323:7;1284:16;1323:14;:25;;:14;:25;1284:16;1397:30;;;;;;;;1407:13;;1397:30;;;;1407:13;;-1:-1:-1;1407:13:2;;;;;;;;;;;;;;;-1:-1:-1;;;;;1397:30:2;;;;;1422:1;1397:30;;;;;;-1:-1:-1;1397:30:2;;;;;;;1385:42;;;;-1:-1:-1;;;;;;1385:42:2;;;;;;;;;;;;;;;;;;;;;1450:13;;1437:38;;1450:13;;;;;;;;;;;;;;;;;1437:38;;;;;;;;1465:9;1437:38;-1:-1:-1;;;;;1437:38:2;;;;;;;;;;;;;;;;;;1450:13;-1:-1:-1;;;;;1437:12:2;:38;:::i;:::-;1528:1;1514:295;1535:8;1531:12;;:1;:12;1514:295;;;1564:63;1577:10;1588:1;1577:13;;;;;;;;;;;;;;1592:34;;;;;;;;1602:10;1613:1;1602:13;;;;;;;;;;;;;;-1:-1:-1;;;;;1592:34:2;;;;;1617:1;1621;1617:5;1592:34;;;;1624:1;1592:34;;;;;1564:12;;;:63;;:::i;:::-;1673:19;1695:31;1708:10;1723:1;1719;:5;1708:17;;;;;;;;;;;;;;1695:12;;;:31;;:::i;:::-;1673:53;;1776:5;;1783:10;1794:1;1783:13;;;;;;;;;;;;;;;;;;;1759:38;;;;;;;;;;;;;;;-1:-1:-1;;;;;;1759:38:2;;;;;;;26:21:-1;;;22:32;;6:49;;1759:38:2;;;;;;1749:49;;;;;1740:6;;;;;:58;1545:3;;1514:295;;;-1:-1:-1;1833:5:2;;1824:15;;;;;;;954:892;;;;92:5021;;4582:132;4692:5;;4675:26;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;4675:26:2;;;;;;;26:21:-1;;;22:32;;6:49;;4675:26:2;;;;;;4665:37;;;;;;;;;-1:-1:-1;4653:50:2;;;:11;:50;;;;;:54;;;;-1:-1:-1;;;;;;4653:54:2;-1:-1:-1;;;;;4653:54:2;;;;;;;;;;-1:-1:-1;4653:54:2;;;;;;;;;;;4582:132::o;4720:120::-;4775:17;4811:22;4824:1;4827:5;;4811:12;;;:22;;:::i;:::-;4804:29;4720:120;-1:-1:-1;;4720:120:2:o;4846:154::-;4968:23;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;4968:23:2;;;;;;;26:21:-1;;;22:32;;6:49;;4968:23:2;;;;;;4958:34;;;;;;;;;-1:-1:-1;4946:47:2;;;:11;:47;;;;;4846:154::o;92:5021::-;;;;;;;", - "deployedSourceMap": "92:5021:2:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;92:5021:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;780:13;;;:::i;:::-;;;;;;;;;;;;;;;;2711:261;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;2711:261:2;;;;;;;;;;;;;;-1:-1:-1;;;5:28;;2:2;;;46:1;43;36:12;2:2;2711:261:2;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;2711:261:2;;;;;;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;2711:261:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;81:16;;74:27;;;;-1:-1;2711:261:2;;-1:-1:-1;2711:261:2;;-1:-1:-1;;;;;2711:261:2:i;:::-;;530:50;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;530:50:2;;:::i;3246:652::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;3246:652:2;;;;;;;:::i;5006:105::-;;;:::i;843:38::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;843:38:2;;:::i;1852:27::-;;;:::i;:::-;;;;-1:-1:-1;;;;;1852:27:2;;;;;;;;;;;;;;586:39;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;586:39:2;;:::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;586:39:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4305:271;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;4305:271:2;;;;;;;;;;;;:::i;819:17::-;;;:::i;:::-;;;;;;;;;;;;;;;;;;887:36;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;887:36:2;;:::i;3159:81::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;3159:81:2;;:::i;732:41::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;732:41:2;;:::i;2172:533::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;2172:533:2;;;;;;;:::i;930:17::-;;;:::i;1957:209::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;1957:209:2;;;;;;;;;;;;;;-1:-1:-1;;;5:28;;2:2;;;46:1;43;36:12;2:2;1957:209:2;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;1957:209:2;;;;;;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;1957:209:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;81:16;;74:27;;;;-1:-1;1957:209:2;;-1:-1:-1;1957:209:2;;-1:-1:-1;;;;;1957:209:2:i;631:44::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;631:44:2;;:::i;3904:395::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;3904:395:2;;;;;;;;;;;;;;;;;;-1:-1:-1;;;5:28;;2:2;;;46:1;43;36:12;2:2;3904:395:2;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;3904:395:2;;;;;;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;3904:395:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;81:16;;74:27;;;;-1:-1;3904:395:2;;-1:-1:-1;3904:395:2;;-1:-1:-1;;;;;3904:395:2:i;799:13::-;;;:::i;429:48::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;429:48:2;;:::i;:::-;;;;-1:-1:-1;;;;;429:48:2;;;;;;;;;;;;;;;;;;;;;;;;;483:41;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;483:41:2;;:::i;681:45::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;681:45:2;;:::i;2978:175::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;2978:175:2;;;;;;;:::i;780:13::-;;;;:::o;2711:261::-;2783:19;2805:24;2818:10;2805:12;:24::i;:::-;2783:46;;2847:1;:9;;;2860:1;2847:14;;2839:23;;;;;;2881:5;;;;2880:6;2872:15;;;;;;2934:5;;2946:9;;;;2917:39;;;;;;;;;;;;;;;;;;;;;;;;;;;26:21:-1;;;22:32;;;6:49;;2917:39:2;;;;2907:50;;;;;;;;;2898:60;;;;:8;:60;;;:67;;;;;;;;:::i;:::-;;2711:261;;;:::o;530:50::-;;;;;;;;;;;;;:::o;3246:652::-;3310:19;3332:32;3345:10;3357:6;3332:12;:32::i;:::-;3310:54;;3382:1;:9;;;3395:1;3382:14;;3374:23;;;;;;3415:5;;;;3407:14;;;;;;3498:17;;;;:9;:17;;;;;;;;;3462:30;;;;;;;;;;;;;;;;26:21:-1;;;22:32;;6:49;;3462:30:2;;;;;;3452:41;;;;;;3439:55;;:12;:55;;;;;;;:76;;3431:111;;;;;-1:-1:-1;;;3431:111:2;;;;;;;;;;;;-1:-1:-1;;;3431:111:2;;;;;;;;;;;;;;;3754:30;;;;;;;;;;;;;;;;;;26:21:-1;;;22:32;;6:49;;3754:30:2;;;;;3744:41;;;;;;3731:55;;;;:12;:55;;;;;;3729:57;;;;;;;;;;3714:9;;;3683:41;;;;;;;;;;;;;;;;;;;;;;26:21:-1;;;22:32;;;6:49;;3683:41:2;;;;;3673:52;;;;;;3663:63;;:9;:63;;;;;:123;3858:30;;;;;;;;;;;;;;;26:21:-1;;;22:32;;;6:49;;3858:30:2;;;;;;3848:41;;;;;;;;;3835:55;;;;;;;;3802:89;;;;;;;;;;3779:4;;3809:10;;3802:89;;;;;;;;;3246:652;;;:::o;5006:105::-;5049:4;5072:24;5085:10;5072:12;:24::i;:::-;:32;;;5065:39;;5006:105;;:::o;843:38::-;;;;;;;;;;;;;:::o;1852:27::-;;;-1:-1:-1;;;;;1852:27:2;;:::o;586:39::-;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;586:39:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;4305:271::-;4540:5;;4523:44;;;;;;;;;;;;;;;;;4389:12;4523:44;;;;;;;;;;;;;;;26:21:-1;;;22:32;;;6:49;;4523:44:2;;;;;;4513:55;;;;;;;;;-1:-1:-1;4506:63:2;;;:6;:63;;;;;4499:70;;;;;;;;;-1:-1:-1;;4499:70:2;;;;;;;;;;;;;;;;;;;;;;;;;;4389:12;;4523:44;;4506:63;;4499:70;;;4506:63;4499:70;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4305:271;;;;;:::o;819:17::-;;;;;;:::o;887:36::-;;;;;;;;;;;;;:::o;3159:81::-;3210:23;3221:4;3227:5;;3210:10;:23::i;:::-;3159:81;:::o;732:41::-;;;;;;;;;;;;;:::o;2172:533::-;2224:19;2246:24;2259:10;2246:12;:24::i;:::-;2224:46;;2288:1;:9;;;2301:1;2288:14;;2280:23;;;;;;2363:5;;2370:9;;;;2346:42;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;26:21:-1;;;22:32;;;6:49;;2346:42:2;;;;;;2336:53;;;;;;;;;2322:68;;;;:13;:68;;;;;;;;2321:69;2313:78;;;;;;2443:5;;;2473:4;2450:9;;;;2426:42;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;26:21:-1;;;22:32;;;6:49;;2426:42:2;;;;;2416:53;;;;;;2402:68;;;;:13;:68;;;;;:75;;-1:-1:-1;;2402:75:2;;;;;2567:5;;2559:14;;;:7;:14;;;;;;2522:31;;;;;;;;;;;;;2402:75;2522:31;;;;;;;;26:21:-1;;;22:32;;;6:49;;2522:31:2;;;;;;2512:42;;;;;;;;;2493:62;;:18;:62;;;;;;;2491:64;;;;;;;;;:82;2487:212;;;2589:1;:6;;;2609:1;:6;;;2629:5;:12;;-1:-1:-1;;2629:12:2;2637:4;2629:12;;;2676:5;;2660:28;;;;;;;;;;;;;;;;;;;;;;;;;2487:212;2172:533;;;:::o;930:17::-;;;;:::o;1957:209::-;2039:13;;:60;;;-1:-1:-1;;;2039:60:2;;2066:10;2039:60;;;;2086:4;2039:60;;;;;;;;;;;;-1:-1:-1;;;;;2039:13:2;;;;:26;;:60;;;;;;;;;;;;;;;:13;;:60;;;5:2:-1;;;;30:1;27;20:12;5:2;2039:60:2;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;2039:60:2;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;2115:44:2;;;2130:10;2115:44;;;;;;;;;;2039:60;2115:44;;;;;;;;;;;;;;;;;;;2130:10;2142:9;;2153:5;;2115:44;;;;;;;;;;;;;;;-1:-1:-1;8:100;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;2115:44:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1957:209;;:::o;631:44::-;;;;;;;;;;;;;:::o;3904:395::-;3988:19;4010:24;4023:10;4010:12;:24::i;:::-;3988:46;;4052:1;:9;;;4065:1;4052:14;;4044:23;;;;;;4085:5;;;;4077:14;;;;;;4154:5;;4167:9;;;;4137:40;;;;;;;;;;;;;;;;;;;;;;;;;;;26:21:-1;;;22:32;;;6:49;;4137:40:2;;;;4127:51;;;;;;;;;4101:13;4117:62;;;:9;:62;;;;;;4197:13;4189:22;;;;;;4256:5;;4239:44;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;26:21:-1;;;22:32;;;6:49;;4239:44:2;;;;;;4229:55;;;;;;4222:63;;;;:6;:63;;;:70;;;;;;;;:::i;:::-;;3904:395;;;;;:::o;799:13::-;;;;:::o;429:48::-;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;429:48:2;;;;;;:::o;483:41::-;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;483:41:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;681:45;;;;;;;;;;;;;;;:::o;2978:175::-;3120:5;;3103:41;;;;;;;;;;;;;;;;;3053:12;3103:41;;;;;;;;26:21:-1;;;22:32;;6:49;;3103:41:2;;;;;;3093:52;;;;;;;;;-1:-1:-1;3084:62:2;;;:8;:62;;;;;3077:69;;;;;;;;;-1:-1:-1;;3077:69:2;;;;;;;;;;;;;;;;;;;;;;;;;;3053:12;;3103:41;;3084:62;;3077:69;;;3084:62;3077:69;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2978:175;;;;:::o;4720:120::-;4775:17;4811:22;4824:1;4827:5;;4811:12;:22::i;:::-;4804:29;4720:120;-1:-1:-1;;4720:120:2:o;4846:154::-;4968:23;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;4968:23:2;;;;;;;26:21:-1;;;22:32;;6:49;;4968:23:2;;;;;;4958:34;;;;;;;;;-1:-1:-1;4946:47:2;;;:11;:47;;;;;4846:154::o;92:5021::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;92:5021:2;;;-1:-1:-1;92:5021:2;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;", - "source": "pragma solidity ^0.5.0;\nimport './openzeppelin-solidity/contracts/token/ERC20/IERC20.sol';\n\ncontract SharedDB {\n struct Validator {\n address addr;\n uint partyId;\n bytes32 next;\n }\n\n event NewEpoch(uint indexed epoch);\n event KeygenCompleted(uint indexed epoch, uint x, uint y);\n event Signup(address indexed from, bytes32 indexed hash, uint epoch, uint partyId);\n\n Validator validator;\n mapping(bytes32 => Validator) public dbValidator;\n mapping(bytes32 => bytes) public dbKeygen;\n mapping(bytes32 => uint) public confirmationsCount;\n mapping(bytes32 => bytes) public dbSign;\n mapping(bytes32 => uint) public signupsCount;\n mapping(bytes32 => bool) public confirmations;\n mapping(bytes32 => uint) public dbSignups;\n\n uint public x;\n uint public y;\n\n bool public ready;\n\n mapping(uint => uint) public threshold;\n mapping(uint => uint) public parties;\n\n uint public epoch;\n\n constructor(uint32 _threshold, uint32 _parties, address[] memory validators, address _tokenContract) public {\n require(_parties > 0);\n require(_threshold < _parties);\n require(validators.length == _parties);\n\n tokenContract = IERC20(_tokenContract);\n\n epoch = 1;\n ready = false;\n\n threshold[epoch] = _threshold;\n parties[epoch] = _parties;\n // First validator\n validator = Validator(validators[0], 1, 0);\n setValidator(validators[0], validator);\n\n // Other validators\n for (uint i = 1; i < _parties; i++) {\n setValidator(validators[i], Validator(validators[i], i + 1, 0));\n // Link to prev one\n Validator storage v = getValidator(validators[i - 1]);\n v.next = keccak256(abi.encodePacked(epoch, validators[i]));\n }\n\n emit NewEpoch(epoch);\n }\n\n IERC20 public tokenContract;\n\n event ReceivedTokens(address from, string recipient, uint value);\n\n function requestAffirmation(uint value, string memory recipient) public {\n tokenContract.transferFrom(msg.sender, address(this), value);\n\n emit ReceivedTokens(msg.sender, recipient, value);\n }\n\n function confirm(uint _x, uint _y) public {\n Validator storage v = getValidator(msg.sender);\n require(v.partyId != 0);\n require(!confirmations[keccak256(abi.encodePacked(epoch, v.partyId, _x, _y))]);\n\n confirmations[keccak256(abi.encodePacked(epoch, v.partyId, _x, _y))] = true;\n if (++confirmationsCount[keccak256(abi.encodePacked(epoch, _x, _y))] == parties[epoch]) {\n x = _x;\n y = _y;\n ready = true;\n emit KeygenCompleted(epoch, x, y);\n }\n }\n\n function setKeygenData(bytes32 key, bytes memory data) public {\n Validator storage v = getValidator(msg.sender);\n require(v.partyId != 0);\n require(!ready);\n\n dbKeygen[keccak256(abi.encodePacked(epoch, key, v.partyId))] = data;\n }\n\n function getKeygenData(uint fromPartyId, bytes32 key) view public returns (bytes memory) {\n return dbKeygen[keccak256(abi.encodePacked(epoch, key, fromPartyId))];\n }\n\n function signupSign(bytes32 hash) public {\n signupSign(hash, epoch);\n }\n\n function signupSign(bytes32 hash, uint _epoch) public {\n Validator storage v = getValidator(msg.sender, _epoch);\n require(v.partyId != 0);\n require(ready);\n require(signupsCount[keccak256(abi.encodePacked(_epoch, hash))] <= threshold[_epoch], \"Already enough signers\");\n //require(confirmationsCount[keccak256(abi.encodePacked(_epoch, x, y))] == parties[_epoch]); == ready\n\n dbSignups[keccak256(abi.encodePacked(_epoch, hash, v.partyId))] = ++signupsCount[keccak256(abi.encodePacked(_epoch, hash))];\n\n emit Signup(msg.sender, hash, _epoch, signupsCount[keccak256(abi.encodePacked(_epoch, hash))]);\n }\n\n function setSignData(bytes32 hash, bytes32 key, bytes memory data) public {\n Validator storage v = getValidator(msg.sender);\n require(v.partyId != 0);\n require(ready);\n uint signupId = dbSignups[keccak256(abi.encodePacked(epoch, hash, v.partyId))];\n require(signupId != 0);\n\n dbSign[keccak256(abi.encodePacked(epoch, hash, signupId, key))] = data;\n }\n\n function getSignData(uint signupId, bytes32 hash, bytes32 key) view public returns (bytes memory) {\n //uint id = dbSignups[keccak256(abi.encodePacked(epoch, hash, fromPartyId))];\n return dbSign[keccak256(abi.encodePacked(epoch, hash, signupId, key))];\n }\n\n function setValidator(address a, Validator memory v) private {\n dbValidator[keccak256(abi.encodePacked(epoch, a))] = v;\n }\n\n function getValidator(address a) view private returns (Validator storage) {\n return getValidator(a, epoch);\n }\n\n function getValidator(address a, uint kv) view private returns (Validator storage) {\n return dbValidator[keccak256(abi.encodePacked(kv, a))];\n }\n\n function getPartyId() view public returns (uint) {\n return getValidator(msg.sender).partyId;\n }\n}\n", - "sourcePath": "/Users/kirillfedoseev/Innopolis/My own projects/bridge/bridge/src/deploy/contracts/SharedDB.sol", - "ast": { - "absolutePath": "/Users/kirillfedoseev/Innopolis/My own projects/bridge/bridge/src/deploy/contracts/SharedDB.sol", - "exportedSymbols": { - "SharedDB": [ - 746 - ] - }, - "id": 747, - "nodeType": "SourceUnit", - "nodes": [ - { - "id": 108, - "literals": [ - "solidity", - "^", - "0.5", - ".0" - ], - "nodeType": "PragmaDirective", - "src": "0:23:2" - }, - { - "absolutePath": "/Users/kirillfedoseev/Innopolis/My own projects/bridge/bridge/src/deploy/contracts/openzeppelin-solidity/contracts/token/ERC20/IERC20.sol", - "file": "./openzeppelin-solidity/contracts/token/ERC20/IERC20.sol", - "id": 109, - "nodeType": "ImportDirective", - "scope": 747, - "sourceUnit": 9382, - "src": "24:66:2", - "symbolAliases": [], - "unitAlias": "" - }, - { - "baseContracts": [], - "contractDependencies": [], - "contractKind": "contract", - "documentation": null, - "fullyImplemented": true, - "id": 746, - "linearizedBaseContracts": [ - 746 - ], - "name": "SharedDB", - "nodeType": "ContractDefinition", - "nodes": [ - { - "canonicalName": "SharedDB.Validator", - "id": 116, - "members": [ - { - "constant": false, - "id": 111, - "name": "addr", - "nodeType": "VariableDeclaration", - "scope": 116, - "src": "143:12:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 110, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "143:7:2", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 113, - "name": "partyId", - "nodeType": "VariableDeclaration", - "scope": 116, - "src": "165:12:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 112, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "165:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 115, - "name": "next", - "nodeType": "VariableDeclaration", - "scope": 116, - "src": "187:12:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 114, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "187:7:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "name": "Validator", - "nodeType": "StructDefinition", - "scope": 746, - "src": "116:90:2", - "visibility": "public" - }, - { - "anonymous": false, - "documentation": null, - "id": 120, - "name": "NewEpoch", - "nodeType": "EventDefinition", - "parameters": { - "id": 119, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 118, - "indexed": true, - "name": "epoch", - "nodeType": "VariableDeclaration", - "scope": 120, - "src": "227:18:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 117, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "227:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "226:20:2" - }, - "src": "212:35:2" - }, - { - "anonymous": false, - "documentation": null, - "id": 128, - "name": "KeygenCompleted", - "nodeType": "EventDefinition", - "parameters": { - "id": 127, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 122, - "indexed": true, - "name": "epoch", - "nodeType": "VariableDeclaration", - "scope": 128, - "src": "274:18:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 121, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "274:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 124, - "indexed": false, - "name": "x", - "nodeType": "VariableDeclaration", - "scope": 128, - "src": "294:6:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 123, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "294:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 126, - "indexed": false, - "name": "y", - "nodeType": "VariableDeclaration", - "scope": 128, - "src": "302:6:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 125, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "302:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "273:36:2" - }, - "src": "252:58:2" - }, - { - "anonymous": false, - "documentation": null, - "id": 138, - "name": "Signup", - "nodeType": "EventDefinition", - "parameters": { - "id": 137, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 130, - "indexed": true, - "name": "from", - "nodeType": "VariableDeclaration", - "scope": 138, - "src": "328:20:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 129, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "328:7:2", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 132, - "indexed": true, - "name": "hash", - "nodeType": "VariableDeclaration", - "scope": 138, - "src": "350:20:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 131, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "350:7:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 134, - "indexed": false, - "name": "epoch", - "nodeType": "VariableDeclaration", - "scope": 138, - "src": "372:10:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 133, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "372:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 136, - "indexed": false, - "name": "partyId", - "nodeType": "VariableDeclaration", - "scope": 138, - "src": "384:12:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 135, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "384:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "327:70:2" - }, - "src": "315:83:2" - }, - { - "constant": false, - "id": 140, - "name": "validator", - "nodeType": "VariableDeclaration", - "scope": 746, - "src": "404:19:2", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage", - "typeString": "struct SharedDB.Validator" - }, - "typeName": { - "contractScope": null, - "id": 139, - "name": "Validator", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 116, - "src": "404:9:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 144, - "name": "dbValidator", - "nodeType": "VariableDeclaration", - "scope": 746, - "src": "429:48:2", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Validator_$116_storage_$", - "typeString": "mapping(bytes32 => struct SharedDB.Validator)" - }, - "typeName": { - "id": 143, - "keyType": { - "id": 141, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "437:7:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Mapping", - "src": "429:29:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Validator_$116_storage_$", - "typeString": "mapping(bytes32 => struct SharedDB.Validator)" - }, - "valueType": { - "contractScope": null, - "id": 142, - "name": "Validator", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 116, - "src": "448:9:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator" - } - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 148, - "name": "dbKeygen", - "nodeType": "VariableDeclaration", - "scope": 746, - "src": "483:41:2", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes_storage_$", - "typeString": "mapping(bytes32 => bytes)" - }, - "typeName": { - "id": 147, - "keyType": { - "id": 145, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "491:7:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Mapping", - "src": "483:25:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes_storage_$", - "typeString": "mapping(bytes32 => bytes)" - }, - "valueType": { - "id": 146, - "name": "bytes", - "nodeType": "ElementaryTypeName", - "src": "502:5:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage_ptr", - "typeString": "bytes" - } - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 152, - "name": "confirmationsCount", - "nodeType": "VariableDeclaration", - "scope": 746, - "src": "530:50:2", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - }, - "typeName": { - "id": 151, - "keyType": { - "id": 149, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "538:7:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Mapping", - "src": "530:24:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - }, - "valueType": { - "id": 150, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "549:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 156, - "name": "dbSign", - "nodeType": "VariableDeclaration", - "scope": 746, - "src": "586:39:2", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes_storage_$", - "typeString": "mapping(bytes32 => bytes)" - }, - "typeName": { - "id": 155, - "keyType": { - "id": 153, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "594:7:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Mapping", - "src": "586:25:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes_storage_$", - "typeString": "mapping(bytes32 => bytes)" - }, - "valueType": { - "id": 154, - "name": "bytes", - "nodeType": "ElementaryTypeName", - "src": "605:5:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage_ptr", - "typeString": "bytes" - } - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 160, - "name": "signupsCount", - "nodeType": "VariableDeclaration", - "scope": 746, - "src": "631:44:2", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - }, - "typeName": { - "id": 159, - "keyType": { - "id": 157, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "639:7:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Mapping", - "src": "631:24:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - }, - "valueType": { - "id": 158, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "650:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 164, - "name": "confirmations", - "nodeType": "VariableDeclaration", - "scope": 746, - "src": "681:45:2", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - }, - "typeName": { - "id": 163, - "keyType": { - "id": 161, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "689:7:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Mapping", - "src": "681:24:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - }, - "valueType": { - "id": 162, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "700:4:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 168, - "name": "dbSignups", - "nodeType": "VariableDeclaration", - "scope": 746, - "src": "732:41:2", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - }, - "typeName": { - "id": 167, - "keyType": { - "id": 165, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "740:7:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Mapping", - "src": "732:24:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - }, - "valueType": { - "id": 166, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "751:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 170, - "name": "x", - "nodeType": "VariableDeclaration", - "scope": 746, - "src": "780:13:2", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 169, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "780:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 172, - "name": "y", - "nodeType": "VariableDeclaration", - "scope": 746, - "src": "799:13:2", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 171, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "799:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 174, - "name": "ready", - "nodeType": "VariableDeclaration", - "scope": 746, - "src": "819:17:2", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 173, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "819:4:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 178, - "name": "threshold", - "nodeType": "VariableDeclaration", - "scope": 746, - "src": "843:38:2", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_uint256_$", - "typeString": "mapping(uint256 => uint256)" - }, - "typeName": { - "id": 177, - "keyType": { - "id": 175, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "851:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Mapping", - "src": "843:21:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_uint256_$", - "typeString": "mapping(uint256 => uint256)" - }, - "valueType": { - "id": 176, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "859:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 182, - "name": "parties", - "nodeType": "VariableDeclaration", - "scope": 746, - "src": "887:36:2", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_uint256_$", - "typeString": "mapping(uint256 => uint256)" - }, - "typeName": { - "id": 181, - "keyType": { - "id": 179, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "895:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Mapping", - "src": "887:21:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_uint256_$", - "typeString": "mapping(uint256 => uint256)" - }, - "valueType": { - "id": 180, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "903:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 184, - "name": "epoch", - "nodeType": "VariableDeclaration", - "scope": 746, - "src": "930:17:2", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 183, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "930:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "public" - }, - { - "body": { - "id": 313, - "nodeType": "Block", - "src": "1062:784:2", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - }, - "id": 199, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 197, - "name": "_parties", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 188, - "src": "1080:8:2", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "nodeType": "BinaryOperation", - "operator": ">", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 198, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1091:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "1080:12:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 196, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 12440, - 12441 - ], - "referencedDeclaration": 12440, - "src": "1072:7:2", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 200, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1072:21:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 201, - "nodeType": "ExpressionStatement", - "src": "1072:21:2" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - }, - "id": 205, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 203, - "name": "_threshold", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 186, - "src": "1111:10:2", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "id": 204, - "name": "_parties", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 188, - "src": "1124:8:2", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "src": "1111:21:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 202, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 12440, - 12441 - ], - "referencedDeclaration": 12440, - "src": "1103:7:2", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 206, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1103:30:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 207, - "nodeType": "ExpressionStatement", - "src": "1103:30:2" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 212, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 209, - "name": "validators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 191, - "src": "1151:10:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 210, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1151:17:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "id": 211, - "name": "_parties", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 188, - "src": "1172:8:2", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "src": "1151:29:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 208, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 12440, - 12441 - ], - "referencedDeclaration": 12440, - "src": "1143:7:2", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 213, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1143:38:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 214, - "nodeType": "ExpressionStatement", - "src": "1143:38:2" - }, - { - "expression": { - "argumentTypes": null, - "id": 219, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 215, - "name": "tokenContract", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 316, - "src": "1192:13:2", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$9381", - "typeString": "contract IERC20" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 217, - "name": "_tokenContract", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 193, - "src": "1215:14:2", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 216, - "name": "IERC20", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 9381, - "src": "1208:6:2", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_IERC20_$9381_$", - "typeString": "type(contract IERC20)" - } - }, - "id": 218, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1208:22:2", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$9381", - "typeString": "contract IERC20" - } - }, - "src": "1192:38:2", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$9381", - "typeString": "contract IERC20" - } - }, - "id": 220, - "nodeType": "ExpressionStatement", - "src": "1192:38:2" - }, - { - "expression": { - "argumentTypes": null, - "id": 223, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 221, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 184, - "src": "1241:5:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "31", - "id": 222, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1249:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "1241:9:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 224, - "nodeType": "ExpressionStatement", - "src": "1241:9:2" - }, - { - "expression": { - "argumentTypes": null, - "id": 227, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 225, - "name": "ready", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 174, - "src": "1260:5:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "66616c7365", - "id": 226, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1268:5:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "false" - }, - "src": "1260:13:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 228, - "nodeType": "ExpressionStatement", - "src": "1260:13:2" - }, - { - "expression": { - "argumentTypes": null, - "id": 233, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 229, - "name": "threshold", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 178, - "src": "1284:9:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_uint256_$", - "typeString": "mapping(uint256 => uint256)" - } - }, - "id": 231, - "indexExpression": { - "argumentTypes": null, - "id": 230, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 184, - "src": "1294:5:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "1284:16:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 232, - "name": "_threshold", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 186, - "src": "1303:10:2", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "src": "1284:29:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 234, - "nodeType": "ExpressionStatement", - "src": "1284:29:2" - }, - { - "expression": { - "argumentTypes": null, - "id": 239, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 235, - "name": "parties", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 182, - "src": "1323:7:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_uint256_$", - "typeString": "mapping(uint256 => uint256)" - } - }, - "id": 237, - "indexExpression": { - "argumentTypes": null, - "id": 236, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 184, - "src": "1331:5:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "1323:14:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 238, - "name": "_parties", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 188, - "src": "1340:8:2", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "src": "1323:25:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 240, - "nodeType": "ExpressionStatement", - "src": "1323:25:2" - }, - { - "expression": { - "argumentTypes": null, - "id": 249, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 241, - "name": "validator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 140, - "src": "1385:9:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage", - "typeString": "struct SharedDB.Validator storage ref" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 243, - "name": "validators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 191, - "src": "1407:10:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 245, - "indexExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 244, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1418:1:2", - "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": "1407:13:2", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "hexValue": "31", - "id": 246, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1422:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - { - "argumentTypes": null, - "hexValue": "30", - "id": 247, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1425:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - } - ], - "id": 242, - "name": "Validator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 116, - "src": "1397:9:2", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_struct$_Validator_$116_storage_ptr_$", - "typeString": "type(struct SharedDB.Validator storage pointer)" - } - }, - "id": 248, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "structConstructorCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1397:30:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_memory", - "typeString": "struct SharedDB.Validator memory" - } - }, - "src": "1385:42:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage", - "typeString": "struct SharedDB.Validator storage ref" - } - }, - "id": 250, - "nodeType": "ExpressionStatement", - "src": "1385:42:2" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 252, - "name": "validators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 191, - "src": "1450:10:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 254, - "indexExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 253, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1461:1:2", - "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": "1450:13:2", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 255, - "name": "validator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 140, - "src": "1465:9:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage", - "typeString": "struct SharedDB.Validator storage ref" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_struct$_Validator_$116_storage", - "typeString": "struct SharedDB.Validator storage ref" - } - ], - "id": 251, - "name": "setValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 700, - "src": "1437:12:2", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_struct$_Validator_$116_memory_ptr_$returns$__$", - "typeString": "function (address,struct SharedDB.Validator memory)" - } - }, - "id": 256, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1437:38:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 257, - "nodeType": "ExpressionStatement", - "src": "1437:38:2" - }, - { - "body": { - "id": 307, - "nodeType": "Block", - "src": "1550:259:2", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 269, - "name": "validators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 191, - "src": "1577:10:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 271, - "indexExpression": { - "argumentTypes": null, - "id": 270, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 259, - "src": "1588:1:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "1577:13:2", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 273, - "name": "validators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 191, - "src": "1602:10:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 275, - "indexExpression": { - "argumentTypes": null, - "id": 274, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 259, - "src": "1613:1:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "1602:13:2", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 278, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 276, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 259, - "src": "1617:1:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 277, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1621:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "1617:5:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "hexValue": "30", - "id": 279, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1624:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - } - ], - "id": 272, - "name": "Validator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 116, - "src": "1592:9:2", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_struct$_Validator_$116_storage_ptr_$", - "typeString": "type(struct SharedDB.Validator storage pointer)" - } - }, - "id": 280, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "structConstructorCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1592:34:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_memory", - "typeString": "struct SharedDB.Validator memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_struct$_Validator_$116_memory", - "typeString": "struct SharedDB.Validator memory" - } - ], - "id": 268, - "name": "setValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 700, - "src": "1564:12:2", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_struct$_Validator_$116_memory_ptr_$returns$__$", - "typeString": "function (address,struct SharedDB.Validator memory)" - } - }, - "id": 281, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1564:63:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 282, - "nodeType": "ExpressionStatement", - "src": "1564:63:2" - }, - { - "assignments": [ - 284 - ], - "declarations": [ - { - "constant": false, - "id": 284, - "name": "v", - "nodeType": "VariableDeclaration", - "scope": 307, - "src": "1673:19:2", - "stateVariable": false, - "storageLocation": "storage", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator" - }, - "typeName": { - "contractScope": null, - "id": 283, - "name": "Validator", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 116, - "src": "1673:9:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 292, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 286, - "name": "validators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 191, - "src": "1708:10:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 290, - "indexExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 289, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 287, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 259, - "src": "1719:1:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 288, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1723:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "1719:5:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "1708:17:2", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 285, - "name": "getValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 713, - 733 - ], - "referencedDeclaration": 713, - "src": "1695:12:2", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_struct$_Validator_$116_storage_ptr_$", - "typeString": "function (address) view returns (struct SharedDB.Validator storage pointer)" - } - }, - "id": 291, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1695:31:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator storage pointer" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "1673:53:2" - }, - { - "expression": { - "argumentTypes": null, - "id": 305, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 293, - "name": "v", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 284, - "src": "1740:1:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator storage pointer" - } - }, - "id": 295, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "next", - "nodeType": "MemberAccess", - "referencedDeclaration": 115, - "src": "1740:6:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 299, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 184, - "src": "1776:5:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 300, - "name": "validators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 191, - "src": "1783:10:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 302, - "indexExpression": { - "argumentTypes": null, - "id": 301, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 259, - "src": "1794:1:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "1783:13:2", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "expression": { - "argumentTypes": null, - "id": 297, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12424, - "src": "1759:3:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 298, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1759:16:2", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 303, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1759:38:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 296, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12431, - "src": "1749:9:2", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 304, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1749:49:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "src": "1740:58:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "id": 306, - "nodeType": "ExpressionStatement", - "src": "1740:58:2" - } - ] - }, - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 264, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 262, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 259, - "src": "1531:1:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "id": 263, - "name": "_parties", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 188, - "src": "1535:8:2", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "src": "1531:12:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 308, - "initializationExpression": { - "assignments": [ - 259 - ], - "declarations": [ - { - "constant": false, - "id": 259, - "name": "i", - "nodeType": "VariableDeclaration", - "scope": 308, - "src": "1519:6:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 258, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1519:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 261, - "initialValue": { - "argumentTypes": null, - "hexValue": "31", - "id": 260, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1528:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "nodeType": "VariableDeclarationStatement", - "src": "1519:10:2" - }, - "loopExpression": { - "expression": { - "argumentTypes": null, - "id": 266, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "1545:3:2", - "subExpression": { - "argumentTypes": null, - "id": 265, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 259, - "src": "1545:1:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 267, - "nodeType": "ExpressionStatement", - "src": "1545:3:2" - }, - "nodeType": "ForStatement", - "src": "1514:295:2" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 310, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 184, - "src": "1833:5:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 309, - "name": "NewEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 120, - "src": "1824:8:2", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$returns$__$", - "typeString": "function (uint256)" - } - }, - "id": 311, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1824:15:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 312, - "nodeType": "EmitStatement", - "src": "1819:20:2" - } - ] - }, - "documentation": null, - "id": 314, - "implemented": true, - "kind": "constructor", - "modifiers": [], - "name": "", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 194, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 186, - "name": "_threshold", - "nodeType": "VariableDeclaration", - "scope": 314, - "src": "966:17:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - }, - "typeName": { - "id": 185, - "name": "uint32", - "nodeType": "ElementaryTypeName", - "src": "966:6:2", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 188, - "name": "_parties", - "nodeType": "VariableDeclaration", - "scope": 314, - "src": "985:15:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - }, - "typeName": { - "id": 187, - "name": "uint32", - "nodeType": "ElementaryTypeName", - "src": "985:6:2", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 191, - "name": "validators", - "nodeType": "VariableDeclaration", - "scope": 314, - "src": "1002:27:2", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 189, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1002:7:2", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 190, - "length": null, - "nodeType": "ArrayTypeName", - "src": "1002:9:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 193, - "name": "_tokenContract", - "nodeType": "VariableDeclaration", - "scope": 314, - "src": "1031:22:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 192, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1031:7:2", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "965:89:2" - }, - "returnParameters": { - "id": 195, - "nodeType": "ParameterList", - "parameters": [], - "src": "1062:0:2" - }, - "scope": 746, - "src": "954:892:2", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "constant": false, - "id": 316, - "name": "tokenContract", - "nodeType": "VariableDeclaration", - "scope": 746, - "src": "1852:27:2", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$9381", - "typeString": "contract IERC20" - }, - "typeName": { - "contractScope": null, - "id": 315, - "name": "IERC20", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 9381, - "src": "1852:6:2", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$9381", - "typeString": "contract IERC20" - } - }, - "value": null, - "visibility": "public" - }, - { - "anonymous": false, - "documentation": null, - "id": 324, - "name": "ReceivedTokens", - "nodeType": "EventDefinition", - "parameters": { - "id": 323, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 318, - "indexed": false, - "name": "from", - "nodeType": "VariableDeclaration", - "scope": 324, - "src": "1907:12:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 317, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1907:7:2", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 320, - "indexed": false, - "name": "recipient", - "nodeType": "VariableDeclaration", - "scope": 324, - "src": "1921:16:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string" - }, - "typeName": { - "id": 319, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "1921:6:2", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 322, - "indexed": false, - "name": "value", - "nodeType": "VariableDeclaration", - "scope": 324, - "src": "1939:10:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 321, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1939:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1906:44:2" - }, - "src": "1886:65:2" - }, - { - "body": { - "id": 349, - "nodeType": "Block", - "src": "2029:137:2", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 334, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12437, - "src": "2066:3:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 335, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2066:10:2", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 337, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12457, - "src": "2086:4:2", - "typeDescriptions": { - "typeIdentifier": "t_contract$_SharedDB_$746", - "typeString": "contract SharedDB" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_SharedDB_$746", - "typeString": "contract SharedDB" - } - ], - "id": 336, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "2078:7:2", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 338, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2078:13:2", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 339, - "name": "value", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 326, - "src": "2093:5:2", - "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": 331, - "name": "tokenContract", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 316, - "src": "2039:13:2", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$9381", - "typeString": "contract IERC20" - } - }, - "id": 333, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "transferFrom", - "nodeType": "MemberAccess", - "referencedDeclaration": 9364, - "src": "2039:26:2", - "typeDescriptions": { - "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$_t_bool_$", - "typeString": "function (address,address,uint256) external returns (bool)" - } - }, - "id": 340, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2039:60:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 341, - "nodeType": "ExpressionStatement", - "src": "2039:60:2" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 343, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12437, - "src": "2130:3:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 344, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2130:10:2", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 345, - "name": "recipient", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 328, - "src": "2142:9:2", - "typeDescriptions": { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string memory" - } - }, - { - "argumentTypes": null, - "id": 346, - "name": "value", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 326, - "src": "2153:5:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string memory" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 342, - "name": "ReceivedTokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 324, - "src": "2115:14:2", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_string_memory_ptr_$_t_uint256_$returns$__$", - "typeString": "function (address,string memory,uint256)" - } - }, - "id": 347, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2115:44:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 348, - "nodeType": "EmitStatement", - "src": "2110:49:2" - } - ] - }, - "documentation": null, - "id": 350, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "requestAffirmation", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 329, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 326, - "name": "value", - "nodeType": "VariableDeclaration", - "scope": 350, - "src": "1985:10:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 325, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1985:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 328, - "name": "recipient", - "nodeType": "VariableDeclaration", - "scope": 350, - "src": "1997:23:2", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string" - }, - "typeName": { - "id": 327, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "1997:6:2", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1984:37:2" - }, - "returnParameters": { - "id": 330, - "nodeType": "ParameterList", - "parameters": [], - "src": "2029:0:2" - }, - "scope": 746, - "src": "1957:209:2", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 437, - "nodeType": "Block", - "src": "2214:491:2", - "statements": [ - { - "assignments": [ - 358 - ], - "declarations": [ - { - "constant": false, - "id": 358, - "name": "v", - "nodeType": "VariableDeclaration", - "scope": 437, - "src": "2224:19:2", - "stateVariable": false, - "storageLocation": "storage", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator" - }, - "typeName": { - "contractScope": null, - "id": 357, - "name": "Validator", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 116, - "src": "2224:9:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 363, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 360, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12437, - "src": "2259:3:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 361, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2259:10:2", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - ], - "id": 359, - "name": "getValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 713, - 733 - ], - "referencedDeclaration": 713, - "src": "2246:12:2", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_struct$_Validator_$116_storage_ptr_$", - "typeString": "function (address) view returns (struct SharedDB.Validator storage pointer)" - } - }, - "id": 362, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2246:24:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator storage pointer" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "2224:46:2" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 368, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 365, - "name": "v", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 358, - "src": "2288:1:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator storage pointer" - } - }, - "id": 366, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "partyId", - "nodeType": "MemberAccess", - "referencedDeclaration": 113, - "src": "2288:9:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 367, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2301:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "2288:14:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 364, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 12440, - 12441 - ], - "referencedDeclaration": 12440, - "src": "2280:7:2", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 369, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2280:23:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 370, - "nodeType": "ExpressionStatement", - "src": "2280:23:2" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 384, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "!", - "prefix": true, - "src": "2321:69:2", - "subExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 372, - "name": "confirmations", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 164, - "src": "2322:13:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - } - }, - "id": 383, - "indexExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 376, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 184, - "src": "2363:5:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 377, - "name": "v", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 358, - "src": "2370:1:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator storage pointer" - } - }, - "id": 378, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "partyId", - "nodeType": "MemberAccess", - "referencedDeclaration": 113, - "src": "2370:9:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 379, - "name": "_x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 352, - "src": "2381:2:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 380, - "name": "_y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 354, - "src": "2385:2:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 374, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12424, - "src": "2346:3:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 375, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2346:16:2", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 381, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2346:42:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 373, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12431, - "src": "2336:9:2", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 382, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2336:53:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "2322:68:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 371, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 12440, - 12441 - ], - "referencedDeclaration": 12440, - "src": "2313:7:2", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 385, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2313:78:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 386, - "nodeType": "ExpressionStatement", - "src": "2313:78:2" - }, - { - "expression": { - "argumentTypes": null, - "id": 400, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 387, - "name": "confirmations", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 164, - "src": "2402:13:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - } - }, - "id": 398, - "indexExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 391, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 184, - "src": "2443:5:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 392, - "name": "v", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 358, - "src": "2450:1:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator storage pointer" - } - }, - "id": 393, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "partyId", - "nodeType": "MemberAccess", - "referencedDeclaration": 113, - "src": "2450:9:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 394, - "name": "_x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 352, - "src": "2461:2:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 395, - "name": "_y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 354, - "src": "2465:2:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 389, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12424, - "src": "2426:3:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 390, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2426:16:2", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 396, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2426:42:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 388, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12431, - "src": "2416:9:2", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 397, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2416:53:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "2402:68:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 399, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2473:4:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "src": "2402:75:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 401, - "nodeType": "ExpressionStatement", - "src": "2402:75:2" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 416, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 412, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": true, - "src": "2491:64:2", - "subExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 402, - "name": "confirmationsCount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 152, - "src": "2493:18:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - } - }, - "id": 411, - "indexExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 406, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 184, - "src": "2539:5:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 407, - "name": "_x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 352, - "src": "2546:2:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 408, - "name": "_y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 354, - "src": "2550:2:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 404, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12424, - "src": "2522:3:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 405, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2522:16:2", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 409, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2522:31:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 403, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12431, - "src": "2512:9:2", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 410, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2512:42:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "2493:62:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 413, - "name": "parties", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 182, - "src": "2559:7:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_uint256_$", - "typeString": "mapping(uint256 => uint256)" - } - }, - "id": 415, - "indexExpression": { - "argumentTypes": null, - "id": 414, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 184, - "src": "2567:5:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "2559:14:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2491:82:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 436, - "nodeType": "IfStatement", - "src": "2487:212:2", - "trueBody": { - "id": 435, - "nodeType": "Block", - "src": "2575:124:2", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 419, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 417, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 170, - "src": "2589:1:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 418, - "name": "_x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 352, - "src": "2593:2:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2589:6:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 420, - "nodeType": "ExpressionStatement", - "src": "2589:6:2" - }, - { - "expression": { - "argumentTypes": null, - "id": 423, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 421, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 172, - "src": "2609:1:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 422, - "name": "_y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 354, - "src": "2613:2:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2609:6:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 424, - "nodeType": "ExpressionStatement", - "src": "2609:6:2" - }, - { - "expression": { - "argumentTypes": null, - "id": 427, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 425, - "name": "ready", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 174, - "src": "2629:5:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 426, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2637:4:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "src": "2629:12:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 428, - "nodeType": "ExpressionStatement", - "src": "2629:12:2" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 430, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 184, - "src": "2676:5:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 431, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 170, - "src": "2683:1:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 432, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 172, - "src": "2686:1:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 429, - "name": "KeygenCompleted", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 128, - "src": "2660:15:2", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$_t_uint256_$returns$__$", - "typeString": "function (uint256,uint256,uint256)" - } - }, - "id": 433, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2660:28:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 434, - "nodeType": "EmitStatement", - "src": "2655:33:2" - } - ] - } - } - ] - }, - "documentation": null, - "id": 438, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "confirm", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 355, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 352, - "name": "_x", - "nodeType": "VariableDeclaration", - "scope": 438, - "src": "2189:7:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 351, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "2189:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 354, - "name": "_y", - "nodeType": "VariableDeclaration", - "scope": 438, - "src": "2198:7:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 353, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "2198:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2188:18:2" - }, - "returnParameters": { - "id": 356, - "nodeType": "ParameterList", - "parameters": [], - "src": "2214:0:2" - }, - "scope": 746, - "src": "2172:533:2", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 478, - "nodeType": "Block", - "src": "2773:199:2", - "statements": [ - { - "assignments": [ - 446 - ], - "declarations": [ - { - "constant": false, - "id": 446, - "name": "v", - "nodeType": "VariableDeclaration", - "scope": 478, - "src": "2783:19:2", - "stateVariable": false, - "storageLocation": "storage", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator" - }, - "typeName": { - "contractScope": null, - "id": 445, - "name": "Validator", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 116, - "src": "2783:9:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 451, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 448, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12437, - "src": "2818:3:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 449, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2818:10:2", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - ], - "id": 447, - "name": "getValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 713, - 733 - ], - "referencedDeclaration": 713, - "src": "2805:12:2", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_struct$_Validator_$116_storage_ptr_$", - "typeString": "function (address) view returns (struct SharedDB.Validator storage pointer)" - } - }, - "id": 450, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2805:24:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator storage pointer" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "2783:46:2" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 456, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 453, - "name": "v", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 446, - "src": "2847:1:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator storage pointer" - } - }, - "id": 454, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "partyId", - "nodeType": "MemberAccess", - "referencedDeclaration": 113, - "src": "2847:9:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 455, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2860:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "2847:14:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 452, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 12440, - 12441 - ], - "referencedDeclaration": 12440, - "src": "2839:7:2", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 457, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2839:23:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 458, - "nodeType": "ExpressionStatement", - "src": "2839:23:2" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 461, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "!", - "prefix": true, - "src": "2880:6:2", - "subExpression": { - "argumentTypes": null, - "id": 460, - "name": "ready", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 174, - "src": "2881:5:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 459, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 12440, - 12441 - ], - "referencedDeclaration": 12440, - "src": "2872:7:2", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 462, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2872:15:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 463, - "nodeType": "ExpressionStatement", - "src": "2872:15:2" - }, - { - "expression": { - "argumentTypes": null, - "id": 476, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 464, - "name": "dbKeygen", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 148, - "src": "2898:8:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes_storage_$", - "typeString": "mapping(bytes32 => bytes storage ref)" - } - }, - "id": 474, - "indexExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 468, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 184, - "src": "2934:5:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 469, - "name": "key", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 440, - "src": "2941:3:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 470, - "name": "v", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 446, - "src": "2946:1:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator storage pointer" - } - }, - "id": 471, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "partyId", - "nodeType": "MemberAccess", - "referencedDeclaration": 113, - "src": "2946:9:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 466, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12424, - "src": "2917:3:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 467, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2917:16:2", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 472, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2917:39:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 465, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12431, - "src": "2907:9:2", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 473, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2907:50:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "2898:60:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage", - "typeString": "bytes storage ref" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 475, - "name": "data", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 442, - "src": "2961:4:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - }, - "src": "2898:67:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage", - "typeString": "bytes storage ref" - } - }, - "id": 477, - "nodeType": "ExpressionStatement", - "src": "2898:67:2" - } - ] - }, - "documentation": null, - "id": 479, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "setKeygenData", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 443, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 440, - "name": "key", - "nodeType": "VariableDeclaration", - "scope": 479, - "src": "2734:11:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 439, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "2734:7:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 442, - "name": "data", - "nodeType": "VariableDeclaration", - "scope": 479, - "src": "2747:17:2", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes" - }, - "typeName": { - "id": 441, - "name": "bytes", - "nodeType": "ElementaryTypeName", - "src": "2747:5:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage_ptr", - "typeString": "bytes" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2733:32:2" - }, - "returnParameters": { - "id": 444, - "nodeType": "ParameterList", - "parameters": [], - "src": "2773:0:2" - }, - "scope": 746, - "src": "2711:261:2", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 499, - "nodeType": "Block", - "src": "3067:86:2", - "statements": [ - { - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 488, - "name": "dbKeygen", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 148, - "src": "3084:8:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes_storage_$", - "typeString": "mapping(bytes32 => bytes storage ref)" - } - }, - "id": 497, - "indexExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 492, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 184, - "src": "3120:5:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 493, - "name": "key", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 483, - "src": "3127:3:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "id": 494, - "name": "fromPartyId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 481, - "src": "3132:11:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 490, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12424, - "src": "3103:3:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 491, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3103:16:2", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 495, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3103:41:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 489, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12431, - "src": "3093:9:2", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 496, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3093:52:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3084:62:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage", - "typeString": "bytes storage ref" - } - }, - "functionReturnParameters": 487, - "id": 498, - "nodeType": "Return", - "src": "3077:69:2" - } - ] - }, - "documentation": null, - "id": 500, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getKeygenData", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 484, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 481, - "name": "fromPartyId", - "nodeType": "VariableDeclaration", - "scope": 500, - "src": "3001:16:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 480, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "3001:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 483, - "name": "key", - "nodeType": "VariableDeclaration", - "scope": 500, - "src": "3019:11:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 482, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "3019:7:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "3000:31:2" - }, - "returnParameters": { - "id": 487, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 486, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 500, - "src": "3053:12:2", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes" - }, - "typeName": { - "id": 485, - "name": "bytes", - "nodeType": "ElementaryTypeName", - "src": "3053:5:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage_ptr", - "typeString": "bytes" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "3052:14:2" - }, - "scope": 746, - "src": "2978:175:2", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 510, - "nodeType": "Block", - "src": "3200:40:2", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 506, - "name": "hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 502, - "src": "3221:4:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "id": 507, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 184, - "src": "3227:5:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 505, - "name": "signupSign", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 511, - 594 - ], - "referencedDeclaration": 594, - "src": "3210:10:2", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$_t_uint256_$returns$__$", - "typeString": "function (bytes32,uint256)" - } - }, - "id": 508, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3210:23:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 509, - "nodeType": "ExpressionStatement", - "src": "3210:23:2" - } - ] - }, - "documentation": null, - "id": 511, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "signupSign", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 503, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 502, - "name": "hash", - "nodeType": "VariableDeclaration", - "scope": 511, - "src": "3179:12:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 501, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "3179:7:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "3178:14:2" - }, - "returnParameters": { - "id": 504, - "nodeType": "ParameterList", - "parameters": [], - "src": "3200:0:2" - }, - "scope": 746, - "src": "3159:81:2", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 593, - "nodeType": "Block", - "src": "3300:598:2", - "statements": [ - { - "assignments": [ - 519 - ], - "declarations": [ - { - "constant": false, - "id": 519, - "name": "v", - "nodeType": "VariableDeclaration", - "scope": 593, - "src": "3310:19:2", - "stateVariable": false, - "storageLocation": "storage", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator" - }, - "typeName": { - "contractScope": null, - "id": 518, - "name": "Validator", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 116, - "src": "3310:9:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 525, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 521, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12437, - "src": "3345:3:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 522, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3345:10:2", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 523, - "name": "_epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 515, - "src": "3357:6:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 520, - "name": "getValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 713, - 733 - ], - "referencedDeclaration": 733, - "src": "3332:12:2", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_address_$_t_uint256_$returns$_t_struct$_Validator_$116_storage_ptr_$", - "typeString": "function (address,uint256) view returns (struct SharedDB.Validator storage pointer)" - } - }, - "id": 524, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3332:32:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator storage pointer" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "3310:54:2" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 530, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 527, - "name": "v", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 519, - "src": "3382:1:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator storage pointer" - } - }, - "id": 528, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "partyId", - "nodeType": "MemberAccess", - "referencedDeclaration": 113, - "src": "3382:9:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 529, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3395:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "3382:14:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 526, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 12440, - 12441 - ], - "referencedDeclaration": 12440, - "src": "3374:7:2", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 531, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3374:23:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 532, - "nodeType": "ExpressionStatement", - "src": "3374:23:2" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 534, - "name": "ready", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 174, - "src": "3415:5:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 533, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 12440, - 12441 - ], - "referencedDeclaration": 12440, - "src": "3407:7:2", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 535, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3407:14:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 536, - "nodeType": "ExpressionStatement", - "src": "3407:14:2" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 550, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 538, - "name": "signupsCount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 160, - "src": "3439:12:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - } - }, - "id": 546, - "indexExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 542, - "name": "_epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 515, - "src": "3479:6:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 543, - "name": "hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 513, - "src": "3487:4:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "expression": { - "argumentTypes": null, - "id": 540, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12424, - "src": "3462:3:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 541, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3462:16:2", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 544, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3462:30:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 539, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12431, - "src": "3452:9:2", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 545, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3452:41:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3439:55:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<=", - "rightExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 547, - "name": "threshold", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 178, - "src": "3498:9:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_uint256_$", - "typeString": "mapping(uint256 => uint256)" - } - }, - "id": 549, - "indexExpression": { - "argumentTypes": null, - "id": 548, - "name": "_epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 515, - "src": "3508:6:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3498:17:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3439:76:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "416c726561647920656e6f756768207369676e657273", - "id": 551, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3517:24:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_9cbe871a78eb8af4b4d5116f316fc411f9c5ba039b05c15801e65409713afb9f", - "typeString": "literal_string \"Already enough signers\"" - }, - "value": "Already enough signers" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_9cbe871a78eb8af4b4d5116f316fc411f9c5ba039b05c15801e65409713afb9f", - "typeString": "literal_string \"Already enough signers\"" - } - ], - "id": 537, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 12440, - 12441 - ], - "referencedDeclaration": 12441, - "src": "3431:7:2", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 552, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3431:111:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 553, - "nodeType": "ExpressionStatement", - "src": "3431:111:2" - }, - { - "expression": { - "argumentTypes": null, - "id": 575, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 554, - "name": "dbSignups", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 168, - "src": "3663:9:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - } - }, - "id": 564, - "indexExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 558, - "name": "_epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 515, - "src": "3700:6:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 559, - "name": "hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 513, - "src": "3708:4:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 560, - "name": "v", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 519, - "src": "3714:1:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator storage pointer" - } - }, - "id": 561, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "partyId", - "nodeType": "MemberAccess", - "referencedDeclaration": 113, - "src": "3714:9:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 556, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12424, - "src": "3683:3:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 557, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3683:16:2", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 562, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3683:41:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 555, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12431, - "src": "3673:9:2", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 563, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3673:52:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "3663:63:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 574, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": true, - "src": "3729:57:2", - "subExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 565, - "name": "signupsCount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 160, - "src": "3731:12:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - } - }, - "id": 573, - "indexExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 569, - "name": "_epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 515, - "src": "3771:6:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 570, - "name": "hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 513, - "src": "3779:4:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "expression": { - "argumentTypes": null, - "id": 567, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12424, - "src": "3754:3:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 568, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3754:16:2", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 571, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3754:30:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 566, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12431, - "src": "3744:9:2", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 572, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3744:41:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "3731:55:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3663:123:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 576, - "nodeType": "ExpressionStatement", - "src": "3663:123:2" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 578, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12437, - "src": "3809:3:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 579, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3809:10:2", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 580, - "name": "hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 513, - "src": "3821:4:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "id": 581, - "name": "_epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 515, - "src": "3827:6:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 582, - "name": "signupsCount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 160, - "src": "3835:12:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - } - }, - "id": 590, - "indexExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 586, - "name": "_epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 515, - "src": "3875:6:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 587, - "name": "hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 513, - "src": "3883:4:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "expression": { - "argumentTypes": null, - "id": 584, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12424, - "src": "3858:3:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 585, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3858:16:2", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 588, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3858:30:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 583, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12431, - "src": "3848:9:2", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 589, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3848:41:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3835:55:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 577, - "name": "Signup", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 138, - "src": "3802:6:2", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_bytes32_$_t_uint256_$_t_uint256_$returns$__$", - "typeString": "function (address,bytes32,uint256,uint256)" - } - }, - "id": 591, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3802:89:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 592, - "nodeType": "EmitStatement", - "src": "3797:94:2" - } - ] - }, - "documentation": null, - "id": 594, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "signupSign", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 516, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 513, - "name": "hash", - "nodeType": "VariableDeclaration", - "scope": 594, - "src": "3266:12:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 512, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "3266:7:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 515, - "name": "_epoch", - "nodeType": "VariableDeclaration", - "scope": 594, - "src": "3280:11:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 514, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "3280:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "3265:27:2" - }, - "returnParameters": { - "id": 517, - "nodeType": "ParameterList", - "parameters": [], - "src": "3300:0:2" - }, - "scope": 746, - "src": "3246:652:2", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 655, - "nodeType": "Block", - "src": "3978:321:2", - "statements": [ - { - "assignments": [ - 604 - ], - "declarations": [ - { - "constant": false, - "id": 604, - "name": "v", - "nodeType": "VariableDeclaration", - "scope": 655, - "src": "3988:19:2", - "stateVariable": false, - "storageLocation": "storage", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator" - }, - "typeName": { - "contractScope": null, - "id": 603, - "name": "Validator", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 116, - "src": "3988:9:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 609, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 606, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12437, - "src": "4023:3:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 607, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4023:10:2", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - ], - "id": 605, - "name": "getValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 713, - 733 - ], - "referencedDeclaration": 713, - "src": "4010:12:2", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_struct$_Validator_$116_storage_ptr_$", - "typeString": "function (address) view returns (struct SharedDB.Validator storage pointer)" - } - }, - "id": 608, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4010:24:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator storage pointer" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "3988:46:2" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 614, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 611, - "name": "v", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 604, - "src": "4052:1:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator storage pointer" - } - }, - "id": 612, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "partyId", - "nodeType": "MemberAccess", - "referencedDeclaration": 113, - "src": "4052:9:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 613, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4065:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "4052:14:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 610, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 12440, - 12441 - ], - "referencedDeclaration": 12440, - "src": "4044:7:2", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 615, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4044:23:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 616, - "nodeType": "ExpressionStatement", - "src": "4044:23:2" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 618, - "name": "ready", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 174, - "src": "4085:5:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 617, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 12440, - 12441 - ], - "referencedDeclaration": 12440, - "src": "4077:7:2", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 619, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4077:14:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 620, - "nodeType": "ExpressionStatement", - "src": "4077:14:2" - }, - { - "assignments": [ - 622 - ], - "declarations": [ - { - "constant": false, - "id": 622, - "name": "signupId", - "nodeType": "VariableDeclaration", - "scope": 655, - "src": "4101:13:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 621, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "4101:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 634, - "initialValue": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 623, - "name": "dbSignups", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 168, - "src": "4117:9:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - } - }, - "id": 633, - "indexExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 627, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 184, - "src": "4154:5:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 628, - "name": "hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 596, - "src": "4161:4:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 629, - "name": "v", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 604, - "src": "4167:1:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator storage pointer" - } - }, - "id": 630, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "partyId", - "nodeType": "MemberAccess", - "referencedDeclaration": 113, - "src": "4167:9:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 625, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12424, - "src": "4137:3:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 626, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4137:16:2", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 631, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4137:40:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 624, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12431, - "src": "4127:9:2", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 632, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4127:51:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4117:62:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "4101:78:2" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 638, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 636, - "name": "signupId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 622, - "src": "4197:8:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 637, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4209:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "4197:13:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 635, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 12440, - 12441 - ], - "referencedDeclaration": 12440, - "src": "4189:7:2", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 639, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4189:22:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 640, - "nodeType": "ExpressionStatement", - "src": "4189:22:2" - }, - { - "expression": { - "argumentTypes": null, - "id": 653, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 641, - "name": "dbSign", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 156, - "src": "4222:6:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes_storage_$", - "typeString": "mapping(bytes32 => bytes storage ref)" - } - }, - "id": 651, - "indexExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 645, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 184, - "src": "4256:5:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 646, - "name": "hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 596, - "src": "4263:4:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "id": 647, - "name": "signupId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 622, - "src": "4269:8:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 648, - "name": "key", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 598, - "src": "4279:3:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "expression": { - "argumentTypes": null, - "id": 643, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12424, - "src": "4239:3:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 644, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4239:16:2", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 649, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4239:44:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 642, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12431, - "src": "4229:9:2", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 650, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4229:55:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "4222:63:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage", - "typeString": "bytes storage ref" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 652, - "name": "data", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 600, - "src": "4288:4:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - }, - "src": "4222:70:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage", - "typeString": "bytes storage ref" - } - }, - "id": 654, - "nodeType": "ExpressionStatement", - "src": "4222:70:2" - } - ] - }, - "documentation": null, - "id": 656, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "setSignData", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 601, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 596, - "name": "hash", - "nodeType": "VariableDeclaration", - "scope": 656, - "src": "3925:12:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 595, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "3925:7:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 598, - "name": "key", - "nodeType": "VariableDeclaration", - "scope": 656, - "src": "3939:11:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 597, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "3939:7:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 600, - "name": "data", - "nodeType": "VariableDeclaration", - "scope": 656, - "src": "3952:17:2", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes" - }, - "typeName": { - "id": 599, - "name": "bytes", - "nodeType": "ElementaryTypeName", - "src": "3952:5:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage_ptr", - "typeString": "bytes" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "3924:46:2" - }, - "returnParameters": { - "id": 602, - "nodeType": "ParameterList", - "parameters": [], - "src": "3978:0:2" - }, - "scope": 746, - "src": "3904:395:2", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 679, - "nodeType": "Block", - "src": "4403:173:2", - "statements": [ - { - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 667, - "name": "dbSign", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 156, - "src": "4506:6:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes_storage_$", - "typeString": "mapping(bytes32 => bytes storage ref)" - } - }, - "id": 677, - "indexExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 671, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 184, - "src": "4540:5:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 672, - "name": "hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 660, - "src": "4547:4:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "id": 673, - "name": "signupId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 658, - "src": "4553:8:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 674, - "name": "key", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 662, - "src": "4563:3:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "expression": { - "argumentTypes": null, - "id": 669, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12424, - "src": "4523:3:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 670, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4523:16:2", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 675, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4523:44:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 668, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12431, - "src": "4513:9:2", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 676, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4513:55:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4506:63:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage", - "typeString": "bytes storage ref" - } - }, - "functionReturnParameters": 666, - "id": 678, - "nodeType": "Return", - "src": "4499:70:2" - } - ] - }, - "documentation": null, - "id": 680, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getSignData", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 663, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 658, - "name": "signupId", - "nodeType": "VariableDeclaration", - "scope": 680, - "src": "4326:13:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 657, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "4326:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 660, - "name": "hash", - "nodeType": "VariableDeclaration", - "scope": 680, - "src": "4341:12:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 659, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "4341:7:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 662, - "name": "key", - "nodeType": "VariableDeclaration", - "scope": 680, - "src": "4355:11:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 661, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "4355:7:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4325:42:2" - }, - "returnParameters": { - "id": 666, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 665, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 680, - "src": "4389:12:2", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes" - }, - "typeName": { - "id": 664, - "name": "bytes", - "nodeType": "ElementaryTypeName", - "src": "4389:5:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage_ptr", - "typeString": "bytes" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4388:14:2" - }, - "scope": 746, - "src": "4305:271:2", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 699, - "nodeType": "Block", - "src": "4643:71:2", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 697, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 687, - "name": "dbValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 144, - "src": "4653:11:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Validator_$116_storage_$", - "typeString": "mapping(bytes32 => struct SharedDB.Validator storage ref)" - } - }, - "id": 695, - "indexExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 691, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 184, - "src": "4692:5:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 692, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 682, - "src": "4699:1:2", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "expression": { - "argumentTypes": null, - "id": 689, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12424, - "src": "4675:3:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 690, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4675:16:2", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 693, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4675:26:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 688, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12431, - "src": "4665:9:2", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 694, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4665:37:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "4653:50:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage", - "typeString": "struct SharedDB.Validator storage ref" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 696, - "name": "v", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 684, - "src": "4706:1:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_memory_ptr", - "typeString": "struct SharedDB.Validator memory" - } - }, - "src": "4653:54:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage", - "typeString": "struct SharedDB.Validator storage ref" - } - }, - "id": 698, - "nodeType": "ExpressionStatement", - "src": "4653:54:2" - } - ] - }, - "documentation": null, - "id": 700, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "setValidator", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 685, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 682, - "name": "a", - "nodeType": "VariableDeclaration", - "scope": 700, - "src": "4604:9:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 681, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "4604:7:2", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 684, - "name": "v", - "nodeType": "VariableDeclaration", - "scope": 700, - "src": "4615:18:2", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_memory_ptr", - "typeString": "struct SharedDB.Validator" - }, - "typeName": { - "contractScope": null, - "id": 683, - "name": "Validator", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 116, - "src": "4615:9:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4603:31:2" - }, - "returnParameters": { - "id": 686, - "nodeType": "ParameterList", - "parameters": [], - "src": "4643:0:2" - }, - "scope": 746, - "src": "4582:132:2", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "private" - }, - { - "body": { - "id": 712, - "nodeType": "Block", - "src": "4794:46:2", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 708, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 702, - "src": "4824:1:2", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 709, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 184, - "src": "4827:5:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 707, - "name": "getValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 713, - 733 - ], - "referencedDeclaration": 733, - "src": "4811:12:2", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_address_$_t_uint256_$returns$_t_struct$_Validator_$116_storage_ptr_$", - "typeString": "function (address,uint256) view returns (struct SharedDB.Validator storage pointer)" - } - }, - "id": 710, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4811:22:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator storage pointer" - } - }, - "functionReturnParameters": 706, - "id": 711, - "nodeType": "Return", - "src": "4804:29:2" - } - ] - }, - "documentation": null, - "id": 713, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getValidator", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 703, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 702, - "name": "a", - "nodeType": "VariableDeclaration", - "scope": 713, - "src": "4742:9:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 701, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "4742:7:2", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4741:11:2" - }, - "returnParameters": { - "id": 706, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 705, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 713, - "src": "4775:17:2", - "stateVariable": false, - "storageLocation": "storage", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator" - }, - "typeName": { - "contractScope": null, - "id": 704, - "name": "Validator", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 116, - "src": "4775:9:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4774:19:2" - }, - "scope": 746, - "src": "4720:120:2", - "stateMutability": "view", - "superFunction": null, - "visibility": "private" - }, - { - "body": { - "id": 732, - "nodeType": "Block", - "src": "4929:71:2", - "statements": [ - { - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 722, - "name": "dbValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 144, - "src": "4946:11:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Validator_$116_storage_$", - "typeString": "mapping(bytes32 => struct SharedDB.Validator storage ref)" - } - }, - "id": 730, - "indexExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 726, - "name": "kv", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "4985:2:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 727, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 715, - "src": "4989:1:2", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "expression": { - "argumentTypes": null, - "id": 724, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12424, - "src": "4968:3:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 725, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4968:16:2", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 728, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4968:23:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 723, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12431, - "src": "4958:9:2", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 729, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4958:34:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4946:47:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage", - "typeString": "struct SharedDB.Validator storage ref" - } - }, - "functionReturnParameters": 721, - "id": 731, - "nodeType": "Return", - "src": "4939:54:2" - } - ] - }, - "documentation": null, - "id": 733, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getValidator", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 718, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 715, - "name": "a", - "nodeType": "VariableDeclaration", - "scope": 733, - "src": "4868:9:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 714, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "4868:7:2", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 717, - "name": "kv", - "nodeType": "VariableDeclaration", - "scope": 733, - "src": "4879:7:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 716, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "4879:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4867:20:2" - }, - "returnParameters": { - "id": 721, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 720, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 733, - "src": "4910:17:2", - "stateVariable": false, - "storageLocation": "storage", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator" - }, - "typeName": { - "contractScope": null, - "id": 719, - "name": "Validator", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 116, - "src": "4910:9:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4909:19:2" - }, - "scope": 746, - "src": "4846:154:2", - "stateMutability": "view", - "superFunction": null, - "visibility": "private" - }, - { - "body": { - "id": 744, - "nodeType": "Block", - "src": "5055:56:2", - "statements": [ - { - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 739, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12437, - "src": "5085:3:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 740, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "5085:10:2", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - ], - "id": 738, - "name": "getValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 713, - 733 - ], - "referencedDeclaration": 713, - "src": "5072:12:2", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_struct$_Validator_$116_storage_ptr_$", - "typeString": "function (address) view returns (struct SharedDB.Validator storage pointer)" - } - }, - "id": 741, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5072:24:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator storage pointer" - } - }, - "id": 742, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "partyId", - "nodeType": "MemberAccess", - "referencedDeclaration": 113, - "src": "5072:32:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 737, - "id": 743, - "nodeType": "Return", - "src": "5065:39:2" - } - ] - }, - "documentation": null, - "id": 745, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getPartyId", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 734, - "nodeType": "ParameterList", - "parameters": [], - "src": "5025:2:2" - }, - "returnParameters": { - "id": 737, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 736, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 745, - "src": "5049:4:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 735, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5049:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5048:6:2" - }, - "scope": 746, - "src": "5006:105:2", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - } - ], - "scope": 747, - "src": "92:5021:2" - } - ], - "src": "0:5114:2" - }, - "legacyAST": { - "absolutePath": "/Users/kirillfedoseev/Innopolis/My own projects/bridge/bridge/src/deploy/contracts/SharedDB.sol", - "exportedSymbols": { - "SharedDB": [ - 746 - ] - }, - "id": 747, - "nodeType": "SourceUnit", - "nodes": [ - { - "id": 108, - "literals": [ - "solidity", - "^", - "0.5", - ".0" - ], - "nodeType": "PragmaDirective", - "src": "0:23:2" - }, - { - "absolutePath": "/Users/kirillfedoseev/Innopolis/My own projects/bridge/bridge/src/deploy/contracts/openzeppelin-solidity/contracts/token/ERC20/IERC20.sol", - "file": "./openzeppelin-solidity/contracts/token/ERC20/IERC20.sol", - "id": 109, - "nodeType": "ImportDirective", - "scope": 747, - "sourceUnit": 9382, - "src": "24:66:2", - "symbolAliases": [], - "unitAlias": "" - }, - { - "baseContracts": [], - "contractDependencies": [], - "contractKind": "contract", - "documentation": null, - "fullyImplemented": true, - "id": 746, - "linearizedBaseContracts": [ - 746 - ], - "name": "SharedDB", - "nodeType": "ContractDefinition", - "nodes": [ - { - "canonicalName": "SharedDB.Validator", - "id": 116, - "members": [ - { - "constant": false, - "id": 111, - "name": "addr", - "nodeType": "VariableDeclaration", - "scope": 116, - "src": "143:12:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 110, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "143:7:2", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 113, - "name": "partyId", - "nodeType": "VariableDeclaration", - "scope": 116, - "src": "165:12:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 112, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "165:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 115, - "name": "next", - "nodeType": "VariableDeclaration", - "scope": 116, - "src": "187:12:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 114, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "187:7:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "name": "Validator", - "nodeType": "StructDefinition", - "scope": 746, - "src": "116:90:2", - "visibility": "public" - }, - { - "anonymous": false, - "documentation": null, - "id": 120, - "name": "NewEpoch", - "nodeType": "EventDefinition", - "parameters": { - "id": 119, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 118, - "indexed": true, - "name": "epoch", - "nodeType": "VariableDeclaration", - "scope": 120, - "src": "227:18:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 117, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "227:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "226:20:2" - }, - "src": "212:35:2" - }, - { - "anonymous": false, - "documentation": null, - "id": 128, - "name": "KeygenCompleted", - "nodeType": "EventDefinition", - "parameters": { - "id": 127, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 122, - "indexed": true, - "name": "epoch", - "nodeType": "VariableDeclaration", - "scope": 128, - "src": "274:18:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 121, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "274:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 124, - "indexed": false, - "name": "x", - "nodeType": "VariableDeclaration", - "scope": 128, - "src": "294:6:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 123, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "294:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 126, - "indexed": false, - "name": "y", - "nodeType": "VariableDeclaration", - "scope": 128, - "src": "302:6:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 125, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "302:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "273:36:2" - }, - "src": "252:58:2" - }, - { - "anonymous": false, - "documentation": null, - "id": 138, - "name": "Signup", - "nodeType": "EventDefinition", - "parameters": { - "id": 137, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 130, - "indexed": true, - "name": "from", - "nodeType": "VariableDeclaration", - "scope": 138, - "src": "328:20:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 129, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "328:7:2", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 132, - "indexed": true, - "name": "hash", - "nodeType": "VariableDeclaration", - "scope": 138, - "src": "350:20:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 131, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "350:7:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 134, - "indexed": false, - "name": "epoch", - "nodeType": "VariableDeclaration", - "scope": 138, - "src": "372:10:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 133, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "372:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 136, - "indexed": false, - "name": "partyId", - "nodeType": "VariableDeclaration", - "scope": 138, - "src": "384:12:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 135, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "384:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "327:70:2" - }, - "src": "315:83:2" - }, - { - "constant": false, - "id": 140, - "name": "validator", - "nodeType": "VariableDeclaration", - "scope": 746, - "src": "404:19:2", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage", - "typeString": "struct SharedDB.Validator" - }, - "typeName": { - "contractScope": null, - "id": 139, - "name": "Validator", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 116, - "src": "404:9:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 144, - "name": "dbValidator", - "nodeType": "VariableDeclaration", - "scope": 746, - "src": "429:48:2", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Validator_$116_storage_$", - "typeString": "mapping(bytes32 => struct SharedDB.Validator)" - }, - "typeName": { - "id": 143, - "keyType": { - "id": 141, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "437:7:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Mapping", - "src": "429:29:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Validator_$116_storage_$", - "typeString": "mapping(bytes32 => struct SharedDB.Validator)" - }, - "valueType": { - "contractScope": null, - "id": 142, - "name": "Validator", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 116, - "src": "448:9:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator" - } - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 148, - "name": "dbKeygen", - "nodeType": "VariableDeclaration", - "scope": 746, - "src": "483:41:2", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes_storage_$", - "typeString": "mapping(bytes32 => bytes)" - }, - "typeName": { - "id": 147, - "keyType": { - "id": 145, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "491:7:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Mapping", - "src": "483:25:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes_storage_$", - "typeString": "mapping(bytes32 => bytes)" - }, - "valueType": { - "id": 146, - "name": "bytes", - "nodeType": "ElementaryTypeName", - "src": "502:5:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage_ptr", - "typeString": "bytes" - } - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 152, - "name": "confirmationsCount", - "nodeType": "VariableDeclaration", - "scope": 746, - "src": "530:50:2", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - }, - "typeName": { - "id": 151, - "keyType": { - "id": 149, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "538:7:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Mapping", - "src": "530:24:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - }, - "valueType": { - "id": 150, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "549:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 156, - "name": "dbSign", - "nodeType": "VariableDeclaration", - "scope": 746, - "src": "586:39:2", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes_storage_$", - "typeString": "mapping(bytes32 => bytes)" - }, - "typeName": { - "id": 155, - "keyType": { - "id": 153, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "594:7:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Mapping", - "src": "586:25:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes_storage_$", - "typeString": "mapping(bytes32 => bytes)" - }, - "valueType": { - "id": 154, - "name": "bytes", - "nodeType": "ElementaryTypeName", - "src": "605:5:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage_ptr", - "typeString": "bytes" - } - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 160, - "name": "signupsCount", - "nodeType": "VariableDeclaration", - "scope": 746, - "src": "631:44:2", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - }, - "typeName": { - "id": 159, - "keyType": { - "id": 157, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "639:7:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Mapping", - "src": "631:24:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - }, - "valueType": { - "id": 158, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "650:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 164, - "name": "confirmations", - "nodeType": "VariableDeclaration", - "scope": 746, - "src": "681:45:2", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - }, - "typeName": { - "id": 163, - "keyType": { - "id": 161, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "689:7:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Mapping", - "src": "681:24:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - }, - "valueType": { - "id": 162, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "700:4:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 168, - "name": "dbSignups", - "nodeType": "VariableDeclaration", - "scope": 746, - "src": "732:41:2", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - }, - "typeName": { - "id": 167, - "keyType": { - "id": 165, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "740:7:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Mapping", - "src": "732:24:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - }, - "valueType": { - "id": 166, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "751:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 170, - "name": "x", - "nodeType": "VariableDeclaration", - "scope": 746, - "src": "780:13:2", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 169, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "780:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 172, - "name": "y", - "nodeType": "VariableDeclaration", - "scope": 746, - "src": "799:13:2", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 171, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "799:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 174, - "name": "ready", - "nodeType": "VariableDeclaration", - "scope": 746, - "src": "819:17:2", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 173, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "819:4:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 178, - "name": "threshold", - "nodeType": "VariableDeclaration", - "scope": 746, - "src": "843:38:2", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_uint256_$", - "typeString": "mapping(uint256 => uint256)" - }, - "typeName": { - "id": 177, - "keyType": { - "id": 175, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "851:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Mapping", - "src": "843:21:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_uint256_$", - "typeString": "mapping(uint256 => uint256)" - }, - "valueType": { - "id": 176, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "859:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 182, - "name": "parties", - "nodeType": "VariableDeclaration", - "scope": 746, - "src": "887:36:2", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_uint256_$", - "typeString": "mapping(uint256 => uint256)" - }, - "typeName": { - "id": 181, - "keyType": { - "id": 179, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "895:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Mapping", - "src": "887:21:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_uint256_$", - "typeString": "mapping(uint256 => uint256)" - }, - "valueType": { - "id": 180, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "903:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 184, - "name": "epoch", - "nodeType": "VariableDeclaration", - "scope": 746, - "src": "930:17:2", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 183, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "930:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "public" - }, - { - "body": { - "id": 313, - "nodeType": "Block", - "src": "1062:784:2", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - }, - "id": 199, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 197, - "name": "_parties", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 188, - "src": "1080:8:2", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "nodeType": "BinaryOperation", - "operator": ">", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 198, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1091:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "1080:12:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 196, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 12440, - 12441 - ], - "referencedDeclaration": 12440, - "src": "1072:7:2", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 200, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1072:21:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 201, - "nodeType": "ExpressionStatement", - "src": "1072:21:2" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - }, - "id": 205, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 203, - "name": "_threshold", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 186, - "src": "1111:10:2", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "id": 204, - "name": "_parties", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 188, - "src": "1124:8:2", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "src": "1111:21:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 202, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 12440, - 12441 - ], - "referencedDeclaration": 12440, - "src": "1103:7:2", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 206, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1103:30:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 207, - "nodeType": "ExpressionStatement", - "src": "1103:30:2" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 212, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 209, - "name": "validators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 191, - "src": "1151:10:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 210, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1151:17:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "id": 211, - "name": "_parties", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 188, - "src": "1172:8:2", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "src": "1151:29:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 208, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 12440, - 12441 - ], - "referencedDeclaration": 12440, - "src": "1143:7:2", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 213, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1143:38:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 214, - "nodeType": "ExpressionStatement", - "src": "1143:38:2" - }, - { - "expression": { - "argumentTypes": null, - "id": 219, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 215, - "name": "tokenContract", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 316, - "src": "1192:13:2", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$9381", - "typeString": "contract IERC20" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 217, - "name": "_tokenContract", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 193, - "src": "1215:14:2", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 216, - "name": "IERC20", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 9381, - "src": "1208:6:2", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_IERC20_$9381_$", - "typeString": "type(contract IERC20)" - } - }, - "id": 218, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1208:22:2", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$9381", - "typeString": "contract IERC20" - } - }, - "src": "1192:38:2", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$9381", - "typeString": "contract IERC20" - } - }, - "id": 220, - "nodeType": "ExpressionStatement", - "src": "1192:38:2" - }, - { - "expression": { - "argumentTypes": null, - "id": 223, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 221, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 184, - "src": "1241:5:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "31", - "id": 222, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1249:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "1241:9:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 224, - "nodeType": "ExpressionStatement", - "src": "1241:9:2" - }, - { - "expression": { - "argumentTypes": null, - "id": 227, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 225, - "name": "ready", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 174, - "src": "1260:5:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "66616c7365", - "id": 226, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1268:5:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "false" - }, - "src": "1260:13:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 228, - "nodeType": "ExpressionStatement", - "src": "1260:13:2" - }, - { - "expression": { - "argumentTypes": null, - "id": 233, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 229, - "name": "threshold", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 178, - "src": "1284:9:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_uint256_$", - "typeString": "mapping(uint256 => uint256)" - } - }, - "id": 231, - "indexExpression": { - "argumentTypes": null, - "id": 230, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 184, - "src": "1294:5:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "1284:16:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 232, - "name": "_threshold", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 186, - "src": "1303:10:2", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "src": "1284:29:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 234, - "nodeType": "ExpressionStatement", - "src": "1284:29:2" - }, - { - "expression": { - "argumentTypes": null, - "id": 239, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 235, - "name": "parties", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 182, - "src": "1323:7:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_uint256_$", - "typeString": "mapping(uint256 => uint256)" - } - }, - "id": 237, - "indexExpression": { - "argumentTypes": null, - "id": 236, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 184, - "src": "1331:5:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "1323:14:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 238, - "name": "_parties", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 188, - "src": "1340:8:2", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "src": "1323:25:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 240, - "nodeType": "ExpressionStatement", - "src": "1323:25:2" - }, - { - "expression": { - "argumentTypes": null, - "id": 249, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 241, - "name": "validator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 140, - "src": "1385:9:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage", - "typeString": "struct SharedDB.Validator storage ref" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 243, - "name": "validators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 191, - "src": "1407:10:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 245, - "indexExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 244, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1418:1:2", - "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": "1407:13:2", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "hexValue": "31", - "id": 246, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1422:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - { - "argumentTypes": null, - "hexValue": "30", - "id": 247, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1425:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - } - ], - "id": 242, - "name": "Validator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 116, - "src": "1397:9:2", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_struct$_Validator_$116_storage_ptr_$", - "typeString": "type(struct SharedDB.Validator storage pointer)" - } - }, - "id": 248, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "structConstructorCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1397:30:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_memory", - "typeString": "struct SharedDB.Validator memory" - } - }, - "src": "1385:42:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage", - "typeString": "struct SharedDB.Validator storage ref" - } - }, - "id": 250, - "nodeType": "ExpressionStatement", - "src": "1385:42:2" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 252, - "name": "validators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 191, - "src": "1450:10:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 254, - "indexExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 253, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1461:1:2", - "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": "1450:13:2", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 255, - "name": "validator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 140, - "src": "1465:9:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage", - "typeString": "struct SharedDB.Validator storage ref" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_struct$_Validator_$116_storage", - "typeString": "struct SharedDB.Validator storage ref" - } - ], - "id": 251, - "name": "setValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 700, - "src": "1437:12:2", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_struct$_Validator_$116_memory_ptr_$returns$__$", - "typeString": "function (address,struct SharedDB.Validator memory)" - } - }, - "id": 256, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1437:38:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 257, - "nodeType": "ExpressionStatement", - "src": "1437:38:2" - }, - { - "body": { - "id": 307, - "nodeType": "Block", - "src": "1550:259:2", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 269, - "name": "validators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 191, - "src": "1577:10:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 271, - "indexExpression": { - "argumentTypes": null, - "id": 270, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 259, - "src": "1588:1:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "1577:13:2", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 273, - "name": "validators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 191, - "src": "1602:10:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 275, - "indexExpression": { - "argumentTypes": null, - "id": 274, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 259, - "src": "1613:1:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "1602:13:2", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 278, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 276, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 259, - "src": "1617:1:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 277, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1621:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "1617:5:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "hexValue": "30", - "id": 279, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1624:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - } - ], - "id": 272, - "name": "Validator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 116, - "src": "1592:9:2", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_struct$_Validator_$116_storage_ptr_$", - "typeString": "type(struct SharedDB.Validator storage pointer)" - } - }, - "id": 280, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "structConstructorCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1592:34:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_memory", - "typeString": "struct SharedDB.Validator memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_struct$_Validator_$116_memory", - "typeString": "struct SharedDB.Validator memory" - } - ], - "id": 268, - "name": "setValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 700, - "src": "1564:12:2", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_struct$_Validator_$116_memory_ptr_$returns$__$", - "typeString": "function (address,struct SharedDB.Validator memory)" - } - }, - "id": 281, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1564:63:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 282, - "nodeType": "ExpressionStatement", - "src": "1564:63:2" - }, - { - "assignments": [ - 284 - ], - "declarations": [ - { - "constant": false, - "id": 284, - "name": "v", - "nodeType": "VariableDeclaration", - "scope": 307, - "src": "1673:19:2", - "stateVariable": false, - "storageLocation": "storage", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator" - }, - "typeName": { - "contractScope": null, - "id": 283, - "name": "Validator", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 116, - "src": "1673:9:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 292, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 286, - "name": "validators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 191, - "src": "1708:10:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 290, - "indexExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 289, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 287, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 259, - "src": "1719:1:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 288, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1723:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "1719:5:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "1708:17:2", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 285, - "name": "getValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 713, - 733 - ], - "referencedDeclaration": 713, - "src": "1695:12:2", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_struct$_Validator_$116_storage_ptr_$", - "typeString": "function (address) view returns (struct SharedDB.Validator storage pointer)" - } - }, - "id": 291, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1695:31:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator storage pointer" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "1673:53:2" - }, - { - "expression": { - "argumentTypes": null, - "id": 305, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 293, - "name": "v", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 284, - "src": "1740:1:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator storage pointer" - } - }, - "id": 295, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "next", - "nodeType": "MemberAccess", - "referencedDeclaration": 115, - "src": "1740:6:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 299, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 184, - "src": "1776:5:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 300, - "name": "validators", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 191, - "src": "1783:10:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 302, - "indexExpression": { - "argumentTypes": null, - "id": 301, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 259, - "src": "1794:1:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "1783:13:2", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "expression": { - "argumentTypes": null, - "id": 297, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12424, - "src": "1759:3:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 298, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1759:16:2", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 303, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1759:38:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 296, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12431, - "src": "1749:9:2", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 304, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1749:49:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "src": "1740:58:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "id": 306, - "nodeType": "ExpressionStatement", - "src": "1740:58:2" - } - ] - }, - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 264, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 262, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 259, - "src": "1531:1:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "id": 263, - "name": "_parties", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 188, - "src": "1535:8:2", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "src": "1531:12:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 308, - "initializationExpression": { - "assignments": [ - 259 - ], - "declarations": [ - { - "constant": false, - "id": 259, - "name": "i", - "nodeType": "VariableDeclaration", - "scope": 308, - "src": "1519:6:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 258, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1519:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 261, - "initialValue": { - "argumentTypes": null, - "hexValue": "31", - "id": 260, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1528:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "nodeType": "VariableDeclarationStatement", - "src": "1519:10:2" - }, - "loopExpression": { - "expression": { - "argumentTypes": null, - "id": 266, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "1545:3:2", - "subExpression": { - "argumentTypes": null, - "id": 265, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 259, - "src": "1545:1:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 267, - "nodeType": "ExpressionStatement", - "src": "1545:3:2" - }, - "nodeType": "ForStatement", - "src": "1514:295:2" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 310, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 184, - "src": "1833:5:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 309, - "name": "NewEpoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 120, - "src": "1824:8:2", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$returns$__$", - "typeString": "function (uint256)" - } - }, - "id": 311, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1824:15:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 312, - "nodeType": "EmitStatement", - "src": "1819:20:2" - } - ] - }, - "documentation": null, - "id": 314, - "implemented": true, - "kind": "constructor", - "modifiers": [], - "name": "", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 194, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 186, - "name": "_threshold", - "nodeType": "VariableDeclaration", - "scope": 314, - "src": "966:17:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - }, - "typeName": { - "id": 185, - "name": "uint32", - "nodeType": "ElementaryTypeName", - "src": "966:6:2", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 188, - "name": "_parties", - "nodeType": "VariableDeclaration", - "scope": 314, - "src": "985:15:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - }, - "typeName": { - "id": 187, - "name": "uint32", - "nodeType": "ElementaryTypeName", - "src": "985:6:2", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 191, - "name": "validators", - "nodeType": "VariableDeclaration", - "scope": 314, - "src": "1002:27:2", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 189, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1002:7:2", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 190, - "length": null, - "nodeType": "ArrayTypeName", - "src": "1002:9:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 193, - "name": "_tokenContract", - "nodeType": "VariableDeclaration", - "scope": 314, - "src": "1031:22:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 192, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1031:7:2", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "965:89:2" - }, - "returnParameters": { - "id": 195, - "nodeType": "ParameterList", - "parameters": [], - "src": "1062:0:2" - }, - "scope": 746, - "src": "954:892:2", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "constant": false, - "id": 316, - "name": "tokenContract", - "nodeType": "VariableDeclaration", - "scope": 746, - "src": "1852:27:2", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$9381", - "typeString": "contract IERC20" - }, - "typeName": { - "contractScope": null, - "id": 315, - "name": "IERC20", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 9381, - "src": "1852:6:2", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$9381", - "typeString": "contract IERC20" - } - }, - "value": null, - "visibility": "public" - }, - { - "anonymous": false, - "documentation": null, - "id": 324, - "name": "ReceivedTokens", - "nodeType": "EventDefinition", - "parameters": { - "id": 323, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 318, - "indexed": false, - "name": "from", - "nodeType": "VariableDeclaration", - "scope": 324, - "src": "1907:12:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 317, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1907:7:2", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 320, - "indexed": false, - "name": "recipient", - "nodeType": "VariableDeclaration", - "scope": 324, - "src": "1921:16:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string" - }, - "typeName": { - "id": 319, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "1921:6:2", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 322, - "indexed": false, - "name": "value", - "nodeType": "VariableDeclaration", - "scope": 324, - "src": "1939:10:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 321, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1939:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1906:44:2" - }, - "src": "1886:65:2" - }, - { - "body": { - "id": 349, - "nodeType": "Block", - "src": "2029:137:2", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 334, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12437, - "src": "2066:3:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 335, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2066:10:2", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 337, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12457, - "src": "2086:4:2", - "typeDescriptions": { - "typeIdentifier": "t_contract$_SharedDB_$746", - "typeString": "contract SharedDB" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_SharedDB_$746", - "typeString": "contract SharedDB" - } - ], - "id": 336, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "2078:7:2", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 338, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2078:13:2", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 339, - "name": "value", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 326, - "src": "2093:5:2", - "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": 331, - "name": "tokenContract", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 316, - "src": "2039:13:2", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$9381", - "typeString": "contract IERC20" - } - }, - "id": 333, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "transferFrom", - "nodeType": "MemberAccess", - "referencedDeclaration": 9364, - "src": "2039:26:2", - "typeDescriptions": { - "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$_t_bool_$", - "typeString": "function (address,address,uint256) external returns (bool)" - } - }, - "id": 340, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2039:60:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 341, - "nodeType": "ExpressionStatement", - "src": "2039:60:2" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 343, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12437, - "src": "2130:3:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 344, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2130:10:2", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 345, - "name": "recipient", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 328, - "src": "2142:9:2", - "typeDescriptions": { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string memory" - } - }, - { - "argumentTypes": null, - "id": 346, - "name": "value", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 326, - "src": "2153:5:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string memory" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 342, - "name": "ReceivedTokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 324, - "src": "2115:14:2", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_string_memory_ptr_$_t_uint256_$returns$__$", - "typeString": "function (address,string memory,uint256)" - } - }, - "id": 347, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2115:44:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 348, - "nodeType": "EmitStatement", - "src": "2110:49:2" - } - ] - }, - "documentation": null, - "id": 350, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "requestAffirmation", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 329, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 326, - "name": "value", - "nodeType": "VariableDeclaration", - "scope": 350, - "src": "1985:10:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 325, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1985:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 328, - "name": "recipient", - "nodeType": "VariableDeclaration", - "scope": 350, - "src": "1997:23:2", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string" - }, - "typeName": { - "id": 327, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "1997:6:2", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1984:37:2" - }, - "returnParameters": { - "id": 330, - "nodeType": "ParameterList", - "parameters": [], - "src": "2029:0:2" - }, - "scope": 746, - "src": "1957:209:2", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 437, - "nodeType": "Block", - "src": "2214:491:2", - "statements": [ - { - "assignments": [ - 358 - ], - "declarations": [ - { - "constant": false, - "id": 358, - "name": "v", - "nodeType": "VariableDeclaration", - "scope": 437, - "src": "2224:19:2", - "stateVariable": false, - "storageLocation": "storage", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator" - }, - "typeName": { - "contractScope": null, - "id": 357, - "name": "Validator", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 116, - "src": "2224:9:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 363, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 360, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12437, - "src": "2259:3:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 361, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2259:10:2", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - ], - "id": 359, - "name": "getValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 713, - 733 - ], - "referencedDeclaration": 713, - "src": "2246:12:2", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_struct$_Validator_$116_storage_ptr_$", - "typeString": "function (address) view returns (struct SharedDB.Validator storage pointer)" - } - }, - "id": 362, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2246:24:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator storage pointer" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "2224:46:2" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 368, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 365, - "name": "v", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 358, - "src": "2288:1:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator storage pointer" - } - }, - "id": 366, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "partyId", - "nodeType": "MemberAccess", - "referencedDeclaration": 113, - "src": "2288:9:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 367, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2301:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "2288:14:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 364, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 12440, - 12441 - ], - "referencedDeclaration": 12440, - "src": "2280:7:2", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 369, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2280:23:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 370, - "nodeType": "ExpressionStatement", - "src": "2280:23:2" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 384, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "!", - "prefix": true, - "src": "2321:69:2", - "subExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 372, - "name": "confirmations", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 164, - "src": "2322:13:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - } - }, - "id": 383, - "indexExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 376, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 184, - "src": "2363:5:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 377, - "name": "v", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 358, - "src": "2370:1:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator storage pointer" - } - }, - "id": 378, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "partyId", - "nodeType": "MemberAccess", - "referencedDeclaration": 113, - "src": "2370:9:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 379, - "name": "_x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 352, - "src": "2381:2:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 380, - "name": "_y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 354, - "src": "2385:2:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 374, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12424, - "src": "2346:3:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 375, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2346:16:2", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 381, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2346:42:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 373, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12431, - "src": "2336:9:2", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 382, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2336:53:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "2322:68:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 371, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 12440, - 12441 - ], - "referencedDeclaration": 12440, - "src": "2313:7:2", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 385, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2313:78:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 386, - "nodeType": "ExpressionStatement", - "src": "2313:78:2" - }, - { - "expression": { - "argumentTypes": null, - "id": 400, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 387, - "name": "confirmations", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 164, - "src": "2402:13:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$", - "typeString": "mapping(bytes32 => bool)" - } - }, - "id": 398, - "indexExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 391, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 184, - "src": "2443:5:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 392, - "name": "v", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 358, - "src": "2450:1:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator storage pointer" - } - }, - "id": 393, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "partyId", - "nodeType": "MemberAccess", - "referencedDeclaration": 113, - "src": "2450:9:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 394, - "name": "_x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 352, - "src": "2461:2:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 395, - "name": "_y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 354, - "src": "2465:2:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 389, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12424, - "src": "2426:3:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 390, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2426:16:2", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 396, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2426:42:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 388, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12431, - "src": "2416:9:2", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 397, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2416:53:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "2402:68:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 399, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2473:4:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "src": "2402:75:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 401, - "nodeType": "ExpressionStatement", - "src": "2402:75:2" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 416, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 412, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": true, - "src": "2491:64:2", - "subExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 402, - "name": "confirmationsCount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 152, - "src": "2493:18:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - } - }, - "id": 411, - "indexExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 406, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 184, - "src": "2539:5:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 407, - "name": "_x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 352, - "src": "2546:2:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 408, - "name": "_y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 354, - "src": "2550:2:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 404, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12424, - "src": "2522:3:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 405, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2522:16:2", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 409, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2522:31:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 403, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12431, - "src": "2512:9:2", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 410, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2512:42:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "2493:62:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 413, - "name": "parties", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 182, - "src": "2559:7:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_uint256_$", - "typeString": "mapping(uint256 => uint256)" - } - }, - "id": 415, - "indexExpression": { - "argumentTypes": null, - "id": 414, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 184, - "src": "2567:5:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "2559:14:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2491:82:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 436, - "nodeType": "IfStatement", - "src": "2487:212:2", - "trueBody": { - "id": 435, - "nodeType": "Block", - "src": "2575:124:2", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 419, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 417, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 170, - "src": "2589:1:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 418, - "name": "_x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 352, - "src": "2593:2:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2589:6:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 420, - "nodeType": "ExpressionStatement", - "src": "2589:6:2" - }, - { - "expression": { - "argumentTypes": null, - "id": 423, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 421, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 172, - "src": "2609:1:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 422, - "name": "_y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 354, - "src": "2613:2:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2609:6:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 424, - "nodeType": "ExpressionStatement", - "src": "2609:6:2" - }, - { - "expression": { - "argumentTypes": null, - "id": 427, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 425, - "name": "ready", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 174, - "src": "2629:5:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 426, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2637:4:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "src": "2629:12:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 428, - "nodeType": "ExpressionStatement", - "src": "2629:12:2" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 430, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 184, - "src": "2676:5:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 431, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 170, - "src": "2683:1:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 432, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 172, - "src": "2686:1:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 429, - "name": "KeygenCompleted", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 128, - "src": "2660:15:2", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$_t_uint256_$returns$__$", - "typeString": "function (uint256,uint256,uint256)" - } - }, - "id": 433, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2660:28:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 434, - "nodeType": "EmitStatement", - "src": "2655:33:2" - } - ] - } - } - ] - }, - "documentation": null, - "id": 438, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "confirm", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 355, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 352, - "name": "_x", - "nodeType": "VariableDeclaration", - "scope": 438, - "src": "2189:7:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 351, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "2189:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 354, - "name": "_y", - "nodeType": "VariableDeclaration", - "scope": 438, - "src": "2198:7:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 353, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "2198:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2188:18:2" - }, - "returnParameters": { - "id": 356, - "nodeType": "ParameterList", - "parameters": [], - "src": "2214:0:2" - }, - "scope": 746, - "src": "2172:533:2", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 478, - "nodeType": "Block", - "src": "2773:199:2", - "statements": [ - { - "assignments": [ - 446 - ], - "declarations": [ - { - "constant": false, - "id": 446, - "name": "v", - "nodeType": "VariableDeclaration", - "scope": 478, - "src": "2783:19:2", - "stateVariable": false, - "storageLocation": "storage", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator" - }, - "typeName": { - "contractScope": null, - "id": 445, - "name": "Validator", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 116, - "src": "2783:9:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 451, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 448, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12437, - "src": "2818:3:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 449, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2818:10:2", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - ], - "id": 447, - "name": "getValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 713, - 733 - ], - "referencedDeclaration": 713, - "src": "2805:12:2", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_struct$_Validator_$116_storage_ptr_$", - "typeString": "function (address) view returns (struct SharedDB.Validator storage pointer)" - } - }, - "id": 450, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2805:24:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator storage pointer" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "2783:46:2" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 456, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 453, - "name": "v", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 446, - "src": "2847:1:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator storage pointer" - } - }, - "id": 454, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "partyId", - "nodeType": "MemberAccess", - "referencedDeclaration": 113, - "src": "2847:9:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 455, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2860:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "2847:14:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 452, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 12440, - 12441 - ], - "referencedDeclaration": 12440, - "src": "2839:7:2", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 457, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2839:23:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 458, - "nodeType": "ExpressionStatement", - "src": "2839:23:2" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 461, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "!", - "prefix": true, - "src": "2880:6:2", - "subExpression": { - "argumentTypes": null, - "id": 460, - "name": "ready", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 174, - "src": "2881:5:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 459, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 12440, - 12441 - ], - "referencedDeclaration": 12440, - "src": "2872:7:2", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 462, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2872:15:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 463, - "nodeType": "ExpressionStatement", - "src": "2872:15:2" - }, - { - "expression": { - "argumentTypes": null, - "id": 476, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 464, - "name": "dbKeygen", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 148, - "src": "2898:8:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes_storage_$", - "typeString": "mapping(bytes32 => bytes storage ref)" - } - }, - "id": 474, - "indexExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 468, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 184, - "src": "2934:5:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 469, - "name": "key", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 440, - "src": "2941:3:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 470, - "name": "v", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 446, - "src": "2946:1:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator storage pointer" - } - }, - "id": 471, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "partyId", - "nodeType": "MemberAccess", - "referencedDeclaration": 113, - "src": "2946:9:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 466, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12424, - "src": "2917:3:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 467, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2917:16:2", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 472, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2917:39:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 465, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12431, - "src": "2907:9:2", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 473, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2907:50:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "2898:60:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage", - "typeString": "bytes storage ref" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 475, - "name": "data", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 442, - "src": "2961:4:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - }, - "src": "2898:67:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage", - "typeString": "bytes storage ref" - } - }, - "id": 477, - "nodeType": "ExpressionStatement", - "src": "2898:67:2" - } - ] - }, - "documentation": null, - "id": 479, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "setKeygenData", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 443, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 440, - "name": "key", - "nodeType": "VariableDeclaration", - "scope": 479, - "src": "2734:11:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 439, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "2734:7:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 442, - "name": "data", - "nodeType": "VariableDeclaration", - "scope": 479, - "src": "2747:17:2", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes" - }, - "typeName": { - "id": 441, - "name": "bytes", - "nodeType": "ElementaryTypeName", - "src": "2747:5:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage_ptr", - "typeString": "bytes" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2733:32:2" - }, - "returnParameters": { - "id": 444, - "nodeType": "ParameterList", - "parameters": [], - "src": "2773:0:2" - }, - "scope": 746, - "src": "2711:261:2", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 499, - "nodeType": "Block", - "src": "3067:86:2", - "statements": [ - { - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 488, - "name": "dbKeygen", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 148, - "src": "3084:8:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes_storage_$", - "typeString": "mapping(bytes32 => bytes storage ref)" - } - }, - "id": 497, - "indexExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 492, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 184, - "src": "3120:5:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 493, - "name": "key", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 483, - "src": "3127:3:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "id": 494, - "name": "fromPartyId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 481, - "src": "3132:11:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 490, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12424, - "src": "3103:3:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 491, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3103:16:2", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 495, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3103:41:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 489, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12431, - "src": "3093:9:2", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 496, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3093:52:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3084:62:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage", - "typeString": "bytes storage ref" - } - }, - "functionReturnParameters": 487, - "id": 498, - "nodeType": "Return", - "src": "3077:69:2" - } - ] - }, - "documentation": null, - "id": 500, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getKeygenData", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 484, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 481, - "name": "fromPartyId", - "nodeType": "VariableDeclaration", - "scope": 500, - "src": "3001:16:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 480, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "3001:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 483, - "name": "key", - "nodeType": "VariableDeclaration", - "scope": 500, - "src": "3019:11:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 482, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "3019:7:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "3000:31:2" - }, - "returnParameters": { - "id": 487, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 486, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 500, - "src": "3053:12:2", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes" - }, - "typeName": { - "id": 485, - "name": "bytes", - "nodeType": "ElementaryTypeName", - "src": "3053:5:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage_ptr", - "typeString": "bytes" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "3052:14:2" - }, - "scope": 746, - "src": "2978:175:2", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 510, - "nodeType": "Block", - "src": "3200:40:2", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 506, - "name": "hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 502, - "src": "3221:4:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "id": 507, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 184, - "src": "3227:5:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 505, - "name": "signupSign", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 511, - 594 - ], - "referencedDeclaration": 594, - "src": "3210:10:2", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$_t_uint256_$returns$__$", - "typeString": "function (bytes32,uint256)" - } - }, - "id": 508, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3210:23:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 509, - "nodeType": "ExpressionStatement", - "src": "3210:23:2" - } - ] - }, - "documentation": null, - "id": 511, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "signupSign", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 503, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 502, - "name": "hash", - "nodeType": "VariableDeclaration", - "scope": 511, - "src": "3179:12:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 501, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "3179:7:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "3178:14:2" - }, - "returnParameters": { - "id": 504, - "nodeType": "ParameterList", - "parameters": [], - "src": "3200:0:2" - }, - "scope": 746, - "src": "3159:81:2", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 593, - "nodeType": "Block", - "src": "3300:598:2", - "statements": [ - { - "assignments": [ - 519 - ], - "declarations": [ - { - "constant": false, - "id": 519, - "name": "v", - "nodeType": "VariableDeclaration", - "scope": 593, - "src": "3310:19:2", - "stateVariable": false, - "storageLocation": "storage", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator" - }, - "typeName": { - "contractScope": null, - "id": 518, - "name": "Validator", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 116, - "src": "3310:9:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 525, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 521, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12437, - "src": "3345:3:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 522, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3345:10:2", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 523, - "name": "_epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 515, - "src": "3357:6:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 520, - "name": "getValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 713, - 733 - ], - "referencedDeclaration": 733, - "src": "3332:12:2", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_address_$_t_uint256_$returns$_t_struct$_Validator_$116_storage_ptr_$", - "typeString": "function (address,uint256) view returns (struct SharedDB.Validator storage pointer)" - } - }, - "id": 524, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3332:32:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator storage pointer" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "3310:54:2" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 530, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 527, - "name": "v", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 519, - "src": "3382:1:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator storage pointer" - } - }, - "id": 528, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "partyId", - "nodeType": "MemberAccess", - "referencedDeclaration": 113, - "src": "3382:9:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 529, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3395:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "3382:14:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 526, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 12440, - 12441 - ], - "referencedDeclaration": 12440, - "src": "3374:7:2", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 531, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3374:23:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 532, - "nodeType": "ExpressionStatement", - "src": "3374:23:2" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 534, - "name": "ready", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 174, - "src": "3415:5:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 533, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 12440, - 12441 - ], - "referencedDeclaration": 12440, - "src": "3407:7:2", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 535, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3407:14:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 536, - "nodeType": "ExpressionStatement", - "src": "3407:14:2" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 550, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 538, - "name": "signupsCount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 160, - "src": "3439:12:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - } - }, - "id": 546, - "indexExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 542, - "name": "_epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 515, - "src": "3479:6:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 543, - "name": "hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 513, - "src": "3487:4:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "expression": { - "argumentTypes": null, - "id": 540, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12424, - "src": "3462:3:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 541, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3462:16:2", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 544, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3462:30:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 539, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12431, - "src": "3452:9:2", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 545, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3452:41:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3439:55:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<=", - "rightExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 547, - "name": "threshold", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 178, - "src": "3498:9:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_uint256_$", - "typeString": "mapping(uint256 => uint256)" - } - }, - "id": 549, - "indexExpression": { - "argumentTypes": null, - "id": 548, - "name": "_epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 515, - "src": "3508:6:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3498:17:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3439:76:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "416c726561647920656e6f756768207369676e657273", - "id": 551, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3517:24:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_9cbe871a78eb8af4b4d5116f316fc411f9c5ba039b05c15801e65409713afb9f", - "typeString": "literal_string \"Already enough signers\"" - }, - "value": "Already enough signers" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_9cbe871a78eb8af4b4d5116f316fc411f9c5ba039b05c15801e65409713afb9f", - "typeString": "literal_string \"Already enough signers\"" - } - ], - "id": 537, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 12440, - 12441 - ], - "referencedDeclaration": 12441, - "src": "3431:7:2", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 552, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3431:111:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 553, - "nodeType": "ExpressionStatement", - "src": "3431:111:2" - }, - { - "expression": { - "argumentTypes": null, - "id": 575, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 554, - "name": "dbSignups", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 168, - "src": "3663:9:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - } - }, - "id": 564, - "indexExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 558, - "name": "_epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 515, - "src": "3700:6:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 559, - "name": "hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 513, - "src": "3708:4:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 560, - "name": "v", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 519, - "src": "3714:1:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator storage pointer" - } - }, - "id": 561, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "partyId", - "nodeType": "MemberAccess", - "referencedDeclaration": 113, - "src": "3714:9:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 556, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12424, - "src": "3683:3:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 557, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3683:16:2", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 562, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3683:41:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 555, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12431, - "src": "3673:9:2", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 563, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3673:52:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "3663:63:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 574, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": true, - "src": "3729:57:2", - "subExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 565, - "name": "signupsCount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 160, - "src": "3731:12:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - } - }, - "id": 573, - "indexExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 569, - "name": "_epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 515, - "src": "3771:6:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 570, - "name": "hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 513, - "src": "3779:4:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "expression": { - "argumentTypes": null, - "id": 567, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12424, - "src": "3754:3:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 568, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3754:16:2", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 571, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3754:30:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 566, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12431, - "src": "3744:9:2", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 572, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3744:41:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "3731:55:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3663:123:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 576, - "nodeType": "ExpressionStatement", - "src": "3663:123:2" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 578, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12437, - "src": "3809:3:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 579, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3809:10:2", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 580, - "name": "hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 513, - "src": "3821:4:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "id": 581, - "name": "_epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 515, - "src": "3827:6:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 582, - "name": "signupsCount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 160, - "src": "3835:12:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - } - }, - "id": 590, - "indexExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 586, - "name": "_epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 515, - "src": "3875:6:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 587, - "name": "hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 513, - "src": "3883:4:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "expression": { - "argumentTypes": null, - "id": 584, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12424, - "src": "3858:3:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 585, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3858:16:2", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 588, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3858:30:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 583, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12431, - "src": "3848:9:2", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 589, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3848:41:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3835:55:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 577, - "name": "Signup", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 138, - "src": "3802:6:2", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_bytes32_$_t_uint256_$_t_uint256_$returns$__$", - "typeString": "function (address,bytes32,uint256,uint256)" - } - }, - "id": 591, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3802:89:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 592, - "nodeType": "EmitStatement", - "src": "3797:94:2" - } - ] - }, - "documentation": null, - "id": 594, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "signupSign", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 516, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 513, - "name": "hash", - "nodeType": "VariableDeclaration", - "scope": 594, - "src": "3266:12:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 512, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "3266:7:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 515, - "name": "_epoch", - "nodeType": "VariableDeclaration", - "scope": 594, - "src": "3280:11:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 514, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "3280:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "3265:27:2" - }, - "returnParameters": { - "id": 517, - "nodeType": "ParameterList", - "parameters": [], - "src": "3300:0:2" - }, - "scope": 746, - "src": "3246:652:2", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 655, - "nodeType": "Block", - "src": "3978:321:2", - "statements": [ - { - "assignments": [ - 604 - ], - "declarations": [ - { - "constant": false, - "id": 604, - "name": "v", - "nodeType": "VariableDeclaration", - "scope": 655, - "src": "3988:19:2", - "stateVariable": false, - "storageLocation": "storage", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator" - }, - "typeName": { - "contractScope": null, - "id": 603, - "name": "Validator", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 116, - "src": "3988:9:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 609, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 606, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12437, - "src": "4023:3:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 607, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4023:10:2", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - ], - "id": 605, - "name": "getValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 713, - 733 - ], - "referencedDeclaration": 713, - "src": "4010:12:2", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_struct$_Validator_$116_storage_ptr_$", - "typeString": "function (address) view returns (struct SharedDB.Validator storage pointer)" - } - }, - "id": 608, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4010:24:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator storage pointer" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "3988:46:2" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 614, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 611, - "name": "v", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 604, - "src": "4052:1:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator storage pointer" - } - }, - "id": 612, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "partyId", - "nodeType": "MemberAccess", - "referencedDeclaration": 113, - "src": "4052:9:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 613, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4065:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "4052:14:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 610, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 12440, - 12441 - ], - "referencedDeclaration": 12440, - "src": "4044:7:2", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 615, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4044:23:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 616, - "nodeType": "ExpressionStatement", - "src": "4044:23:2" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 618, - "name": "ready", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 174, - "src": "4085:5:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 617, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 12440, - 12441 - ], - "referencedDeclaration": 12440, - "src": "4077:7:2", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 619, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4077:14:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 620, - "nodeType": "ExpressionStatement", - "src": "4077:14:2" - }, - { - "assignments": [ - 622 - ], - "declarations": [ - { - "constant": false, - "id": 622, - "name": "signupId", - "nodeType": "VariableDeclaration", - "scope": 655, - "src": "4101:13:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 621, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "4101:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 634, - "initialValue": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 623, - "name": "dbSignups", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 168, - "src": "4117:9:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", - "typeString": "mapping(bytes32 => uint256)" - } - }, - "id": 633, - "indexExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 627, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 184, - "src": "4154:5:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 628, - "name": "hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 596, - "src": "4161:4:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 629, - "name": "v", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 604, - "src": "4167:1:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator storage pointer" - } - }, - "id": 630, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "partyId", - "nodeType": "MemberAccess", - "referencedDeclaration": 113, - "src": "4167:9:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 625, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12424, - "src": "4137:3:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 626, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4137:16:2", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 631, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4137:40:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 624, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12431, - "src": "4127:9:2", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 632, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4127:51:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4117:62:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "4101:78:2" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 638, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 636, - "name": "signupId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 622, - "src": "4197:8:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 637, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4209:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "4197:13:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 635, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 12440, - 12441 - ], - "referencedDeclaration": 12440, - "src": "4189:7:2", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 639, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4189:22:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 640, - "nodeType": "ExpressionStatement", - "src": "4189:22:2" - }, - { - "expression": { - "argumentTypes": null, - "id": 653, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 641, - "name": "dbSign", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 156, - "src": "4222:6:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes_storage_$", - "typeString": "mapping(bytes32 => bytes storage ref)" - } - }, - "id": 651, - "indexExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 645, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 184, - "src": "4256:5:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 646, - "name": "hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 596, - "src": "4263:4:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "id": 647, - "name": "signupId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 622, - "src": "4269:8:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 648, - "name": "key", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 598, - "src": "4279:3:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "expression": { - "argumentTypes": null, - "id": 643, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12424, - "src": "4239:3:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 644, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4239:16:2", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 649, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4239:44:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 642, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12431, - "src": "4229:9:2", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 650, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4229:55:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "4222:63:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage", - "typeString": "bytes storage ref" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 652, - "name": "data", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 600, - "src": "4288:4:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - }, - "src": "4222:70:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage", - "typeString": "bytes storage ref" - } - }, - "id": 654, - "nodeType": "ExpressionStatement", - "src": "4222:70:2" - } - ] - }, - "documentation": null, - "id": 656, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "setSignData", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 601, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 596, - "name": "hash", - "nodeType": "VariableDeclaration", - "scope": 656, - "src": "3925:12:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 595, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "3925:7:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 598, - "name": "key", - "nodeType": "VariableDeclaration", - "scope": 656, - "src": "3939:11:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 597, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "3939:7:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 600, - "name": "data", - "nodeType": "VariableDeclaration", - "scope": 656, - "src": "3952:17:2", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes" - }, - "typeName": { - "id": 599, - "name": "bytes", - "nodeType": "ElementaryTypeName", - "src": "3952:5:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage_ptr", - "typeString": "bytes" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "3924:46:2" - }, - "returnParameters": { - "id": 602, - "nodeType": "ParameterList", - "parameters": [], - "src": "3978:0:2" - }, - "scope": 746, - "src": "3904:395:2", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 679, - "nodeType": "Block", - "src": "4403:173:2", - "statements": [ - { - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 667, - "name": "dbSign", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 156, - "src": "4506:6:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes_storage_$", - "typeString": "mapping(bytes32 => bytes storage ref)" - } - }, - "id": 677, - "indexExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 671, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 184, - "src": "4540:5:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 672, - "name": "hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 660, - "src": "4547:4:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "id": 673, - "name": "signupId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 658, - "src": "4553:8:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 674, - "name": "key", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 662, - "src": "4563:3:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "expression": { - "argumentTypes": null, - "id": 669, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12424, - "src": "4523:3:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 670, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4523:16:2", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 675, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4523:44:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 668, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12431, - "src": "4513:9:2", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 676, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4513:55:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4506:63:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage", - "typeString": "bytes storage ref" - } - }, - "functionReturnParameters": 666, - "id": 678, - "nodeType": "Return", - "src": "4499:70:2" - } - ] - }, - "documentation": null, - "id": 680, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getSignData", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 663, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 658, - "name": "signupId", - "nodeType": "VariableDeclaration", - "scope": 680, - "src": "4326:13:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 657, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "4326:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 660, - "name": "hash", - "nodeType": "VariableDeclaration", - "scope": 680, - "src": "4341:12:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 659, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "4341:7:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 662, - "name": "key", - "nodeType": "VariableDeclaration", - "scope": 680, - "src": "4355:11:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 661, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "4355:7:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4325:42:2" - }, - "returnParameters": { - "id": 666, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 665, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 680, - "src": "4389:12:2", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes" - }, - "typeName": { - "id": 664, - "name": "bytes", - "nodeType": "ElementaryTypeName", - "src": "4389:5:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage_ptr", - "typeString": "bytes" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4388:14:2" - }, - "scope": 746, - "src": "4305:271:2", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 699, - "nodeType": "Block", - "src": "4643:71:2", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 697, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 687, - "name": "dbValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 144, - "src": "4653:11:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Validator_$116_storage_$", - "typeString": "mapping(bytes32 => struct SharedDB.Validator storage ref)" - } - }, - "id": 695, - "indexExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 691, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 184, - "src": "4692:5:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 692, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 682, - "src": "4699:1:2", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "expression": { - "argumentTypes": null, - "id": 689, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12424, - "src": "4675:3:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 690, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4675:16:2", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 693, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4675:26:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 688, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12431, - "src": "4665:9:2", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 694, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4665:37:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "4653:50:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage", - "typeString": "struct SharedDB.Validator storage ref" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 696, - "name": "v", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 684, - "src": "4706:1:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_memory_ptr", - "typeString": "struct SharedDB.Validator memory" - } - }, - "src": "4653:54:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage", - "typeString": "struct SharedDB.Validator storage ref" - } - }, - "id": 698, - "nodeType": "ExpressionStatement", - "src": "4653:54:2" - } - ] - }, - "documentation": null, - "id": 700, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "setValidator", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 685, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 682, - "name": "a", - "nodeType": "VariableDeclaration", - "scope": 700, - "src": "4604:9:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 681, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "4604:7:2", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 684, - "name": "v", - "nodeType": "VariableDeclaration", - "scope": 700, - "src": "4615:18:2", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_memory_ptr", - "typeString": "struct SharedDB.Validator" - }, - "typeName": { - "contractScope": null, - "id": 683, - "name": "Validator", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 116, - "src": "4615:9:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4603:31:2" - }, - "returnParameters": { - "id": 686, - "nodeType": "ParameterList", - "parameters": [], - "src": "4643:0:2" - }, - "scope": 746, - "src": "4582:132:2", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "private" - }, - { - "body": { - "id": 712, - "nodeType": "Block", - "src": "4794:46:2", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 708, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 702, - "src": "4824:1:2", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 709, - "name": "epoch", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 184, - "src": "4827:5:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 707, - "name": "getValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 713, - 733 - ], - "referencedDeclaration": 733, - "src": "4811:12:2", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_address_$_t_uint256_$returns$_t_struct$_Validator_$116_storage_ptr_$", - "typeString": "function (address,uint256) view returns (struct SharedDB.Validator storage pointer)" - } - }, - "id": 710, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4811:22:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator storage pointer" - } - }, - "functionReturnParameters": 706, - "id": 711, - "nodeType": "Return", - "src": "4804:29:2" - } - ] - }, - "documentation": null, - "id": 713, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getValidator", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 703, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 702, - "name": "a", - "nodeType": "VariableDeclaration", - "scope": 713, - "src": "4742:9:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 701, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "4742:7:2", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4741:11:2" - }, - "returnParameters": { - "id": 706, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 705, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 713, - "src": "4775:17:2", - "stateVariable": false, - "storageLocation": "storage", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator" - }, - "typeName": { - "contractScope": null, - "id": 704, - "name": "Validator", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 116, - "src": "4775:9:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4774:19:2" - }, - "scope": 746, - "src": "4720:120:2", - "stateMutability": "view", - "superFunction": null, - "visibility": "private" - }, - { - "body": { - "id": 732, - "nodeType": "Block", - "src": "4929:71:2", - "statements": [ - { - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 722, - "name": "dbValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 144, - "src": "4946:11:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Validator_$116_storage_$", - "typeString": "mapping(bytes32 => struct SharedDB.Validator storage ref)" - } - }, - "id": 730, - "indexExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 726, - "name": "kv", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "4985:2:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 727, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 715, - "src": "4989:1:2", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "expression": { - "argumentTypes": null, - "id": 724, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12424, - "src": "4968:3:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 725, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4968:16:2", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 728, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4968:23:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 723, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12431, - "src": "4958:9:2", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 729, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4958:34:2", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4946:47:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage", - "typeString": "struct SharedDB.Validator storage ref" - } - }, - "functionReturnParameters": 721, - "id": 731, - "nodeType": "Return", - "src": "4939:54:2" - } - ] - }, - "documentation": null, - "id": 733, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getValidator", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 718, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 715, - "name": "a", - "nodeType": "VariableDeclaration", - "scope": 733, - "src": "4868:9:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 714, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "4868:7:2", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 717, - "name": "kv", - "nodeType": "VariableDeclaration", - "scope": 733, - "src": "4879:7:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 716, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "4879:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4867:20:2" - }, - "returnParameters": { - "id": 721, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 720, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 733, - "src": "4910:17:2", - "stateVariable": false, - "storageLocation": "storage", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator" - }, - "typeName": { - "contractScope": null, - "id": 719, - "name": "Validator", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 116, - "src": "4910:9:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4909:19:2" - }, - "scope": 746, - "src": "4846:154:2", - "stateMutability": "view", - "superFunction": null, - "visibility": "private" - }, - { - "body": { - "id": 744, - "nodeType": "Block", - "src": "5055:56:2", - "statements": [ - { - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 739, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12437, - "src": "5085:3:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 740, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "5085:10:2", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - ], - "id": 738, - "name": "getValidator", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 713, - 733 - ], - "referencedDeclaration": 713, - "src": "5072:12:2", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_struct$_Validator_$116_storage_ptr_$", - "typeString": "function (address) view returns (struct SharedDB.Validator storage pointer)" - } - }, - "id": 741, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5072:24:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Validator_$116_storage_ptr", - "typeString": "struct SharedDB.Validator storage pointer" - } - }, - "id": 742, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "partyId", - "nodeType": "MemberAccess", - "referencedDeclaration": 113, - "src": "5072:32:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 737, - "id": 743, - "nodeType": "Return", - "src": "5065:39:2" - } - ] - }, - "documentation": null, - "id": 745, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getPartyId", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 734, - "nodeType": "ParameterList", - "parameters": [], - "src": "5025:2:2" - }, - "returnParameters": { - "id": 737, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 736, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 745, - "src": "5049:4:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 735, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5049:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5048:6:2" - }, - "scope": 746, - "src": "5006:105:2", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - } - ], - "scope": 747, - "src": "92:5021:2" - } - ], - "src": "0:5114:2" - }, - "compiler": { - "name": "solc", - "version": "0.5.9+commit.e560f70d.Emscripten.clang" - }, - "networks": { - "33": { - "events": { - "0xebad8099c467528a56c98b63c8d476d251cf1ffb4c75db94b4d23fa2b6a1e335": { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "epoch", - "type": "uint256" - } - ], - "name": "NewEpoch", - "type": "event", - "signature": "0xebad8099c467528a56c98b63c8d476d251cf1ffb4c75db94b4d23fa2b6a1e335" - }, - "0xd5142d1199af83907992e45da5956bcd2b7656960404acb6b52c57f2001d4c34": { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "epoch", - "type": "uint256" - }, - { - "indexed": false, - "name": "x", - "type": "uint256" - }, - { - "indexed": false, - "name": "y", - "type": "uint256" - } - ], - "name": "KeygenCompleted", - "type": "event", - "signature": "0xd5142d1199af83907992e45da5956bcd2b7656960404acb6b52c57f2001d4c34" - }, - "0x0241f8405c07cef23d7f0c436e722ead63bf1d1a54f5e956d61c4d49abe9161a": { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "from", - "type": "address" - }, - { - "indexed": true, - "name": "hash", - "type": "bytes32" - }, - { - "indexed": false, - "name": "epoch", - "type": "uint256" - }, - { - "indexed": false, - "name": "partyId", - "type": "uint256" - } - ], - "name": "Signup", - "type": "event", - "signature": "0x0241f8405c07cef23d7f0c436e722ead63bf1d1a54f5e956d61c4d49abe9161a" - }, - "0xf5c740acde48c0facbccbf48e65351e42a1e79e6cb26cd5bbb80a545cb38fdc7": { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "name": "from", - "type": "address" - }, - { - "indexed": false, - "name": "recipient", - "type": "string" - }, - { - "indexed": false, - "name": "value", - "type": "uint256" - } - ], - "name": "ReceivedTokens", - "type": "event", - "signature": "0xf5c740acde48c0facbccbf48e65351e42a1e79e6cb26cd5bbb80a545cb38fdc7" - } - }, - "links": {}, - "address": "0x94b40CC641Ed7db241A1f04C8896ba6f6cC36b85", - "transactionHash": "0x3bce72b368dd51323603e9e8b95b30072f65dea7271430ad8f05e6854173aaee" - }, - "77": { - "events": {}, - "links": {}, - "address": "0xE72aB1106Dbb554912A16991B5608B79456868AE", - "transactionHash": "0x5d1911b86d18f00143161761b9815b39163338dc00bd827947279d2aa7c647fd" - } - }, - "schemaVersion": "3.0.10", - "updatedAt": "2019-07-03T18:43:48.331Z", - "devdoc": { - "methods": {} - }, - "userdoc": { - "methods": {} - } -} \ No newline at end of file diff --git a/src/deploy/contracts/Bridge.sol b/src/deploy/contracts/Bridge.sol deleted file mode 100644 index 853f9a5..0000000 --- a/src/deploy/contracts/Bridge.sol +++ /dev/null @@ -1,20 +0,0 @@ -pragma solidity ^0.5.0; - -import './openzeppelin-solidity/contracts/token/ERC20/IERC20.sol'; - -contract Bridge { - - IERC20 public tokenContract; - - event ReceivedTokens(address from, string recipient, uint value); - - constructor(address _tokenContract) public { - tokenContract = IERC20(_tokenContract); - } - - function requestAffirmation(uint value, string memory recipient) public { - tokenContract.transfer(address(this), value); - - emit ReceivedTokens(msg.sender, recipient, value); - } -} diff --git a/src/deploy/contracts/SharedDB.sol b/src/deploy/contracts/SharedDB.sol deleted file mode 100644 index 4c5fc66..0000000 --- a/src/deploy/contracts/SharedDB.sol +++ /dev/null @@ -1,143 +0,0 @@ -pragma solidity ^0.5.0; -import './openzeppelin-solidity/contracts/token/ERC20/IERC20.sol'; - -contract SharedDB { - struct Validator { - address addr; - uint partyId; - bytes32 next; - } - - event NewEpoch(uint indexed epoch); - event KeygenCompleted(uint indexed epoch, uint x, uint y); - event Signup(address indexed from, bytes32 indexed hash, uint epoch, uint partyId); - - Validator validator; - mapping(bytes32 => Validator) public dbValidator; - mapping(bytes32 => bytes) public dbKeygen; - mapping(bytes32 => uint) public confirmationsCount; - mapping(bytes32 => bytes) public dbSign; - mapping(bytes32 => uint) public signupsCount; - mapping(bytes32 => bool) public confirmations; - mapping(bytes32 => uint) public dbSignups; - - uint public x; - uint public y; - - bool public ready; - - mapping(uint => uint) public threshold; - mapping(uint => uint) public parties; - - uint public epoch; - - constructor(uint32 _threshold, uint32 _parties, address[] memory validators, address _tokenContract) public { - require(_parties > 0); - require(_threshold < _parties); - require(validators.length == _parties); - - tokenContract = IERC20(_tokenContract); - - epoch = 1; - ready = false; - - threshold[epoch] = _threshold; - parties[epoch] = _parties; - // First validator - validator = Validator(validators[0], 1, 0); - setValidator(validators[0], validator); - - // Other validators - for (uint i = 1; i < _parties; i++) { - setValidator(validators[i], Validator(validators[i], i + 1, 0)); - // Link to prev one - Validator storage v = getValidator(validators[i - 1]); - v.next = keccak256(abi.encodePacked(epoch, validators[i])); - } - - emit NewEpoch(epoch); - } - - IERC20 public tokenContract; - - event ReceivedTokens(address from, string recipient, uint value); - - function requestAffirmation(uint value, string memory recipient) public { - tokenContract.transferFrom(msg.sender, address(this), value); - - emit ReceivedTokens(msg.sender, recipient, value); - } - - function confirm(uint _x, uint _y) public { - Validator storage v = getValidator(msg.sender); - require(v.partyId != 0); - require(!confirmations[keccak256(abi.encodePacked(epoch, v.partyId, _x, _y))]); - - confirmations[keccak256(abi.encodePacked(epoch, v.partyId, _x, _y))] = true; - if (++confirmationsCount[keccak256(abi.encodePacked(epoch, _x, _y))] == parties[epoch]) { - x = _x; - y = _y; - ready = true; - emit KeygenCompleted(epoch, x, y); - } - } - - function setKeygenData(bytes32 key, bytes memory data) public { - Validator storage v = getValidator(msg.sender); - require(v.partyId != 0); - require(!ready); - - dbKeygen[keccak256(abi.encodePacked(epoch, key, v.partyId))] = data; - } - - function getKeygenData(uint fromPartyId, bytes32 key) view public returns (bytes memory) { - return dbKeygen[keccak256(abi.encodePacked(epoch, key, fromPartyId))]; - } - - function signupSign(bytes32 hash) public { - signupSign(hash, epoch); - } - - function signupSign(bytes32 hash, uint _epoch) public { - Validator storage v = getValidator(msg.sender, _epoch); - require(v.partyId != 0); - require(ready); - require(signupsCount[keccak256(abi.encodePacked(_epoch, hash))] <= threshold[_epoch], "Already enough signers"); - //require(confirmationsCount[keccak256(abi.encodePacked(_epoch, x, y))] == parties[_epoch]); == ready - - dbSignups[keccak256(abi.encodePacked(_epoch, hash, v.partyId))] = ++signupsCount[keccak256(abi.encodePacked(_epoch, hash))]; - - emit Signup(msg.sender, hash, _epoch, signupsCount[keccak256(abi.encodePacked(_epoch, hash))]); - } - - function setSignData(bytes32 hash, bytes32 key, bytes memory data) public { - Validator storage v = getValidator(msg.sender); - require(v.partyId != 0); - require(ready); - uint signupId = dbSignups[keccak256(abi.encodePacked(epoch, hash, v.partyId))]; - require(signupId != 0); - - dbSign[keccak256(abi.encodePacked(epoch, hash, signupId, key))] = data; - } - - function getSignData(uint signupId, bytes32 hash, bytes32 key) view public returns (bytes memory) { - //uint id = dbSignups[keccak256(abi.encodePacked(epoch, hash, fromPartyId))]; - return dbSign[keccak256(abi.encodePacked(epoch, hash, signupId, key))]; - } - - function setValidator(address a, Validator memory v) private { - dbValidator[keccak256(abi.encodePacked(epoch, a))] = v; - } - - function getValidator(address a) view private returns (Validator storage) { - return getValidator(a, epoch); - } - - function getValidator(address a, uint kv) view private returns (Validator storage) { - return dbValidator[keccak256(abi.encodePacked(kv, a))]; - } - - function getPartyId() view public returns (uint) { - return getValidator(msg.sender).partyId; - } -} diff --git a/src/deploy/.env b/src/deploy/deploy-home/.env similarity index 95% rename from src/deploy/.env rename to src/deploy/deploy-home/.env index ce24476..e3eed26 100644 --- a/src/deploy/.env +++ b/src/deploy/deploy-home/.env @@ -1,5 +1,5 @@ RPC_URL=https://sokol.poa.network -RPC_URL_DEV=http://127.0.0.1:7545 +RPC_URL_DEV=http://127.0.0.1:4444 PRIVATE_KEY=e49fe947f224ae8e126c41b1be3e52be701509c2366e835ea8c08651f91030e0 PRIVATE_KEY_DEV=e2aeb24eaa63102d0c0821717c3b6384abdabd7af2ad4ec8e650dce300798b27 diff --git a/src/deploy/deploy-home/contracts/Bridge.sol b/src/deploy/deploy-home/contracts/Bridge.sol new file mode 100644 index 0000000..ae4261a --- /dev/null +++ b/src/deploy/deploy-home/contracts/Bridge.sol @@ -0,0 +1,177 @@ +pragma solidity ^0.5.0; + +import './openzeppelin-solidity/contracts/token/ERC20/IERC20.sol'; + +contract Bridge { + event NewEpoch(uint indexed epoch); + event KeygenCompleted(uint indexed epoch, uint x, uint y); + event ReceivedTokens(address from, string recipient, uint value); // pass epoch and params in this event + + address[] public validators; + address[] public nextValidators; + address[] public savedNextValidators; + mapping(bytes32 => uint) public confirmationsCount; + mapping(bytes32 => bool) public confirmations; + mapping(bytes32 => uint) public dbTransferCount; + mapping(bytes32 => bool) public dbTransfer; + mapping(bytes32 => uint) public votesCount; + mapping(bytes32 => bool) public votes; + + uint public x; + uint public y; + + bool public ready; + + uint public threshold; + uint public nextThreshold; + + uint public epoch; + + constructor(uint _threshold, uint _parties, address[] memory _validators, address _tokenContract) public { + require(_parties > 0); + require(_threshold < _parties); + require(_validators.length == _parties); + + tokenContract = IERC20(_tokenContract); + + epoch = 1; + ready = false; + + nextThreshold = _threshold; + savedNextValidators = _validators; + + emit NewEpoch(epoch); + } + + IERC20 public tokenContract; + + function requestAffirmation(uint value, string memory recipient) public { + require(ready, "Current epoch is not ready"); + + tokenContract.transferFrom(msg.sender, address(this), value); + + emit ReceivedTokens(msg.sender, recipient, value); + } + + function transfer(bytes32 hash, address to, uint value) public { + uint partyId = getPartyId(); + require(partyId != 0, "Not a validator"); + require(!dbTransfer[keccak256(abi.encodePacked(hash, msg.sender, to, value))], "Already voted"); + + dbTransfer[keccak256(abi.encodePacked(hash, msg.sender, to, value))] = true; + if (++dbTransferCount[keccak256(abi.encodePacked(hash, to, value))] == threshold + 1) + tokenContract.transfer(to, value); + } + + function confirm(uint _x, uint _y) public { + uint partyId = getNextPartyId(msg.sender); + require(partyId != 0, "Not a next validator"); + require(!confirmations[keccak256(abi.encodePacked(epoch, partyId, _x, _y))], "Already confirmed"); + + confirmations[keccak256(abi.encodePacked(epoch, partyId, _x, _y))] = true; + if (++confirmationsCount[keccak256(abi.encodePacked(epoch, _x, _y))] == nextParties()) { + x = _x; + y = _y; + validators = savedNextValidators; + nextValidators = savedNextValidators; + threshold = nextThreshold; + ready = true; + emit KeygenCompleted(epoch, x, y); + } + } + + function parties() view public returns (uint) { + return validators.length; + } + + function nextParties() view public returns (uint) { + return savedNextValidators.length; + } + + function getPartyId() view public returns (uint) { + return getPartyId(msg.sender); + } + + function getPartyId(address a) view public returns (uint) { + for (uint i = 0; i < parties(); i++) { + if (validators[i] == a) + return i + 1; + } + return 0; + } + + function getNextPartyId(address a) view public returns (uint) { + for (uint i = 0; i < nextParties(); i++) { + if (savedNextValidators[i] == a) + return i + 1; + } + return 0; + } + + function getValidatorsArray() view public returns (address[] memory) { + return validators; + } + + function getNextValidatorsArray() view public returns (address[] memory) { + return savedNextValidators; + } + + // Send current epoch in votes? + + function voteAddValidator(address validator) public { + require(getPartyId() != 0, "Not a current validator"); + require(getNextPartyId(validator) == 0, "Already a validator"); + require(!votes[keccak256(abi.encodePacked(uint(1), epoch, msg.sender, validator))], "Already voted"); + + votes[keccak256(abi.encodePacked(uint(1), epoch, msg.sender, validator))] = true; + if (++votesCount[keccak256(abi.encodePacked(uint(1), epoch, validator))] == threshold + 1) { + nextValidators.push(validator); + } + } + + function voteRemoveValidator(address validator) public { + require(getPartyId() != 0, "Not a current validator"); + require(getNextPartyId(validator) != 0, "Already not a validator"); + require(!votes[keccak256(abi.encodePacked(uint(2), epoch, msg.sender, validator))], "Already voted"); + + votes[keccak256(abi.encodePacked(uint(2), epoch, msg.sender, validator))] = true; + if (++votesCount[keccak256(abi.encodePacked(uint(2), epoch, validator))] == threshold + 1) { + _removeValidator(validator); + } + } + + function _removeValidator(address validator) private { + for (uint i = 0; i < nextValidators.length - 1; i++) { + if (nextValidators[i] == validator) { + nextValidators[i] = nextValidators[nextValidators.length - 1]; + } + } + delete nextValidators[nextValidators.length - 1]; + nextValidators.length--; + } + + function voteChangeThreshold(uint _threshold) public { + require(getPartyId() != 0, "Not a current validator"); + require(!votes[keccak256(abi.encodePacked(uint(3), epoch, msg.sender, threshold))], "Already voted"); + + votes[keccak256(abi.encodePacked(uint(3), epoch, msg.sender, _threshold))] = true; + if (++votesCount[keccak256(abi.encodePacked(uint(3), epoch, _threshold))] == threshold + 1) { + nextThreshold = _threshold; + } + } + + function voteStartEpoch(uint newEpoch) public { + require(newEpoch == epoch + 1, "Wrong epoch number"); + require(getPartyId() != 0, "Not a current validator"); + require(!votes[keccak256(abi.encodePacked(uint(4), epoch, msg.sender))], "Voted already"); + + votes[keccak256(abi.encodePacked(uint(4), epoch, msg.sender))] = true; + if (++votesCount[keccak256(abi.encodePacked(uint(4), epoch))] == threshold + 1) { + ready = false; + + epoch++; + savedNextValidators = nextValidators; + emit NewEpoch(epoch); + } + } +} diff --git a/src/deploy-test/contracts/Migrations.sol b/src/deploy/deploy-home/contracts/Migrations.sol similarity index 100% rename from src/deploy-test/contracts/Migrations.sol rename to src/deploy/deploy-home/contracts/Migrations.sol diff --git a/src/deploy-test/contracts/openzeppelin-solidity b/src/deploy/deploy-home/contracts/openzeppelin-solidity similarity index 100% rename from src/deploy-test/contracts/openzeppelin-solidity rename to src/deploy/deploy-home/contracts/openzeppelin-solidity diff --git a/src/deploy-test/migrations/1_initial_migration.js b/src/deploy/deploy-home/migrations/1_initial_migration.js similarity index 100% rename from src/deploy-test/migrations/1_initial_migration.js rename to src/deploy/deploy-home/migrations/1_initial_migration.js diff --git a/src/deploy/migrations/2_deployment.js b/src/deploy/deploy-home/migrations/2_deployment.js similarity index 89% rename from src/deploy/migrations/2_deployment.js rename to src/deploy/deploy-home/migrations/2_deployment.js index 02ccb4c..652ef86 100644 --- a/src/deploy/migrations/2_deployment.js +++ b/src/deploy/deploy-home/migrations/2_deployment.js @@ -1,6 +1,6 @@ require('dotenv').config() -const SharedDB = artifacts.require('SharedDB') +const Bridge = artifacts.require('Bridge') const { THRESHOLD, PARTIES, VALIDATOR_ADDRESS_1, VALIDATOR_ADDRESS_2, VALIDATOR_ADDRESS_3, VALIDATOR_ADDRESS_4, @@ -9,7 +9,7 @@ const { module.exports = deployer => { deployer.deploy( - SharedDB, + Bridge, THRESHOLD, PARTIES, [ diff --git a/src/deploy/truffle-config.js b/src/deploy/deploy-home/truffle-config.js similarity index 96% rename from src/deploy/truffle-config.js rename to src/deploy/deploy-home/truffle-config.js index de81074..661aade 100644 --- a/src/deploy/truffle-config.js +++ b/src/deploy/deploy-home/truffle-config.js @@ -8,7 +8,7 @@ module.exports = { networks: { development: { provider: new PrivateKeyProvider(PRIVATE_KEY_DEV, RPC_URL_DEV), - network_id: '33' + network_id: '44' }, staging: { provider: new PrivateKeyProvider(PRIVATE_KEY, RPC_URL), diff --git a/src/deploy-test/.env b/src/deploy/deploy-side/.env similarity index 66% rename from src/deploy-test/.env rename to src/deploy/deploy-side/.env index 1fc551e..dad8b94 100644 --- a/src/deploy-test/.env +++ b/src/deploy/deploy-side/.env @@ -1,7 +1,5 @@ RPC_URL=https://sokol.poa.network -RPC_URL_DEV=http://127.0.0.1:7545 +RPC_URL_DEV=http://127.0.0.1:3333 PRIVATE_KEY=e49fe947f224ae8e126c41b1be3e52be701509c2366e835ea8c08651f91030e0 PRIVATE_KEY_DEV=e2aeb24eaa63102d0c0821717c3b6384abdabd7af2ad4ec8e650dce300798b27 - -SHARED_DB_ADDRESS=0xED3B25004A77de5dE38850a7D148315537C15572 diff --git a/src/deploy/contracts/Migrations.sol b/src/deploy/deploy-side/contracts/Migrations.sol similarity index 100% rename from src/deploy/contracts/Migrations.sol rename to src/deploy/deploy-side/contracts/Migrations.sol diff --git a/src/deploy/deploy-side/contracts/SharedDB.sol b/src/deploy/deploy-side/contracts/SharedDB.sol new file mode 100644 index 0000000..f098410 --- /dev/null +++ b/src/deploy/deploy-side/contracts/SharedDB.sol @@ -0,0 +1,50 @@ +pragma solidity ^0.5.0; + +contract SharedDB { + mapping(bytes32 => bytes) public dbKeygen; + mapping(bytes32 => bytes) public dbSign; + mapping(bytes32 => uint) public signupsCount; + mapping(bytes32 => uint) public dbSignups; + + function setKeygenData(bytes32 key, bytes memory data) public { + dbKeygen[keccak256(abi.encodePacked(msg.sender, key))] = data; + } + + function getKeygenData(address from, bytes32 key) view public returns (bytes memory) { + return dbKeygen[keccak256(abi.encodePacked(from, key))]; + } + + function signupSign(bytes32 hash) public { + require(dbSignups[keccak256(abi.encodePacked(msg.sender, hash))] == 0); + + dbSignups[keccak256(abi.encodePacked(msg.sender, hash))] = ++signupsCount[hash]; + } + + function getSignupNumber(bytes32 hash, address[] memory validators, address validator) view public returns (uint) { + require(dbSignups[keccak256(abi.encodePacked(validator, hash))] > 0, "Have not voted yet"); + 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 setSignData(bytes32 hash, bytes32 key, bytes memory data) public { + dbSign[keccak256(abi.encodePacked(msg.sender, hash, key))] = data; + } + + function getSignData(address from, bytes32 hash, bytes32 key) view public returns (bytes memory) { + return dbSign[keccak256(abi.encodePacked(from, hash, key))]; + } +} diff --git a/src/deploy/migrations/1_initial_migration.js b/src/deploy/deploy-side/migrations/1_initial_migration.js similarity index 100% rename from src/deploy/migrations/1_initial_migration.js rename to src/deploy/deploy-side/migrations/1_initial_migration.js diff --git a/src/deploy/deploy-side/migrations/2_deployment.js b/src/deploy/deploy-side/migrations/2_deployment.js new file mode 100644 index 0000000..bad14cd --- /dev/null +++ b/src/deploy/deploy-side/migrations/2_deployment.js @@ -0,0 +1,5 @@ +const SharedDB = artifacts.require('SharedDB') + +module.exports = deployer => { + deployer.deploy(SharedDB) +} diff --git a/src/deploy-test/truffle-config.js b/src/deploy/deploy-side/truffle-config.js similarity index 100% rename from src/deploy-test/truffle-config.js rename to src/deploy/deploy-side/truffle-config.js diff --git a/src/deploy/deploy-test/.env b/src/deploy/deploy-test/.env new file mode 100644 index 0000000..2fb93ca --- /dev/null +++ b/src/deploy/deploy-test/.env @@ -0,0 +1,5 @@ +RPC_URL=https://sokol.poa.network +RPC_URL_DEV=http://127.0.0.1:4444 + +PRIVATE_KEY=e49fe947f224ae8e126c41b1be3e52be701509c2366e835ea8c08651f91030e0 +PRIVATE_KEY_DEV=e2aeb24eaa63102d0c0821717c3b6384abdabd7af2ad4ec8e650dce300798b27 diff --git a/src/deploy/deploy-test/contracts/Migrations.sol b/src/deploy/deploy-test/contracts/Migrations.sol new file mode 100644 index 0000000..389e95a --- /dev/null +++ b/src/deploy/deploy-test/contracts/Migrations.sol @@ -0,0 +1,24 @@ +pragma solidity ^0.5.9; + +contract Migrations { + address public owner; + + uint public last_completed_migration; + + modifier restricted() { + if (msg.sender == owner) _; + } + + constructor() public { + owner = msg.sender; + } + + function setCompleted(uint completed) restricted public { + last_completed_migration = completed; + } + + function upgrade(address new_address) restricted public { + Migrations upgraded = Migrations(new_address); + upgraded.setCompleted(last_completed_migration); + } +} diff --git a/src/deploy/contracts/openzeppelin-solidity b/src/deploy/deploy-test/contracts/openzeppelin-solidity similarity index 100% rename from src/deploy/contracts/openzeppelin-solidity rename to src/deploy/deploy-test/contracts/openzeppelin-solidity diff --git a/src/deploy/deploy-test/migrations/1_initial_migration.js b/src/deploy/deploy-test/migrations/1_initial_migration.js new file mode 100644 index 0000000..15bdc97 --- /dev/null +++ b/src/deploy/deploy-test/migrations/1_initial_migration.js @@ -0,0 +1,5 @@ +const Migrations = artifacts.require('Migrations') + +module.exports = deployer => { + deployer.deploy(Migrations) +} diff --git a/src/deploy-test/migrations/2_deployment.js b/src/deploy/deploy-test/migrations/2_deployment.js similarity index 100% rename from src/deploy-test/migrations/2_deployment.js rename to src/deploy/deploy-test/migrations/2_deployment.js diff --git a/src/deploy/deploy-test/truffle-config.js b/src/deploy/deploy-test/truffle-config.js new file mode 100644 index 0000000..661aade --- /dev/null +++ b/src/deploy/deploy-test/truffle-config.js @@ -0,0 +1,29 @@ +require('dotenv').config() + +const PrivateKeyProvider = require('truffle-hdwallet-provider') + +const { RPC_URL, PRIVATE_KEY, RPC_URL_DEV, PRIVATE_KEY_DEV } = process.env + +module.exports = { + networks: { + development: { + provider: new PrivateKeyProvider(PRIVATE_KEY_DEV, RPC_URL_DEV), + network_id: '44' + }, + staging: { + provider: new PrivateKeyProvider(PRIVATE_KEY, RPC_URL), + network_id: '77' + } + }, + compilers: { + solc: { + version: '0.5.9', + settings: { + optimizer: { + enabled: true, + runs: 3 + } + } + } + } +} diff --git a/src/oracle/.env b/src/oracle/.env index 6c8ab21..33c959b 100644 --- a/src/oracle/.env +++ b/src/oracle/.env @@ -1,14 +1,12 @@ -THRESHOLD=1 -PARTIES=3 - -KEY_FILE=keys.store - #RPC_URL=https://sokol.poa.network -RPC_URL=http://host.docker.internal:7545 -RPC_URL_DEV=http://127.0.0.1:7545 +HOME_RPC_URL=http://127.0.0.1:4444 +SIDE_RPC_URL=http://127.0.0.1:3333 +HOME_CHAIN_ID=44 +SIDE_CHAIN_ID=33 -SHARED_DB_ADDRESS=0x94b40CC641Ed7db241A1f04C8896ba6f6cC36b85 -TOKEN_ADDRESS=0x44c158FE850821ae69DaF37AADF5c539e9d0025B +HOME_BRIDGE_ADDRESS=0x94b40CC641Ed7db241A1f04C8896ba6f6cC36b85 +HOME_TOKEN_ADDRESS=0x44c158FE850821ae69DaF37AADF5c539e9d0025B +SIDE_SHARED_DB_ADDRESS=0x44c158FE850821ae69DaF37AADF5c539e9d0025B #VALIDATOR_PRIVATE_KEY=d1e7b8ff274e517e1a332f2bc0ac051e30db196ba31c68c2efcd022e8ec358f1 VALIDATOR_PRIVATE_KEY=2be3f252e16541bf1bb2d4a517d2bf173e6d09f2d765d32c64dc50515aec63ea @@ -17,9 +15,9 @@ VALIDATOR_PRIVATE_KEY=2be3f252e16541bf1bb2d4a517d2bf173e6d09f2d765d32c64dc50515a LOCAL=true -#MESSAGE=fb2487601395e1cabad725e2e006ae16dd134a536ea1e30919b86e7aa572584d - DEPLOY_PRIVATE_KEY=e2aeb24eaa63102d0c0821717c3b6384abdabd7af2ad4ec8e650dce300798b27 FOREIGN_URL=https://testnet-dex.binance.org/ FOREIGN_CHAIN_ID=Binance-Chain-Nile + +VOTES_PROXY_PORT=5000 diff --git a/src/oracle/bncWatcher/Dockerfile b/src/oracle/bncWatcher/Dockerfile new file mode 100644 index 0000000..c8ee2a9 --- /dev/null +++ b/src/oracle/bncWatcher/Dockerfile @@ -0,0 +1,14 @@ +FROM node:10.16.0-alpine + +WORKDIR /watcher + +RUN apk update && \ + apk add libssl1.1 libressl-dev curl + +COPY package.json /watcher/ + +RUN npm install + +COPY bncWatcher.js db.js /watcher/ + +ENTRYPOINT ["node", "bncWatcher.js"] diff --git a/src/oracle/bncWatcher/bncWatcher.js b/src/oracle/bncWatcher/bncWatcher.js new file mode 100644 index 0000000..f005eac --- /dev/null +++ b/src/oracle/bncWatcher/bncWatcher.js @@ -0,0 +1,92 @@ +const redis = require('./db') +const axios = require('axios') +const bech32 = require('bech32') +const BN = require('bignumber.js') +const fs = require('fs') +const crypto = require('crypto') + +const { FOREIGN_URL, PROXY_URL } = process.env +const FOREIGN_ASSET = 'BNB' + +const foreignHttpClient = axios.create({ baseURL: FOREIGN_URL }) +const proxyHttpClient = axios.create({ baseURL: PROXY_URL }) + +async function initialize () { + if (await redis.get('foreignTime') === null) { + console.log('Set default foreign time') + await redis.set('foreignTime', 1562306990672) + } +} + +async function main () { + const newTransactions = await fetchNewTransactions() + if (newTransactions === null || newTransactions.length === 0) { + + await new Promise(r => setTimeout(r, 5000)) + return + } + + console.log(`Found ${newTransactions.length} new transactions`) + + for (const tx of newTransactions.reverse()) { + if (tx.memo !== 'funding') { + await proxyHttpClient + .post('/transfer', { + to: tx.memo, + value: new BN(tx.value).integerValue(BN.ROUND_FLOOR),//(new BN(tx.value).multipliedBy(10 ** 8)).toNumber(), + hash: `0x${tx.txHash}` + }) + } + await redis.set('foreignTime', Date.parse(tx.timeStamp)) + } +} + +async function fetchNewTransactions () { + console.log('Fetching new transactions') + const startTime = parseInt(await redis.get('foreignTime')) + 1 + const address = await getLastForeignAddress() + if (address === null) + return null + console.log('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) +} + +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) +} + +function publicKeyToAddress ({ x, y }) { + const compact = (parseInt(y[y.length - 1], 16) % 2 ? '03' : '02') + padZeros(x, 64) + const sha256Hash = crypto.createHash('sha256').update(Buffer.from(compact, 'hex')).digest('hex') + const hash = crypto.createHash('ripemd160').update(Buffer.from(sha256Hash, 'hex')).digest('hex') + const words = bech32.toWords(Buffer.from(hash, 'hex')) + return bech32.encode('tbnb', words) +} + +function padZeros (s, len) { + while (s.length < len) + s = '0' + s + return s +} + +initialize().then(async () => { + while (true) { + await main() + } +}) diff --git a/src/oracle/watcher/db.js b/src/oracle/bncWatcher/db.js similarity index 100% rename from src/oracle/watcher/db.js rename to src/oracle/bncWatcher/db.js diff --git a/src/oracle/bncWatcher/package.json b/src/oracle/bncWatcher/package.json new file mode 100644 index 0000000..c835354 --- /dev/null +++ b/src/oracle/bncWatcher/package.json @@ -0,0 +1,12 @@ +{ + "name": "watcher", + "version": "0.0.1", + "dependencies": { + "ioredis": "4.10.0", + "axios": "0.19.0", + "bech32": "1.1.3", + "bignumber.js": "9.0.0" + } +} + + diff --git a/src/oracle/docker-compose.yml b/src/oracle/docker-compose.yml index db3d37e..31e9459 100644 --- a/src/oracle/docker-compose.yml +++ b/src/oracle/docker-compose.yml @@ -4,14 +4,23 @@ services: image: blockchain-proxy build: ./proxy environment: - - RPC_URL - - SHARED_DB_ADDRESS + - HOME_RPC_URL + - HOME_BRIDGE_ADDRESS + - HOME_CHAIN_ID + - SIDE_RPC_URL + - SIDE_SHARED_DB_ADDRESS + - SIDE_CHAIN_ID - VALIDATOR_PRIVATE_KEY volumes: - - '../deploy/build/contracts:/proxy/contracts_data' + - '../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: - - sign-proxy-net - - keygen-proxy-net + - test_network +# - sign-proxy-net +# - keygen-proxy-net +# - bncwatcher-proxy-net keygen: image: keygen-client build: ./tss-keygen @@ -21,9 +30,10 @@ services: volumes: - '${PWD}/keys:/keys' networks: - - keygen-proxy-net - - rabbit-keygen-net - - redis-keygen-net + - test_network +# - keygen-proxy-net +# - rabbit-keygen-net +# - redis-keygen-net signer: image: sign-client build: ./tss-sign @@ -35,44 +45,68 @@ services: volumes: - '${PWD}/keys:/keys' networks: - - sign-proxy-net - - rabbit-signer-net - - redis-signer-net + - test_network +# - sign-proxy-net +# - rabbit-signer-net +# - redis-signer-net redis: image: redis:5.0.5-alpine volumes: - '${PWD}/db:/data' networks: - - redis-signer-net - - redis-keygen-net - - redis-watcher-net + - test_network +# - redis-signer-net +# - redis-keygen-net +# - redis-ethwatcher-net +# - redis-bncwatcher-net rabbitmq: hostname: rabbit image: rabbitmq:3.7.15-alpine volumes: - '${PWD}/queue:/var/lib/rabbitmq/mnesia' networks: - - rabbit-signer-net - - rabbit-keygen-net - - rabbit-watcher-net + - test_network +# - rabbit-signer-net +# - rabbit-keygen-net +# - rabbit-ethwatcher-net +# - rabbit-bncwatcher-net eth-watcher: - build: ./watcher + build: ethWatcher image: eth-watcher environment: - - 'HOME_RPC_URL=${RPC_URL}' - - 'HOME_BRIDGE_ADDRESS=${SHARED_DB_ADDRESS}' + - HOME_RPC_URL + - HOME_BRIDGE_ADDRESS - 'RABBITMQ_URL=amqp://rabbitmq:5672' volumes: - - '../deploy/build/contracts:/watcher/contracts_data' + - '../deploy/deploy-home/build/contracts/Bridge.json:/watcher/contracts_data/Bridge.json' networks: - - rabbit-watcher-net - - redis-watcher-net + - test_network +# - rabbit-ethwatcher-net +# - redis-ethwatcher-net + bnc-watcher: + build: bncWatcher + image: bnc-watcher + environment: + - FOREIGN_URL + - 'RABBITMQ_URL=amqp://rabbitmq:5672' + - 'PROXY_URL=http://proxy:8001' + volumes: + - '${PWD}/keys:/keys' + networks: + - test_network +# - rabbit-bncwatcher-net +# - redis-bncwatcher-net +# - bncwatcher-proxy-net networks: - sign-proxy-net: - keygen-proxy-net: - rabbit-signer-net: - rabbit-keygen-net: - rabbit-watcher-net: - redis-keygen-net: - redis-signer-net: - redis-watcher-net: + test_network: +# sign-proxy-net: +# keygen-proxy-net: +# rabbit-signer-net: +# rabbit-keygen-net: +# rabbit-ethwatcher-net: +# rabbit-bncwatcher-net: +# redis-keygen-net: +# redis-signer-net: +# redis-ethwatcher-net: +# redis-bncwatcher-net: +# bncwatcher-proxy-net: diff --git a/src/oracle/watcher/Dockerfile b/src/oracle/ethWatcher/Dockerfile similarity index 100% rename from src/oracle/watcher/Dockerfile rename to src/oracle/ethWatcher/Dockerfile diff --git a/src/oracle/ethWatcher/db.js b/src/oracle/ethWatcher/db.js new file mode 100644 index 0000000..b98810e --- /dev/null +++ b/src/oracle/ethWatcher/db.js @@ -0,0 +1,21 @@ +const Redis = require('ioredis') + +console.log('Connecting to redis') + +const redis = new Redis({ + port: 6379, + host: 'redis', + family: 4, + password: 'password', + db: 0 +}) + +redis.on('connect', () => { + console.log('Connected to redis') +}) + +redis.on('error', () => { + console.log('Redis error') +}) + +module.exports = redis diff --git a/src/oracle/watcher/ethWatcher.js b/src/oracle/ethWatcher/ethWatcher.js similarity index 93% rename from src/oracle/watcher/ethWatcher.js rename to src/oracle/ethWatcher/ethWatcher.js index bebf483..8cf0113 100644 --- a/src/oracle/watcher/ethWatcher.js +++ b/src/oracle/ethWatcher/ethWatcher.js @@ -1,7 +1,7 @@ const amqp = require('amqplib') const Web3 = require('web3') const redis = require('./db') -const bridgeAbi = require('./contracts_data/SharedDB.json').abi +const bridgeAbi = require('./contracts_data/Bridge.json').abi const { HOME_RPC_URL, HOME_BRIDGE_ADDRESS, RABBITMQ_URL } = process.env @@ -52,11 +52,10 @@ async function initialize () { } } -// By design, epoch change needs last epoch to be confirmed -// Each transfer needs last epoch to be confirmed too async function main () { console.log(`Watching events in block #${blockNumber}`) if (await web3Home.eth.getBlock(blockNumber) === null) { + console.log('No block') await new Promise(r => setTimeout(r, 1000)) return } @@ -79,9 +78,10 @@ async function main () { console.log('Sent new epoch event') if (oldEpoch > 0) { + // Transfer all assets to new account tss account channel.sendToQueue(signQueue.queue, Buffer.from(JSON.stringify({ - epoch: oldEpoch, - nonce: foreignNonce[oldEpoch], + epoch: newEpoch, + //nonce: foreignNonce[oldEpoch], })), { persistent: true }) diff --git a/src/oracle/watcher/package.json b/src/oracle/ethWatcher/package.json similarity index 100% rename from src/oracle/watcher/package.json rename to src/oracle/ethWatcher/package.json diff --git a/src/oracle/proxy/index.js b/src/oracle/proxy/index.js index 9ee6d1a..db97c84 100644 --- a/src/oracle/proxy/index.js +++ b/src/oracle/proxy/index.js @@ -1,17 +1,21 @@ const express = require('express') const Web3 = require('web3') -const fs = require('fs') -const BN = require('bignumber.js') -const ethers = require('ethers') +const AsyncLock = require('async-lock') -const { RPC_URL, SHARED_DB_ADDRESS, VALIDATOR_PRIVATE_KEY } = process.env -const abi = require('./contracts_data/SharedDB.json').abi +const { HOME_RPC_URL, HOME_BRIDGE_ADDRESS, SIDE_RPC_URL, SIDE_SHARED_DB_ADDRESS, VALIDATOR_PRIVATE_KEY, HOME_CHAIN_ID, SIDE_CHAIN_ID } = process.env +const abiSharedDb = require('./contracts_data/SharedDB.json').abi +const abiBridge = require('./contracts_data/Bridge.json').abi -const web3 = new Web3(RPC_URL, null, { transactionConfirmationBlocks: 1 }) -const contract = new web3.eth.Contract(abi, SHARED_DB_ADDRESS) -const validatorAddress = web3.eth.accounts.privateKeyToAccount(`0x${VALIDATOR_PRIVATE_KEY}`).address +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 sharedDb = new sideWeb3.eth.Contract(abiSharedDb, SIDE_SHARED_DB_ADDRESS) +const validatorAddress = homeWeb3.eth.accounts.privateKeyToAccount(`0x${VALIDATOR_PRIVATE_KEY}`).address -let validatorNonce +const lock = new AsyncLock() + +let homeValidatorNonce +let sideValidatorNonce const app = express() app.use(express.json()) @@ -22,23 +26,35 @@ app.post('/set', set) app.post('/signupkeygen', signupKeygen) app.post('/signupsign', signupSign) -app.get('/params', params) +app.get('/current_params', currentParams) +app.get('/next_params', nextParams) app.post('/confirm', confirm) +app.post('/transfer', transfer) + +const votesProxyApp = express() +votesProxyApp.use(express.json()) +votesProxyApp.use(express.urlencoded({ extended: true })) + +votesProxyApp.get('/vote/startEpoch/:epoch', voteStartEpoch) +votesProxyApp.get('/vote/addValidator/:validator', voteAddValidator) +votesProxyApp.get('/vote/removeValidator/:validator', voteRemoveValidator) +votesProxyApp.get('/info', info) async function main () { - validatorNonce = await web3.eth.getTransactionCount(validatorAddress) - - try { - fs.mkdirSync('/generated_data') - } catch (e) { - - } + homeValidatorNonce = await homeWeb3.eth.getTransactionCount(validatorAddress) + sideValidatorNonce = await sideWeb3.eth.getTransactionCount(validatorAddress) app.listen(8001, () => { - console.log('Listening on port 8001') + console.log('Proxy is listening on port 8001') + }) + + votesProxyApp.listen(8002, () => { + console.log('Votes proxy is listening on port 8001') }) } +main() + function Ok (data) { return { Ok: data } } @@ -49,16 +65,23 @@ function Err (data) { async function get (req, res) { console.log('Get call') + const round = req.body.key.second const uuid = req.body.key.third - const from = parseInt(req.body.key.first) - const to = Number(req.body.key.fourth) - const key = web3.utils.sha3(`${req.body.key.second}_${to}`) + let from + if (uuid.startsWith('k')) + from = await bridge.methods.savedNextValidators(parseInt(req.body.key.first) - 1).call() + else { + const validators = await bridge.methods.getValidatorsArray().call() + from = await sharedDb.methods.getSignupAddress(uuid, validators, parseInt(req.body.key.first)).call() + } + const to = Number(req.body.key.fourth) // 0 if empty + const key = homeWeb3.utils.sha3(`${round}_${to}`) const data = await (uuid.startsWith('k') - ? contract.methods.getKeygenData(from, key).call() - : contract.methods.getSignData(from, uuid, key).call()) + ? sharedDb.methods.getKeygenData(from, key).call() + : sharedDb.methods.getSignData(from, uuid, key).call()) - const result = web3.utils.hexToUtf8(data) + const result = homeWeb3.utils.hexToUtf8(data) if (result.length) res.send(Ok({ key: req.body.key, value: result })) else { @@ -70,14 +93,15 @@ async function get (req, res) { async function set (req, res) { console.log('Set call') + const round = req.body.key.second const uuid = req.body.key.third const to = Number(req.body.key.fourth) - const key = web3.utils.sha3(`${req.body.key.second}_${to}`) + const key = homeWeb3.utils.sha3(`${round}_${to}`) - const query = uuid.startsWith('k') ? contract.methods.setKeygenData(key, web3.utils.utf8ToHex(req.body.value)) - : contract.methods.setSignData(uuid, key, web3.utils.utf8ToHex(req.body.value)) - await sendQuery(query) - fs.writeFileSync(`/generated_data/${req.body.key.first}_${req.body.key.second}_${req.body.key.third}_${req.body.key.fourth}.json`, req.body.value) + const query = uuid.startsWith('k') + ? sharedDb.methods.setKeygenData(key, sideWeb3.utils.utf8ToHex(req.body.value)) + : sharedDb.methods.setSignData(uuid, key, sideWeb3.utils.utf8ToHex(req.body.value)) + await sideSendQuery(query) res.send(Ok(null)) console.log('Set end') @@ -85,71 +109,168 @@ async function set (req, res) { async function signupKeygen (req, res) { console.log('SignupKeygen call') - const epoch = (await contract.methods.epoch().call()).toNumber() - const partyId = (await contract.methods.getPartyId().call({ from: validatorAddress })).toNumber() + const epoch = (await bridge.methods.epoch().call()).toNumber() + const partyId = (await bridge.methods.getNextPartyId(validatorAddress).call()).toNumber() - res.send(Ok({ uuid: `k${epoch}`, number: partyId })) - console.log('SignupKeygen end') + if (partyId === 0) { + res.send(Err({ message: 'Not a validator' })) + } else { + res.send(Ok({ uuid: `k${epoch}`, number: partyId })) + console.log('SignupKeygen end') + } } async function signupSign (req, res) { console.log('SignupSign call') - console.log(req.body.third) - const hash = web3.utils.sha3(`0x${req.body.third}`) - const query = contract.methods.signupSign(hash) - const receipt = await sendQuery(query) + const hash = sideWeb3.utils.sha3(`0x${req.body.third}`) + const query = sharedDb.methods.signupSign(hash) + await sideSendQuery(query) - while (true) { - const events = await contract.getPastEvents('Signup', { - filter: { from: validatorAddress, hash }, - fromBlock: receipt.blockNumber, - toBlock: receipt.blockNumber - }) - const event = events[0] + const validators = await bridge.methods.getValidatorsArray().call() + const threshold = await bridge.methods.threshold().call() + const id = (await sharedDb.methods.getSignupNumber(hash, validators, validatorAddress).call()).toNumber() - if (event) { - res.send(Ok({ uuid: hash, number: event.returnValues.partyId.toNumber() })) - break - } + if (id > threshold + 1) { + res.send(Err({})) } + + res.send(Ok({ uuid: hash, number: id })) console.log('SignupSign end') } async function confirm (req, res) { console.log('Confirm call') const { x, y } = req.body[5] - const query = contract.methods.confirm(`0x${x}`, `0x${y}`) - await sendQuery(query) - //const addr = `0x${web3.utils.sha3(`0x${x}${y}`).substring(26)}` - //console.log(addr) + const query = bridge.methods.confirm(`0x${x}`, `0x${y}`) + await homeSendQuery(query) res.send() console.log('Confirm end') } -async function params (req, res) { - console.log('Params call') - const epoch = parseInt(req.query.epoch) - const parties = (await contract.methods.parties(epoch).call()).toNumber().toString() - const threshold = (await contract.methods.threshold(epoch).call()).toNumber().toString() +async function currentParams (req, res) { + console.log('Current params call') + const parties = (await bridge.methods.parties().call()).toNumber().toString() + const threshold = (await bridge.methods.threshold().call()).toNumber().toString() res.send({ parties, threshold }) - console.log('Params end') + console.log('Current params end') } -async function sendQuery (query) { - const encodedABI = query.encodeABI() - const tx = { - data: encodedABI, - from: validatorAddress, - to: SHARED_DB_ADDRESS, - nonce: validatorNonce++, - chainId: 33 +async function nextParams (req, res) { + console.log('Next params call') + const parties = (await bridge.methods.nextParties().call()).toNumber().toString() + const threshold = (await bridge.methods.nextThreshold().call()).toNumber().toString() + res.send({ parties, threshold }) + console.log('Next params end') +} + +function sideSendQuery (query) { + return lock.acquire('side', async () => { + const encodedABI = query.encodeABI() + const tx = { + data: encodedABI, + from: validatorAddress, + to: SIDE_SHARED_DB_ADDRESS, + nonce: sideValidatorNonce++, + chainId: parseInt(SIDE_CHAIN_ID) + } + tx.gas = Math.min(Math.ceil(await query.estimateGas(tx) * 1.5), 6721975) + const signedTx = await sideWeb3.eth.accounts.signTransaction(tx, VALIDATOR_PRIVATE_KEY) + + try { + return await sideWeb3.eth.sendSignedTransaction(signedTx.rawTransaction) + } catch (e) { + //sideValidatorNonce-- + console.log('Side tx failed', e.message) + return null + } + }) +} + +function homeSendQuery (query) { + return lock.acquire('home', async () => { + const encodedABI = query.encodeABI() + const tx = { + data: encodedABI, + from: validatorAddress, + to: HOME_BRIDGE_ADDRESS, + nonce: homeValidatorNonce++, + chainId: parseInt(HOME_CHAIN_ID) + } + tx.gas = Math.min(Math.ceil(await query.estimateGas(tx) * 1.5), 6721975) + const signedTx = await homeWeb3.eth.accounts.signTransaction(tx, VALIDATOR_PRIVATE_KEY) + + try { + return await homeWeb3.eth.sendSignedTransaction(signedTx.rawTransaction) + } catch (e) { + //homeValidatorNonce-- + console.log('Home tx failed', e.message) + return null + } + }) +} + +async function voteStartEpoch (req, res) { + console.log('Voting for starting new epoch') + const query = bridge.methods.voteStartEpoch(req.params.epoch) + try { + await homeSendQuery(query) + } catch (e) { + console.log(e) } - tx.gas = Math.min(Math.ceil(await query.estimateGas(tx) * 1.5), 6721975) - const signedTx = await web3.eth.accounts.signTransaction(tx, VALIDATOR_PRIVATE_KEY) - - const receipt = await web3.eth.sendSignedTransaction(signedTx.rawTransaction) - - return receipt + res.send('Voted') + console.log('Voted successfully') } -main() +async function voteAddValidator (req, res) { + console.log('Voting for adding new validator') + const query = bridge.methods.voteAddValidator(req.params.validator) + try { + await homeSendQuery(query) + } catch (e) { + console.log(e) + } + res.send('Voted') + console.log('Voted successfully') +} + +async function voteRemoveValidator (req, res) { + console.log('Voting for removing validator') + const query = bridge.methods.voteRemoveValidator(req.params.validator) + try { + await homeSendQuery(query) + } catch (e) { + console.log(e) + } + res.send('Voted') + console.log('Voted successfully') +} + +async function info (req, res) { + console.log('Info start') + res.send({ + epoch: (await bridge.methods.epoch().call()).toNumber(), + threshold: (await bridge.methods.threshold().call()).toNumber(), + nextThreshold: (await bridge.methods.nextThreshold().call()).toNumber(), + validators: await bridge.methods.getValidatorsArray().call(), + nextValidators: await bridge.methods.getNextValidatorsArray().call(), + homeBalance: 0, + foreignBalance: 0 + }) + console.log('Info end') +} + +async function transfer (req, res) { + console.log('Transfer start') + const { hash, to, value } = req.body + if (homeWeb3.utils.isAddress(to)) { + console.log('Calling transfer') + const query = bridge.methods.transfer(hash, to, value) + await homeSendQuery(query) + } else { + // return funds ? + } + res.send() + console.log('Transfer end') +} + + diff --git a/src/oracle/proxy/package.json b/src/oracle/proxy/package.json index 162dcce..4192d0a 100644 --- a/src/oracle/proxy/package.json +++ b/src/oracle/proxy/package.json @@ -3,9 +3,7 @@ "version": "0.0.1", "dependencies": { "web3": "1.0.0-beta.55", - "dotenv": "8.0.0", "express": "4.17.1", - "bignumber.js": "9.0.0", - "ethers": "4.0.31" + "async-lock": "1.2.0" } } diff --git a/src/oracle/testApprove.js b/src/oracle/testApprove.js index 4e79a58..95aa3e9 100644 --- a/src/oracle/testApprove.js +++ b/src/oracle/testApprove.js @@ -2,14 +2,14 @@ require('dotenv').config() const Web3 = require('web3') -const { RPC_URL_DEV, SHARED_DB_ADDRESS, DEPLOY_PRIVATE_KEY, TOKEN_ADDRESS } = process.env -const web3 = new Web3(RPC_URL_DEV, null, { transactionConfirmationBlocks: 1 }) -const abiBridge = require('../deploy/build/contracts/SharedDB').abi -const abiToken = require('../deploy/build/contracts/IERC20').abi -const bridge = new web3.eth.Contract(abiBridge, SHARED_DB_ADDRESS) -const token = new web3.eth.Contract(abiToken, TOKEN_ADDRESS) +const { HOME_RPC_URL, HOME_BRIDGE_ADDRESS, HOME_CHAIN_ID, DEPLOY_PRIVATE_KEY, HOME_TOKEN_ADDRESS } = process.env +const web3 = new Web3(HOME_RPC_URL, null, { transactionConfirmationBlocks: 1 }) +const abiBridge = require('../deploy/deploy-home/build/contracts/SharedDB').abi +const abiToken = require('../deploy/deploy-home/build/contracts/IERC20').abi +const bridge = new web3.eth.Contract(abiBridge, HOME_BRIDGE_ADDRESS) +const token = new web3.eth.Contract(abiToken, HOME_TOKEN_ADDRESS) -const query1 = token.methods.approve(SHARED_DB_ADDRESS, 1) +const query1 = token.methods.approve(HOME_BRIDGE_ADDRESS, 1) const query2 = bridge.methods.requestAffirmation(1, 'tbnb1h3nmmqukrtjc0prmtdts0kxlgmw8rend4zfasn') let nonce @@ -18,8 +18,8 @@ const deployAddress = web3.eth.accounts.privateKeyToAccount(`0x${DEPLOY_PRIVATE_ async function main () { console.log(deployAddress) nonce = await web3.eth.getTransactionCount(deployAddress) - await sendQuery(query1, TOKEN_ADDRESS) - await sendQuery(query2, SHARED_DB_ADDRESS) + await sendQuery(query1, HOME_TOKEN_ADDRESS) + await sendQuery(query2, HOME_BRIDGE_ADDRESS) } async function sendQuery (query, to) { @@ -29,14 +29,12 @@ async function sendQuery (query, to) { from: deployAddress, to, nonce: nonce++, - chainId: 33 + chainId: parseInt(HOME_CHAIN_ID) } tx.gas = Math.min(Math.ceil(await query.estimateGas(tx) * 1.5), 6721975) const signedTx = await web3.eth.accounts.signTransaction(tx, DEPLOY_PRIVATE_KEY) - const receipt = await web3.eth.sendSignedTransaction(signedTx.rawTransaction) - - return receipt + return await web3.eth.sendSignedTransaction(signedTx.rawTransaction) } main() diff --git a/src/oracle/testBinanceSend.js b/src/oracle/testBinanceSend.js index 373186f..7e092ff 100644 --- a/src/oracle/testBinanceSend.js +++ b/src/oracle/testBinanceSend.js @@ -1,17 +1,22 @@ +require('dotenv').config() + const Bnc = require('@binance-chain/javascript-sdk') const axios = require('axios') -const Transaction = require('../oracle/tss-sign/tx') +const Transaction = require('./tss-sign/tx') const crypto = require('crypto') const ecc = require('tiny-secp256k1') const privKey = 'b92a59209e28149e5cee8e54dfceb80a08ea08e654261bdb9d264b15dee2525c' const asset = 'BNB' -const amount = 2.5 +const amount = '2.5' const addressTo = process.argv[2] const addressFrom = Bnc.crypto.getAddressFromPrivateKey(privKey) -const message = 'A note to you' +const message = process.argv[3] || 'funding' const api = 'https://testnet-dex.binance.org/' - +const publicKey = { + x: 'b32b5ea8698156239ea7092ef8a44a4b711ea29525da34a8233bdc0dd3af7f1a', + y: '6b5b77f2e925f93cae7fc894ff50bafcb7b6e6e96e339c96e41663ccaf0a4d68' +} const httpClient = axios.create({ baseURL: api }) @@ -19,20 +24,14 @@ httpClient .get(`/api/v1/account/${addressFrom}`) .then((res) => { const { sequence } = res.data - const tx = new Transaction('tbnb1h3nmmqukrtjc0prmtdts0kxlgmw8rend4zfasn', 674629, sequence, process.argv[2], amount, 'BNB', 'test') + const tx = new Transaction('tbnb1h3nmmqukrtjc0prmtdts0kxlgmw8rend4zfasn', 674629, sequence, addressTo, amount, asset, message) const hash = crypto.createHash('sha256').update(tx.getSignBytes()).digest('hex') - console.log(tx.getSignBytes().toString('hex')) - console.log(hash) - const signature = ecc.sign(Buffer.from(hash, 'hex'), Buffer.from('b92a59209e28149e5cee8e54dfceb80a08ea08e654261bdb9d264b15dee2525c', 'hex')) + const signature = ecc.sign(Buffer.from(hash, 'hex'), Buffer.from(privKey, 'hex')) const sig = { r: signature.toString('hex').substr(0, 64), s: signature.toString('hex').substr(64, 64) } - console.log(sig) - const publicKey = { - x: 'b32b5ea8698156239ea7092ef8a44a4b711ea29525da34a8233bdc0dd3af7f1a', - y: '6b5b77f2e925f93cae7fc894ff50bafcb7b6e6e96e339c96e41663ccaf0a4d68' - } + return tx.addSignature(publicKey, sig) }) .then(signed => { diff --git a/src/oracle/tss-keygen/keygen-entrypoint.sh b/src/oracle/tss-keygen/keygen-entrypoint.sh index 3b4ac7c..9fec2e6 100755 --- a/src/oracle/tss-keygen/keygen-entrypoint.sh +++ b/src/oracle/tss-keygen/keygen-entrypoint.sh @@ -8,9 +8,9 @@ until curl "$1" > /dev/null 2>&1; do sleep 1; done -echo "Fetching current tss params" +echo "Fetching next tss params" -curl -X GET "$1/params?epoch=$3" -o ./params > /dev/null 2>&1 +curl -X GET "$1/next_params" -o ./params > /dev/null 2>&1 echo "Generating key using server $1" @@ -18,6 +18,6 @@ echo "Generating key using server $1" echo "Generated keys for all parties" -echo "Sending confirmation" +#echo "Sending confirmation" -curl -X POST -H "Content-Type: application/json" -d @"$2" "$1/confirm" > /dev/null 2>&1 +#curl -X POST -H "Content-Type: application/json" -d @"$2" "$1/confirm" > /dev/null 2>&1 diff --git a/src/oracle/tss-keygen/keygen.js b/src/oracle/tss-keygen/keygen.js index b63f823..35b1c54 100644 --- a/src/oracle/tss-keygen/keygen.js +++ b/src/oracle/tss-keygen/keygen.js @@ -10,21 +10,43 @@ async function main () { console.log('Connecting to RabbitMQ server') const connection = await connectRabbit(RABBITMQ_URL) console.log('Connecting to epoch events queue') - const channel = await connection.createConfirmChannel() + const channel = await connection.createChannel() const queue = await channel.assertQueue('epochQueue') - channel.prefetch(1) + let prev + let cmd + + channel.prefetch(2) channel.consume(queue.queue, msg => { + if (prev) { + const t = prev + prev = msg + channel.ack(t) + } + if (cmd) { + cmd.kill() + } const data = JSON.parse(msg.content) console.log(`Consumed new epoch event, starting keygen for epoch ${data.epoch}`) const keysFile = `/keys/keys${data.epoch}.store` console.log('Running ./keygen-entrypoint.sh') - const cmd = exec.execFile('./keygen-entrypoint.sh', [PROXY_URL, keysFile, data.epoch], () => { - console.log('Finished keygen') - const publicKey = JSON.parse(fs.readFileSync(keysFile).toString())[5] - console.log(`Generated multisig account in binance chain: ${publicKeyToAddress(publicKey)}`) + cmd = exec.execFile('./keygen-entrypoint.sh', [PROXY_URL, keysFile], async () => { + cmd = null + if (fs.existsSync(keysFile)) { + console.log(`Finished keygen for epoch ${data.epoch}`) + const publicKey = JSON.parse(fs.readFileSync(keysFile))[5] + console.log(`Generated multisig account in binance chain: ${publicKeyToAddress(publicKey)}`) + if (data.epoch === 1) { + console.log('Sending keys confirmation on first generated epoch') + await confirm(keysFile) + } + } + else { + console.log(`Keygen for epoch ${data.epoch} failed`) + } + prev = null channel.ack(msg) }) cmd.stdout.on('data', data => console.log(data.toString())) @@ -43,10 +65,20 @@ async function connectRabbit (url) { }) } -function publicKeyToAddress({x, y}) { - const compact = (parseInt(y[63], 16) % 2 ? '03' : '02') + x +async function confirm (keysFile) { + exec.execSync(`curl -X POST -H "Content-Type: application/json" -d @"${keysFile}" "${PROXY_URL}/confirm"`, { stdio: 'pipe' }) +} + +function publicKeyToAddress ({ x, y }) { + const compact = (parseInt(y[y.length - 1], 16) % 2 ? '03' : '02') + padZeros(x, 64) const sha256Hash = crypto.createHash('sha256').update(Buffer.from(compact, 'hex')).digest('hex') const hash = crypto.createHash('ripemd160').update(Buffer.from(sha256Hash, 'hex')).digest('hex') const words = bech32.toWords(Buffer.from(hash, 'hex')) return bech32.encode('tbnb', words) } + +function padZeros (s, len) { + while (s.length < len) + s = '0' + s + return s +} diff --git a/src/oracle/tss-sign/package.json b/src/oracle/tss-sign/package.json index 2632639..0a96155 100644 --- a/src/oracle/tss-sign/package.json +++ b/src/oracle/tss-sign/package.json @@ -4,6 +4,7 @@ "dependencies": { "@binance-chain/javascript-sdk": "2.13.9", "amqplib": "0.5.3", - "axios": "0.19.0" + "axios": "0.19.0", + "bignumber.js": "9.0.0" } } diff --git a/src/oracle/tss-sign/sign-entrypoint.sh b/src/oracle/tss-sign/sign-entrypoint.sh index 2cdcea3..0059cc4 100755 --- a/src/oracle/tss-sign/sign-entrypoint.sh +++ b/src/oracle/tss-sign/sign-entrypoint.sh @@ -10,10 +10,10 @@ done echo "Fetching current tss params" -curl -X GET "$1/params?epoch=$3" -o ./params > /dev/null 2>&1 +curl -X GET "$1/current_params" -o ./params > /dev/null 2>&1 echo "Signing message using server $1" -./gg18_sign_client "$1" "$2" "$4" +./gg18_sign_client "$1" "$2" "$3" echo "Signed message" diff --git a/src/oracle/tss-sign/signer.js b/src/oracle/tss-sign/signer.js index 5d7dbcd..b20a913 100644 --- a/src/oracle/tss-sign/signer.js +++ b/src/oracle/tss-sign/signer.js @@ -3,8 +3,10 @@ const fs = require('fs') const amqp = require('amqplib') const crypto = require('crypto') const bech32 = require('bech32') +const BN = require('bignumber.js') const { RABBITMQ_URL, FOREIGN_URL, PROXY_URL } = process.env +const FOREIGN_ASSET = 'BNB' const Transaction = require('./tx') const axios = require('axios') @@ -14,7 +16,7 @@ async function main () { console.log('Connecting to RabbitMQ server') const connection = await connectRabbit(RABBITMQ_URL) console.log('Connecting to signature events queue') - const channel = await connection.createConfirmChannel() + const channel = await connection.createChannel() const queue = await channel.assertQueue('signQueue') channel.prefetch(1) @@ -24,36 +26,88 @@ async function main () { console.log('Consumed sign event') console.log(data) const { recipient, value, nonce, epoch } = data - const keysFile = `/keys/keys${epoch}.store` - console.log(`Reading ${keysFile}`) - const { address, publicKey } = await getAccountFromFile(keysFile) - console.log(`Tx from ${address}`) + if (recipient) { + const keysFile = `/keys/keys${epoch}.store` - console.log('Getting account data') - const account = await getAccount(address) + const { address, publicKey } = await getAccountFromFile(keysFile) + console.log(`Tx from ${address}`) - console.log(`Building corresponding transaction, nonce ${nonce}, recipient ${recipient}`) - const tx = new Transaction(address, account.account_number, nonce, recipient, value, 'BNB') - const hash = crypto.createHash('sha256').update(tx.getSignBytes()).digest('hex') + const account = await getAccount(address) - console.log(`Starting signature generation for transaction hash ${hash}`) - const cmd = exec.execFile('./sign-entrypoint.sh', [PROXY_URL, keysFile, epoch, hash], async () => { - console.log('Finished signature generation') - const signature = JSON.parse(fs.readFileSync('signature')) - console.log(signature) + console.log(`Building corresponding trasfer transaction, nonce ${nonce}, recipient ${recipient}`) + const tx = new Transaction(address, account.account_number, nonce, recipient, value, FOREIGN_ASSET) - console.log('Building signed transaction') - const signedTx = tx.addSignature(publicKey, { r: signature[1], s: signature[3] }) + const hash = crypto.createHash('sha256').update(tx.getSignBytes()).digest('hex') - console.log('Sending transaction') - console.log(signedTx) - await sendTx(signedTx) + console.log(`Starting signature generation for transaction hash ${hash}`) + const cmd = exec.execFile('./sign-entrypoint.sh', [PROXY_URL, keysFile, hash], async () => { + if (fs.existsSync('signature')) { + console.log('Finished signature generation') + const signature = JSON.parse(fs.readFileSync('signature')) + console.log(signature) - channel.ack(msg) - }) - cmd.stdout.on('data', data => console.log(data.toString())) - cmd.stderr.on('data', data => console.error(data.toString())) + console.log('Building signed transaction') + const signedTx = tx.addSignature(publicKey, { r: signature[1], s: signature[3] }) + + console.log('Sending transaction') + console.log(signedTx) + await sendTx(signedTx) + } + await waitForAccountNonce(address, nonce + 1) + + channel.ack(msg) + }) + cmd.stdout.on('data', data => console.log(data.toString())) + cmd.stderr.on('data', data => console.error(data.toString())) + } else { + const accountFile = await waitLastAccountEpoch(epoch) + + // If new keys with greater epoch already exists + if (accountFile === null) { + channel.ack(msg) + return + } + const to = accountFile.address + const prevEpoch = getPrevEpoch(epoch) + + const prevKeysFile = `/keys/keys${prevEpoch}.store` + const { address: from, publicKey } = await getAccountFromFile(prevKeysFile) + console.log(`Tx from ${from}, to ${to}`) + + const account = await getAccount(from) + + const maxValue = new BN(account.balances.find(x => x.symbol === FOREIGN_ASSET).free).minus(new BN(37500).div(10 ** 8)) + console.log(`Building corresponding transaction for transferring all funds, nonce ${account.sequence}, recipient ${to}`) + const tx = new Transaction(from, account.account_number, account.sequence, to, maxValue, FOREIGN_ASSET) + + const hash = crypto.createHash('sha256').update(tx.getSignBytes()).digest('hex') + + fs.unlinkSync('signature') + + console.log(`Starting signature generation for transaction hash ${hash}`) + const cmd = exec.execFile('./sign-entrypoint.sh', [PROXY_URL, prevKeysFile, hash], async () => { + if (fs.existsSync('signature')) { + console.log('Finished signature generation') + const signature = JSON.parse(fs.readFileSync('signature')) + console.log(signature) + + console.log('Building signed transaction') + const signedTx = tx.addSignature(publicKey, { r: signature[1], s: signature[3] }) + + console.log('Sending transaction') + console.log(signedTx) + await sendTx(signedTx) + } + await waitForAccountNonce(from, account.sequence + 1) + + await confirm(`/keys/keys${epoch}.store`) + + channel.ack(msg) + }) + cmd.stdout.on('data', data => console.log(data.toString())) + cmd.stderr.on('data', data => console.error(data.toString())) + } }) } @@ -69,9 +123,14 @@ async function connectRabbit (url) { }) } +async function confirm (keysFile) { + exec.execSync(`curl -X POST -H "Content-Type: application/json" -d @"${keysFile}" "${PROXY_URL}/confirm"`, { stdio: 'pipe' }) +} + async function getAccountFromFile (file) { + console.log(`Reading ${file}`) while (!fs.existsSync(file)) { - console.log('Waiting for needed epoch key') + console.log('Waiting for needed epoch key', file) await new Promise(resolve => setTimeout(resolve, 1000)) } const publicKey = JSON.parse(fs.readFileSync(file))[5] @@ -81,7 +140,36 @@ async function getAccountFromFile (file) { } } +function getPrevEpoch (epoch) { + return Math.max(0, ...fs.readdirSync('/keys').map(x => parseInt(x.split('.')[0].substr(4))).filter(x => x < epoch)) +} + +async function waitLastAccountEpoch (epoch) { + while (true) { + const curEpoch = Math.max(0, ...fs.readdirSync('/keys').map(x => parseInt(x.split('.')[0].substr(4)))) + if (curEpoch === epoch) + return getAccountFromFile(`/keys/keys${epoch}.store`) + else if (curEpoch > epoch) + return null + else + await new Promise(resolve => setTimeout(resolve, 1000)) + } +} + +async function waitForAccountNonce (address, nonce) { + console.log(`Waiting for account ${address} to have nonce ${nonce}`) + while (true) { + const sequence = (await getAccount(address)).sequence + if (sequence === nonce) + break + await new Promise(resolve => setTimeout(resolve, 1000)) + console.log('Waiting for needed account nonce') + } + console.log('Account nonce is OK') +} + async function getAccount (address) { + console.log(`Getting account ${address} data`) return httpClient .get(`/api/v1/account/${address}`) .then(res => res.data) @@ -97,90 +185,16 @@ async function sendTx (tx) { .then(x => console.log(x.response), x => console.log(x.response)) } -function buildTx (acc, nonce, to, value) { - const tx = new Transaction({ - account_number: acc.account_number, - chain_id: 'Binance-Chain-Nile', - memo: '', - msg: { - 'inputs': [ - { - 'coins': [ - { - 'denom': 'BNB', - 'amount': value.toString() - } - ], - 'address': acc.address - } - ], - 'outputs': [ - { - 'address': to, - 'coins': [ - { - 'denom': 'BNB', - 'amount': value.toString() - } - ] - } - ] - }, - type: 'MsgSend', - sequence: nonce - }) - return tx.getSignBytes(tx.msgs[0]) -} - -function buildSignedTx (acc, publicKey, nonce, to, value, signature) { - const tx = new Transaction({ - account_number: acc.account_number, - chain_id: 'Binance-Chain-Nile', - memo: '', - msg: { - 'inputs': [ - { - 'coins': [ - { - 'denom': 'BNB', - 'amount': value.toString() - } - ], - 'address': acc.address - } - ], - 'outputs': [ - { - 'address': to, - 'coins': [ - { - 'denom': 'BNB', - 'amount': value.toString() - } - ] - } - ] - }, - type: 'MsgSend', - sequence: nonce - }) - tx.signatures = [{ - pub_key: Buffer.from(publicKey, 'hex', 38), - signature: Buffer.concat([Buffer.from(signature[1], 'hex', 32), Buffer.from(signature[3], 'hex', 32)]), - account_number: acc.account_number, - sequence: nonce - }] - return tx -} - -function encodePublicKey ({ x, y }) { - return 'eb5ae98721' + (parseInt(y[63], 16) % 2 ? '03' : '02') + x -} - function publicKeyToAddress ({ x, y }) { - const compact = (parseInt(y[63], 16) % 2 ? '03' : '02') + x + const compact = (parseInt(y[y.length - 1], 16) % 2 ? '03' : '02') + padZeros(x, 64) const sha256Hash = crypto.createHash('sha256').update(Buffer.from(compact, 'hex')).digest('hex') const hash = crypto.createHash('ripemd160').update(Buffer.from(sha256Hash, 'hex')).digest('hex') const words = bech32.toWords(Buffer.from(hash, 'hex')) return bech32.encode('tbnb', words) } + +function padZeros (s, len) { + while (s.length < len) + s = '0' + s + return s +} diff --git a/src/oracle/tss-sign/tx.js b/src/oracle/tss-sign/tx.js index 7f5f64d..c694e8f 100644 --- a/src/oracle/tss-sign/tx.js +++ b/src/oracle/tss-sign/tx.js @@ -1,6 +1,6 @@ const TransactionBnc = require('@binance-chain/javascript-sdk/lib/tx').default const { crypto } = require('@binance-chain/javascript-sdk') -const BN = require('bn.js') +const BN = require('bignumber.js') const { FOREIGN_CHAIN_ID } = process.env @@ -9,7 +9,7 @@ class Transaction { const accCode = crypto.decodeAddress(fromAddress) const toAccCode = crypto.decodeAddress(toAddress) - amount *= 10 ** 8 + amount = new BN(amount).multipliedBy(10 ** 8).toNumber() const coin = { denom: asset, @@ -31,17 +31,11 @@ class Transaction { this.signMsg = { inputs: [{ address: fromAddress, - coins: [{ - amount: amount, - denom: asset - }] + coins: [coin] }], outputs: [{ address: toAddress, - coins: [{ - amount: amount, - denom: asset - }] + coins: [coin] }] } @@ -64,9 +58,9 @@ class Transaction { 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.divn(2))) { + if (s.gt(n.div(2))) { console.log('Normalizing s') - signature.s = n.sub(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 = [{ diff --git a/src/oracle/watcher/config.json b/src/oracle/watcher/config.json deleted file mode 100644 index 261a15d..0000000 --- a/src/oracle/watcher/config.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "sideChain": { - "rpcUrl": "http://host.docker.internal:7545" - }, - "redis": { - "port": 6379, - "host": "127.0.0.1", - "family": 4, - "password": "password", - "db": 0 - }, - "home": { - "rpcUrl": "http://host.docker.internal:7545", - "pollingInterval": 1000 - }, - "foreign": { - "api": "https://testnet-dex.binance.org/", - "pollingInterval": 1000 - } -} diff --git a/src/tss/multi-party-ecdsa b/src/tss/multi-party-ecdsa new file mode 160000 index 0000000..1d0c886 --- /dev/null +++ b/src/tss/multi-party-ecdsa @@ -0,0 +1 @@ +Subproject commit 1d0c8867aa4d3da0d80de41a60ec3fd6bad2f85a