diff --git a/.gitignore b/.gitignore index e77abb02..9b2d2f44 100644 --- a/.gitignore +++ b/.gitignore @@ -1,44 +1,6 @@ -# Binaries for programs and plugins -*.exe -*.exe~ -*.dll -*.so -*.dylib -.DS_Store - -# Test binary, build with `go test -c` -*.test - -# Output of the go coverage tool, specifically when used with LiteIDE -*.out -coverage.txt - -# IDE -.idea/ -.vscode/ -.history - -# Builds -build/ -bin/ -site/ -target/ -tests/*.txt - -# golang -.env -bridge -keys/ -*.key - -# Chainbridge -config.toml -config.json -*.block -gethdata1/ -gethdata2/ -centrifuge-chain/ -# Solidity -/solidity -/cfgBuilder/*.toml -todo.list +.idea +keystore.json +target +/contracts/node_modules/ +runtime +config.toml \ No newline at end of file diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 4f26294b..00000000 --- a/Dockerfile +++ /dev/null @@ -1,23 +0,0 @@ -FROM golang:1.20.4-alpine as builder - -RUN mkdir /compass - -COPY . /compass - -RUN apk add --no-cache musl-dev gcc - -RUN cd /compass && cd cmd/compass && GOOS=linux go build -o ../../build/compass && cp ../../eth2/eth2-proof ../../build/ - -FROM alpine as prod - -RUN apk update --no-cache && apk add --no-cache ca-certificates tzdata -ENV TZ Asia/Shanghai - -WORKDIR /root - -COPY --from=builder /compass/build/compass /root/compass -COPY --from=builder /compass/build/eth2-proof /root/eth2-proof - -RUN chmod +x /root/eth2-proof && chmod +x /root/compass - -ENTRYPOINT ["/root/compass"] \ No newline at end of file diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 153d416d..00000000 --- a/LICENSE +++ /dev/null @@ -1,165 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - - This version of the GNU Lesser General Public License incorporates -the terms and conditions of version 3 of the GNU General Public -License, supplemented by the additional permissions listed below. - - 0. Additional Definitions. - - As used herein, "this License" refers to version 3 of the GNU Lesser -General Public License, and the "GNU GPL" refers to version 3 of the GNU -General Public License. - - "The Library" refers to a covered work governed by this License, -other than an Application or a Combined Work as defined below. - - An "Application" is any work that makes use of an interface provided -by the Library, but which is not otherwise based on the Library. -Defining a subclass of a class defined by the Library is deemed a mode -of using an interface provided by the Library. - - A "Combined Work" is a work produced by combining or linking an -Application with the Library. The particular version of the Library -with which the Combined Work was made is also called the "Linked -Version". - - The "Minimal Corresponding Source" for a Combined Work means the -Corresponding Source for the Combined Work, excluding any source code -for portions of the Combined Work that, considered in isolation, are -based on the Application, and not on the Linked Version. - - The "Corresponding Application Code" for a Combined Work means the -object code and/or source code for the Application, including any data -and utility programs needed for reproducing the Combined Work from the -Application, but excluding the System Libraries of the Combined Work. - - 1. Exception to Section 3 of the GNU GPL. - - You may convey a covered work under sections 3 and 4 of this License -without being bound by section 3 of the GNU GPL. - - 2. Conveying Modified Versions. - - If you modify a copy of the Library, and, in your modifications, a -facility refers to a function or data to be supplied by an Application -that uses the facility (other than as an argument passed when the -facility is invoked), then you may convey a copy of the modified -version: - - a) under this License, provided that you make a good faith effort to - ensure that, in the event an Application does not supply the - function or data, the facility still operates, and performs - whatever part of its purpose remains meaningful, or - - b) under the GNU GPL, with none of the additional permissions of - this License applicable to that copy. - - 3. Object Code Incorporating Material from Library Header Files. - - The object code form of an Application may incorporate material from -a header file that is part of the Library. You may convey such object -code under terms of your choice, provided that, if the incorporated -material is not limited to numerical parameters, data structure -layouts and accessors, or small macros, inline functions and templates -(ten or fewer lines in length), you do both of the following: - - a) Give prominent notice with each copy of the object code that the - Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the object code with a copy of the GNU GPL and this license - document. - - 4. Combined Works. - - You may convey a Combined Work under terms of your choice that, -taken together, effectively do not restrict modification of the -portions of the Library contained in the Combined Work and reverse -engineering for debugging such modifications, if you also do each of -the following: - - a) Give prominent notice with each copy of the Combined Work that - the Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the Combined Work with a copy of the GNU GPL and this license - document. - - c) For a Combined Work that displays copyright notices during - execution, include the copyright notice for the Library among - these notices, as well as a reference directing the user to the - copies of the GNU GPL and this license document. - - d) Do one of the following: - - 0) Convey the Minimal Corresponding Source under the terms of this - License, and the Corresponding Application Code in a form - suitable for, and under terms that permit, the user to - recombine or relink the Application with a modified version of - the Linked Version to produce a modified Combined Work, in the - manner specified by section 6 of the GNU GPL for conveying - Corresponding Source. - - 1) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (a) uses at run time - a copy of the Library already present on the user's computer - system, and (b) will operate properly with a modified version - of the Library that is interface-compatible with the Linked - Version. - - e) Provide Installation Information, but only if you would otherwise - be required to provide such information under section 6 of the - GNU GPL, and only to the extent that such information is - necessary to install and execute a modified version of the - Combined Work produced by recombining or relinking the - Application with a modified version of the Linked Version. (If - you use option 4d0, the Installation Information must accompany - the Minimal Corresponding Source and Corresponding Application - Code. If you use option 4d1, you must provide the Installation - Information in the manner specified by section 6 of the GNU GPL - for conveying Corresponding Source.) - - 5. Combined Libraries. - - You may place library facilities that are a work based on the -Library side by side in a single library together with other library -facilities that are not Applications and are not covered by this -License, and convey such a combined library under terms of your -choice, if you do both of the following: - - a) Accompany the combined library with a copy of the same work based - on the Library, uncombined with any other library facilities, - conveyed under the terms of this License. - - b) Give prominent notice with the combined library that part of it - is a work based on the Library, and explaining where to find the - accompanying uncombined form of the same work. - - 6. Revised Versions of the GNU Lesser General Public License. - - The Free Software Foundation may publish revised and/or new versions -of the GNU Lesser General Public License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. - - Each version is given a distinguishing version number. If the -Library as you received it specifies that a certain numbered version -of the GNU Lesser General Public License "or any later version" -applies to it, you have the option of following the terms and -conditions either of that published version or of any later version -published by the Free Software Foundation. If the Library as you -received it does not specify a version number of the GNU Lesser -General Public License, you may choose any version of the GNU Lesser -General Public License ever published by the Free Software Foundation. - - If the Library as you received it specifies that a proxy can decide -whether future versions of the GNU Lesser General Public License shall -apply, that proxy's public statement of acceptance of any version is -permanent authorization for you to choose that version for the -Library. \ No newline at end of file diff --git a/Makefile b/Makefile deleted file mode 100644 index cc8bc819..00000000 --- a/Makefile +++ /dev/null @@ -1,35 +0,0 @@ -PROJECTNAME=$(shell basename "$(PWD)") -VERSION=-ldflags="-X main.Version=$(shell git describe --tags)" -SOL_DIR=./solidity - -CENT_EMITTER_ADDR?=0x1 -CENT_CHAIN_ID?=0x1 -CENT_TO?=0x1234567890 -CENT_TOKEN_ID?=0x5 -CENT_METADATA?=0x0 - -.PHONY: help build install -all: help - -help: Makefile - @echo - @echo "Choose a make command to run in "$(PROJECTNAME)":" - @echo - @$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$' - @echo - -get: - @echo " > \033[32mDownloading & Installing all the modules...\033[0m " - go mod tidy && go mod download - -build: - @echo " > \033[32mBuilding compass...\033[0m " - cd cmd/compass && go build -o ../../build/compass - -dev: - @echo " > \033[32mBuilding compass-dev...\033[0m " - cd cmd/compass && env GOARCH=amd64 CGO_ENABLED=0 go build -o ../../build/compass-dev - -install: - @echo " > \033[32mInstalling compass...\033[0m " - cd cmd/compass && go install $(VERSION) \ No newline at end of file diff --git a/README.md b/README.md index 9180ab2c..89297877 100644 --- a/README.md +++ b/README.md @@ -1,241 +1,45 @@ # Compass +Compass is Ultra-light Verification Protocol of MAP Protocol. It is designed as a library, that other blockchains can integrated it to support MAP Protocol. -Compass is the Golang implementation of cross-chain communication maintainer for MAP Protocol. It currently supports bridging between EVM based chains. +# map-rly Usage -The Compass is an independent service, it contains two operating modes, [Maintainer](#maintainer) and [Messenger](#messenger) mode, users need specify a mode to start the service program - -The newly designed compass version contains all the functions required to run the relay node. With this tool, you can run nodes on almost all hardware platforms. - -This project is inspired by [ChainSafe/ChainBridge](https://github.com/ChainSafe/ChainBridge) - -# Contents - -- [Compass](#compass) -- [Contents](#contents) -- [Quick Start](#quick-start) - - [2. Prepare the accounts for each chain](#2-prepare-the-accounts-for-each-chain) - - [3. Modify the configuration file](#3-modify-the-configuration-file) - - [4. Running the executable](#4-running-the-executable) -- [Building](#building) -- [Maintainer](#maintainer) -- [Messenger](#messenger) -- [Monitor](#monitor) -- [Configuration](#configuration) - - [Options](#options) - - [Blockstore](#blockstore) - - [Keystore](#keystore) -- [Chain Implementations](#chain-implementations) - - [Near](#near) - -# Quick Start - -the recommanded way to get the executable is to download it from the release page. - ->if you want to build it from the source code,check the [building](#building) section below. - -### 2. Prepare the accounts for each chain -fund some accounts in order to send txs on each chain, you want to provice crosse-chain service. -the esaiest way is to using the same one address for every chain. Please prepare an account keystore. - -### 3. Modify the configuration file -copy a example configure file from -```json -{ - "mapchain": { - "id": "212", - "endpoint": "http://18.142.54.137:7445", - "from": "0xE0DC8D7f134d0A79019BEF9C2fd4b2013a64fCD6", - "keystorePath": "/root/UTC-E0DC8D7f134d0A79019BEF9C2fd4b2013a64fCD6", - "opts": { - "mcs": "0x0ac4611305254cdd257beC56CB79CBeC720Cd02D", - "lightnode": "0x000068656164657273746F726541646472657373", - "http": "true", - "gasLimit": "4000000000000", - "maxGasPrice": "2000000000000", - "syncIdList": "[34434]" - } - }, - "chains": [ - { - "name": "pri-eth", - "type": "ethereum", - "id": "34434", - "endpoint": "http://18.138.248.113:8545", - "from": "0xE0DC8D7f134d0A79019BEF9C2fd4b2013a64fCD6", - "keystorePath": "/root/UTC-E0DC8D7f134d0A79019BEF9C2fd4b2013a64fCD6", - "opts": { - "mcs": "0xcfc80beddb70f12af6da768fc30e396889dfce26", - "lightnode": "0x80Be41aEBFdaDBD58a65aa549cB266dAFb6b8304", - "http": "true", - "gasLimit": "400000000000", - "maxGasPrice": "200000000000", - "syncToMap": "true" - } - } - ] -} -``` -modify the configuration accordingly. -fill the accounts for each chain. - -### 4. Running the executable -lauch and keep the executable runing simply by run: -```zsh -compass-oracle maintainer --blockstore ./block-eth-map --config ./config-mcs-erh-map.json +## Help document +```shell +./map-rly +./map-rly help ``` -you will be asked to input the password to unlock your account.(which you have inputed at step 2) -if everything runs smoothly. it's all set - -# Building - -Building compass requires a [Go](https://github.com/golang/go) compiler(version 1.16 or later) - -under the root directory of the repo +

The default command is help.

-`make build`: Builds `compass` in `./build`. -`make install`: Uses `go install` to add `compass` to your GOBIN. +## Configure the application. +

The command requires a configuration file named config.toml in the same directory as the command

-# Oracle +[example](./example.config.toml) -use the `oracle` mode to synchronize the information of blocks in each chain according to the information in the configuration file -Start with the following command: -```zsh -compass-oracle oracle --blockstore ./block-eth-map --config ./config.json --keystorePath ./key.json +## To become relayer +```shell +./map-rly register # Interactive +./map-rly register 200000 # Direct execution ``` +

You can continue to call to increase the registration amount

-# Maintainer - -Synchronize the information of blocks in each chain according to the information in the configuration file - -Start with the following command: -```zsh -compass-oracle maintainer --blockstore ./block-eth-map --config ./config.json +## +```shell +./map-rly unregister # Interactive +./map-rly unregister 200000 # Direct execution ``` +

With the unregister transaction executed, the unregistering portion is locked in the contract for about 2 epoch. After the period, you can withdraw the unregistered coins.

-# Messenger - -Synchronize the log information of transactions of blocks in each chain according to the information in the configuration file - -Start with the following command: -```zsh -compass-oracle messenger --blockstore ./block-eth-map --config ./config.json -``` - -# Configuration - -the configuration file is a small JSON file. - -``` -{ - "mapchain": { - "id": "0", // Chain ID of the MAP chain - "endpoint": "ws://:", // Node endpoint - "from": "0xff93...", // MAP chain address of maintainer - "opts": {} // MAP Chain configuration options (see below) - }, - "chains": [] // List of Chain configurations -} - -``` - -A chain configurations take this form: - +## Get relayer information +```shell +./map-rly info # Read information once +./map-rly info watch # Read information Every five seconds +./map-rly info watch 10 # Read information Every ten seconds ``` -{ - "name": "eth", // Human-readable name - "type": "ethereum", // Chain type (Please see the following cousin for details) - "id": "0", // Chain ID - "endpoint": "ws://:", // Node endpoint - "from": "0xff93...", // On-chain address of maintainer - "keystorePath" : "keystore/path/", // keystore path, plase user abs path - "opts": {}, // Chain-specific configuration options (see below) -} -``` - -| chain | type | -|:--------:|----------| -| ethereum | ethereum | -| bsc | bsc | -| goerli | eth2 | -| polygon | matic | -| near | near | -| klaytn | klaytn | -| conflux | conflux | -| merlin | ethereum | -| blast | ethereum | -| filecoin | ethereum | -| bevm | ethereum | -| bttc | bttc | - -See `config.json.example` for an example configuration. - -### Options -Since MAP is also a EVM based chain, so the opts of the **mapchain** is following the options below as well -Ethereum chains support the following additional options: - -``` -{ - "mcs": "0x12345...", // Address of the bridge contract (required) - "maxGasPrice": "0x1234", // Gas price for transactions (default: 50000000) - "gasLimit": "0x1234", // Gas limit for transactions (default: 1000000) - "gasMultiplier": "1.25", // Multiplies the gas price by the supplied value (default: 1) - "startBlock": "1234", // The block to start processing events from (default: 0) - "blockConfirmations": "10" // Number of blocks to wait before processing a block (default: 20) - "lightnode": "0x12345...", // the lightnode to sync header - "syncToMap": "false", // Whether sync blockchain headers to Map,(default : true) - "syncIdList": "[214]" // Those chain ids are synchronized to the map,and This configuration can only be used in mapchain - "event": "mapTransferOut(...)|depositOutToken(...)", // MCS events monitored by the program, multiple with | interval, - // Here we give the events that need to be monitored,Map:mapTransferOut(bytes,bytes,bytes32,uint256,uint256,bytes,uint256,bytes) Near: 2ef1cdf83614a69568ed2c96a275dd7fb2e63a464aa3a0ffe79f55d538c8b3b5|150bd848adaf4e3e699dcac82d75f111c078ce893375373593cc1b9208998377 - "oracleNode": "1234" // use to match oracle event -} +## Main daemon program +```shell +./map-rly daemon ``` -## Blockstore - -The blockstore is used to record the last block the maintainer processed, so it can pick up where it left off. - -To disable loading from the chunk library, specify the "--fresh" flag. Add the fresh flag, and the program will execute from height 0, - -In addition, the configuration file provides the "startBlock" option, and the program will execute from the startBlock - -## Keystore - -Compass requires keys to sign and submit transactions, and to identify each bridge node on chain. - -To use secure keys, see `compass accounts --help`. The keystore password can be supplied with the `KEYSTORE_PASSWORD` environment variable. - -To import external ethereum keys, such as those generated with geth, use `compass accounts import --ethereum /path/to/key`. - -To import private keys as keystores, use `compass accounts import --privateKey key`. - -# Chain Implementations - -- Ethereum (Solidity): [contracts](https://github.com/mapprotocol/contracts) - The Solidity contracts required for compass. Includes scripts for deployment. - -## Near - -If you need to synchronize the near block, please install the near cli first. Here is a simple tutorial. For more information, - -please check [Near cli installation tutorial](https://docs.near.org/tools/near-cli#installation) - -First, install npm. Depending on the system, the running command is different. The following is an example of the installation command in - -the ubuntu system. Use the `apt install npm` command to run `npm install -g near cli`, - -After installation, use 'near -- version' to check whether the installation is successful - -Configure the environment you need, for example: - -` - export NEAR_CLI_LOCALNET_RPC_SERVER_URL=https://archival-rpc.testnet.near.org - - export NEAR_ENV=testnet -` - -Use the 'near login' command , Creates a key pair locally in `.near-credentials` with an implicit account as the accountId. (hash representation of the public key) - -And record the directory to the keystorePath option in the configuration file +

Do relay work

-In addition, another program needs to be run for near messenger. Please check [near-lake-s3](./near-lake-s3/README.md) diff --git a/abi/head_store.go b/abi/head_store.go new file mode 100644 index 00000000..01bd6522 --- /dev/null +++ b/abi/head_store.go @@ -0,0 +1,51 @@ +package abi + +const HeaderStoreContractAbi = `[ + { + "inputs": [ + { + "internalType": "uint256", + "name": "chainID", + "type": "uint256" + } + ], + "name": "currentNumberAndHash", + "outputs": [ + { + "internalType": "uint256", + "name": "number", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "hash", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "from", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "to", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "headers", + "type": "bytes" + } + ], + "name": "save", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +]` diff --git a/abi/relayer.go b/abi/relayer.go new file mode 100644 index 00000000..e57accca --- /dev/null +++ b/abi/relayer.go @@ -0,0 +1,207 @@ +package abi + +const RelayerContractAbi = `[ + { + "name": "Register", + "inputs": [ + { + "type": "address", + "name": "from", + "indexed": true + }, + { + "type": "uint256", + "name": "value", + "indexed": false + } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "Withdraw", + "inputs": [ + { + "type": "address", + "name": "from", + "indexed": true + }, + { + "type": "uint256", + "name": "value", + "indexed": false + } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "Unregister", + "inputs": [ + { + "type": "address", + "name": "from", + "indexed": true + }, + { + "type": "uint256", + "name": "value", + "indexed": false + } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "Append", + "inputs": [ + { + "type": "address", + "name": "from", + "indexed": true + }, + { + "type": "uint256", + "name": "value", + "indexed": false + } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "register", + "outputs": [], + "inputs": [ + { + "type": "uint256", + "name": "value" + } + ], + "constant": false, + "payable": false, + "type": "function" + }, + { + "name": "append", + "outputs": [], + "inputs": [ + { + "type": "uint256", + "name": "value" + } + ], + "constant": false, + "payable": false, + "type": "function" + }, + { + "name": "getRelayerBalance", + "outputs": [ + { + "type": "uint256", + "unit": "wei", + "name": "registered" + }, + { + "type": "uint256", + "unit": "wei", + "name": "unregistering" + }, + { + "type": "uint256", + "unit": "wei", + "name": "unregistered" + } + ], + "inputs": [ + { + "type": "address", + "name": "owner" + } + ], + "constant": true, + "payable": false, + "type": "function" + }, + { + "name": "withdraw", + "outputs": [], + "inputs": [ + { + "type": "uint256", + "unit": "wei", + "name": "value" + } + ], + "constant": false, + "payable": false, + "type": "function" + }, + { + "name": "unregister", + "outputs": [], + "inputs": [ + { + "type": "uint256", + "unit": "wei", + "name": "value" + } + ], + "constant": false, + "payable": false, + "type": "function" + }, + { + "name": "getPeriodHeight", + "outputs": [ + { + "type": "uint256", + "name": "start" + }, + { + "type": "uint256", + "name": "end" + }, + { + "type": "bool", + "name": "relayer" + } + ], + "inputs": [ + { + "type": "address", + "name": "owner" + } + ], + "constant": true, + "payable": false, + "type": "function" + }, + { + "name": "getRelayer", + "inputs": [ + { + "type": "address", + "name": "owner" + } + ], + "outputs": [ + { + "type": "bool", + "name": "register" + }, + { + "type": "bool", + "name": "relayer" + }, + { + "type": "uint256", + "name": "epoch" + } + ], + "constant": true, + "payable": false, + "type": "function" + } +]` diff --git a/abi/router.go b/abi/router.go new file mode 100644 index 00000000..4871b65d --- /dev/null +++ b/abi/router.go @@ -0,0 +1,252 @@ +package abi + +const RouterContractAbi = ` +[ + { + "inputs": [ + { + "internalType": "address", + "name": "mpcAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "verfiy", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "orderId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "fromChainID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "toChainID", + "type": "uint256" + } + ], + "name": "LogSwapIn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "orderId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes32[]", + "name": "message", + "type": "bytes32[]" + }, + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "fromChainID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "toChainID", + "type": "uint256" + } + ], + "name": "LogSwapInFail", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "orderId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "fromChainID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "toChainID", + "type": "uint256" + } + ], + "name": "LogSwapOut", + "type": "event" + }, + { + "inputs": [], + "name": "mpc", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "fromChainID", + "type": "uint256" + }, + { + "internalType": "address", + "name": "sourceRouter", + "type": "address" + }, + { + "internalType": "bytes32[]", + "name": "data", + "type": "bytes32[]" + } + ], + "name": "swapIn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "toChainID", + "type": "uint256" + } + ], + "name": "swapOut", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +]` diff --git a/atlas/func.go b/atlas/func.go new file mode 100644 index 00000000..8309e41b --- /dev/null +++ b/atlas/func.go @@ -0,0 +1,112 @@ +package atlas + +import ( + "context" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/ethclient" + "github.com/ethereum/go-ethereum/ethdb/memorydb" + "github.com/ethereum/go-ethereum/light" + "github.com/ethereum/go-ethereum/rlp" + "github.com/ethereum/go-ethereum/trie" + "github.com/mapprotocol/compass/chains" + types2 "github.com/mapprotocol/compass/types" + "math/big" +) + +var ( + tr *trie.Trie + receipts []*types.Receipt + lastBlockNumber uint64 +) + +func GetTxProve(src chains.ChainInterface, aLog *types.Log, eventResponse *types2.EventLogSwapOutResponse) []byte { + + // 调用以太坊接口获取 receipts + blockNumber := aLog.BlockNumber + transactionIndex := aLog.TxIndex + if blockNumber != lastBlockNumber { + queryNewReceiptsAndTr(blockNumber, src.GetClient()) + } + + proof := light.NewNodeSet() + key, err := rlp.EncodeToBytes(transactionIndex) + if err != nil { + panic(err) + } + if err = tr.Prove(key, 0, proof); err != nil { + panic(err) + } + + txProve := TxProve{ + Tx: &TxParams{ + From: aLog.Topics[2].Bytes(), + To: aLog.Topics[3].Bytes(), + Value: eventResponse.Amount, + }, + Receipt: receipts[transactionIndex], + Prove: proof.NodeList(), + BlockNumber: blockNumber, + TxIndex: transactionIndex, + } + + input, err := rlp.EncodeToBytes(txProve) + if err != nil { + panic(err) + } + return input +} +func queryNewReceiptsAndTr(blockNumber uint64, conn *ethclient.Client) { + txsHash := getTransactionsHashByBlockNumber(conn, big.NewInt(int64(blockNumber))) + receipts = getReceiptsByTxsHash(conn, txsHash) + + // 根据 receipts 生成 trie + var err error + tr, err = trie.New(common.Hash{}, trie.NewDatabase(memorydb.New())) + if err != nil { + panic(err) + } + for i, r := range receipts { + key, err := rlp.EncodeToBytes(uint(i)) + if err != nil { + panic(err) + } + value, err := rlp.EncodeToBytes(r) + if err != nil { + panic(err) + } + + tr.Update(key, value) + } +} +func getTransactionsHashByBlockNumber(conn *ethclient.Client, number *big.Int) []common.Hash { + block, err := conn.BlockByNumber(context.Background(), number) + if err != nil { + panic(err) + } + if block == nil { + panic("failed to connect to the eth node, please check the network") + } + + txs := make([]common.Hash, 0, len(block.Transactions())) + for _, tx := range block.Transactions() { + txs = append(txs, tx.Hash()) + } + return txs +} + +func getReceiptsByTxsHash(conn *ethclient.Client, txsHash []common.Hash) []*types.Receipt { + rs := make([]*types.Receipt, 0, len(txsHash)) + for _, h := range txsHash { + r, err := conn.TransactionReceipt(context.Background(), h) + if err != nil { + panic(err) + } + if r == nil { + panic("failed to connect to the eth node, please check the network") + } + rs = append(rs, r) + } + return rs + +} diff --git a/atlas/structs.go b/atlas/structs.go new file mode 100644 index 00000000..5d0200ce --- /dev/null +++ b/atlas/structs.go @@ -0,0 +1,21 @@ +package atlas + +import ( + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/light" + "math/big" +) + +type TxParams struct { + From []byte + To []byte + Value *big.Int +} + +type TxProve struct { + Tx *TxParams + Receipt *types.Receipt + Prove light.NodeList + BlockNumber uint64 + TxIndex uint +} diff --git a/chain_tools/client.go b/chain_tools/client.go new file mode 100644 index 00000000..1ec716d4 --- /dev/null +++ b/chain_tools/client.go @@ -0,0 +1,14 @@ +package chain_tools + +import ( + "github.com/ethereum/go-ethereum/ethclient" + log "github.com/sirupsen/logrus" +) + +func GetClientByUrl(rpcUrl string) *ethclient.Client { + client, err := ethclient.Dial(rpcUrl) + if err != nil { + log.Fatal(err) + } + return client +} diff --git a/chain_tools/contract.go b/chain_tools/contract.go new file mode 100644 index 00000000..e819cd28 --- /dev/null +++ b/chain_tools/contract.go @@ -0,0 +1,30 @@ +package chain_tools + +import ( + "context" + "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/ethclient" + log "github.com/sirupsen/logrus" +) + +func PackInput(AbiStaking abi.ABI, abiMethod string, params ...interface{}) []byte { + input, err := AbiStaking.Pack(abiMethod, params...) + if err != nil { + log.Fatal(abiMethod, " error ", err) + } + return input +} + +func CallContractReturnBool(client *ethclient.Client, from, toAddress common.Address, input []byte) ([]byte, bool) { + + msg := ethereum.CallMsg{From: from, To: &toAddress, Data: input} + + ret, err := client.CallContract(context.Background(), msg, nil) + if err != nil { + log.Warnln("method CallContract error: ", err) + return ret, false + } + return ret, true +} diff --git a/chain_tools/keystore.go b/chain_tools/keystore.go new file mode 100644 index 00000000..ebf26e67 --- /dev/null +++ b/chain_tools/keystore.go @@ -0,0 +1,47 @@ +package chain_tools + +import ( + "github.com/ethereum/go-ethereum/accounts/keystore" + "github.com/ethereum/go-ethereum/common" + log "github.com/sirupsen/logrus" + "golang.org/x/term" + "io/ioutil" + "os" + "syscall" +) + +func LoadPrivateKey(keystoreStr, password string) (key *keystore.Key, inputPassword string) { + if !common.FileExist(keystoreStr) { + log.Fatal("keystore file not exists.") + } + keyJson, _ := ioutil.ReadFile(keystoreStr) + var err error + if len(password) != 0 { + key, err = keystore.DecryptKey(keyJson, password) + if err != nil { + log.Fatal("Incorrect password! Modify the content in the config file. It can be empty,but it can't be wrong. " + + "use \"./map_rly password\" Generate an encrypted password set to config.toml ") + os.Exit(1) + } + } else { + for { + print("Please enter your password: ") + + passwordByte, err := term.ReadPassword(int(syscall.Stdin)) + if err != nil { + log.Println("Password typed: " + string(password)) + } + password = string(passwordByte) + + key, err = keystore.DecryptKey(keyJson, password) + if err != nil { + println("Incorrect password!") + } else { + println() + inputPassword = password + break + } + } + } + return +} diff --git a/chain_tools/result.go b/chain_tools/result.go new file mode 100644 index 00000000..5df6ff29 --- /dev/null +++ b/chain_tools/result.go @@ -0,0 +1,65 @@ +package chain_tools + +import ( + "context" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/ethclient" + log "github.com/sirupsen/logrus" + "time" +) + +func WaitingForEndPending(conn *ethclient.Client, txHash common.Hash, waitingSeconds int) bool { + count := 0 + time.Sleep(time.Millisecond * 200) + for { + _, isPending, err := conn.TransactionByHash(context.Background(), txHash) + if err != nil { + log.Warnln(err) + return false + } + count++ + if !isPending { + return true + } + if count >= waitingSeconds { + log.Warnln("Not waiting for the result.", txHash.String()) + return false + } + time.Sleep(time.Second) + } +} + +// WaitForReceipt +// @waitingSeconds int <=0 means forever, +func WaitForReceipt(conn *ethclient.Client, txHash common.Hash, waitingSeconds int) bool { + onceTime := time.Second + count := 0 + for { + count += 1 + + receipt, err := conn.TransactionReceipt(context.Background(), txHash) + if err != nil { + if count == waitingSeconds { + log.Warnln("Not waiting for the Receipt.", txHash.String(), waitingSeconds, "times.") + return false + } else { + time.Sleep(onceTime) + continue + } + } + switch receipt.Status { + case types.ReceiptStatusSuccessful: + return true + case types.ReceiptStatusFailed: + log.Warnln("Transaction not completed,unconfirmed.", txHash.String()) + return false + default: + //should unreachable + log.Warnln("Unknown receipt status: ", txHash.String(), receipt.Status) + time.Sleep(onceTime / 2) + continue + } + } + +} diff --git a/chain_tools/transaction.go b/chain_tools/transaction.go new file mode 100644 index 00000000..57f5f417 --- /dev/null +++ b/chain_tools/transaction.go @@ -0,0 +1,55 @@ +package chain_tools + +import ( + "context" + "crypto/ecdsa" + "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/ethclient" + log "github.com/sirupsen/logrus" + "math/big" +) + +func SendContractTransactionWithoutOutputUnlessError(client *ethclient.Client, from, toAddress common.Address, value *big.Int, privateKey *ecdsa.PrivateKey, input []byte) *types.Transaction { + nonce, err := client.PendingNonceAt(context.Background(), from) + if err != nil { + log.Warnln(err) + return nil + } + gasPrice, err := client.SuggestGasPrice(context.Background()) + if err != nil { + log.Warnln(err) + return nil + } + var gasLimit uint64 + msg := ethereum.CallMsg{From: from, To: &toAddress, GasPrice: gasPrice, Value: value, Data: input} + gasLimit, err = client.EstimateGas(context.Background(), msg) + if err != nil { + log.Warnln("EstimateGas error: ", err) + return nil + } + tx := types.NewTx(&types.LegacyTx{ + Nonce: nonce, + Value: value, + To: &toAddress, + Gas: gasLimit, + GasPrice: gasPrice, + Data: input, + }) + chainID, err := client.ChainID(context.Background()) + if err != nil { + log.Infoln("Get ChainID error:", err) + } + signedTx, err := types.SignTx(tx, types.NewEIP2930Signer(chainID), privateKey) + if err != nil { + log.Warnln(err) + return nil + } + err = client.SendTransaction(context.Background(), signedTx) + if err != nil { + log.Warnln("SendTransaction error: ", err) + return nil + } + return signedTx +} diff --git a/chains/bsc/chain.go b/chains/bsc/chain.go deleted file mode 100644 index 41aaae1e..00000000 --- a/chains/bsc/chain.go +++ /dev/null @@ -1,223 +0,0 @@ -package bsc - -import ( - "fmt" - "github.com/ethereum/go-ethereum/common" - "github.com/mapprotocol/compass/internal/constant" - "github.com/mapprotocol/compass/internal/mapprotocol" - "github.com/mapprotocol/compass/pkg/abi" - "github.com/mapprotocol/compass/pkg/contract" - "github.com/mapprotocol/compass/pkg/msg" - "github.com/pkg/errors" - "math/big" - "strconv" - "sync" - - "github.com/ChainSafe/log15" - "github.com/ethereum/go-ethereum/core/types" - connection "github.com/mapprotocol/compass/connections/ethereum" - "github.com/mapprotocol/compass/core" - "github.com/mapprotocol/compass/internal/bsc" - "github.com/mapprotocol/compass/internal/chain" - "github.com/mapprotocol/compass/internal/proof" - "github.com/mapprotocol/compass/internal/tx" - "github.com/mapprotocol/compass/pkg/ethclient" -) - -type Chain struct { -} - -func New() *Chain { - return &Chain{} -} - -func (c *Chain) New(chainCfg *core.ChainConfig, logger log15.Logger, sysErr chan<- error, role mapprotocol.Role) (core.Chain, error) { - return chain.New(chainCfg, logger, sysErr, role, connection.NewConnection, - chain.OptOfSync2Map(c.syncHeaderToMap), - chain.OptOfInitHeight(mapprotocol.HeaderCountOfBsc), - chain.OptOfAssembleProof(c.assembleProof), - chain.OptOfOracleHandler(chain.DefaultOracleHandler)) -} - -func (c *Chain) syncHeaderToMap(m *chain.Maintainer, latestBlock *big.Int) error { - remainder := big.NewInt(0).Mod(new(big.Int).Sub(latestBlock, new(big.Int).SetInt64(mapprotocol.HeaderCountOfBsc-1)), - big.NewInt(mapprotocol.EpochOfBsc)) - if remainder.Cmp(mapprotocol.Big0) != 0 { - return nil - } - // synced height check - syncedHeight, err := mapprotocol.Get2MapHeight(m.Cfg.Id) - if err != nil { - m.Log.Error("Get current synced Height failed", "err", err) - return err - } - if latestBlock.Cmp(syncedHeight) <= 0 { - m.Log.Info("CurrentBlock less than synchronized headerHeight", "synced height", syncedHeight, - "current height", latestBlock) - return nil - } - m.Log.Info("Find sync block", "current height", latestBlock) - headers := make([]*ethclient.BscHeader, mapprotocol.HeaderCountOfBsc) - for i := 0; i < mapprotocol.HeaderCountOfBsc; i++ { - headerHeight := new(big.Int).Sub(latestBlock, new(big.Int).SetInt64(int64(i))) - header, err := m.Conn.Client().BscHeaderByNumber(m.Cfg.Endpoint, headerHeight) - if err != nil { - return err - } - headers[mapprotocol.HeaderCountOfBsc-i-1] = header - } - - params := make([]bsc.Header, 0, len(headers)) - for _, h := range headers { - params = append(params, bsc.ConvertHeader(h)) - } - input, err := mapprotocol.Bsc.Methods[mapprotocol.MethodOfGetHeadersBytes].Inputs.Pack(params) - if err != nil { - m.Log.Error("Failed to abi pack", "err", err) - return err - } - - id := big.NewInt(0).SetUint64(uint64(m.Cfg.Id)) - msgpayload := []interface{}{id, input} - message := msg.NewSyncToMap(m.Cfg.Id, m.Cfg.MapChainID, msgpayload, m.MsgCh) - - err = m.Router.Send(message) - if err != nil { - m.Log.Error("Subscription error: failed to route message", "err", err) - return err - } - - err = m.WaitUntilMsgHandled(1) - if err != nil { - return err - } - return nil -} - -func (c *Chain) assembleProof(m *chain.Messenger, log *types.Log, proofType int64, toChainID uint64, sign [][]byte) (*msg.Message, error) { - var ( - message msg.Message - orderId = log.Topics[1] - ) - var orderId32 [32]byte - for idx, v := range orderId { - orderId32[idx] = v - } - - payload, err := c.Proof(m.Conn.Client(), log, m.Cfg.Endpoint, proofType, uint64(m.Cfg.Id), toChainID, sign) - if err != nil { - return nil, fmt.Errorf("unable to Parse Log: %w", err) - } - - msgPayload := []interface{}{payload, orderId32, log.BlockNumber, log.TxHash} - message = msg.NewSwapWithProof(m.Cfg.Id, m.Cfg.MapChainID, msgPayload, m.MsgCh) - return &message, nil -} - -func (c *Chain) Connect(id, endpoint, mcs, lightNode, oracleNode string) (*ethclient.Client, error) { - conn := connection.NewConnection(endpoint, true, nil, nil, big.NewInt(chain.DefaultGasLimit), - big.NewInt(chain.DefaultGasPrice), chain.DefaultGasMultiplier) - err := conn.Connect() - if err != nil { - return nil, err - } - - fn := sync.OnceFunc(func() { - idInt, _ := strconv.ParseUint(id, 10, 64) - oracleAbi, _ := abi.New(mapprotocol.OracleAbiJson) - call := contract.New(conn, []common.Address{common.HexToAddress(mcs)}, oracleAbi) - mapprotocol.ContractMapping[msg.ChainId(idInt)] = call - - oAbi, _ := abi.New(mapprotocol.SignerJson) - oracleCall := contract.New(conn, []common.Address{common.HexToAddress(oracleNode)}, oAbi) - mapprotocol.SingMapping[msg.ChainId(idInt)] = oracleCall - - fn := mapprotocol.Map2EthHeight(constant.ZeroAddress.Hex(), common.HexToAddress(lightNode), conn.Client()) - mapprotocol.Map2OtherHeight[msg.ChainId(idInt)] = fn - }) - fn() - - return conn.Client(), nil -} - -func (c *Chain) Proof(client *ethclient.Client, log *types.Log, endpoint string, proofType int64, selfId, - toChainID uint64, sign [][]byte) ([]byte, error) { - var ( - orderId = log.Topics[1] - method = chain.GetMethod(log.Topics[0]) - bigNumber = big.NewInt(int64(log.BlockNumber)) - ) - txsHash, err := mapprotocol.GetTxsByBn(client, bigNumber) - if err != nil { - return nil, fmt.Errorf("unable to get tx hashes Logs: %w", err) - } - var receipts []*types.Receipt - key := strconv.FormatUint(selfId, 10) + "_" + bigNumber.String() - if v, ok := proof.CacheReceipt.Get(key); ok { - receipts = v.([]*types.Receipt) - } else { - receipts, err = tx.GetReceiptsByTxsHash(client, txsHash) - if err != nil { - return nil, fmt.Errorf("unable to get receipts hashes Logs: %w", err) - } - proof.CacheReceipt.Add(key, receipts) - } - var orderId32 [32]byte - for idx, v := range orderId { - orderId32[idx] = v - } - - headers := make([]*ethclient.BscHeader, mapprotocol.HeaderCountOfBsc) - for i := 0; i < mapprotocol.HeaderCountOfBsc; i++ { - headerHeight := new(big.Int).Add(bigNumber, new(big.Int).SetInt64(int64(i))) - header, err := client.BscHeaderByNumber(endpoint, headerHeight) - if err != nil { - return nil, err - } - headers[i] = header - } - - params := make([]bsc.Header, 0, len(headers)) - for _, h := range headers { - params = append(params, bsc.ConvertHeader(h)) - } - - ret, err := bsc.AssembleProof(params, log, receipts, method, msg.ChainId(selfId), proofType, sign, orderId32) - if err != nil { - return nil, fmt.Errorf("unable to Parse Log: %w", err) - } - - return ret, nil -} - -func (c *Chain) Maintainer(client *ethclient.Client, selfId, toChainId uint64, srcEndpoint string) ([]byte, error) { - syncedHeight, err := mapprotocol.Get2MapHeight(msg.ChainId(selfId)) - if err != nil { - return nil, errors.Wrap(err, "unable to get synced height") - } - syncStartHeight := big.NewInt(syncedHeight.Int64() + (mapprotocol.HeaderCountOfBsc - 1) + mapprotocol.EpochOfBsc) // desc order - headers := make([]*ethclient.BscHeader, mapprotocol.HeaderCountOfBsc) - for i := 0; i < mapprotocol.HeaderCountOfBsc; i++ { - headerHeight := new(big.Int).Sub(syncStartHeight, new(big.Int).SetInt64(int64(i))) - header, err := client.BscHeaderByNumber(srcEndpoint, headerHeight) - if err != nil { - return nil, err - } - headers[mapprotocol.HeaderCountOfBsc-i-1] = header - } - - params := make([]bsc.Header, 0, len(headers)) - for _, h := range headers { - params = append(params, bsc.ConvertHeader(h)) - } - input, err := mapprotocol.Bsc.Methods[mapprotocol.MethodOfGetHeadersBytes].Inputs.Pack(params) - if err != nil { - return nil, err - } - - ret, err := mapprotocol.PackInput(mapprotocol.LightManger, mapprotocol.MethodUpdateBlockHeader, big.NewInt(0).SetUint64(selfId), input) - if err != nil { - return nil, err - } - return ret, nil -} diff --git a/chains/btc/chain.go b/chains/btc/chain.go deleted file mode 100644 index 8749bbd1..00000000 --- a/chains/btc/chain.go +++ /dev/null @@ -1,93 +0,0 @@ -package btc - -import ( - "github.com/ChainSafe/log15" - "github.com/ethereum/go-ethereum/log" - "github.com/mapprotocol/compass/core" - "github.com/mapprotocol/compass/internal/chain" - "github.com/mapprotocol/compass/internal/mapprotocol" - "github.com/mapprotocol/compass/pkg/msg" -) - -type Chain struct { - cfg *core.ChainConfig - conn core.Connection - writer *Writer - stop chan<- int - listen core.Listener -} - -func New() *Chain { - return &Chain{} -} - -func (c *Chain) New(chainCfg *core.ChainConfig, logger log15.Logger, sysErr chan<- error, role mapprotocol.Role) (core.Chain, error) { - return createChain(chainCfg, logger, sysErr, role) -} - -func createChain(chainCfg *core.ChainConfig, logger log15.Logger, sysErr chan<- error, role mapprotocol.Role) (core.Chain, error) { - config, err := parseCfg(chainCfg) - if err != nil { - return nil, err - } - - var ( - stop = make(chan int) - listen core.Listener - ) - bs, err := chain.SetupBlockStore(&config.Config, role) - if err != nil { - return nil, err - } - cs := chain.NewCommonSync(nil, &config.Config, logger, stop, sysErr, bs) - - switch role { - case mapprotocol.RoleOfMessenger: - listen = newSync(cs, handler(mos), config) - case mapprotocol.RoleOfOracle: - listen = newSync(cs, handler(oracle), config) - } - - return &Chain{ - stop: stop, - listen: listen, - cfg: chainCfg, - writer: newWriter(config, logger, stop, sysErr), - }, nil -} - -func (c *Chain) SetRouter(r core.Router) { - r.Listen(c.cfg.Id, c.writer) - c.listen.SetRouter(r) -} - -func (c *Chain) Start() error { - err := c.listen.Sync() - if err != nil { - return err - } - - log.Debug("Successfully started Chain") - return nil -} - -func (c *Chain) Id() msg.ChainId { - return c.cfg.Id -} - -func (c *Chain) Name() string { - return c.cfg.Name -} - -// Stop signals to any running routines to exit -func (c *Chain) Stop() { - close(c.stop) - if c.conn != nil { - c.conn.Close() - } -} - -// Conn return Connection interface for relayer register -func (c *Chain) Conn() core.Connection { - return c.conn -} diff --git a/chains/btc/config.go b/chains/btc/config.go deleted file mode 100644 index 1608223c..00000000 --- a/chains/btc/config.go +++ /dev/null @@ -1,26 +0,0 @@ -package btc - -import ( - "github.com/mapprotocol/compass/core" - "github.com/mapprotocol/compass/internal/chain" -) - -type Config struct { - chain.Config - Addr string -} - -func parseCfg(chainCfg *core.ChainConfig) (*Config, error) { - cfg, err := chain.ParseConfig(chainCfg) - if err != nil { - return nil, err - } - ret := Config{ - Config: *cfg, - } - - if ele, ok := chainCfg.Opts[chain.Addr]; ok && ele != "" { - ret.Addr = ele - } - return &ret, nil -} diff --git a/chains/btc/conn.go b/chains/btc/conn.go deleted file mode 100644 index 7d113e0d..00000000 --- a/chains/btc/conn.go +++ /dev/null @@ -1,93 +0,0 @@ -package btc - -import ( - "context" - "math/big" - "time" - - "github.com/ChainSafe/log15" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/accounts/keystore" - ethcommon "github.com/ethereum/go-ethereum/common" - "github.com/gagliardetto/solana-go/rpc" - "github.com/mapprotocol/compass/internal/constant" - "github.com/mapprotocol/compass/pkg/ethclient" -) - -type Connection struct { - endpoint string - cli *rpc.Client - log log15.Logger - stop chan int - reqTime, cacheBlockNumber int64 -} - -func NewConnection(endpoint string, log log15.Logger) *Connection { - return &Connection{ - endpoint: endpoint, - log: log, - stop: make(chan int), - } -} - -// Connect starts the ethereum WS connection -func (c *Connection) Connect() error { - c.cli = rpc.New(c.endpoint) - return nil -} - -func (c *Connection) Keypair() *keystore.Key { - return nil -} - -func (c *Connection) Client() *ethclient.Client { - return nil -} - -func (c *Connection) Opts() *bind.TransactOpts { - return nil -} - -func (c *Connection) CallOpts() *bind.CallOpts { - return nil -} - -func (c *Connection) UnlockOpts() { -} - -func (c *Connection) LockAndUpdateOpts(needNewNonce bool) error { - return nil -} - -// LatestBlock returns the latest block from the current chain -func (c *Connection) LatestBlock() (*big.Int, error) { - // 1s req - if time.Now().Unix()-c.reqTime < constant.ReqInterval { - return big.NewInt(0).SetInt64(c.cacheBlockNumber), nil - } - - bnum, err := c.cli.GetBlockHeight(context.Background(), rpc.CommitmentFinalized) - if err != nil { - return nil, err - } - c.cacheBlockNumber = int64(bnum) - c.reqTime = time.Now().Unix() - - return big.NewInt(0).SetInt64(c.cacheBlockNumber), nil -} - -// EnsureHasBytecode asserts if contract code exists at the specified address -func (c *Connection) EnsureHasBytecode(addr ethcommon.Address) error { - return nil -} - -func (c *Connection) WaitForBlock(targetBlock *big.Int, delay *big.Int) error { - return nil -} - -func (c *Connection) Close() { - if c.cli != nil { - _ = c.cli.Close() - } - close(c.stop) -} diff --git a/chains/btc/sync.go b/chains/btc/sync.go deleted file mode 100644 index d1dc05fa..00000000 --- a/chains/btc/sync.go +++ /dev/null @@ -1,376 +0,0 @@ -package btc - -import ( - "context" - "encoding/json" - "fmt" - "github.com/ethereum/go-ethereum/crypto" - "github.com/mapprotocol/compass/internal/abi" - "github.com/mapprotocol/compass/internal/blacklist" - "github.com/mapprotocol/compass/internal/contract" - "github.com/mapprotocol/compass/internal/mapprotocol" - "github.com/mapprotocol/compass/internal/proof" - "github.com/mapprotocol/compass/internal/stream" - "github.com/mapprotocol/compass/pkg/msg" - "github.com/mr-tron/base58" - "math/big" - "strconv" - "strings" - "time" - - "github.com/ethereum/go-ethereum/common" - "github.com/mapprotocol/compass/internal/chain" - "github.com/mapprotocol/compass/internal/constant" - "github.com/mapprotocol/compass/pkg/util" - "github.com/pkg/errors" -) - -type ( - Handler func(*sync) (int64, error) - LogHandler func(*sync, *MessageOut) error -) - -type sync struct { - *chain.CommonSync - handler Handler - cfg *Config -} - -func newSync(cs *chain.CommonSync, handler Handler, cfg *Config) *sync { - return &sync{CommonSync: cs, handler: handler, cfg: cfg} -} - -func (m *sync) Sync() error { - m.Log.Info("Starting listener...") - if !m.Cfg.SyncToMap { - time.Sleep(time.Hour * 2400) - return nil - } - - select { - case <-m.Stop: - return errors.New("polling terminated") - default: - for { - id, err := m.handler(m) - if err != nil { - if errors.Is(err, chain.NotVerifyAble) { - time.Sleep(constant.BlockRetryInterval) - continue - } - m.Log.Error("Filter Failed to get events for block", "err", err) - util.Alarm(context.Background(), fmt.Sprintf("handler mos failed, chain=%s, err is %s", m.Cfg.Name, err.Error())) - time.Sleep(constant.BlockRetryInterval) - continue - } - if id == 0 { - time.Sleep(constant.MessengerInterval) - continue - } - - m.Cfg.StartBlock = big.NewInt(id) - _ = m.WaitUntilMsgHandled(1) - err = m.BlockStore.StoreBlock(m.Cfg.StartBlock) - if err != nil { - m.Log.Error("Failed to write latest block to file", "err", err) - } - - time.Sleep(constant.MessengerInterval) - } - } -} - -func handler(lh LogHandler) Handler { - return func(m *sync) (int64, error) { - topic := "" - for idx, ele := range m.cfg.Events { - topic += ele.GetTopic().Hex() - if idx != len(m.cfg.Events)-1 { - topic += "," - } - } - - uri := fmt.Sprintf("%s/%s?%s", m.Cfg.BtcHost, constant.FilterBtcLogUrl, - fmt.Sprintf("id=%d&chain_id=%d&topic=%s&limit=1", - m.Cfg.StartBlock.Int64(), m.Cfg.Id, topic)) - //m.Cfg.StartBlock.Int64(), 1360095883558913, topic)) - data, err := chain.Request(uri) - if err != nil { - return 0, err - } - listData, err := json.Marshal(data) - if err != nil { - return 0, errors.Wrap(err, "marshal resp.Data failed") - } - back := stream.BtcLogListResp{} - err = json.Unmarshal(listData, &back) - if err != nil { - return 0, err - } - if len(back.Items) == 0 { - return 0, nil - } - m.Log.Info("Btc find a log", "id", back.Items[0].Id, "block", back.Items[0].BlockNumber) - logData := common.Hex2Bytes(back.Items[0].LogData) - var log = MessageOut{} - err = json.Unmarshal(logData, &log) - if err != nil { - return 0, err - } - log.Id = back.Items[0].Id - log.Addr = m.cfg.Addr - log.Topic = back.Items[0].Topic - log.TxHash = back.Items[0].TxHash - log.BlockNumber = back.Items[0].BlockNumber - // check sender - isBlack, err := blacklist.CheckAccount(log.Sender, strconv.FormatUint(uint64(m.Cfg.Id), 10)) - if err != nil { - return 0, err - } - if isBlack { - m.Log.Info("Ignore this log, because it is black", "id", log.Id, "sender", log.Sender) - return back.Items[0].Id, nil - } - // check receiver - isBlack, err = blacklist.CheckAccount(log.To, strconv.FormatUint(uint64(m.Cfg.Id), 10)) - if err != nil { - return 0, err - } - if isBlack { - m.Log.Info("Ignore this log, because it is black", "id", log.Id, "to", log.To) - return back.Items[0].Id, nil - } - - // check src tx - isBlack, err = blacklist.CheckTxs(log.SrcChain, log.InTxHash) - if err != nil { - return 0, err - } - if isBlack { - m.Log.Info("Ignore this log, because it is black", "id", log.Id, "srcChain", log.SrcChain, "txHash", log.TxHash) - return back.Items[0].Id, nil - } - err = lh(m, &log) - if err != nil { - return 0, err - } - - return back.Items[0].Id, nil - } -} - -func mos(m *sync, log *MessageOut) error { - receiptHash, receiptPack, err := genReceipt(log) - if err != nil { - return errors.Wrap(err, "gen receipt failed") - } - m.Log.Info("Btc2Evm mos generate", "receiptHash", receiptHash) - bn := proof.GenLogBlockNumber(big.NewInt(log.BlockNumber), uint(log.Id)) - proposalInfo, err := chain.GetSigner(bn, *receiptHash, uint64(m.cfg.Id), uint64(m.cfg.MapChainID)) - if err != nil { - return err - } - var fixedHash [32]byte - for i, v := range receiptHash { - fixedHash[i] = v - } - pd := proof.SignLogData{ - ProofType: constant.ProofTypeOfContract, - BlockNum: bn, - ReceiptRoot: fixedHash, - Signatures: proposalInfo.Signatures, - Proof: receiptPack, - } - - input, err := mapprotocol.GetAbi.Methods[mapprotocol.MethodOfGetBytes].Inputs.Pack(pd) - if err != nil { - return errors.Wrap(err, "pack getBytes failed") - } - - orderId := common.HexToHash(log.OrderID) - finalInput, err := mapprotocol.PackInput(mapprotocol.Mcs, mapprotocol.MethodOfMessageIn, - big.NewInt(0).SetUint64(uint64(m.Cfg.Id)), - big.NewInt(int64(0)), orderId, input) - if err != nil { - return err - } - - var orderId32 [32]byte - for i, v := range orderId { - orderId32[i] = v - } - message := msg.NewSwapWithProof(m.Cfg.Id, m.Cfg.MapChainID, []interface{}{finalInput, - orderId32, log.BlockNumber, log.TxHash}, m.MsgCh) - err = m.Router.Send(message) - if err != nil { - m.Log.Error("subscription error: failed to route message", "err", err) - return err - } - - return nil -} - -func oracle(m *sync, log *MessageOut) error { - receiptHash, _, err := genReceipt(log) - if err != nil { - return errors.Wrap(err, "gen receipt failed") - } - m.Log.Info("Sol2Evm oracle generate", "receiptHash", receiptHash) - - ret, err := chain.MulSignInfo(0, uint64(m.Cfg.MapChainID)) - if err != nil { - return errors.Wrap(err, "mul sign failed") - } - - version := make([]byte, 0) - for _, v := range ret.Version { - version = append(version, byte(v)) - } - - bn := proof.GenLogBlockNumber(big.NewInt(log.BlockNumber), uint(log.Id)) - input, err := mapprotocol.PackAbi.Methods[mapprotocol.MethodOfSolidityPack].Inputs.Pack(receiptHash, - ret.Version, bn, big.NewInt(int64(m.Cfg.Id))) - if err != nil { - return errors.Wrap(err, "oracle pack input failed") - } - - message := msg.NewProposal(m.Cfg.Id, m.Cfg.MapChainID, []interface{}{input, receiptHash, bn}, m.MsgCh) - err = m.Router.Send(message) - if err != nil { - m.Log.Error("Subscription error: failed to route message", "err", err) - return nil - } - - return nil -} - -func genReceipt(log *MessageOut) (*common.Hash, []byte, error) { - // 解析 - fromChain, ok := big.NewInt(0).SetString(log.SrcChain, 10) - if !ok { - return nil, nil, fmt.Errorf("invalid fromChain (%s)", log.SrcChain) - } - toChain, ok := big.NewInt(0).SetString(log.DstChain, 10) - if !ok { - return nil, nil, fmt.Errorf("invalid toChain (%s)", log.DstChain) - } - amount, ok := big.NewInt(0).SetString(log.InAmount, 10) - if !ok { - return nil, nil, fmt.Errorf("invalid amount (%s)", log.InAmount) - } - gasLimit, ok := big.NewInt(0).SetString(log.GasLimit, 10) - if !ok { - return nil, nil, fmt.Errorf("invalid gasLimit (%s)", log.GasLimit) - } - minAmount, ok := big.NewInt(0).SetString(log.MinOutAmount, 10) - if !ok { - return nil, nil, fmt.Errorf("invalid minAmount (%s)", log.MinOutAmount) - } - - orderId := common.HexToHash(log.OrderID) - bridgeData := common.Hex2Bytes(strings.TrimPrefix(log.SwapData, "0x")) - bridgeParam, err := abi.DecodeBridgeParam(bridgeData) - if err != nil { - return nil, nil, errors.Wrap(err, "decode bridge param failed") - } - - to := common.Hex2Bytes(strings.TrimPrefix(log.To, "0x")) - dstToken := common.Hex2Bytes(strings.TrimPrefix(log.DstToken, "0x")) - if toChain.Int64() == constant.SolMainChainId { - dstToken, _ = base58.Decode(log.DstToken) - } - if len(bridgeParam.SwapData) > 0 { - // check swapData - receiver := common.Hex2Bytes(strings.TrimPrefix(log.Receiver, "0x")) - if toChain.Int64() == constant.SolMainChainId { - receiver, _ = base58.Decode(log.Receiver) - } - pass, err := contract.Validate(log.Relay, toChain, minAmount, dstToken, - receiver, bridgeParam.SwapData) - if err != nil { - return nil, nil, err - } - if !pass { - return nil, nil, fmt.Errorf("invalid swapData (%s)", log.SwapData) - } - } - - if log.SrcToken == constant.TokenLongAddressOfBtc { - log.SrcToken = constant.TokenShortAddressOfBtc - } - eo := mapprotocol.MessageOutEvent{ - FromChain: fromChain, - ToChain: toChain, - OrderId: orderId, - Amount: amount, - Token: common.Hex2Bytes(strings.TrimPrefix(log.SrcToken, "0x")), - From: []byte(log.From), // btc address - SwapData: bridgeParam.SwapData, - GasLimit: gasLimit, - Mos: common.Hex2Bytes(strings.TrimPrefix(log.MOS, "0x")), - Initiator: []byte(log.Sender), // btc address - Relay: log.Relay, - MessageType: log.MessageType, - To: to, - } - data, err := mapprotocol.SolAbi.Methods[mapprotocol.MethodOfSolEventEncode].Inputs.Pack(&eo) - if err != nil { - return nil, nil, errors.Wrap(err, "marshal event code failed") - } - // abi - receiptPack, err := mapprotocol.SolAbi.Methods[mapprotocol.MethodOfSolPackReceipt].Inputs.Pack( - common.Hex2Bytes(strings.TrimPrefix(log.Addr, "0x")), - common.Hex2Bytes(strings.TrimPrefix(log.Topic, "0x")), data) - if err != nil { - return nil, nil, errors.Wrap(err, "marshal pack failed") - } - receipt := common.BytesToHash(crypto.Keccak256(receiptPack)) - return &receipt, receiptPack, nil -} - -type MessageOut struct { - Id int64 `json:"id"` - Topic string `json:"topic"` - BlockNumber int64 `json:"block_number"` - TxHash string `json:"tx_hash"` - Addr string `json:"addr"` - OrderID string `json:"order_id"` // orderId - From string `json:"from"` // relay - To string `json:"to"` // - SrcChain string `json:"src_chain"` // fromChain - SrcToken string `json:"src_token"` // token - Sender string `json:"sender"` // initiator - InAmount string `json:"in_amount"` // amount - InTxHash string `json:"in_tx_hash"` - BridgeFee string `json:"bridge_fee"` - DstChain string `json:"dst_chain"` // toChain - DstToken string `json:"dst_token"` // - Receiver string `json:"receiver"` // - MOS string `json:"mos"` // map mos address - Relay bool `json:"relay"` // (from butter) - MessageType uint8 `json:"message_type"` // default 3 - GasLimit string `json:"gas_limit"` // default 0 - MinOutAmount string `json:"min_out_amount"` // minOutAmount - SwapData string `json:"swap_data"` // (from butter) -} - -type T struct { - OrderId string `json:"order_id"` - From string `json:"from"` - To string `json:"to"` - SrcChain string `json:"src_chain"` - SrcToken string `json:"src_token"` - Sender string `json:"sender"` - InAmount string `json:"in_amount"` - InTxHash string `json:"in_tx_hash"` - BridgeFee string `json:"bridge_fee"` - DstChain string `json:"dst_chain"` - DstToken string `json:"dst_token"` - Receiver string `json:"receiver"` - Mos string `json:"mos"` - Relay bool `json:"relay"` - MessageType int `json:"message_type"` - GasLimit string `json:"gas_limit"` - MinOutAmount string `json:"min_out_amount"` - SwapData string `json:"swap_data"` -} diff --git a/chains/btc/writer.go b/chains/btc/writer.go deleted file mode 100644 index 1a0a91f5..00000000 --- a/chains/btc/writer.go +++ /dev/null @@ -1,38 +0,0 @@ -package btc - -import ( - "github.com/ChainSafe/log15" - "github.com/mapprotocol/compass/pkg/msg" -) - -type Writer struct { - cfg *Config - log log15.Logger - stop <-chan int - sysErr chan<- error -} - -func newWriter(cfg *Config, log log15.Logger, stop <-chan int, sysErr chan<- error) *Writer { - return &Writer{ - cfg: cfg, - log: log, - stop: stop, - sysErr: sysErr, - } -} - -func (w *Writer) ResolveMessage(m msg.Message) bool { - w.log.Info("Attempting to resolve message", "type", m.Type, "src", m.Source, "dst", m.Destination) - switch m.Type { - case msg.SwapWithMapProof: - return w.exeMcs(m) - default: - w.log.Error("Unknown message type received", "type", m.Type) - return false - } -} - -func (w *Writer) exeMcs(m msg.Message) bool { - m.DoneCh <- struct{}{} - return true -} diff --git a/chains/conflux/chain.go b/chains/conflux/chain.go deleted file mode 100644 index 7accda78..00000000 --- a/chains/conflux/chain.go +++ /dev/null @@ -1,356 +0,0 @@ -package conflux - -import ( - "context" - "fmt" - "github.com/mapprotocol/compass/internal/proof" - "math/big" - "strconv" - "sync" - "time" - - "github.com/mapprotocol/compass/internal/tx" - "github.com/mapprotocol/compass/pkg/abi" - "github.com/mapprotocol/compass/pkg/contract" - "github.com/mapprotocol/compass/pkg/ethclient" - - "github.com/ChainSafe/log15" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/core/types" - connection "github.com/mapprotocol/compass/connections/ethereum" - "github.com/mapprotocol/compass/core" - "github.com/mapprotocol/compass/internal/chain" - "github.com/mapprotocol/compass/internal/conflux" - "github.com/mapprotocol/compass/internal/constant" - "github.com/mapprotocol/compass/internal/mapprotocol" - "github.com/mapprotocol/compass/pkg/msg" - "github.com/pkg/errors" - "github.com/sirupsen/logrus" -) - -var ( - skippedRound, startNumber uint64 - cli = &conflux.Client{} -) - -type Chain struct { -} - -func New() *Chain { - return &Chain{} -} - -func (c *Chain) New(chainCfg *core.ChainConfig, logger log15.Logger, sysErr chan<- error, role mapprotocol.Role) (core.Chain, error) { - client, err := conflux.NewClient(chainCfg.Opts[chain.Eth2Url]) - if err != nil { - panic("conflux init client failed" + err.Error()) - } - cli = client - return chain.New(chainCfg, logger, sysErr, role, connection.NewConnection, - chain.OptOfSync2Map(c.syncHeaderToMap), - chain.OptOfInitHeight(mapprotocol.HeaderOneCount), - chain.OptOfAssembleProof(c.assembleProof), - chain.OptOfOracleHandler(chain.DefaultOracleHandler), - ) -} - -func (c *Chain) syncHeaderToMap(m *chain.Maintainer, latestBlock *big.Int) error { - state, err := getState(m) - if err != nil { - m.Log.Error("Conflux GetConfluxState Failed", "err", err) - return err - } - m.Log.Info("Conflux GetState", "state", state) - epoch := state.Epoch.Uint64() - round := state.Round.Uint64() + 1 - if skippedRound > 0 { - round = skippedRound + 1 - } - if startNumber == 0 { - startNumber = state.FinalizedBlockNumber.Uint64() - } else if state.FinalizedBlockNumber.Uint64() > startNumber { - m.Log.Info("conflux update endBlock", "startNumber", startNumber, "endNumber", state.FinalizedBlockNumber.Uint64()) - if state.FinalizedBlockNumber.Uint64()-startNumber > 200 { - err = updateHeaders(m, startNumber, state.FinalizedBlockNumber.Uint64()) - if err != nil { - return err - } - } - startNumber = state.FinalizedBlockNumber.Uint64() - } - - committed, err := c.isCommitted(epoch, round) - if err != nil { - m.Log.Error("Conflux isCommitted Failed", "err", err) - return err - } - m.Log.Info("Conflux isCommitted", "committed", committed, "epoch", epoch, "round", round) - if !committed { - time.Sleep(time.Second * 5) - return nil - } - - ledger, err := cli.GetLedgerInfoByEpochAndRound( - context.Background(), - hexutil.Uint64(epoch), - hexutil.Uint64(round), - ) - if err != nil && err.Error() != "not found" { - return errors.WithMessage(err, "Failed to get ledger") - } - - // no ledger in round, just skip it - if ledger == nil { - m.Log.Info("No ledger info in this round", "epoch", epoch) - skippedRound = round - time.Sleep(time.Second * 5) - return nil - } - - pivot := ledger.LedgerInfo.CommitInfo.Pivot - - // both committee and pow pivot block unchanged - if ledger.LedgerInfo.CommitInfo.NextEpochState == nil { - if pivot == nil || uint64(pivot.Height) <= state.FinalizedBlockNumber.Uint64() { - m.Log.Info("Pos block pivot not changed", "pivot", pivot, - "finalizedBlockNumber", state.FinalizedBlockNumber, "epoch", epoch, "round", round) - skippedRound = round - return nil - } - } - - input, err := mapprotocol.Conflux.Methods["relayPOS"].Inputs.Pack(conflux.ConvertLedger(ledger)) - if err != nil { - m.Log.Error("Failed to abi pack", "err", err) - return err - } - - id := big.NewInt(0).SetUint64(uint64(m.Cfg.Id)) - msgpayload := []interface{}{id, input, true} - message := msg.NewSyncToMap(m.Cfg.Id, m.Cfg.MapChainID, msgpayload, m.MsgCh) - - err = m.Router.Send(message) - if err != nil { - m.Log.Error("Subscription error: failed to route message", "err", err) - return err - } - - err = m.WaitUntilMsgHandled(1) - if err != nil { - return err - } - skippedRound = 0 - return nil -} - -func (c *Chain) assembleProof(m *chain.Messenger, log *types.Log, proofType int64, toChainID uint64, sign [][]byte) (*msg.Message, error) { - var ( - err error - message msg.Message - orderId = log.Topics[1] - ) - - var orderId32 [32]byte - for idx, v := range orderId { - orderId32[idx] = v - } - - payload, err := c.Proof(m.Conn.Client(), log, "", proofType, uint64(m.Cfg.Id), toChainID, sign) - if err != nil { - return nil, fmt.Errorf("unable to Parse Log: %w", err) - } - - msgPayload := []interface{}{payload, orderId32, log.BlockNumber, log.TxHash} - message = msg.NewSwapWithProof(m.Cfg.Id, m.Cfg.MapChainID, msgPayload, m.MsgCh) - return &message, nil -} - -func getState(m *chain.Maintainer) (*conflux.ILightNodeState, error) { - data, err := mapprotocol.GetDataByManager(mapprotocol.MethodClientState, big.NewInt(int64(m.Cfg.Id))) - if err != nil { - return nil, err - } - analysis, err := mapprotocol.Other.Methods[mapprotocol.MethodOfState].Outputs.Unpack(data) - if err != nil { - return nil, errors.Wrap(err, "analysis") - } - ret := new(conflux.ILightNodeState) - if err = mapprotocol.Other.Methods[mapprotocol.MethodOfState].Outputs.Copy(&ret, analysis); err != nil { - return nil, errors.Wrap(err, "analysis copy") - } - return ret, nil -} - -func nearestPivot(selfId uint64, height *big.Int) (*big.Int, error) { - pack, err := mapprotocol.Conflux.Methods[mapprotocol.MethodOfNearestPivot].Inputs.Pack(height) - if err != nil { - return nil, errors.Wrap(err, "nearestPivot pack failed") - } - data, err := mapprotocol.GetDataByManager(mapprotocol.MethodOFinalizedState, big.NewInt(int64(selfId)), pack) - if err != nil { - return nil, errors.Wrap(err, "finalizedState unpack failed") - } - analysis, err := mapprotocol.Conflux.Methods[mapprotocol.MethodOfNearestPivot].Outputs.Unpack(data) - if err != nil { - return nil, errors.Wrap(err, "nearestPivot unpack failed") - } - ret := new(big.Int) - if err = mapprotocol.Conflux.Methods[mapprotocol.MethodOfNearestPivot].Outputs.Copy(&ret, analysis); err != nil { - return nil, errors.Wrap(err, "nearestPivot copy failed") - } - return ret, nil -} - -func updateHeaders(m *chain.Maintainer, startNumber, endNumber uint64) error { - m.Log.Info("Sync Header", "startNumber", startNumber, "endNumber", endNumber) - headers := make([][]byte, mapprotocol.HeaderLengthOfConflux) - idx := mapprotocol.HeaderLengthOfConflux - 1 - for i := endNumber; i >= startNumber; i-- { - blk, err := cli.GetBlockByEpochNumber(context.Background(), hexutil.Uint64(i)) - if err != nil { - return err - } - - m.Log.Info("updateHeaders ", "height", i, "idx", idx) - ele := conflux.MustRLPEncodeBlock(blk) - headers[idx] = ele - idx-- - if idx != -1 && i != startNumber { - continue - } - if i == startNumber { - headers = headers[idx+1:] - } - - input, err := mapprotocol.Conflux.Methods[mapprotocol.MethodOfGetBlockHeadersBytes].Inputs.Pack(headers) - if err != nil { - m.Log.Error("Failed to header abi pack", "err", err) - return err - } - id := big.NewInt(0).SetUint64(uint64(m.Cfg.Id)) - msgPayload := []interface{}{id, input} - message := msg.NewSyncToMap(m.Cfg.Id, m.Cfg.MapChainID, msgPayload, m.MsgCh) - err = m.Router.Send(message) - if err != nil { - m.Log.Error("Subscription header error: failed to route message", "err", err) - return nil - } - err = m.WaitUntilMsgHandled(1) - if err != nil { - return err - } - if i != startNumber { - i++ // special handle - } - idx = mapprotocol.HeaderLengthOfConflux - 1 - time.Sleep(time.Second * 2) - } - - return nil -} - -func (c *Chain) isCommitted(epoch, round uint64) (bool, error) { - status, err := cli.GetStatus(context.Background()) - if err != nil { - return false, errors.WithMessage(err, "Failed to get pos status") - } - - block, err := cli.GetBlockByNumber(context.Background(), conflux.NewBlockNumber(status.LatestCommitted)) - if err != nil { - return false, errors.WithMessage(err, "Failed to get the latest committed block") - } - - if block == nil { - logrus.Fatal("Latest committed PoS block is nil") - } - - logrus.WithFields(logrus.Fields{ - "epoch": uint64(block.Epoch), - "round": uint64(block.Round), - }).Debug("Latest committed block found") - - if epoch > uint64(block.Epoch) { - return false, nil - } - - if epoch < uint64(block.Epoch) { - return true, nil - } - - return round <= uint64(block.Round), nil -} - -func (c *Chain) Connect(id, endpoint, mcs, lightNode, oracleNode string) (*ethclient.Client, error) { - conn := connection.NewConnection(endpoint, true, nil, nil, big.NewInt(chain.DefaultGasLimit), - big.NewInt(chain.DefaultGasPrice), chain.DefaultGasMultiplier) - err := conn.Connect() - if err != nil { - return nil, err - } - - fn := sync.OnceFunc(func() { - idInt, _ := strconv.ParseUint(id, 10, 64) - oracleAbi, _ := abi.New(mapprotocol.OracleAbiJson) - call := contract.New(conn, []common.Address{common.HexToAddress(mcs)}, oracleAbi) - mapprotocol.ContractMapping[msg.ChainId(idInt)] = call - - oAbi, _ := abi.New(mapprotocol.SignerJson) - oracleCall := contract.New(conn, []common.Address{common.HexToAddress(oracleNode)}, oAbi) - mapprotocol.SingMapping[msg.ChainId(idInt)] = oracleCall - - fn := mapprotocol.Map2EthHeight(constant.ZeroAddress.Hex(), common.HexToAddress(lightNode), conn.Client()) - mapprotocol.Map2OtherHeight[msg.ChainId(idInt)] = fn - }) - fn() - - return conn.Client(), nil -} - -func (c *Chain) Proof(client *ethclient.Client, log *types.Log, endpoint string, proofType int64, selfId, - toChainID uint64, sign [][]byte) ([]byte, error) { - var ( - err error - pivot = big.NewInt(0) - orderId = log.Topics[1] - receipts []*types.Receipt - bigNumber = big.NewInt(int64(log.BlockNumber)) - method = chain.GetMethod(log.Topics[0]) - ) - if proofType == constant.ProofTypeOfOrigin { - pivot, err = nearestPivot(selfId, new(big.Int).SetUint64(log.BlockNumber+conflux.DeferredExecutionEpochs)) - if err != nil { - return nil, err - } - } - var orderId32 [32]byte - for idx, v := range orderId { - orderId32[idx] = v - } - - txsHash, err := mapprotocol.GetTxsByBn(client, big.NewInt(int64(log.BlockNumber))) - if err != nil { - return nil, fmt.Errorf("unable to get tx hashes Logs: %w", err) - } - - key := strconv.FormatUint(selfId, 10) + "_" + bigNumber.String() - if v, ok := proof.CacheReceipt.Get(key); ok { - receipts = v.([]*types.Receipt) - } else { - receipts, err := tx.GetReceiptsByTxsHash(client, txsHash) - if err != nil { - return nil, fmt.Errorf("unable to get receipts hashes Logs: %w", err) - } - proof.CacheReceipt.Add(key, receipts) - } - ret, err := conflux.AssembleProof(cli, pivot.Uint64(), uint64(proofType), method, msg.ChainId(selfId), log, receipts, orderId32, sign) - if err != nil { - return nil, fmt.Errorf("unable to Parse Log: %w", err) - } - - return ret, nil -} - -func (c *Chain) Maintainer(client *ethclient.Client, selfId, toChainId uint64, srcEndpoint string) ([]byte, error) { - return nil, errors.New("cfx temporary not support maintainer") -} diff --git a/chains/eth2/chain.go b/chains/eth2/chain.go deleted file mode 100644 index 3544024e..00000000 --- a/chains/eth2/chain.go +++ /dev/null @@ -1,217 +0,0 @@ -package eth2 - -import ( - "fmt" - "github.com/ChainSafe/log15" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/log" - "github.com/mapprotocol/compass/connections/eth2" - "github.com/mapprotocol/compass/core" - "github.com/mapprotocol/compass/internal/chain" - "github.com/mapprotocol/compass/internal/constant" - ieth "github.com/mapprotocol/compass/internal/eth2" - "github.com/mapprotocol/compass/internal/mapprotocol" - "github.com/mapprotocol/compass/internal/tx" - "github.com/mapprotocol/compass/pkg/abi" - "github.com/mapprotocol/compass/pkg/contract" - "github.com/mapprotocol/compass/pkg/ethclient" - "github.com/mapprotocol/compass/pkg/keystore" - "github.com/mapprotocol/compass/pkg/msg" - "github.com/pkg/errors" - "math/big" - "strconv" - "sync" -) - -var _ core.Chain = new(Chain) - -type Chain struct { - cfg *core.ChainConfig // The config of the chain - conn core.Eth2Connection // The chains connection - writer *chain.Writer // The writer of the chain - listen core.Listener // The listener of this chain - stop chan<- int -} - -func New() *Chain { - return &Chain{} -} - -func (c *Chain) New(chainCfg *core.ChainConfig, logger log15.Logger, sysErr chan<- error, role mapprotocol.Role) (core.Chain, error) { - cfg, err := chain.ParseConfig(chainCfg) - if err != nil { - return nil, err - } - - kpI, err := keystore.KeypairFromEth(cfg.KeystorePath) - if err != nil { - return nil, err - } - //kp, _ := kpI.(*secp256k1.Keypair) - bs, err := chain.SetupBlockStore(cfg, role) - if err != nil { - return nil, err - } - - stop := make(chan int) - conn := eth2.NewConnection(cfg.Endpoint, cfg.Eth2Endpoint, cfg.Http, kpI, logger, cfg.GasLimit, cfg.MaxGasPrice, - cfg.GasMultiplier) - err = conn.Connect() - if err != nil { - return nil, err - } - - if chainCfg.LatestBlock { - curr, err := conn.LatestBlock() - if err != nil { - return nil, err - } - cfg.StartBlock = curr - } - - // simplified a little bit - var listen core.Listener - cs := chain.NewCommonSync(conn, cfg, logger, stop, sysErr, bs, chain.OptOfOracleHandler(chain.DefaultOracleHandler)) - switch role { - case mapprotocol.RoleOfMaintainer: - fn := mapprotocol.Map2EthHeight(cfg.From, cfg.LightNode, conn.Client()) - height, err := fn() - if err != nil { - return nil, errors.Wrap(err, "eth2 get init headerHeight failed") - } - logger.Info("map2eth2 Current situation", "height", height, "lightNode", cfg.LightNode) - mapprotocol.SyncOtherMap[cfg.Id] = height - mapprotocol.Map2OtherHeight[cfg.Id] = fn - listen = NewMaintainer(cs, conn.Eth2Client()) - case mapprotocol.RoleOfMessenger: - oracleAbi, _ := abi.New(mapprotocol.OracleAbiJson) - call := contract.New(conn, cfg.McsContract, oracleAbi) - mapprotocol.ContractMapping[cfg.Id] = call - listen = NewMessenger(cs) - case mapprotocol.RoleOfOracle: - oAbi, _ := abi.New(mapprotocol.SignerJson) - oracleCall := contract.New(conn, []common.Address{cfg.OracleNode}, oAbi) - mapprotocol.SingMapping[cfg.Id] = oracleCall - - otherAbi, _ := abi.New(mapprotocol.OtherAbi) - call := contract.New(conn, []common.Address{cfg.LightNode}, otherAbi) - mapprotocol.LightNodeMapping[cfg.Id] = call - listen = chain.NewOracle(cs) - } - wri := chain.NewWriter(conn, cfg, logger, stop, sysErr) - - return &Chain{ - cfg: chainCfg, - conn: conn, - writer: wri, - stop: stop, - listen: listen, - }, nil -} - -func (c *Chain) SetRouter(r core.Router) { - r.Listen(c.cfg.Id, c.writer) - c.listen.SetRouter(r) -} - -func (c *Chain) Start() error { - err := c.listen.Sync() - if err != nil { - return err - } - - log.Debug("Successfully started chain") - return nil -} - -func (c *Chain) Id() msg.ChainId { - return c.cfg.Id -} - -func (c *Chain) Name() string { - return c.cfg.Name -} - -// Stop signals to any running routines to exit -func (c *Chain) Stop() { - close(c.stop) - if c.conn != nil { - c.conn.Close() - } -} - -// EthClient return EthClient for global map connection -func (c *Chain) EthClient() *ethclient.Client { - return c.conn.Client() -} - -// Conn return Connection interface for relayer register -func (c *Chain) Conn() core.Connection { - return c.conn -} - -func (c *Chain) Connect(id, endpoint, mcs, lightNode, oracleNode string) (*ethclient.Client, error) { - conn := eth2.NewConnection(endpoint, "", true, nil, nil, big.NewInt(chain.DefaultGasLimit), - big.NewInt(chain.DefaultGasPrice), chain.DefaultGasMultiplier) - err := conn.Connect() - if err != nil { - return nil, err - } - - fn := sync.OnceFunc(func() { - idInt, _ := strconv.ParseUint(id, 10, 64) - oracleAbi, _ := abi.New(mapprotocol.OracleAbiJson) - call := contract.New(conn, []common.Address{common.HexToAddress(mcs)}, oracleAbi) - mapprotocol.ContractMapping[msg.ChainId(idInt)] = call - - oAbi, _ := abi.New(mapprotocol.SignerJson) - oracleCall := contract.New(conn, []common.Address{common.HexToAddress(oracleNode)}, oAbi) - mapprotocol.SingMapping[msg.ChainId(idInt)] = oracleCall - - fn := mapprotocol.Map2EthHeight(constant.ZeroAddress.Hex(), common.HexToAddress(lightNode), conn.Client()) - mapprotocol.Map2OtherHeight[msg.ChainId(idInt)] = fn - }) - fn() - - return conn.Client(), nil -} - -func (c *Chain) Proof(client *ethclient.Client, log *types.Log, endpoint string, proofType int64, selfId, - toChainID uint64, sign [][]byte) ([]byte, error) { - var ( - orderId = log.Topics[1] - method = chain.GetMethod(log.Topics[0]) - blockNumber = big.NewInt(0).SetUint64(log.BlockNumber) - ) - - header, err := client.EthLatestHeaderByNumber(endpoint, blockNumber) - if err != nil { - return nil, err - } - // when syncToMap we need to assemble a tx proof - txsHash, err := mapprotocol.GetTxsByBn(client, blockNumber) - if err != nil { - return nil, fmt.Errorf("unable to get tx hashes Logs: %w", err) - } - receipts, err := tx.GetReceiptsByTxsHash(client, txsHash) - if err != nil { - return nil, fmt.Errorf("unable to get receipts hashes Logs: %w", err) - } - - var orderId32 [32]byte - for i, v := range orderId { - orderId32[i] = v - } - - ret, err := ieth.AssembleProof(*ieth.ConvertHeader(header), log, receipts, method, msg.ChainId(selfId), proofType, sign, orderId32) - if err != nil { - return nil, fmt.Errorf("unable to Parse Log: %w", err) - } - - return ret, nil -} - -func (c *Chain) Maintainer(client *ethclient.Client, selfId, toChainId uint64, srcEndpoint string) ([]byte, error) { - return nil, errors.New("eth not support maintainer") -} diff --git a/chains/eth2/maintainer.go b/chains/eth2/maintainer.go deleted file mode 100644 index 276b47f6..00000000 --- a/chains/eth2/maintainer.go +++ /dev/null @@ -1,506 +0,0 @@ -package eth2 - -import ( - "context" - "errors" - "fmt" - "github.com/mapprotocol/compass/internal/mapprotocol" - "github.com/mapprotocol/compass/pkg/msg" - "math/big" - "strconv" - "time" - - log "github.com/ChainSafe/log15" - "github.com/ethereum/go-ethereum/common" - "github.com/mapprotocol/compass/internal/constant" - "github.com/mapprotocol/compass/internal/eth2" - "github.com/mapprotocol/compass/pkg/util" - - "github.com/mapprotocol/compass/internal/chain" -) - -type Maintainer struct { - *chain.CommonSync - syncedHeight *big.Int - eth2Client *eth2.Client -} - -func NewMaintainer(cs *chain.CommonSync, eth2Client *eth2.Client) *Maintainer { - return &Maintainer{ - CommonSync: cs, - eth2Client: eth2Client, - syncedHeight: new(big.Int), - } -} - -func (m *Maintainer) Sync() error { - m.Log.Debug("Starting listener...") - go func() { - err := m.sync() - if err != nil { - m.Log.Error("Polling blocks failed", "err", err) - } - }() - - return nil -} - -// sync function of Maintainer will poll for the latest block and proceed to parse the associated events as it sees new blocks. -// Polling begins at the block defined in `m.Cfg.StartBlock`. Failed attempts to fetch the latest block or parse -// a block will be retried up to BlockRetryLimit times before continuing to the next block. -func (m *Maintainer) sync() error { - if !m.Cfg.SyncToMap { - time.Sleep(time.Hour * 2400) - return nil - } - var currentBlock = m.Cfg.StartBlock - m.Log.Info("Polling Blocks...", "block", currentBlock) - - err := m.updateSyncHeight() - if err != nil { - m.Log.Error("Get synced Height failed", "err", err) - return err - } - - if m.syncedHeight.Cmp(currentBlock) != 0 { - currentBlock.Add(m.syncedHeight, new(big.Int).SetInt64(1)) - m.Log.Info("SyncedHeight is higher or lower than currentHeight, so let currentHeight = syncedHeight", - "syncedHeight", m.syncedHeight, "currentBlock", currentBlock) - } - - for { - select { - case <-m.Stop: - return errors.New("polling terminated") - default: - err := m.updateSyncHeight() - if err != nil { - m.Log.Error("UpdateSyncHeight failed", "err", err) - time.Sleep(constant.BlockRetryInterval) - continue - } - - startNumber, endNumber, err := mapprotocol.GetEth22MapNumber(m.Cfg.Id) - if err != nil { - m.Log.Error("Get startNumber failed", "err", err) - time.Sleep(constant.BlockRetryInterval) - continue - } - - log.Info("UpdateRange ", "startNumber", startNumber, "endNumber", endNumber) - if startNumber.Int64() != 0 && endNumber.Int64() != 0 { - // updateHeader 流程 - err = m.updateHeaders(startNumber, endNumber) - if err != nil { - m.Log.Error("updateHeaders failed", "err", err) - time.Sleep(constant.QueryRetryInterval) - util.Alarm(context.Background(), fmt.Sprintf("eth2 sync header failed, err is %s", err.Error())) - continue - } - } - - resp, err := m.eth2Client.BeaconHeaders(context.Background(), constant.FinalBlockIdOfEth2) - if err != nil { - m.Log.Error("Unable to get latest block", "block", currentBlock, "err", err) - time.Sleep(constant.BlockRetryInterval) - continue - } - - lastFinalizedSlotOnContract := m.syncedHeight - lastFinalizedSlotOnEth, ok := new(big.Int).SetString(resp.Data.Header.Message.Slot, 10) - if !ok { - time.Sleep(constant.BlockRetryInterval) - continue - } - - if !m.isEnoughBlocksForLightClientUpdate(lastFinalizedSlotOnContract, lastFinalizedSlotOnEth) { - time.Sleep(time.Second * 60) - continue - } - - latestBlock, err := m.Conn.LatestBlock() - if err != nil { - m.Log.Error("Unable to get latest block", "block", currentBlock, "err", err) - time.Sleep(constant.BlockRetryInterval) - continue - } - - err = m.sendRegularLightClientUpdate(lastFinalizedSlotOnContract, lastFinalizedSlotOnEth) - if err != nil { - m.Log.Error("Failed to listen header for block", "block", currentBlock, "err", err) - if !errors.Is(err, constant.ErrUnWantedSync) { - util.Alarm(context.Background(), fmt.Sprintf("eth2 sync lightClient failed, err is %s", err.Error())) - } - time.Sleep(constant.BlockRetryInterval) - continue - } - - // Write to block store. Not a critical operation, no need to retry - err = m.BlockStore.StoreBlock(currentBlock) - if err != nil { - m.Log.Error("Failed to write latest block to blockstore", "block", currentBlock, "err", err) - } - - currentBlock.Add(currentBlock, big.NewInt(1)) - if latestBlock.Int64()-currentBlock.Int64() <= m.Cfg.BlockConfirmations.Int64() { - time.Sleep(time.Second * 10) - } else { - time.Sleep(time.Millisecond * 20) - } - } - } -} - -func (m *Maintainer) updateSyncHeight() error { - syncedHeight, err := mapprotocol.Get2MapHeight(m.Cfg.Id) - if err != nil { - m.Log.Error("Get synced Height failed", "err", err) - return err - } - - m.Log.Info("Check Sync Status...", "synced", syncedHeight) - m.syncedHeight = syncedHeight - return nil -} - -func (m *Maintainer) isEnoughBlocksForLightClientUpdate(lastFinalizedSlotOnContract, lastFinalizedSlotOnEth *big.Int) bool { - if (lastFinalizedSlotOnEth.Int64() - lastFinalizedSlotOnContract.Int64()) < (constant.SlotsPerEpoch * 1) { - m.Log.Info("Light client update were send less then 1 epochs ago. Skipping sending light client update", - "lastFinalizedSlotOnEth", lastFinalizedSlotOnEth, "lastFinalizedSlotOnContract", lastFinalizedSlotOnContract) - return false - } - if lastFinalizedSlotOnEth.Uint64() <= lastFinalizedSlotOnContract.Uint64() { - m.Log.Info("Last finalized slot on Eth equal to last finalized slot on Contract. Skipping sending light client update.", - "lastFinalizedSlotOnEth", lastFinalizedSlotOnEth, "lastFinalizedSlotOnContract", lastFinalizedSlotOnContract) - return false - } - - return true -} - -func (m *Maintainer) getPeriodForSlot(slot uint64) uint64 { - return slot / uint64(constant.SlotsPerEpoch*constant.EpochsPerPeriod) -} - -// sendRegularLightClientUpdate listen header from current chain to Map chain -func (m *Maintainer) sendRegularLightClientUpdate(lastFinalizedSlotOnContract, lastFinalizedSlotOnEth *big.Int) error { - lastEth2PeriodOnContract := m.getPeriodForSlot(lastFinalizedSlotOnContract.Uint64()) - endPeriod := m.getPeriodForSlot(lastFinalizedSlotOnEth.Uint64()) - - var ( - err error - lightUpdateData = ð2.LightClientUpdate{} - ) - m.Log.Info("Period check", "periodOnContract", lastEth2PeriodOnContract, "endPeriod", endPeriod, - "slotOnEth", lastFinalizedSlotOnEth, "slotOnContract", lastFinalizedSlotOnContract) - if lastEth2PeriodOnContract == endPeriod { - lightUpdateData, err = m.getFinalityLightClientUpdate(lastFinalizedSlotOnContract) - } else { - lightUpdateData, err = m.getLightClientUpdateForLastPeriod(lastEth2PeriodOnContract) - } - if err != nil { - return err - } - lightClientInput, err := mapprotocol.Eth2.Methods[mapprotocol.MethodOfGetUpdatesBytes].Inputs.Pack(lightUpdateData) - if err != nil { - m.Log.Error("Failed to abi pack", "err", err) - return err - } - - id := big.NewInt(0).SetUint64(uint64(m.Cfg.Id)) - msgpayload := []interface{}{id, lightClientInput, true} - message := msg.NewSyncToMap(m.Cfg.Id, m.Cfg.MapChainID, msgpayload, m.MsgCh) - err = m.Router.Send(message) - if err != nil { - m.Log.Error("Subscription error: failed to route message", "err", err) - return nil - } - err = m.WaitUntilMsgHandled(1) - if err != nil { - return err - } - return nil -} - -func (m *Maintainer) getFinalityLightClientUpdate(lastFinalizedSlotOnContract *big.Int) (*eth2.LightClientUpdate, error) { - resp, err := m.eth2Client.FinallyUpdate(context.Background()) - if err != nil { - return nil, err - } - - bitvector512 := util.NewBitvector512(util.FromHexString(resp.Data.SyncAggregate.SyncCommitteeBits)) - count := bitvector512.Count() - - m.Log.Info("521 check", "len", len(util.FromHexString(resp.Data.SyncAggregate.SyncCommitteeBits)), - "count", count, "512Len", bitvector512.Len()) - - if count*3 < bitvector512.Len()*2 { - m.Log.Warn(fmt.Sprintf("not enought sync committe count %d", count)) - return nil, constant.ErrUnWantedSync - } - - //signatureSlot, err := m.getSignatureSlot(resp.Data.AttestedHeader.Beacon.Slot, &resp.Data.SyncAggregate) - //if err != nil { - // return nil, err - //} - signatureSlot, err := strconv.ParseUint(resp.Data.SignatureSlot, 10, 64) - if err != nil { - return nil, err - } - - fhSlot, _ := big.NewInt(0).SetString(resp.Data.FinalizedHeader.Beacon.Slot, 10) - fhProposerIndex, ok := big.NewInt(0).SetString(resp.Data.FinalizedHeader.Beacon.ProposerIndex, 10) - if !ok { - return nil, errors.New("FinalizedHeader Slot Not Number") - } - - if fhSlot.Cmp(lastFinalizedSlotOnContract) <= 0 { - m.Log.Warn("Finally slot less than slot on contract", "slot", fhSlot.Int64(), "contract.Int64()", lastFinalizedSlotOnContract.Int64()) - return nil, constant.ErrUnWantedSync - } - - m.Log.Info("Slot compare", "fhSlot", resp.Data.FinalizedHeader.Beacon.Slot, "fsOnContract ", lastFinalizedSlotOnContract) - slot, _ := big.NewInt(0).SetString(resp.Data.AttestedHeader.Beacon.Slot, 10) - proposerIndex, ok := big.NewInt(0).SetString(resp.Data.AttestedHeader.Beacon.ProposerIndex, 10) - if !ok { - return nil, errors.New("AttestedHeader Slot Not Number") - } - finalityBranch := make([][32]byte, 0, len(resp.Data.FinalityBranch)) - for _, fb := range resp.Data.FinalityBranch { - finalityBranch = append(finalityBranch, common.HexToHash(fb)) - } - - exeFinalityBranch := make([][32]byte, 0) - execution := ð2.ContractExecution{} - //fmt.Println("resp.Version ", resp.Version) - if resp.Version == "capella" { - branches := make([]string, 0, len(resp.Data.FinalizedHeader.ExecutionBranch)) - branches = append(branches, resp.Data.FinalizedHeader.ExecutionBranch...) - exeFinalityBranch = eth2.GenerateByApi(branches) - execution, err = eth2.ConvertExecution(&resp.Data.FinalizedHeader.Execution) - if err != nil { - return nil, err - } - } else { - block, err := m.eth2Client.GetBlocks(context.Background(), resp.Data.FinalizedHeader.Beacon.Slot) - if err != nil { - return nil, err - } - branches, txRoot, wdRoot, err := eth2.Generate(resp.Data.FinalizedHeader.Beacon.Slot, m.Cfg.Eth2Endpoint) - if err != nil { - return nil, err - } - exeFinalityBranch = branches - block.Data.Message.Body.ExecutionPayload.TransactionsRoot = txRoot - block.Data.Message.Body.ExecutionPayload.WithdrawalsRoot = wdRoot - execution, err = eth2.ConvertExecution(&block.Data.Message.Body.ExecutionPayload) - if err != nil { - return nil, err - } - } - - return ð2.LightClientUpdate{ - SignatureSlot: signatureSlot, - SyncAggregate: eth2.ContractSyncAggregate{ - SyncCommitteeBits: util.FromHexString(resp.Data.SyncAggregate.SyncCommitteeBits), - SyncCommitteeSignature: util.FromHexString(resp.Data.SyncAggregate.SyncCommitteeSignature), - }, - AttestedHeader: eth2.BeaconBlockHeader{ - Slot: slot.Uint64(), - ProposerIndex: proposerIndex.Uint64(), - ParentRoot: common.HexToHash(resp.Data.AttestedHeader.Beacon.ParentRoot), - StateRoot: common.HexToHash(resp.Data.AttestedHeader.Beacon.StateRoot), - BodyRoot: common.HexToHash(resp.Data.AttestedHeader.Beacon.BodyRoot), - }, - NextSyncCommittee: eth2.ContractSyncCommittee{ - Pubkeys: make([]byte, 0), - AggregatePubkey: make([]byte, 0), - }, - NextSyncCommitteeBranch: nil, - FinalityBranch: finalityBranch, - FinalizedHeader: eth2.BeaconBlockHeader{ - Slot: fhSlot.Uint64(), - ProposerIndex: fhProposerIndex.Uint64(), - ParentRoot: common.HexToHash(resp.Data.FinalizedHeader.Beacon.ParentRoot), - StateRoot: common.HexToHash(resp.Data.FinalizedHeader.Beacon.StateRoot), - BodyRoot: common.HexToHash(resp.Data.FinalizedHeader.Beacon.BodyRoot), - }, - ExecutionBranch: exeFinalityBranch, - FinalizedExecution: execution, - }, nil -} - -func (m *Maintainer) getSignatureSlot(slot string, sa *eth2.SyncAggregate) (uint64, error) { - var CheckSlotsForwardLimit uint64 = 10 - ahSlot, ok := big.NewInt(0).SetString(slot, 10) - if !ok { - return 0, errors.New("ahSlot not number") - } - var signatureSlot = ahSlot.Uint64() + 1 - for { - blocks, err := m.eth2Client.GetBlocks(context.Background(), strconv.FormatUint(signatureSlot, 10)) - if err != nil { - m.Log.Info("GetSignatureSlot GetBlocks failed", "blockId", signatureSlot, "err", err) - } - - if blocks != nil && blocks.Data.Message.Body.SyncAggregate.SyncCommitteeSignature == sa.SyncCommitteeSignature { - break - } - - signatureSlot += 1 - if signatureSlot-ahSlot.Uint64() > CheckSlotsForwardLimit { - return 0, errors.New("signature slot not found") - } - } - - return signatureSlot, nil -} - -func (m *Maintainer) getLightClientUpdateForLastPeriod(lastEth2PeriodOnContract uint64) (*eth2.LightClientUpdate, error) { - headers, err := m.eth2Client.BeaconHeaders(context.Background(), constant.HeadBlockIdOfEth2) - if err != nil { - return nil, err - } - - headerSlot, ok := big.NewInt(0).SetString(headers.Data.Header.Message.Slot, 10) - if !ok { - return nil, errors.New("BeaconHeaders Slot Not Number") - } - - lastPeriod := m.getPeriodForSlot(headerSlot.Uint64()) - if lastPeriod-lastEth2PeriodOnContract != 1 { // More than one intervals - lastPeriod = lastEth2PeriodOnContract + 1 - } - resp, err := m.eth2Client.LightClientUpdate(context.Background(), lastPeriod) - if err != nil { - return nil, err - } - slot, _ := big.NewInt(0).SetString(resp.Data.AttestedHeader.Beacon.Slot, 10) - proposerIndex, ok := big.NewInt(0).SetString(resp.Data.AttestedHeader.Beacon.ProposerIndex, 10) - if !ok { - return nil, errors.New("AttestedHeader Slot Not Number") - } - - nextSyncCommitteeBranch := make([][32]byte, 0, len(resp.Data.NextSyncCommitteeBranch)) - for _, b := range resp.Data.NextSyncCommitteeBranch { - nextSyncCommitteeBranch = append(nextSyncCommitteeBranch, common.HexToHash(b)) - } - pubKeys := make([]byte, 0, len(resp.Data.NextSyncCommittee.Pubkeys)*48) - for _, pk := range resp.Data.NextSyncCommittee.Pubkeys { - pubKeys = append(pubKeys, util.FromHexString(pk)...) - } - finalityBranch := make([][32]byte, 0, len(resp.Data.FinalityBranch)) - for _, fb := range resp.Data.FinalityBranch { - finalityBranch = append(finalityBranch, common.HexToHash(fb)) - } - fhSlot, _ := big.NewInt(0).SetString(resp.Data.FinalizedHeader.Beacon.Slot, 10) - fhProposerIndex, ok := big.NewInt(0).SetString(resp.Data.FinalizedHeader.Beacon.ProposerIndex, 10) - if !ok { - return nil, errors.New("FinalizedHeader Slot Not Number") - } - - exeFinalityBranch := make([][32]byte, 0) - execution := ð2.ContractExecution{} - signatureSlot, err := strconv.ParseUint(resp.Data.SignatureSlot, 10, 64) - if err != nil { - return nil, err - } - //fmt.Println("resp.Version ", resp.Version) - if resp.Version == "capella" { - branches := make([]string, 0, len(resp.Data.FinalizedHeader.ExecutionBranch)) - branches = append(branches, resp.Data.FinalizedHeader.ExecutionBranch...) - exeFinalityBranch = eth2.GenerateByApi(branches) - execution, err = eth2.ConvertExecution(&resp.Data.FinalizedHeader.Execution) - if err != nil { - return nil, err - } - } else { - block, err := m.eth2Client.GetBlocks(context.Background(), resp.Data.FinalizedHeader.Beacon.Slot) - if err != nil { - return nil, err - } - branches, txRoot, wdRoot, err := eth2.Generate(resp.Data.FinalizedHeader.Beacon.Slot, m.Cfg.Eth2Endpoint) - if err != nil { - return nil, err - } - exeFinalityBranch = branches - block.Data.Message.Body.ExecutionPayload.TransactionsRoot = txRoot - block.Data.Message.Body.ExecutionPayload.WithdrawalsRoot = wdRoot - execution, err = eth2.ConvertExecution(&block.Data.Message.Body.ExecutionPayload) - if err != nil { - return nil, err - } - } - return ð2.LightClientUpdate{ - AttestedHeader: eth2.BeaconBlockHeader{ - Slot: slot.Uint64(), - ProposerIndex: proposerIndex.Uint64(), - ParentRoot: common.HexToHash(resp.Data.AttestedHeader.Beacon.ParentRoot), - StateRoot: common.HexToHash(resp.Data.AttestedHeader.Beacon.StateRoot), - BodyRoot: common.HexToHash(resp.Data.AttestedHeader.Beacon.BodyRoot), - }, - SyncAggregate: eth2.ContractSyncAggregate{ - SyncCommitteeBits: util.FromHexString(resp.Data.SyncAggregate.SyncCommitteeBits), - SyncCommitteeSignature: util.FromHexString(resp.Data.SyncAggregate.SyncCommitteeSignature), - }, - SignatureSlot: signatureSlot, - NextSyncCommitteeBranch: nextSyncCommitteeBranch, - NextSyncCommittee: eth2.ContractSyncCommittee{ - Pubkeys: pubKeys, - AggregatePubkey: util.FromHexString(resp.Data.NextSyncCommittee.AggregatePubkey), - }, - FinalityBranch: finalityBranch, - FinalizedHeader: eth2.BeaconBlockHeader{ - Slot: fhSlot.Uint64(), - ProposerIndex: fhProposerIndex.Uint64(), - ParentRoot: common.HexToHash(resp.Data.FinalizedHeader.Beacon.ParentRoot), - StateRoot: common.HexToHash(resp.Data.FinalizedHeader.Beacon.StateRoot), - BodyRoot: common.HexToHash(resp.Data.FinalizedHeader.Beacon.BodyRoot), - }, - ExecutionBranch: exeFinalityBranch, - FinalizedExecution: execution, - }, nil -} - -func (m *Maintainer) updateHeaders(startNumber, endNumber *big.Int) error { - m.Log.Info("Sync Header", "startNumber", startNumber, "endNumber", endNumber) - headers := make([]eth2.BlockHeader, mapprotocol.HeaderLengthOfEth2) - idx := mapprotocol.HeaderLengthOfEth2 - 1 - for i := endNumber.Int64(); i >= startNumber.Int64(); i-- { - header, err := m.Conn.Client().EthLatestHeaderByNumber(m.Cfg.Endpoint, new(big.Int).SetInt64(i)) - if err != nil { - return err - } - - headers[idx] = *eth2.ConvertHeader(header) - idx-- - if idx != -1 && i != startNumber.Int64() { - continue - } - if i == startNumber.Int64() { - headers = headers[idx+1:] - } - input, err := mapprotocol.Eth2.Methods[mapprotocol.MethodOfGetHeadersBytes].Inputs.Pack(headers) - if err != nil { - m.Log.Error("Failed to header abi pack", "err", err) - return err - } - - id := big.NewInt(0).SetUint64(uint64(m.Cfg.Id)) - msgPayload := []interface{}{id, input} - message := msg.NewSyncToMap(m.Cfg.Id, m.Cfg.MapChainID, msgPayload, m.MsgCh) - err = m.Router.Send(message) - if err != nil { - m.Log.Error("Subscription header error: failed to route message", "err", err) - return nil - } - err = m.WaitUntilMsgHandled(1) - if err != nil { - return err - } - idx = mapprotocol.HeaderLengthOfEth2 - 1 - time.Sleep(time.Second * 2) - } - - return nil -} diff --git a/chains/eth2/messenger.go b/chains/eth2/messenger.go deleted file mode 100644 index 2591c6f9..00000000 --- a/chains/eth2/messenger.go +++ /dev/null @@ -1,291 +0,0 @@ -package eth2 - -import ( - "context" - "encoding/json" - "fmt" - "github.com/mapprotocol/compass/internal/mapprotocol" - "github.com/mapprotocol/compass/pkg/msg" - "math/big" - "strings" - "time" - - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/mapprotocol/compass/internal/chain" - "github.com/mapprotocol/compass/internal/constant" - "github.com/mapprotocol/compass/internal/eth2" - "github.com/mapprotocol/compass/internal/stream" - "github.com/mapprotocol/compass/internal/tx" - "github.com/mapprotocol/compass/pkg/util" - "github.com/pkg/errors" -) - -type Messenger struct { - *chain.CommonSync -} - -func NewMessenger(cs *chain.CommonSync) *Messenger { - return &Messenger{ - CommonSync: cs, - } -} - -func (m *Messenger) Sync() error { - m.Log.Debug("Starting listener...") - go func() { - var err error - if m.Cfg.Filter { - err = m.filter() - } else { - err = m.sync() - } - if err != nil { - m.Log.Error("Polling blocks failed", "err", err) - } - }() - - return nil -} - -func (m *Messenger) sync() error { - if !m.Cfg.SyncToMap { - time.Sleep(time.Hour * 2400) - } - var currentBlock = m.Cfg.StartBlock - - for { - select { - case <-m.Stop: - return errors.New("polling terminated") - default: - latestBlock, err := m.Conn.LatestBlock() - if err != nil { - m.Log.Error("Unable to get latest block", "block", currentBlock, "err", err) - time.Sleep(constant.QueryRetryInterval) - continue - } - - if big.NewInt(0).Sub(latestBlock, currentBlock).Cmp(m.BlockConfirmations) == -1 { - m.Log.Debug("Block not ready, will retry", "target", currentBlock, "latest", latestBlock) - time.Sleep(constant.BalanceRetryInterval) - continue - } - count, err := m.getEventsForBlock(currentBlock) - if err != nil { - m.Log.Error("Failed to get events for block", "block", currentBlock, "err", err) - util.Alarm(context.Background(), fmt.Sprintf("eth2 mos failed, err is %s", err.Error())) - time.Sleep(constant.BlockRetryInterval) - continue - } - - // hold until all messages are handled - _ = m.WaitUntilMsgHandled(count) - - // Write to block store. Not a critical operation, no need to retry - err = m.BlockStore.StoreBlock(currentBlock) - if err != nil { - m.Log.Error("Failed to write latest block to blockstore", "block", currentBlock, "err", err) - } - - // Goto next block and reset retry counter - currentBlock.Add(currentBlock, big.NewInt(1)) - if latestBlock.Int64()-currentBlock.Int64() <= m.Cfg.BlockConfirmations.Int64() { - time.Sleep(time.Second * 10) - } else { - time.Sleep(time.Millisecond * 20) - } - } - } -} - -// getEventsForBlock looks for the deposit event in the latest block -func (m *Messenger) getEventsForBlock(latestBlock *big.Int) (int, error) { - count := 0 - for idx, addr := range m.Cfg.McsContract { - query := m.BuildQuery(addr, m.Cfg.Events, latestBlock, latestBlock) - logs, err := m.Conn.Client().FilterLogs(context.Background(), query) - if err != nil { - return 0, fmt.Errorf("unable to Filter Logs: %w", err) - } - - for _, log := range logs { - tmp := log - send, err := log2Msg(m, &tmp, idx) - if err != nil { - return 0, err - } - count += send - } - } - - return count, nil -} - -func (m *Messenger) filter() error { - for { - select { - case <-m.Stop: - return errors.New("filter polling terminated") - default: - latestBlock, err := m.FilterLatestBlock() - if err != nil { - m.Log.Error("Unable to get latest block", "err", err) - time.Sleep(constant.BlockRetryInterval) - continue - } - count, err := m.filterMosHandler(latestBlock.Uint64()) - if err != nil { - if errors.Is(err, chain.NotVerifyAble) { - time.Sleep(constant.ThirtySecondInterval) - continue - } - m.Log.Error("Filter Failed to get events for block", "err", err) - util.Alarm(context.Background(), fmt.Sprintf("filter mos failed, chain=%s, err is %s", m.Cfg.Name, err.Error())) - time.Sleep(constant.BlockRetryInterval) - continue - } - - // hold until all messages are handled - _ = m.WaitUntilMsgHandled(count) - err = m.BlockStore.StoreBlock(m.Cfg.StartBlock) - if err != nil { - m.Log.Error("Filter Failed to write latest block to blockStore", "err", err) - } - - time.Sleep(constant.MessengerInterval) - } - } -} - -func (m *Messenger) filterMosHandler(latestBlock uint64) (int, error) { - count := 0 - topic := "" - for idx, ele := range m.Cfg.Events { - topic += ele.GetTopic().Hex() - if idx != len(m.Cfg.Events)-1 { - topic += "," - } - } - data, err := chain.Request(fmt.Sprintf("%s/%s?%s", m.Cfg.FilterHost, constant.FilterUrl, - fmt.Sprintf("id=%d&project_id=%d&chain_id=%d&topic=%s&limit=1", - m.Cfg.StartBlock.Int64(), constant.ProjectOfMsger, m.Cfg.Id, topic))) - if err != nil { - return 0, err - } - listData, err := json.Marshal(data) - if err != nil { - return 0, errors.Wrap(err, "marshal resp.Data failed") - } - back := stream.MosListResp{} - err = json.Unmarshal(listData, &back) - if err != nil { - return 0, err - } - if len(back.List) == 0 { - time.Sleep(constant.QueryRetryInterval) - return 0, nil - } - - for _, ele := range back.List { - idx := m.Match(ele.ContractAddress) - if idx == -1 { - m.Log.Info("Filter Log Address Not Match", "id", ele.Id, "address", ele.ContractAddress) - m.Cfg.StartBlock = big.NewInt(ele.Id) - continue - } - if latestBlock-ele.BlockNumber < m.BlockConfirmations.Uint64() { - m.Log.Debug("Block not ready, will retry", "currentBlock", ele.BlockNumber, "latest", latestBlock) - time.Sleep(constant.BalanceRetryInterval) - continue - } - - split := strings.Split(ele.Topic, ",") - topics := make([]common.Hash, 0, len(split)) - for _, sp := range split { - topics = append(topics, common.HexToHash(sp)) - } - log := &types.Log{ - Address: common.HexToAddress(ele.ContractAddress), - Topics: topics, - Data: common.Hex2Bytes(ele.LogData), - BlockNumber: ele.BlockNumber, - TxHash: common.HexToHash(ele.TxHash), - TxIndex: ele.TxIndex, - BlockHash: common.HexToHash(ele.BlockHash), - Index: ele.LogIndex, - } - send, err := log2Msg(m, log, idx) - if err != nil { - return 0, err - } - count += send - m.Cfg.StartBlock = big.NewInt(ele.Id) - } - - return count, nil -} - -func log2Msg(m *Messenger, log *types.Log, idx int) (int, error) { - orderId := log.Topics[1] - method := m.GetMethod(log.Topics[0]) - blockNumber := big.NewInt(0).SetUint64(log.BlockNumber) - header, err := m.Conn.Client().EthLatestHeaderByNumber(m.Cfg.Endpoint, blockNumber) - if err != nil { - return 0, err - } - // when syncToMap we need to assemble a tx proof - txsHash, err := mapprotocol.GetTxsByBn(m.Conn.Client(), blockNumber) - if err != nil { - return 0, fmt.Errorf("unable to get tx hashes Logs: %w", err) - } - receipts, err := tx.GetReceiptsByTxsHash(m.Conn.Client(), txsHash) - if err != nil { - return 0, fmt.Errorf("unable to get receipts hashes Logs: %w", err) - } - - proofType, err := chain.PreSendTx(idx, uint64(m.Cfg.Id), uint64(m.Cfg.MapChainID), big.NewInt(0).SetUint64(log.BlockNumber), orderId.Bytes()) - if errors.Is(err, chain.OrderExist) { - m.Log.Info("This txHash order exist", "txHash", log.TxHash) - return 0, nil - } - if errors.Is(err, chain.NotVerifyAble) { - m.Log.Info("CurrentBlock not verify", "txHash", log.TxHash) - return 0, err - } - if err != nil { - return 0, err - } - var sign [][]byte - if proofType == constant.ProofTypeOfNewOracle || proofType == constant.ProofTypeOfLogOracle { - ret, err := chain.Signer(m.Conn.Client(), uint64(m.Cfg.Id), uint64(m.Cfg.MapChainID), log, proofType) - if err != nil { - return 0, err - } - if !ret.CanVerify { - return 0, chain.NotVerifyAble - } - sign = ret.Signatures - } - m.Log.Info("Event found", "txHash", log.TxHash, "orderId", orderId, "method", method, "proofType", proofType) - - var orderId32 [32]byte - for i, v := range orderId { - orderId32[i] = v - } - - payload, err := eth2.AssembleProof(*eth2.ConvertHeader(header), log, receipts, method, m.Cfg.Id, proofType, sign, orderId32) - if err != nil { - return 0, fmt.Errorf("unable to Parse Log: %w", err) - } - - msgPayload := []interface{}{payload, orderId32, log.BlockNumber, log.TxHash} - message := msg.NewSwapWithProof(m.Cfg.Id, m.Cfg.MapChainID, msgPayload, m.MsgCh) - message.Idx = idx - - err = m.Router.Send(message) - if err != nil { - m.Log.Error("Subscription error: failed to route message", "err", err) - } - return 1, nil -} diff --git a/chains/ethereum/chain.go b/chains/ethereum/chain.go index a6558f91..2d36ac88 100644 --- a/chains/ethereum/chain.go +++ b/chains/ethereum/chain.go @@ -2,338 +2,128 @@ package ethereum import ( "context" - "encoding/json" - "fmt" - "github.com/ChainSafe/log15" + "crypto/ecdsa" + "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" + types2 "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/ethclient" "github.com/ethereum/go-ethereum/rlp" - connection "github.com/mapprotocol/compass/connections/ethereum" - "github.com/mapprotocol/compass/core" - "github.com/mapprotocol/compass/internal/chain" - "github.com/mapprotocol/compass/internal/constant" - "github.com/mapprotocol/compass/internal/mapo" - "github.com/mapprotocol/compass/internal/mapprotocol" - "github.com/mapprotocol/compass/internal/tx" - "github.com/mapprotocol/compass/pkg/abi" - "github.com/mapprotocol/compass/pkg/contract" - "github.com/mapprotocol/compass/pkg/ethclient" - "github.com/mapprotocol/compass/pkg/msg" + abi2 "github.com/mapprotocol/compass/abi" + "github.com/mapprotocol/compass/chain_tools" + "github.com/mapprotocol/compass/chains" + "github.com/mapprotocol/compass/types" + log "github.com/sirupsen/logrus" "math/big" - "strconv" "strings" - "sync" + "time" ) -type Chain struct { +type TypeEther struct { + base chains.ChainImplBase + client *ethclient.Client + address common.Address //if SetTarget is not called ,it's nil + privateKey *ecdsa.PrivateKey //if SetTarget is not called ,it's nil + relayerContractAddress common.Address + headerStoreContractAddress common.Address } -func New() *Chain { - return &Chain{} +func (t *TypeEther) GetClient() *ethclient.Client { + return t.client } -func (c *Chain) New(chainCfg *core.ChainConfig, logger log15.Logger, sysErr chan<- error, - role mapprotocol.Role) (core.Chain, error) { - opts := make([]chain.SyncOpt, 0) - - opts = append(opts, chain.OptOfInitHeight(mapprotocol.HeaderOneCount)) - if strconv.FormatUint(uint64(chainCfg.Id), 10) == mapprotocol.MapId { - opts = append(opts, chain.OptOfSync2Map(c.mapToOther)) - opts = append(opts, chain.OptOfInitHeight(mapprotocol.EpochOfMap)) - } else { - opts = append(opts, chain.OptOfSync2Map(c.headerToMap)) - } - opts = append(opts, chain.OptOfAssembleProof(c.assembleProof)) - opts = append(opts, chain.OptOfOracleHandler(chain.DefaultOracleHandler)) - return chain.New(chainCfg, logger, sysErr, role, connection.NewConnection, opts...) +func (t *TypeEther) GetPrivateKey() *ecdsa.PrivateKey { + return t.privateKey } -func (c *Chain) mapToOther(m *chain.Maintainer, latestBlock *big.Int) error { - if latestBlock.Cmp(big.NewInt(0)) == 0 { - return nil - } - remainder := big.NewInt(0).Mod(latestBlock, big.NewInt(mapprotocol.EpochOfMap)) - if remainder.Cmp(mapprotocol.Big0) != 0 { - return nil - } - m.Log.Info("sync block ", "current", latestBlock) - header, err := m.Conn.Client().MAPHeaderByNumber(context.Background(), latestBlock) - if err != nil { - return err - } +func (t *TypeEther) GetStableBlockBeforeHeader() uint64 { + return t.base.StableBlockBeforeHeader - h := mapprotocol.ConvertHeader(header) - aggPK, ist, aggPKBytes, err := mapprotocol.GetAggPK(m.Conn.Client(), new(big.Int).Sub(header.Number, big.NewInt(1)), header.Extra) - if err != nil { - return err - } - istanbulExtra := mapprotocol.ConvertIstanbulExtra(ist) - input, err := mapprotocol.PackInput(mapprotocol.Map2Other, mapprotocol.MethodUpdateBlockHeader, h, istanbulExtra, aggPK) - if err != nil { - return err - } - m.Log.Debug("sync block ", "current", latestBlock, "data", common.Bytes2Hex(input)) - msgpayload := []interface{}{input} - waitCount := len(m.Cfg.SyncChainIDList) - for _, cid := range m.Cfg.SyncChainIDList { - if v, ok := mapprotocol.SyncOtherMap[cid]; ok && latestBlock.Cmp(v) <= 0 { - waitCount-- - m.Log.Info("map to other current less than synchronized headerHeight", "toChainId", cid, "synced height", v, - "current height", latestBlock) - continue - } - // Query the latest height for comparison - if fn, ok := mapprotocol.Map2OtherHeight[cid]; ok { - height, err := fn() - if err != nil { - return fmt.Errorf("get headerHeight failed, cid(%d),err is %v", cid, err) - } - if latestBlock.Cmp(height) <= 0 { - waitCount-- - m.Log.Info("currentBlock less than latest synchronized headerHeight", "toChainId", cid, "synced height", height, - "current height", latestBlock) - continue - } - } - if name, ok := mapprotocol.OnlineChaId[cid]; ok && strings.ToLower(name) == "near" { - param := map[string]interface{}{ - "header": mapprotocol.ConvertNearNeedHeader(header), - "agg_pk": map[string]interface{}{ - "xr": "0x" + common.Bytes2Hex(aggPKBytes[32:64]), - "xi": "0x" + common.Bytes2Hex(aggPKBytes[:32]), - "yi": "0x" + common.Bytes2Hex(aggPKBytes[64:96]), - "yr": "0x" + common.Bytes2Hex(aggPKBytes[96:128]), - }, - } - data, _ := json.Marshal(param) - msgpayload = []interface{}{data} - } else { - msgpayload = []interface{}{input} - } - message := msg.NewSyncFromMap(m.Cfg.MapChainID, cid, msgpayload, m.MsgCh) - err = m.Router.Send(message) - if err != nil { - m.Log.Error("subscription error: failed to route message", "err", err) - return nil - } - } - - err = m.WaitUntilMsgHandled(waitCount) - if err != nil { - return err - } - return nil } -func (c *Chain) headerToMap(m *chain.Maintainer, latestBlock *big.Int) error { - syncedHeight, err := mapprotocol.Get2MapHeight(m.Cfg.Id) - if err != nil { - m.Log.Error("Get synced Height failed", "err", err) - return err - } - // If the current block is lower than the latest height, it will not be synchronized - if latestBlock.Cmp(syncedHeight) <= 0 { - m.Log.Info("currentBlock less than synchronized headerHeight", "synced height", syncedHeight, - "current height", latestBlock) - return nil - } - m.Log.Info("Sync Header to Map Chain", "current", latestBlock) - header, err := m.Conn.Client().HeaderByNumber(context.Background(), latestBlock) - if err != nil { - return err - } - enc, err := c.rlpEthereumHeaders(m.Cfg.Id, m.Cfg.MapChainID, []types.Header{*header}) - if err != nil { - m.Log.Error("failed to rlp ethereum headers", "err", err) - return err - } - id := big.NewInt(0).SetUint64(uint64(m.Cfg.Id)) - data, err := mapprotocol.PackInput(mapprotocol.LightManger, mapprotocol.MethodUpdateBlockHeader, id, enc) - if err != nil { - m.Log.Error("block2Map Failed to pack abi data", "err", err) - return err - } - msgpayload := []interface{}{id, data} - message := msg.NewSyncToMap(m.Cfg.Id, m.Cfg.MapChainID, msgpayload, m.MsgCh) - - err = m.Router.Send(message) - if err != nil { - m.Log.Error("subscription error: failed to route message", "err", err) - return err - } - - err = m.WaitUntilMsgHandled(1) - if err != nil { - return err - } - return nil +func (t *TypeEther) NumberOfSecondsOfBlockCreationTime() time.Duration { + return t.base.NumberOfSecondsOfBlockCreationTime } -func (c *Chain) assembleProof(m *chain.Messenger, log *types.Log, proofType int64, toChainID uint64, sign [][]byte) (*msg.Message, error) { - var ( - message msg.Message - orderId = log.Topics[1] - method = m.GetMethod(log.Topics[0]) +func (t *TypeEther) Save(from types.ChainId, data *[]byte) { + var abiStaking, _ = abi.JSON(strings.NewReader(abi2.HeaderStoreContractAbi)) + input := chain_tools.PackInput(abiStaking, "save", + big.NewInt(int64(from)), + big.NewInt(int64(t.GetChainId())), + data, ) - var orderId32 [32]byte - for idx, v := range orderId { - orderId32[idx] = v - } - payload, err := c.Proof(m.Conn.Client(), log, "", proofType, uint64(m.Cfg.Id), toChainID, sign) - if err != nil { - return nil, fmt.Errorf("build Proof failed, err: %w", err) - } - if m.Cfg.Id == m.Cfg.MapChainID { - msgPayload := []interface{}{payload, orderId32, log.BlockNumber, log.TxHash, method} - message = msg.NewSwapWithMapProof(m.Cfg.MapChainID, msg.ChainId(toChainID), msgPayload, m.MsgCh) - switch toChainID { - case constant.MerlinChainId: - message = msg.NewSwapWithMerlin(m.Cfg.MapChainID, msg.ChainId(toChainID), msgPayload, m.MsgCh) - case constant.SolTestChainId: - fallthrough - case constant.SolMainChainId: - msgPayload = []interface{}{log, sign, method} - message = msg.NewSolProof(m.Cfg.MapChainID, msg.ChainId(toChainID), msgPayload, m.MsgCh) - case constant.TonChainId: - payloads := []interface{}{log} - message = msg.NewSwapWithMapProof(m.Cfg.MapChainID, msg.ChainId(toChainID), payloads, m.MsgCh) - } - } else if m.Cfg.SyncToMap { - msgPayload := []interface{}{payload, orderId32, log.BlockNumber, log.TxHash} - message = msg.NewSwapWithProof(m.Cfg.Id, m.Cfg.MapChainID, msgPayload, m.MsgCh) + tx := chain_tools.SendContractTransactionWithoutOutputUnlessError(t.client, t.address, t.headerStoreContractAddress, nil, t.GetPrivateKey(), input) + if tx == nil { + log.Infoln("Save failed") + return } - return &message, nil + log.Infoln("Save tx hash :", tx.Hash().String()) + chain_tools.WaitingForEndPending(t.client, tx.Hash(), 50) } -func (c *Chain) rlpEthereumHeaders(source, destination msg.ChainId, headers []types.Header) ([]byte, error) { - h, err := rlp.EncodeToBytes(&headers) - if err != nil { - return nil, fmt.Errorf("rpl encode ethereum headers error: %v", err) - } - - params := struct { - From *big.Int - To *big.Int - Headers []byte - }{ - From: big.NewInt(int64(source)), - To: big.NewInt(int64(destination)), - Headers: h, - } +func NewEthChain(name string, chainId types.ChainId, seconds int, rpcUrl string, stableBlockBeforeHeader uint64, + relayerContractAddressStr string, headerStoreContractAddressStr string) *TypeEther { + ret := TypeEther{ + base: chains.ChainImplBase{ + Name: name, + ChainId: chainId, + NumberOfSecondsOfBlockCreationTime: time.Duration(seconds) * time.Second, + RpcUrl: rpcUrl, + StableBlockBeforeHeader: stableBlockBeforeHeader, + }, + client: chain_tools.GetClientByUrl(rpcUrl), + relayerContractAddress: common.HexToAddress(relayerContractAddressStr), + headerStoreContractAddress: common.HexToAddress(headerStoreContractAddressStr), + } + return &ret +} - enc, err := rlp.EncodeToBytes(params) - if err != nil { - return nil, fmt.Errorf("rpl encode params error: %v", err) - } - return enc, nil +func (t *TypeEther) GetAddress() string { + return t.address.String() } -func (c *Chain) Connect(id, endpoint, mcs, lightNode, oracleNode string) (*ethclient.Client, error) { - conn := connection.NewConnection(endpoint, true, nil, nil, big.NewInt(chain.DefaultGasLimit), - big.NewInt(chain.DefaultGasPrice), chain.DefaultGasMultiplier) - err := conn.Connect() - if err != nil { - return nil, err +func (t *TypeEther) SetTarget(keystoreStr string, password string) { + if t.relayerContractAddress.String() == "0x0000000000000000000000000000000000000000" || + t.headerStoreContractAddress.String() == "0x0000000000000000000000000000000000000000" { + log.Fatal(t.GetName(), " cannot be target, relayer_contract_address and header_store_contract_address are required for target.") } + key, _ := chain_tools.LoadPrivateKey(keystoreStr, password) + t.privateKey = key.PrivateKey + t.address = crypto.PubkeyToAddress(key.PrivateKey.PublicKey) - fn := sync.OnceFunc(func() { - idInt, _ := strconv.ParseUint(id, 10, 64) - oracleAbi, _ := abi.New(mapprotocol.OracleAbiJson) - call := contract.New(conn, []common.Address{common.HexToAddress(mcs)}, oracleAbi) - mapprotocol.ContractMapping[msg.ChainId(idInt)] = call - - oAbi, _ := abi.New(mapprotocol.SignerJson) - oracleCall := contract.New(conn, []common.Address{common.HexToAddress(oracleNode)}, oAbi) - mapprotocol.SingMapping[msg.ChainId(idInt)] = oracleCall - - if idInt == constant.MapChainId { - mapprotocol.GlobalMapConn = conn.Client() - mapprotocol.InitOtherChain2MapHeight(common.HexToAddress(lightNode)) - } else { - fn := mapprotocol.Map2EthHeight(constant.ZeroAddress.Hex(), common.HexToAddress(lightNode), conn.Client()) - mapprotocol.Map2OtherHeight[msg.ChainId(idInt)] = fn - } - }) - fn() - - return conn.Client(), nil } -func (c *Chain) Proof(client *ethclient.Client, log *types.Log, endpoint string, proofType int64, selfId, - toChainID uint64, sign [][]byte) ([]byte, error) { - var ( - orderId = log.Topics[1] - method = chain.GetMethod(log.Topics[0]) - bigNumber = big.NewInt(int64(log.BlockNumber)) - ) - txsHash, err := mapprotocol.GetTxsByBn(client, bigNumber) - if err != nil { - return nil, fmt.Errorf("unable to get tx hashes Logs: %w", err) - } - receipts, err := tx.GetReceiptsByTxsHash(client, txsHash) - if err != nil { - return nil, fmt.Errorf("unable to get receipts hashes Logs: %w", err) - } - header, err := client.MAPHeaderByNumber(context.Background(), bigNumber) - if err != nil { - return nil, fmt.Errorf("unable to query header Logs: %w", err) - } +func (t *TypeEther) GetName() string { + return t.base.Name +} - var orderId32 [32]byte - for idx, v := range orderId { - orderId32[idx] = v - } - var ret []byte - if selfId == constant.MapChainId { - remainder := big.NewInt(0).Mod(bigNumber, big.NewInt(mapprotocol.EpochOfMap)) - if remainder.Cmp(mapprotocol.Big0) == 0 { - lr, err := mapprotocol.GetLastReceipt(client, bigNumber) - if err != nil { - return nil, fmt.Errorf("unable to get last receipts in epoch last %w", err) - } - receipts = append(receipts, lr) - } +func (t *TypeEther) GetRpcUrl() string { + return t.base.RpcUrl +} - _, ret, err = mapo.AssembleMapProof(client, log, receipts, header, constant.MapChainId, method, "", proofType, sign, orderId32) - if err != nil { - return nil, fmt.Errorf("unable to Parse Log: %w", err) - } - } else { - ret, err = mapo.AssembleEthProof(client, log, receipts, header, method, msg.ChainId(selfId), proofType, sign, orderId32) - if err != nil { - return nil, fmt.Errorf("unable to Parse Log: %w", err) - } +func (t *TypeEther) GetChainId() types.ChainId { + return t.base.ChainId +} +func (t *TypeEther) GetBlockNumber() uint64 { + num, err := t.client.BlockNumber(context.Background()) + if err == nil { + return num } - - return ret, nil + return 0 } -func (c *Chain) Maintainer(client *ethclient.Client, selfId, toChainId uint64, srcEndpoint string) ([]byte, error) { - ret := make([]byte, 0) - if selfId == constant.MapChainId { - syncedHeight, err := mapprotocol.Map2OtherHeight[msg.ChainId(toChainId)]() - if err != nil { - return nil, err - } - syncHeight := syncedHeight.Int64() + mapprotocol.EpochOfMap - header, err := client.MAPHeaderByNumber(context.Background(), big.NewInt(syncHeight)) - if err != nil { - return nil, err - } - - h := mapprotocol.ConvertHeader(header) - aggPK, ist, _, err := mapprotocol.GetAggPK(client, new(big.Int).Sub(header.Number, big.NewInt(1)), header.Extra) +func (t *TypeEther) GetBlockHeader(num uint64, limit uint64) (*[]byte, error) { + var arr = make([]types2.Header, 0) + var i uint64 + for i = 0; i < limit; i++ { + block, err := t.client.BlockByNumber(context.Background(), big.NewInt(int64(num+i))) if err != nil { - return nil, err + return &[]byte{}, err } - istanbulExtra := mapprotocol.ConvertIstanbulExtra(ist) - ret, err = mapprotocol.PackInput(mapprotocol.Map2Other, mapprotocol.MethodUpdateBlockHeader, h, istanbulExtra, aggPK) - if err != nil { - return nil, err - } - } else { - + arr = append(arr, *block.Header()) } - return ret, nil + + data, _ := rlp.EncodeToBytes(arr) + return &data, nil } diff --git a/chains/ethereum/contract_call.go b/chains/ethereum/contract_call.go new file mode 100644 index 00000000..a86c37d9 --- /dev/null +++ b/chains/ethereum/contract_call.go @@ -0,0 +1,88 @@ +package ethereum + +import ( + "github.com/ethereum/go-ethereum/accounts/abi" + abi2 "github.com/mapprotocol/compass/abi" + "github.com/mapprotocol/compass/chain_tools" + "github.com/mapprotocol/compass/types" + log "github.com/sirupsen/logrus" + "math/big" + "strings" +) + +func (t *TypeEther) Register(value *big.Int) bool { + var abiStaking, _ = abi.JSON(strings.NewReader(abi2.RelayerContractAbi)) + input := chain_tools.PackInput(abiStaking, "register", value) + tx := chain_tools.SendContractTransactionWithoutOutputUnlessError(t.client, t.address, t.relayerContractAddress, nil, t.GetPrivateKey(), input) + if tx == nil { + return false + } + return chain_tools.WaitingForEndPending(t.client, tx.Hash(), 30) +} + +func (t *TypeEther) UnRegister(value *big.Int) bool { + var abiStaking, _ = abi.JSON(strings.NewReader(abi2.RelayerContractAbi)) + input := chain_tools.PackInput(abiStaking, "unregister", &value) + tx := chain_tools.SendContractTransactionWithoutOutputUnlessError(t.client, t.address, t.relayerContractAddress, nil, t.GetPrivateKey(), input) + if tx == nil { + return false + } + return chain_tools.WaitingForEndPending(t.client, tx.Hash(), 30) +} + +func (t *TypeEther) Withdraw(value *big.Int) bool { + var abiStaking, _ = abi.JSON(strings.NewReader(abi2.RelayerContractAbi)) + input := chain_tools.PackInput(abiStaking, "withdraw", &value) + tx := chain_tools.SendContractTransactionWithoutOutputUnlessError(t.client, t.address, t.relayerContractAddress, nil, t.GetPrivateKey(), input) + if tx == nil { + return false + } + return chain_tools.WaitingForEndPending(t.client, tx.Hash(), 30) +} + +func (t *TypeEther) GetRelayerBalance() types.GetRelayerBalanceResponse { + var abiStaking, _ = abi.JSON(strings.NewReader(abi2.RelayerContractAbi)) + input := chain_tools.PackInput(abiStaking, "getRelayerBalance", t.address) + ret, _ := chain_tools.CallContractReturnBool(t.client, t.address, t.relayerContractAddress, input) + var res types.GetRelayerBalanceResponse + if len(ret) == 0 { + return res + } + err := abiStaking.UnpackIntoInterface(&res, "getRelayerBalance", ret) + if err != nil { + log.Warnln("abi error", err) + return res + } + return res +} +func (t *TypeEther) GetRelayer() types.GetRelayerResponse { + var abiStaking, _ = abi.JSON(strings.NewReader(abi2.RelayerContractAbi)) + input := chain_tools.PackInput(abiStaking, "getRelayer", t.address) + ret, _ := chain_tools.CallContractReturnBool(t.client, t.address, t.relayerContractAddress, input) + var res types.GetRelayerResponse + if len(ret) == 0 { + return res + } + err := abiStaking.UnpackIntoInterface(&res, "getRelayer", ret) + if err != nil { + log.Warnln("abi error", err) + return res + } + return res +} +func (t *TypeEther) GetPeriodHeight() types.GetPeriodHeightResponse { + var abiStaking, _ = abi.JSON(strings.NewReader(abi2.RelayerContractAbi)) + input := chain_tools.PackInput(abiStaking, "getPeriodHeight", t.address) + ret, _ := chain_tools.CallContractReturnBool(t.client, t.address, t.relayerContractAddress, input) + + var res types.GetPeriodHeightResponse + if len(ret) == 0 { + return res + } + err := abiStaking.UnpackIntoInterface(&res, "getPeriodHeight", ret) + if err != nil { + log.Warnln("abi error", err) + return res + } + return res +} diff --git a/chains/interface.go b/chains/interface.go new file mode 100644 index 00000000..97f89ed7 --- /dev/null +++ b/chains/interface.go @@ -0,0 +1,41 @@ +package chains + +import ( + "crypto/ecdsa" + "github.com/ethereum/go-ethereum/ethclient" + "github.com/mapprotocol/compass/types" + "math/big" + "time" +) + +type ChainInterface interface { + GetName() string + GetClient() *ethclient.Client + GetChainId() types.ChainId + GetBlockNumber() uint64 + GetRpcUrl() string + GetBlockHeader(num uint64, limit uint64) (*[]byte, error) + GetAddress() string + SetTarget(keystoreStr string, password string) + GetPrivateKey() *ecdsa.PrivateKey + Save(from types.ChainId, Cdata *[]byte) + NumberOfSecondsOfBlockCreationTime() time.Duration + GetStableBlockBeforeHeader() uint64 + ContractInterface +} +type ChainImplBase struct { + Name string + ChainId types.ChainId + RpcUrl string + NumberOfSecondsOfBlockCreationTime time.Duration + StableBlockBeforeHeader uint64 +} +type ContractInterface interface { + Register(value *big.Int) bool + UnRegister(value *big.Int) bool + GetRelayerBalance() types.GetRelayerBalanceResponse + GetRelayer() types.GetRelayerResponse + GetPeriodHeight() types.GetPeriodHeightResponse +} + +// relayContractAddressStr is empty,it cannot be target, diff --git a/chains/interfaces.go b/chains/interfaces.go deleted file mode 100644 index 2520a564..00000000 --- a/chains/interfaces.go +++ /dev/null @@ -1,71 +0,0 @@ -package chains - -import ( - "github.com/ChainSafe/log15" - "github.com/ethereum/go-ethereum/core/types" - "github.com/mapprotocol/compass/chains/bsc" - "github.com/mapprotocol/compass/chains/btc" - "github.com/mapprotocol/compass/chains/conflux" - "github.com/mapprotocol/compass/chains/eth2" - "github.com/mapprotocol/compass/chains/ethereum" - "github.com/mapprotocol/compass/chains/klaytn" - "github.com/mapprotocol/compass/chains/matic" - "github.com/mapprotocol/compass/chains/near" - "github.com/mapprotocol/compass/chains/sol" - "github.com/mapprotocol/compass/chains/ton" - "github.com/mapprotocol/compass/chains/tron" - "github.com/mapprotocol/compass/core" - "github.com/mapprotocol/compass/internal/constant" - "github.com/mapprotocol/compass/internal/mapprotocol" - "github.com/mapprotocol/compass/pkg/ethclient" -) - -var ( - chainMap = map[string]Chainer{ - constant.Bsc: bsc.New(), - constant.Matic: matic.New(), - constant.Conflux: conflux.New(), - constant.Eth2: eth2.New(), - constant.Ethereum: ethereum.New(), - constant.Klaytn: klaytn.New(), - constant.Near: near.New(), - constant.Solana: sol.New(), - constant.Ton: ton.New(), - constant.Tron: tron.New(), - constant.Btc: btc.New(), - } - proofMap = map[string]Proffer{ - constant.Bsc: bsc.New(), - constant.Matic: matic.New(), - constant.Conflux: conflux.New(), - constant.Eth2: eth2.New(), - constant.Ethereum: ethereum.New(), - constant.Klaytn: klaytn.New(), - constant.Tron: tron.New(), - } -) - -func Create(_type string) (Chainer, bool) { - if chain, ok := chainMap[_type]; ok { - return chain, true - } - return nil, false -} - -type Chainer interface { - New(*core.ChainConfig, log15.Logger, chan<- error, mapprotocol.Role) (core.Chain, error) -} - -func CreateProffer(_type string) (Proffer, bool) { - if chain, ok := proofMap[_type]; ok { - return chain, true - } - return nil, false -} - -type Proffer interface { - Connect(id, endpoint, mcs, lightNode, oracleNode string) (*ethclient.Client, error) - Proof(client *ethclient.Client, log *types.Log, endpoint string, proofType int64, selfId, - toChainID uint64, sign [][]byte) ([]byte, error) - Maintainer(client *ethclient.Client, selfId, toChainId uint64, srcEndpoint string) ([]byte, error) -} diff --git a/chains/klaytn/chain.go b/chains/klaytn/chain.go deleted file mode 100644 index ae126b2c..00000000 --- a/chains/klaytn/chain.go +++ /dev/null @@ -1,273 +0,0 @@ -package klaytn - -import ( - "context" - "fmt" - "github.com/mapprotocol/compass/internal/constant" - "github.com/mapprotocol/compass/internal/mapprotocol" - "github.com/mapprotocol/compass/internal/proof" - "github.com/mapprotocol/compass/pkg/msg" - "github.com/pkg/errors" - "math/big" - "strconv" - "strings" - "sync" - "time" - - "github.com/ChainSafe/log15" - ecommon "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/rlp" - "github.com/klaytn/klaytn/common" - connection "github.com/mapprotocol/compass/connections/ethereum" - "github.com/mapprotocol/compass/core" - "github.com/mapprotocol/compass/internal/chain" - "github.com/mapprotocol/compass/internal/klaytn" - "github.com/mapprotocol/compass/internal/tx" - "github.com/mapprotocol/compass/pkg/abi" - "github.com/mapprotocol/compass/pkg/contract" - "github.com/mapprotocol/compass/pkg/ethclient" -) - -var ( - kClient = &klaytn.Client{} -) - -type Chain struct { -} - -func New() *Chain { - return &Chain{} -} - -func (c *Chain) connectKClient(endpoint string) error { - kc, err := klaytn.DialHttp(endpoint, true) - if err != nil { - return err - } - kClient = kc - return nil -} - -func (c *Chain) New(chainCfg *core.ChainConfig, logger log15.Logger, sysErr chan<- error, role mapprotocol.Role) (core.Chain, error) { - err := c.connectKClient(chainCfg.Endpoint) - if err != nil { - return nil, err - } - - return chain.New(chainCfg, logger, sysErr, role, connection.NewConnection, - chain.OptOfSync2Map(c.syncHeaderToMap), - chain.OptOfAssembleProof(c.assembleProof), - chain.OptOfOracleHandler(chain.DefaultOracleHandler)) -} - -func (c *Chain) syncHeaderToMap(m *chain.Maintainer, latestBlock *big.Int) error { - if err := c.syncValidatorHeader(m, latestBlock); err != nil { - return err - } - - if err := c.syncHeader(m, latestBlock); err != nil { - return err - } - - return nil -} - -func (c *Chain) syncValidatorHeader(m *chain.Maintainer, latestBlock *big.Int) error { - kHeader, err := kClient.BlockByNumber(context.Background(), latestBlock) - if err != nil { - return err - } - - if kHeader.VoteData == "0x" { - return nil - } - m.Log.Info("Get voteData", "blockHeight", latestBlock, "voteData", kHeader.VoteData) - data := common.Hex2Bytes(strings.TrimPrefix(kHeader.VoteData, klaytn.PrefixOfHex)) - gVote := new(klaytn.GovernanceVote) - err = rlp.DecodeBytes(data, gVote) - if err != nil { - m.Log.Error("Failed to decode a vote", "number", kHeader.Number, "key", gVote.Key, "value", gVote.Value, "validator", gVote.Validator) - return err - } - - if gVote.Key != "governance.addvalidator" && gVote.Key != "governance.removevalidator" { - return nil - } - - time.Sleep(time.Second) - m.Log.Info("Send Validator Header", "blockHeight", latestBlock) - return c.sendSyncHeader(m, latestBlock, 2) -} - -func (c *Chain) syncHeader(m *chain.Maintainer, latestBlock *big.Int) error { - remainder := big.NewInt(0).Mod(latestBlock, big.NewInt(mapprotocol.EpochOfKlaytn)) - if remainder.Cmp(mapprotocol.Big0) != 0 { - return nil - } - - m.Log.Info("Find sync block", "current height", latestBlock) - syncedHeight, err := mapprotocol.Get2MapHeight(m.Cfg.Id) - if err != nil { - m.Log.Error("Get current synced Height failed", "err", err) - return err - } - if latestBlock.Cmp(syncedHeight) <= 0 { - m.Log.Info("CurrentBlock less than synchronized headerHeight", "synced height", syncedHeight, - "current height", latestBlock) - return nil - } - - return c.sendSyncHeader(m, latestBlock, mapprotocol.HeaderOneCount) -} - -func (c *Chain) sendSyncHeader(m *chain.Maintainer, latestBlock *big.Int, count int) error { - headers, err := c.assembleHeader(m.Conn.Client(), latestBlock, count) - if err != nil { - return err - } - - input, err := mapprotocol.Klaytn.Methods[mapprotocol.MethodOfGetHeadersBytes].Inputs.Pack(headers) - if err != nil { - m.Log.Error("Failed to abi pack", "err", err) - return err - } - - id := big.NewInt(0).SetUint64(uint64(m.Cfg.Id)) - msgpayload := []interface{}{id, input} - message := msg.NewSyncToMap(m.Cfg.Id, m.Cfg.MapChainID, msgpayload, m.MsgCh) - - err = m.Router.Send(message) - if err != nil { - m.Log.Error("Subscription error: failed to route message", "err", err) - return err - } - - err = m.WaitUntilMsgHandled(1) - if err != nil { - return err - } - return nil -} - -func (c *Chain) assembleHeader(client *ethclient.Client, latestBlock *big.Int, count int) ([]klaytn.Header, error) { - headers := make([]klaytn.Header, count) - for i := 0; i < count; i++ { - headerHeight := new(big.Int).Add(latestBlock, new(big.Int).SetInt64(int64(i))) - header, err := client.HeaderByNumber(context.Background(), headerHeight) - if err != nil { - return nil, err - } - hKheader, err := kClient.BlockByNumber(context.Background(), headerHeight) - if err != nil { - return nil, err - } - - headers[count-count+i] = klaytn.ConvertContractHeader(header, hKheader) - } - - return headers, nil -} - -func (c *Chain) assembleProof(m *chain.Messenger, log *types.Log, proofType int64, toChainID uint64, sign [][]byte) (*msg.Message, error) { - var ( - message msg.Message - orderId = log.Topics[1] - ) - payload, err := c.Proof(m.Conn.Client(), log, "", proofType, uint64(m.Cfg.Id), toChainID, sign) - if err != nil { - return nil, fmt.Errorf("unable to Parse Log: %w", err) - } - - var orderId32 [32]byte - for idx, v := range orderId { - orderId32[idx] = v - } - - msgPayload := []interface{}{payload, orderId32, log.BlockNumber, log.TxHash} - message = msg.NewSwapWithProof(m.Cfg.Id, m.Cfg.MapChainID, msgPayload, m.MsgCh) - return &message, nil -} - -func (c *Chain) Connect(id, endpoint, mcs, lightNode, oracleNode string) (*ethclient.Client, error) { - conn := connection.NewConnection(endpoint, true, nil, nil, big.NewInt(chain.DefaultGasLimit), - big.NewInt(chain.DefaultGasPrice), chain.DefaultGasMultiplier) - err := conn.Connect() - if err != nil { - return nil, err - } - - fn := sync.OnceFunc(func() { - err = c.connectKClient(endpoint) - - idInt, _ := strconv.ParseUint(id, 10, 64) - oracleAbi, _ := abi.New(mapprotocol.OracleAbiJson) - call := contract.New(conn, []ecommon.Address{ecommon.HexToAddress(mcs)}, oracleAbi) - mapprotocol.ContractMapping[msg.ChainId(idInt)] = call - - oAbi, _ := abi.New(mapprotocol.SignerJson) - oracleCall := contract.New(conn, []ecommon.Address{ecommon.HexToAddress(oracleNode)}, oAbi) - mapprotocol.SingMapping[msg.ChainId(idInt)] = oracleCall - - fn := mapprotocol.Map2EthHeight(constant.ZeroAddress.Hex(), ecommon.HexToAddress(lightNode), conn.Client()) - mapprotocol.Map2OtherHeight[msg.ChainId(idInt)] = fn - }) - fn() - if err != nil { - return nil, err - } - - return conn.Client(), nil -} - -func (c *Chain) Proof(client *ethclient.Client, log *types.Log, endpoint string, proofType int64, selfId, - toChainID uint64, sign [][]byte) ([]byte, error) { - var ( - orderId = log.Topics[1] - receipts []*types.Receipt - method = chain.GetMethod(log.Topics[0]) - bigNumber = big.NewInt(int64(log.BlockNumber)) - key = strconv.FormatUint(selfId, 10) + "_" + strconv.FormatUint(log.BlockNumber, 10) - ) - - txsHash, err := klaytn.GetTxsHashByBlockNumber(kClient, bigNumber) - if err != nil { - return nil, fmt.Errorf("unable to get tx hashes Logs: %w", err) - } - if v, ok := proof.CacheReceipt.Get(key); ok { - receipts = v.([]*types.Receipt) - } else { - receipts, err = tx.GetReceiptsByTxsHash(client, txsHash) - if err != nil { - return nil, fmt.Errorf("unable to get receipts hashes Logs: %w", err) - } - proof.CacheReceipt.Add(key, receipts) - } - - // get block - header, err := client.HeaderByNumber(context.Background(), bigNumber) - if err != nil { - return nil, err - } - kHeader, err := kClient.BlockByNumber(context.Background(), bigNumber) - if err != nil { - return nil, err - } - - var orderId32 [32]byte - for idx, v := range orderId { - orderId32[idx] = v - } - - ret, err := klaytn.AssembleProof(kClient, klaytn.ConvertContractHeader(header, kHeader), - log, msg.ChainId(selfId), receipts, method, proofType, orderId32, sign) - if err != nil { - return nil, fmt.Errorf("unable to Parse Log: %w", err) - } - - return ret, nil -} - -func (c *Chain) Maintainer(client *ethclient.Client, selfId, toChainId uint64, srcEndpoint string) ([]byte, error) { - return nil, errors.New("klaytn not support maintainer") -} diff --git a/chains/matic/chain.go b/chains/matic/chain.go deleted file mode 100644 index f19ef083..00000000 --- a/chains/matic/chain.go +++ /dev/null @@ -1,231 +0,0 @@ -package matic - -import ( - "context" - "fmt" - "github.com/ChainSafe/log15" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - connection "github.com/mapprotocol/compass/connections/ethereum" - "github.com/mapprotocol/compass/core" - "github.com/mapprotocol/compass/internal/chain" - "github.com/mapprotocol/compass/internal/constant" - "github.com/mapprotocol/compass/internal/mapprotocol" - "github.com/mapprotocol/compass/internal/matic" - "github.com/mapprotocol/compass/internal/proof" - "github.com/mapprotocol/compass/internal/tx" - "github.com/mapprotocol/compass/pkg/abi" - "github.com/mapprotocol/compass/pkg/contract" - "github.com/mapprotocol/compass/pkg/ethclient" - "github.com/mapprotocol/compass/pkg/msg" - "github.com/pkg/errors" - "math/big" - "strconv" - "sync" -) - -type Chain struct { -} - -func New() *Chain { - return &Chain{} -} - -func (c *Chain) New(chainCfg *core.ChainConfig, logger log15.Logger, sysErr chan<- error, role mapprotocol.Role) (core.Chain, error) { - return chain.New(chainCfg, logger, sysErr, role, connection.NewConnection, - chain.OptOfSync2Map(c.syncHeaderToMap), - chain.OptOfInitHeight(12), - chain.OptOfOracleHandler(chain.DefaultOracleHandler), - chain.OptOfAssembleProof(c.assembleProof), - ) -} - -func (c *Chain) syncHeaderToMap(m *chain.Maintainer, latestBlock *big.Int) error { - remainder := big.NewInt(0).Mod(new(big.Int).Sub(latestBlock, mapprotocol.ConfirmsOfMatic), big.NewInt(mapprotocol.HeaderCountOfMatic)) - if remainder.Cmp(mapprotocol.Big0) != 0 { - return nil - } - syncedHeight, err := mapprotocol.Get2MapHeight(m.Cfg.Id) - if err != nil { - m.Log.Error("Get current synced Height failed", "err", err) - return err - } - if latestBlock.Cmp(syncedHeight) <= 0 { - m.Log.Info("CurrentBlock less than synchronized headerHeight", "synced height", syncedHeight, - "current height", latestBlock) - return nil - } - - m.Log.Info("Find sync block", "current height", latestBlock) - startBlock := new(big.Int).Sub(latestBlock, new(big.Int).SetInt64(mapprotocol.ConfirmsOfMatic.Int64()+1)) - headers := make([]*types.Header, mapprotocol.ConfirmsOfMatic.Int64()) - for i := 0; i < int(mapprotocol.ConfirmsOfMatic.Int64()); i++ { - headerHeight := new(big.Int).Add(startBlock, new(big.Int).SetInt64(int64(i))) - header, err := m.Conn.Client().HeaderByNumber(context.Background(), headerHeight) - if err != nil { - return err - } - headers[i] = header - } - - mHeaders := make([]matic.BlockHeader, 0, len(headers)) - for _, h := range headers { - mHeaders = append(mHeaders, matic.ConvertHeader(h)) - } - - input, err := mapprotocol.Matic.Methods[mapprotocol.MethodOfGetHeadersBytes].Inputs.Pack(mHeaders) - if err != nil { - m.Log.Error("Failed to abi pack", "err", err) - return err - } - - id := big.NewInt(0).SetUint64(uint64(m.Cfg.Id)) - msgpayload := []interface{}{id, input} - message := msg.NewSyncToMap(m.Cfg.Id, m.Cfg.MapChainID, msgpayload, m.MsgCh) - - err = m.Router.Send(message) - if err != nil { - m.Log.Error("Subscription error: failed to route message", "err", err) - return err - } - - err = m.WaitUntilMsgHandled(1) - if err != nil { - return err - } - return nil -} - -func (c *Chain) assembleProof(m *chain.Messenger, log *types.Log, proofType int64, toChainID uint64, sign [][]byte) (*msg.Message, error) { - var ( - message msg.Message - orderId = log.Topics[1] - ) - var orderId32 [32]byte - for idx, v := range orderId { - orderId32[idx] = v - } - payload, err := c.Proof(m.Conn.Client(), log, "", proofType, uint64(m.Cfg.Id), toChainID, sign) - if err != nil { - return nil, fmt.Errorf("unable to Parse Log: %w", err) - } - - msgPayload := []interface{}{payload, orderId32, log.BlockNumber, log.TxHash} - message = msg.NewSwapWithProof(m.Cfg.Id, m.Cfg.MapChainID, msgPayload, m.MsgCh) - return &message, nil -} - -func (c *Chain) Connect(id, endpoint, mcs, lightNode, oracleNode string) (*ethclient.Client, error) { - conn := connection.NewConnection(endpoint, true, nil, nil, big.NewInt(chain.DefaultGasLimit), - big.NewInt(chain.DefaultGasPrice), chain.DefaultGasMultiplier) - err := conn.Connect() - if err != nil { - return nil, err - } - - fn := sync.OnceFunc(func() { - idInt, _ := strconv.ParseUint(id, 10, 64) - oracleAbi, _ := abi.New(mapprotocol.OracleAbiJson) - call := contract.New(conn, []common.Address{common.HexToAddress(mcs)}, oracleAbi) - mapprotocol.ContractMapping[msg.ChainId(idInt)] = call - - oAbi, _ := abi.New(mapprotocol.SignerJson) - oracleCall := contract.New(conn, []common.Address{common.HexToAddress(oracleNode)}, oAbi) - mapprotocol.SingMapping[msg.ChainId(idInt)] = oracleCall - - fn := mapprotocol.Map2EthHeight(constant.ZeroAddress.Hex(), common.HexToAddress(lightNode), conn.Client()) - mapprotocol.Map2OtherHeight[msg.ChainId(idInt)] = fn - }) - fn() - - return conn.Client(), nil -} - -func (c *Chain) Proof(client *ethclient.Client, log *types.Log, endpoint string, proofType int64, selfId, - toChainID uint64, sign [][]byte) ([]byte, error) { - var ( - orderId = log.Topics[1] - method = chain.GetMethod(log.Topics[0]) - bigNumber = big.NewInt(int64(log.BlockNumber)) - ) - txsHash, err := tx.GetTxsHashByBlockNumber(client, bigNumber) - if err != nil { - return nil, fmt.Errorf("unable to get tx hashes Logs: %w", err) - } - var receipts []*types.Receipt - key := strconv.FormatUint(selfId, 10) + "_" + bigNumber.String() - if v, ok := proof.CacheReceipt.Get(key); ok { - receipts = v.([]*types.Receipt) - } else { - tmp, err := tx.GetMaticReceiptsByTxsHash(client, txsHash) - if err != nil { - return nil, fmt.Errorf("unable to get receipts hashes Logs: %w", err) - } - for _, t := range tmp { - if t == nil { - continue - } - receipts = append(receipts, t) - } - proof.CacheReceipt.Add(key, receipts) - } - - var orderId32 [32]byte - for idx, v := range orderId { - orderId32[idx] = v - } - headers := make([]*types.Header, mapprotocol.ConfirmsOfMatic.Int64()) - for i := 0; i < int(mapprotocol.ConfirmsOfMatic.Int64()); i++ { - headerHeight := new(big.Int).Add(bigNumber, new(big.Int).SetInt64(int64(i))) - tmp, err := client.HeaderByNumber(context.Background(), headerHeight) - if err != nil { - return nil, fmt.Errorf("getHeader failed, err is %v", err) - } - headers[i] = tmp - } - - mHeaders := make([]matic.BlockHeader, 0, len(headers)) - for _, h := range headers { - mHeaders = append(mHeaders, matic.ConvertHeader(h)) - } - - payload, err := matic.AssembleProof(mHeaders, log, msg.ChainId(selfId), receipts, method, proofType, orderId32) - if err != nil { - return nil, fmt.Errorf("unable to Parse Log: %w", err) - } - - return payload, nil -} - -func (c *Chain) Maintainer(client *ethclient.Client, selfId, toChainId uint64, srcEndpoint string) ([]byte, error) { - syncedHeight, err := mapprotocol.Get2MapHeight(msg.ChainId(selfId)) - if err != nil { - return nil, errors.Wrap(err, "unable to get synced height") - } - startBlock := big.NewInt(syncedHeight.Int64() + mapprotocol.HeaderCountOfMatic) - headers := make([]*types.Header, mapprotocol.ConfirmsOfMatic.Int64()) - for i := 0; i < int(mapprotocol.ConfirmsOfMatic.Int64()); i++ { - headerHeight := new(big.Int).Add(startBlock, new(big.Int).SetInt64(int64(i))) - header, err := client.HeaderByNumber(context.Background(), headerHeight) - if err != nil { - return nil, err - } - headers[i] = header - } - - mHeaders := make([]matic.BlockHeader, 0, len(headers)) - for _, h := range headers { - mHeaders = append(mHeaders, matic.ConvertHeader(h)) - } - - input, err := mapprotocol.Matic.Methods[mapprotocol.MethodOfGetHeadersBytes].Inputs.Pack(mHeaders) - if err != nil { - return nil, err - } - - ret, err := mapprotocol.PackInput(mapprotocol.LightManger, mapprotocol.MethodUpdateBlockHeader, big.NewInt(0).SetUint64(selfId), input) - if err != nil { - return nil, err - } - return ret, nil -} diff --git a/chains/near/chain.go b/chains/near/chain.go deleted file mode 100644 index b0a2ced4..00000000 --- a/chains/near/chain.go +++ /dev/null @@ -1,171 +0,0 @@ -package near - -import ( - "github.com/mapprotocol/compass/internal/mapprotocol" - "github.com/mapprotocol/compass/pkg/keystore" - "github.com/mapprotocol/compass/pkg/msg" - "github.com/mapprotocol/compass/pkg/redis" - "math/big" - - "github.com/pkg/errors" - - "github.com/ChainSafe/log15" - "github.com/mapprotocol/atlas/accounts/abi/bind" - connection "github.com/mapprotocol/compass/connections/near" - "github.com/mapprotocol/compass/core" - "github.com/mapprotocol/compass/pkg/blockstore" - nearclient "github.com/mapprotocol/near-api-go/pkg/client" - "github.com/mapprotocol/near-api-go/pkg/types/key" -) - -type Connection interface { - Connect() error - Keypair() *key.KeyPair - Opts() *bind.TransactOpts - CallOpts() *bind.CallOpts - LockAndUpdateOpts(bool) error - UnlockOpts() - Client() *nearclient.Client - EnsureHasBytecode(address string) error - LatestBlock() (*big.Int, error) - WaitForBlock(block *big.Int, delay *big.Int) error - Close() -} - -type Chain struct { - cfg *core.ChainConfig // The config of the chain - conn Connection // The chains connection - writer *writer // The writer of the chain - stop chan<- int - listen core.Listener // The listener of this chain -} - -func New() *Chain { - return &Chain{} -} - -func setupBlockstore(cfg *Config, kp *key.KeyPair, role mapprotocol.Role) (*blockstore.Blockstore, error) { - bs, err := blockstore.NewBlockstore(cfg.BlockstorePath, cfg.Id, kp.PublicKey.ToPublicKey().Hash(), role) - if err != nil { - return nil, err - } - - if !cfg.FreshStart { - latestBlock, err := bs.TryLoadLatestBlock() - if err != nil { - return nil, err - } - - if latestBlock.Cmp(cfg.StartBlock) == 1 { - cfg.StartBlock = latestBlock - } - } - - return bs, nil -} - -func (c *Chain) New(chainCfg *core.ChainConfig, logger log15.Logger, sysErr chan<- error, - role mapprotocol.Role) (core.Chain, error) { - cfg, err := parseChainConfig(chainCfg) - if err != nil { - return nil, err - } - - kp, err := keystore.NearKeyPairFrom(chainCfg.Network, cfg.KeystorePath, cfg.From) - if err != nil { - return nil, err - } - - bs, err := setupBlockstore(cfg, &kp, role) - if err != nil { - return nil, err - } - - stop := make(chan int) - conn := connection.NewConnection(cfg.Endpoint, cfg.Http, &kp, logger, cfg.GasLimit, cfg.MaxGasPrice, big.NewFloat(cfg.GasMultiplier)) - err = conn.Connect() - if err != nil { - return nil, err - } - - if chainCfg.LatestBlock { - curr, err := conn.LatestBlock() - if err != nil { - return nil, err - } - cfg.StartBlock = curr - } - - // simplified a little bit - var listen core.Listener - cs := NewCommonListen(conn, cfg, logger, stop, sysErr, bs) - if role == mapprotocol.RoleOfMessenger { - redis.Init(cfg.redisUrl) - listen = NewMessenger(cs) - } else if role == mapprotocol.RoleOfMaintainer { - fn := mapprotocol.Map2NearHeight(cfg.lightNode, conn.Client()) - height, err := fn() - if err != nil { - return nil, errors.Wrap(err, "near get init headerHeight failed") - } - logger.Info("Map2Near Current situation", "height", height, "lightNode", cfg.lightNode) - mapprotocol.SyncOtherMap[cfg.Id] = height - mapprotocol.Map2OtherHeight[cfg.Id] = fn - listen = NewMaintainer(cs) - } - writer := NewWriter(conn, cfg, logger, stop, sysErr) - - return &Chain{ - cfg: chainCfg, - conn: conn, - writer: writer, - stop: stop, - listen: listen, - }, nil -} - -func (c *Chain) SetRouter(r core.Router) { - r.Listen(c.cfg.Id, c.writer) - c.listen.SetRouter(r) -} - -func (c *Chain) Start() error { - err := c.listen.Sync() - if err != nil { - return err - } - - err = c.writer.start() - if err != nil { - return err - } - - c.writer.log.Debug("Successfully started chain") - return nil -} - -func (c *Chain) Id() msg.ChainId { - return c.cfg.Id -} - -func (c *Chain) Name() string { - return c.cfg.Name -} - -// Stop signals to any running routines to exit -func (c *Chain) Stop() { - close(c.stop) - if c.conn != nil { - c.conn.Close() - } -} - -// EthClient return EthClient for global map connection -func (c *Chain) EthClient() *nearclient.Client { - return c.conn.Client() -} - -// Conn return Connection interface for relayer register -func (c *Chain) Conn() core.Connection { - return nil -} diff --git a/chains/near/common_listen.go b/chains/near/common_listen.go deleted file mode 100644 index 9144266b..00000000 --- a/chains/near/common_listen.go +++ /dev/null @@ -1,63 +0,0 @@ -package near - -import ( - "github.com/mapprotocol/compass/core" - "math/big" - "time" - - metrics "github.com/ChainSafe/chainbridge-utils/metrics/types" - "github.com/ChainSafe/log15" - "github.com/mapprotocol/compass/pkg/blockstore" -) - -var ( - RetryInterval = time.Second * 5 - RetryLimit = 5 -) - -type CommonListen struct { - cfg Config - conn Connection - log log15.Logger - router core.Router - stop <-chan int - msgCh chan struct{} - sysErr chan<- error // Reports fatal error to core - latestBlock metrics.LatestBlock - blockConfirmations *big.Int - blockStore blockstore.Blockstorer -} - -// NewCommonListen creates and returns a listener -func NewCommonListen(conn Connection, cfg *Config, log log15.Logger, stop <-chan int, sysErr chan<- error, - bs blockstore.Blockstorer) *CommonListen { - return &CommonListen{ - cfg: *cfg, - conn: conn, - log: log, - stop: stop, - sysErr: sysErr, - latestBlock: metrics.LatestBlock{LastUpdated: time.Now()}, - blockConfirmations: cfg.BlockConfirmations, - msgCh: make(chan struct{}), - blockStore: bs, - } -} - -func (c *CommonListen) SetRouter(r core.Router) { - c.router = r -} - -func (c *CommonListen) GetLatestBlock() metrics.LatestBlock { - return c.latestBlock -} - -// waitUntilMsgHandled this function will block untill message is handled -func (c *CommonListen) waitUntilMsgHandled(counter int) error { - c.log.Debug("waitUntilMsgHandled", "counter", counter) - for counter > 0 { - <-c.msgCh - counter -= 1 - } - return nil -} diff --git a/chains/near/config.go b/chains/near/config.go deleted file mode 100644 index 7391151e..00000000 --- a/chains/near/config.go +++ /dev/null @@ -1,56 +0,0 @@ -package near - -import ( - "fmt" - "strings" - - "github.com/mapprotocol/compass/internal/chain" - - "github.com/mapprotocol/compass/core" -) - -type Config struct { - chain.Config - lightNode, redisUrl string - events, mcsContract []string -} - -// parseChainConfig uses a core.ChainConfig to construct a corresponding Config -func parseChainConfig(chainCfg *core.ChainConfig) (*Config, error) { - cfg, err := chain.ParseConfig(chainCfg) - if err != nil { - return nil, err - } - ret := Config{ - Config: *cfg, - lightNode: "", - mcsContract: nil, - } - - if v, ok := chainCfg.Opts[chain.Event]; ok && v != "" { - vs := strings.Split(v, "|") - for _, s := range vs { - ret.events = append(ret.events, s) - } - } - - if contract, ok := chainCfg.Opts[chain.McsOpt]; ok && contract != "" { - for _, addr := range strings.Split(contract, ",") { - ret.mcsContract = append(ret.mcsContract, addr) - } - } else { - return nil, fmt.Errorf("must provide opts.mcs field for ethereum config") - } - - if v, ok := chainCfg.Opts[chain.RedisOpt]; ok && v != "" { - ret.redisUrl = v - delete(chainCfg.Opts, chain.RedisOpt) - } - - if v, ok := chainCfg.Opts[chain.LightNode]; ok && v != "" { - ret.lightNode = v - delete(chainCfg.Opts, chain.LightNode) - } - - return &ret, nil -} diff --git a/chains/near/maintainer.go b/chains/near/maintainer.go deleted file mode 100644 index de910080..00000000 --- a/chains/near/maintainer.go +++ /dev/null @@ -1,128 +0,0 @@ -package near - -import ( - "context" - "errors" - "fmt" - "github.com/mapprotocol/compass/internal/mapprotocol" - "github.com/mapprotocol/compass/pkg/msg" - "math/big" - "time" - - "github.com/mapprotocol/compass/internal/constant" - "github.com/mapprotocol/compass/pkg/util" - - "github.com/mapprotocol/compass/internal/near" - "github.com/mapprotocol/near-api-go/pkg/client/block" -) - -var NearEpochSize = big.NewInt(43200) - -type Maintainer struct { - *CommonListen - syncedHeight *big.Int -} - -func NewMaintainer(cs *CommonListen) *Maintainer { - return &Maintainer{ - CommonListen: cs, - } -} - -func (m *Maintainer) Sync() error { - m.log.Debug("Starting listener...") - go func() { - err := m.sync() - if err != nil { - m.log.Error("Polling blocks failed", "err", err) - } - }() - - return nil -} - -// sync function of Maintainer will poll for the latest block and proceed to parse the associated events as it sees new blocks. -// Polling begins at the block defined in `m.cfg.startBlock`. Failed attempts to fetch the latest block or parse -// a block will be retried up to RetryLimit times before continuing to the next block. -func (m Maintainer) sync() error { - for { - select { - case <-m.stop: - return errors.New("polling terminated") - default: - latestBlock, err := m.conn.LatestBlock() - if err != nil { - m.log.Error("Unable to get latest block", "block", latestBlock, "err", err) - time.Sleep(RetryInterval) - continue - } - - if m.cfg.SyncToMap { - // listen when catchup - m.log.Info("Sync Header to Map Chain", "target", latestBlock) - err = m.toMapChain(latestBlock) - if err != nil { - m.log.Error("Failed to listen header for block", "block", latestBlock, "err", err) - time.Sleep(constant.QueryRetryInterval) - util.Alarm(context.Background(), fmt.Sprintf("near sync header failed, err is %s", err.Error())) - continue - } - } - - m.latestBlock.Height = big.NewInt(0).Set(latestBlock) - m.latestBlock.LastUpdated = time.Now() - } - } -} - -// toMapChain listen header from current chain to Map chain -func (m *Maintainer) toMapChain(latestBlock *big.Int) error { - height, err := mapprotocol.Get2MapHeight(m.cfg.Id) - if err != nil { - return err - } - if latestBlock.Cmp(height) == -1 { - return nil - } - - blocks := new(big.Int).Sub(latestBlock, height) - gap := new(big.Int).Sub(NearEpochSize, blocks).Int64() - if gap > 0 { - m.log.Info("wait for the next light client block to be generated", "target", new(big.Int).Add(height, NearEpochSize).Uint64()) - time.Sleep(time.Duration(gap/10) * time.Second) - return nil - } - - count := new(big.Int).Div(blocks, NearEpochSize).Uint64() - number := height.Uint64() - id := big.NewInt(0).SetUint64(uint64(m.cfg.Id)) - for i := uint64(0); i < count; i++ { - blockDetails, err := m.conn.Client().BlockDetails(context.Background(), block.BlockID(number)) - if err != nil { - m.log.Error("failed to get block", "err", err, "number", number) - return err - } - m.log.Info("get block complete", "number", number, "hash", blockDetails.Header.Hash) - - lightBlock, err := m.conn.Client().NextLightClientBlock(context.Background(), blockDetails.Header.Hash) - if err != nil { - m.log.Error("failed to get next light client block", "err", err, "number", lightBlock.InnerLite.Height, "hash", lightBlock.NextBlockInnerHash) - return err - } - m.log.Info("get next light client block complete", "number", lightBlock.InnerLite.Height, "hash", lightBlock.NextBlockInnerHash) - - number = lightBlock.InnerLite.Height - - message := msg.NewSyncToMap(m.cfg.Id, m.cfg.MapChainID, []interface{}{id, near.Borshify(lightBlock)}, m.msgCh) - err = m.router.Send(message) - if err != nil { - m.log.Error("subscription error: failed to route message", "err", err) - return nil - } - err = m.waitUntilMsgHandled(1) - if err != nil { - return err - } - } - return nil -} diff --git a/chains/near/messenger.go b/chains/near/messenger.go deleted file mode 100644 index a4b56317..00000000 --- a/chains/near/messenger.go +++ /dev/null @@ -1,290 +0,0 @@ -package near - -import ( - "context" - "encoding/json" - "fmt" - "github.com/mapprotocol/compass/internal/mapprotocol" - "github.com/mapprotocol/compass/pkg/msg" - "math/big" - "strings" - "time" - - "github.com/ethereum/go-ethereum/common" - "github.com/mapprotocol/compass/internal/constant" - "github.com/mapprotocol/compass/pkg/util" - - rds "github.com/go-redis/redis/v8" - "github.com/mapprotocol/compass/internal/near" - "github.com/mapprotocol/compass/pkg/redis" - "github.com/mapprotocol/near-api-go/pkg/client" - nearclient "github.com/mapprotocol/near-api-go/pkg/client" - "github.com/mapprotocol/near-api-go/pkg/client/block" - "github.com/pkg/errors" -) - -type Messenger struct { - *CommonListen -} - -func NewMessenger(cs *CommonListen) *Messenger { - return &Messenger{ - CommonListen: cs, - } -} - -func (m *Messenger) Sync() error { - m.log.Debug("Starting listener...") - go func() { - err := m.sync() - if err != nil { - m.log.Error("Polling blocks failed", "err", err) - } - }() - go func() { - m.watchDog() - }() - - return nil -} - -func (m *Messenger) sync() error { - var currentBlock = m.cfg.StartBlock - - for { - select { - case <-m.stop: - return errors.New("polling terminated") - default: - latestBlock, err := m.conn.LatestBlock() - if err != nil { - m.log.Error("Unable to get latest block", "err", err) - time.Sleep(constant.QueryRetryInterval) - continue - } - - if big.NewInt(0).Sub(latestBlock, currentBlock).Cmp(m.blockConfirmations) == -1 { - m.log.Debug("Block not ready, will retry", "target", currentBlock, "latest", latestBlock) - time.Sleep(constant.BlockRetryInterval) - continue - } - - count, err := m.getEventsForBlock(currentBlock) - if err != nil { - m.log.Error("Failed to get events for block", "block", currentBlock, "err", err) - time.Sleep(RetryInterval) - util.Alarm(context.Background(), fmt.Sprintf("near mos failed, err is %s", err.Error())) - continue - } - - // hold until all messages are handled - _ = m.waitUntilMsgHandled(count) - - // Write to block store. Not a critical operation, no need to retry - err = m.blockStore.StoreBlock(currentBlock) - if err != nil { - m.log.Error("Failed to write latest block to blockstore", "block", currentBlock, "err", err) - } - m.latestBlock.LastUpdated = time.Now() - - currentBlock.Add(currentBlock, big.NewInt(1)) - } - } -} - -func (m *Messenger) watchDog() { - record := "" - for { - time.Sleep(time.Minute * 3) - ctx := context.Background() - cmd := redis.GetClient().Get(ctx, redis.BlockHeight) - result, err := cmd.Result() - if err != nil && !errors.Is(err, rds.Nil) { - continue - } - m.log.Info("Near watchdog scan report", "current", result, "record", record) - if record != result { - record = result - continue - } - if record == result { - util.Alarm(context.Background(), fmt.Sprintf("near scan no change in one minute, please admin handler, now=%s", result)) - } - } -} - -func (m *Messenger) getEventsForBlock(latestBlock *big.Int) (int, error) { - if !m.cfg.SyncToMap { - return 0, nil - } - // querying for logs - ctx := context.Background() - cmd := redis.GetClient().RPop(ctx, redis.ListKey) - result, err := cmd.Result() - if err != nil && !errors.Is(err, rds.Nil) { - return 0, errors.Wrap(err, "rPop failed") - } - - if err != nil && errors.Is(err, rds.Nil) { - return 0, nil - } - - data := mapprotocol.StreamerMessage{} - err = json.Unmarshal([]byte(result), &data) - if err != nil { - return 0, errors.Wrap(err, "json marshal failed") - } - target := make([]mapprotocol.IndexerExecutionOutcomeWithReceipt, 0) - for _, shard := range data.Shards { - for _, outcome := range shard.ReceiptExecutionOutcomes { - if m.Idx(outcome.ExecutionOutcome.Outcome.ExecutorID) == -1 { - continue - } - if len(outcome.ExecutionOutcome.Outcome.Logs) == 0 { - continue - } - match := false - for _, ls := range outcome.ExecutionOutcome.Outcome.Logs { - if !match { - match = m.match(ls) - } - } - if match { - m.log.Info("Event found", "log", outcome.ExecutionOutcome.Outcome.Logs, "contract", outcome.ExecutionOutcome.Outcome.ExecutorID) - target = append(target, outcome) - } else { - m.log.Info("Event Not Match", "log", outcome.ExecutionOutcome.Outcome.Logs) - } - } - } - - if len(target) == 0 { - return 0, nil - } - - ret, err := m.makeMessage(target) - if err != nil { - m.log.Error("make message failed", "err", err) - cmd := redis.GetClient().RPush(context.Background(), redis.ListKey, result) - _, err = cmd.Result() - if err != nil { - m.log.Error("make message failed, retry insert failed", "err", err) - } - time.Sleep(constant.TxRetryInterval) - } - - return ret, nil -} - -func (m *Messenger) match(log string) bool { - for _, e := range m.cfg.events { - if strings.HasPrefix(log, e) { - return true - } - } - - return false -} - -func (m *Messenger) Idx(contract string) int { - ret := -1 - for idx, addr := range m.cfg.mcsContract { - if addr == contract { - ret = idx - break - } - } - - return ret -} - -func (m *Messenger) makeMessage(target []mapprotocol.IndexerExecutionOutcomeWithReceipt) (int, error) { - ret := 0 - for _, tg := range target { - m.log.Debug("makeMessage receive one message", "tg", tg) - time.Sleep(time.Second * 3) - var ( - err error - retryCount = 0 - blk client.LightClientBlockView - proof client.RpcLightClientExecutionProofResponse - ) - for { - retryCount++ - if retryCount == RetryLimit { - return 0, errors.New("make message, retries exceeded") - } - blk, err = m.conn.Client().NextLightClientBlock(context.Background(), tg.ExecutionOutcome.BlockHash) - if err != nil { - m.log.Warn("get nextLightClientBlock failed, will retry", "err", err) - time.Sleep(RetryInterval) - continue - } - - clientHead, err := m.conn.Client().BlockDetails(context.Background(), block.BlockID(blk.InnerLite.Height)) - if err != nil { - m.log.Warn("get blockDetails failed, will retry", "err", err) - time.Sleep(RetryInterval) - continue - } - - proof, err = m.conn.Client().LightClientProof(context.Background(), nearclient.Receipt{ - ReceiptID: tg.ExecutionOutcome.ID, - ReceiverID: tg.Receipt.ReceiverID, - LightClientHead: clientHead.Header.Hash, - }) - if err != nil { - m.log.Warn("get lightClientProof failed, will retry", "err", err) - time.Sleep(RetryInterval) - continue - } - if len(proof.BlockProof) <= 0 { - time.Sleep(RetryInterval) - continue - } - break - } - - blkBytes := near.Borshify(blk) - proofBytes, err := near.BorshifyOutcomeProof(proof) - if err != nil { - return 0, errors.Wrap(err, "borshifyOutcomeProof failed") - } - - all, err := mapprotocol.Near.Methods[mapprotocol.MethodOfGetBytes].Inputs.Pack(blkBytes, proofBytes) - if err != nil { - return 0, errors.Wrap(err, "getBytes pack failed") - } - - // get fromChainId and toChainId - logs := strings.SplitN(tg.ExecutionOutcome.Outcome.Logs[0], ":", 2) - out := near.TransferOut{} - err = json.Unmarshal([]byte(logs[1]), &out) - if err != nil { - return 0, errors.Wrap(err, "logs format failed") - } - - method := mapprotocol.MethodOfTransferIn - if strings.HasPrefix(tg.ExecutionOutcome.Outcome.Logs[1], mapprotocol.NearOfDepositIn) { - method = mapprotocol.MethodOfDepositIn - } else if strings.HasPrefix(tg.ExecutionOutcome.Outcome.Logs[1], mapprotocol.NearOfSwapIn) { - method = mapprotocol.MethodOfSwapIn - } - input, err := mapprotocol.Mcs.Pack(method, new(big.Int).SetUint64(uint64(m.cfg.Id)), all) - if err != nil { - return 0, errors.Wrap(err, "transferIn pack failed") - } - - ids := common.HexToHash(out.OrderId) - orderId := make([]byte, 0, len(ids)) - for _, id := range ids { - orderId = append(orderId, id) - } - msgPayload := []interface{}{input, orderId, 0, tg.ExecutionOutcome.Outcome.ReceiptIDs} - message := msg.NewSwapWithProof(m.cfg.Id, m.cfg.MapChainID, msgPayload, m.msgCh) - message.Idx = m.Idx(tg.ExecutionOutcome.Outcome.ExecutorID) - err = m.router.Send(message) - ret++ - } - return ret, nil -} diff --git a/chains/near/write.go b/chains/near/write.go deleted file mode 100644 index 7dcb458c..00000000 --- a/chains/near/write.go +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2021 Compass Systems -// SPDX-License-Identifier: LGPL-3.0-only - -package near - -import ( - "github.com/ChainSafe/log15" - "github.com/mapprotocol/compass/core" - "github.com/mapprotocol/compass/pkg/msg" -) - -var _ core.Writer = &writer{} - -type writer struct { - cfg Config - conn Connection - log log15.Logger - stop <-chan int - sysErr chan<- error // Reports fatal error to core -} - -// NewWriter creates and returns writer -func NewWriter(conn Connection, cfg *Config, log log15.Logger, stop <-chan int, sysErr chan<- error) *writer { - return &writer{ - cfg: *cfg, - conn: conn, - log: log, - stop: stop, - sysErr: sysErr, - } -} - -func (w *writer) start() error { - w.log.Debug("Starting ethereum writer...") - return nil -} - -// ResolveMessage handles any given message based on type -// A bool is returned to indicate failure/success, this should be ignored except for within tests. -func (w *writer) ResolveMessage(m msg.Message) bool { - w.log.Info("Near Attempting to resolve message", "type", m.Type, "src", m.Source, "dst", m.Destination) - - switch m.Type { - case msg.SyncFromMap: - return w.exeSyncMapMsg(m) - case msg.SwapWithMapProof: - return w.exeSwapMsg(m) - default: - w.log.Error("Unknown message type received", "type", m.Type) - return false - } -} diff --git a/chains/near/write_method.go b/chains/near/write_method.go deleted file mode 100644 index 9cf2ad06..00000000 --- a/chains/near/write_method.go +++ /dev/null @@ -1,328 +0,0 @@ -package near - -import ( - "context" - "encoding/base64" - "encoding/json" - "fmt" - "github.com/mapprotocol/compass/internal/mapprotocol" - "github.com/mapprotocol/compass/pkg/msg" - "strconv" - "strings" - "time" - - "github.com/mapprotocol/compass/pkg/util" - - "github.com/ethereum/go-ethereum/common" - "github.com/mapprotocol/compass/internal/constant" - "github.com/mapprotocol/near-api-go/pkg/client/block" - - "github.com/mapprotocol/compass/internal/near" - "github.com/mapprotocol/near-api-go/pkg/client" - "github.com/mapprotocol/near-api-go/pkg/types" - "github.com/mapprotocol/near-api-go/pkg/types/action" - "github.com/mapprotocol/near-api-go/pkg/types/hash" -) - -const ( - MethodOfUpdateBlockHeader = "update_block_header" - MethodOfTransferIn = "transfer_in" - MethodOfSwapIn = "swap_in" - MethodOfVerifyReceiptProof = "verify_receipt_proof" -) - -var ( - OrderIdIsUsed = "the event with order id" - OrderIdIsUsedFlag2 = "is used" - VerifyRangeMatch = "cannot get epoch record for block" - VerifyRangeMatchFlag2 = "expected range" -) - -var ignoreError = map[string]struct{}{ - "invalid to address": {}, - "invalid to chain token address": {}, - "transfer in token failed, maybe TO account does not exist": {}, - "amount should be greater than 0": {}, - "near is not mcs token or fungible token or native token": {}, - "index exceeds event size": {}, - "not map swap out event": {}, - "unexpected map mcs address": {}, - "unexpected to chain": {}, - "invalid target token address:": {}, - "amount in should be == 0": {}, - "min amount out should be greater than 0": {}, - "invalid swap param path": {}, - "invalid path format:": {}, - "invalid account id in path:": {}, - "bridge in token should be equal to the first token in": {}, - "last token out should be equal to wrapped token if target token is zero address": {}, - "target token should be equal to the last token out": {}, - "bridge in token should be equal to wrapped token if target token is zero address": {}, - "bridge in token should be equal to target token": {}, - "is not bridgeable token": {}, - "the transfer in event is already processed": {}, - "is not mcs token or fungible token or native token": {}, - "the swap in event is already processe": {}, - "promise has too many results": {}, - "used amount != amount in && used amount != 0, please check core state!": {}, - "[SWAP FAILURE] call core to do swap in failed, maybe mos doesn't have enough token": {}, - "[FAILURE] mint or transfer token to core failed": {}, -} - -// exeSyncMapMsg executes sync msg, and send tx to the destination blockchain -func (w *writer) exeSyncMapMsg(m msg.Message) bool { - var errorCount int64 - for { - select { - case <-w.stop: - return false - default: - err := w.conn.LockAndUpdateOpts(false) - if err != nil { - w.log.Error("Failed to update nonce", "err", err) - return false - } - - txHash, err := w.sendTx(w.cfg.lightNode, MethodOfUpdateBlockHeader, m.Payload[0].([]byte)) - w.conn.UnlockOpts() - if err == nil { - // message successfully handled - w.log.Info("Sync MapHeader to Near tx execution", "tx", txHash.String(), "src", m.Source, "dst", m.Destination) - m.DoneCh <- struct{}{} - return true - } else if strings.Index(err.Error(), "block header height is incorrect") != -1 { - w.log.Error("The header may have been synchronized,Continue to execute the next header") - m.DoneCh <- struct{}{} - return true - } else { - w.log.Warn("Execution failed will retry", "err", err) - } - errorCount++ - if errorCount >= 10 { - util.Alarm(context.Background(), fmt.Sprintf("map2Near updateHeader failed, err is %s", err.Error())) - errorCount = 0 - } - time.Sleep(constant.TxRetryInterval) - } - } -} - -// exeSwapMsg executes swap msg, and send tx to the destination blockchain -func (w *writer) exeSwapMsg(m msg.Message) bool { - var errorCount int64 - var inputHash interface{} - if len(m.Payload) > 3 { - inputHash = m.Payload[3] - } - data := m.Payload[0].([]byte) - addr := w.cfg.mcsContract[m.Idx] - - for { - // First request whether the orderId already exists - orderId32 := m.Payload[1].([32]byte) - orderId := make([]byte, 0) - for _, ele := range orderId32 { - orderId = append(orderId, ele) - } - exits, err := w.checkOrderId(addr, orderId) - if err != nil { - w.log.Error("check orderId exist failed ", "err", err, "orderId", common.Bytes2Hex(orderId)) - } - if exits { - w.log.Info("Mcs orderId has been processed, Skip this request", "orderId", common.Bytes2Hex(orderId)) - m.DoneCh <- struct{}{} - return true - } - - md := make(map[string]interface{}, 0) - _ = json.Unmarshal(data, &md) - verify, err := json.Marshal(map[string]interface{}{ - "receipt_proof": md["receipt_proof"], - }) - if err != nil { - w.log.Error("Verify Execution failed, Will retry", "srcHash", inputHash, "err", err) - return false - } - txHash, err := w.sendTx(addr, MethodOfVerifyReceiptProof, verify) - if err == nil { - w.log.Info("Verify Success", "mcsTx", txHash.String(), "srcHash", inputHash, "addr", addr) - time.Sleep(time.Second) - break - } else { - for e := range ignoreError { - if strings.Index(err.Error(), e) != -1 { - w.log.Info("Ignore This Error, Continue to the next", "method", MethodOfVerifyReceiptProof, "srcHash", inputHash, "err", err) - m.DoneCh <- struct{}{} - return true - } - } - w.log.Warn("Verify Execution failed, Will retry", "srcHash", inputHash, "err", err) - errorCount++ - if errorCount >= 3 { - if strings.Index(err.Error(), "unexpected end of JSON input") == -1 { - util.Alarm(context.Background(), fmt.Sprintf("map2Near mos(verify_receipt_proof) failed, srcHash=%v err is %s", inputHash, err.Error())) - } - errorCount = 0 - } - time.Sleep(constant.BalanceRetryInterval) - } - } - - errorCount = 0 - for { - select { - case <-w.stop: - return false - default: - method := MethodOfTransferIn - if m.Payload[4].(string) == mapprotocol.MethodOfSwapIn { - method = MethodOfSwapIn - } - w.log.Info("Send transaction", "srcHash", inputHash, "method", method, "addr", addr) - txHash, err := w.sendTx(addr, method, data) - if err == nil { - w.log.Info("Submitted cross tx execution", "mcsTx", txHash.String(), "srcHash", inputHash) - m.DoneCh <- struct{}{} - return true - } else if strings.Index(err.Error(), OrderIdIsUsed) != -1 && strings.Index(err.Error(), OrderIdIsUsedFlag2) != -1 { - w.log.Info("Order id is used, Continue to the next", "srcHash", inputHash, "err", err) - m.DoneCh <- struct{}{} - return true - } else if strings.Index(err.Error(), VerifyRangeMatch) != -1 && strings.Index(err.Error(), VerifyRangeMatchFlag2) != -1 { - abandon := w.resolveVerifyRangeError(m.Payload[2].(uint64), err) - w.log.Error("The block where the transaction is located is no longer verifiable", "srcHash", inputHash, "abandon", abandon, "err", err) - if abandon { - m.DoneCh <- struct{}{} - return true - } - } else if w.cfg.SkipError { - w.log.Warn("Execution failed, ignore this error, Continue to the next ", "srcHash", inputHash, "err", err) - m.DoneCh <- struct{}{} - return true - } else { - for e := range ignoreError { - if strings.Index(err.Error(), e) != -1 { - w.log.Info("Ignore This Error, Continue to the next", "method", method, "srcHash", inputHash, "err", err) - m.DoneCh <- struct{}{} - return true - } - } - w.log.Warn("Execution failed, tx may already be complete", "srcHash", inputHash, "err", err) - errorCount++ - if errorCount >= 3 { - if strings.Index(err.Error(), "unexpected end of JSON input") == -1 { - util.Alarm(context.Background(), fmt.Sprintf("map2Near mos(%s) failed, srcHash=%v err is %s", method, inputHash, err.Error())) - } - errorCount = 0 - } - } - time.Sleep(constant.BalanceRetryInterval) - } - } -} - -// sendTx send tx to an address with value and input data -func (w *writer) sendTx(toAddress string, method string, input []byte) (hash.CryptoHash, error) { - w.log.Info("sendTx", "toAddress", toAddress) - ctx := client.ContextWithKeyPair(context.Background(), *w.conn.Keypair()) - b := types.Balance{} - if method == MethodOfTransferIn || method == MethodOfSwapIn || method == MethodOfVerifyReceiptProof { - b, _ = types.BalanceFromString(near.Deposit) - } - res, err := w.conn.Client().TransactionSendAwait( - ctx, - w.cfg.From, - toAddress, - []action.Action{ - action.NewFunctionCall(method, input, near.NewFunctionCallGas, b), - }, - client.WithLatestBlock(), - client.WithKeyPair(*w.conn.Keypair()), - ) - if err != nil { - return hash.CryptoHash{}, fmt.Errorf("failed to do txn: %w", err) - } - w.log.Debug("sendTx success", "res", res) - if len(res.Status.Failure) != 0 { - return hash.CryptoHash{}, fmt.Errorf("%s", string(res.Status.Failure)) - } - return res.Transaction.Hash, nil -} - -func (w *writer) checkOrderId(toAddress string, input []byte) (bool, error) { - var fixedOrderId [32]byte - for idx, v := range input { - fixedOrderId[idx] = v - } - m := map[string]interface{}{ - "order_id": fixedOrderId, - } - data, err := json.Marshal(m) - if err != nil { - return false, err - } - ctx := client.ContextWithKeyPair(context.Background(), *w.conn.Keypair()) - res, err := w.conn.Client().ContractViewCallFunction(ctx, toAddress, mapprotocol.MethodOfIsUsedEvent, - base64.StdEncoding.EncodeToString(data), block.FinalityFinal()) - if err != nil { - return false, fmt.Errorf("checkOrderId ContractViewCallFunction failed: %w", err) - } - var exist bool - err = json.Unmarshal(res.Result, &exist) - if err != nil { - return false, err - } - return exist, nil -} - -func (w *writer) resolveVerifyRangeError(currentHeight uint64, par error) (isAbandon bool) { - var entityError Error - err := json.Unmarshal([]byte(par.Error()), &entityError) - if err != nil { - w.log.Warn("near mcs back err is not appoint json format", "err", par) - return - } - leftIdx := strings.Index(entityError.ActionError.Kind.FunctionCallError.ExecutionError, "[") - rightIdx := strings.Index(entityError.ActionError.Kind.FunctionCallError.ExecutionError, "]") - rangeStr := entityError.ActionError.Kind.FunctionCallError.ExecutionError[leftIdx:rightIdx] - verifyRange := strings.Split(strings.TrimSpace(rangeStr), ",") - if len(verifyRange) != 2 { - w.log.Warn("near mcs back err is not appoint json format", "err", par) - return - } - left, err := strconv.ParseInt(strings.TrimSpace(verifyRange[0]), 10, 64) - if err != nil { - w.log.Warn("left range resolve failed", "str", verifyRange[0], "err", par) - return - } - right, err := strconv.ParseInt(strings.TrimSpace(verifyRange[1]), 10, 64) - if err != nil { - w.log.Warn("right range resolve failed", "str", verifyRange[1], "err", par) - return - } - if currentHeight < uint64(left) { - isAbandon = true - return - } - if currentHeight > uint64(right) { - time.Sleep(time.Minute * 2) - } - return -} - -type Error struct { - ActionError ActionError `json:"ActionError"` -} - -type ActionError struct { - Index int `json:"index"` - Kind Kind `json:"kind"` -} - -type Kind struct { - FunctionCallError FunctionCallError `json:"FunctionCallError"` -} - -type FunctionCallError struct { - ExecutionError string `json:"ExecutionError"` -} diff --git a/chains/near/write_method_test.go b/chains/near/write_method_test.go deleted file mode 100644 index c0c385bb..00000000 --- a/chains/near/write_method_test.go +++ /dev/null @@ -1,193 +0,0 @@ -package near - -import ( - "context" - "encoding/json" - "fmt" - "github.com/mapprotocol/compass/internal/mapprotocol" - "github.com/mapprotocol/compass/pkg/keystore" - "math/big" - "testing" - - "github.com/mapprotocol/near-api-go/pkg/client" - nearclient "github.com/mapprotocol/near-api-go/pkg/client" - "github.com/mapprotocol/near-api-go/pkg/client/block" - "github.com/mapprotocol/near-api-go/pkg/types" - "github.com/mapprotocol/near-api-go/pkg/types/action" -) - -var ( - from = "xm.test.near" - to = "atlas.test.near" - endPoint = "http://127.0.0.1:3030" -) - -func dailRpc() *nearclient.Client { - client, err := nearclient.NewClient(endPoint) - if err != nil { - panic(err) - } - return &client -} - -func Test_writer_sendTx(t *testing.T) { - kp, err := keystore.NearKeyPairFrom("local", "/Users/xm", from) - if err != nil { - t.Fatalf("keypair err %v", err) - } - - ctx := client.ContextWithKeyPair(context.Background(), kp) - s := `{ - "agg_pk": { - "xi": "0x08ccd7feb39031341784777bf41ddcbac670e60ee2b466e159e18af9d0b0f565", - "xr": "0x1e703741166519a7e278c11a8dc96ef9535dec8f4b0ab2b503f2b4d507198afc", - "yi": "0x0667f9dad6aafa5745043addf652ea155885c7b7e88dca296b6e2cc96c475098", - "yr": "0x21a73b10c7523524cbc37d791c730ce12b5fe7c1031da4d899bffad808b7b305" - }, - "header": { - "baseFee": "0x174876e800", - "bloom": "0x10040000000000000000000000000000000000000000000000000000081020010000000080800000000000000000000000000000000008800000000004000000100000200000000000000008000000000000000000800000000000000000000000008000020000000000000100000800000000000a00000000000010000008000000000000000000000000000000000000000000000000000000200000000000000000000000000080002000000080020000000000800000000000000000000000000002000002000000000100000000000080000000010000000000000020000400000000000000000000000000000000004000000000004000000000000000", - "coinbase": "0x7A3a26123DBD9CFeFc1725fe7779580B987251Cb", - "extra": "0xd7820304846765746888676f312e31352e36856c696e75780000000000000000f8d3c0c0c080b841ec94af426b69d37aa5b3da5015b6920b9dd21021c7d3867c3fe6df1dd07530b3239ac9ad4055971426ae6415bb9fd0b953dcb0e506e45856fcc0debc31c7336901f84407b8401e961ced90d2132b36e9dee49427eff38f46d359dba22c86da66caa064990ab62dc6c3dcaca9fd593f01deba3a81627ca0671c1694241ba35db1e69f894de97f80f8440fb84011a759c98d54d7ed6b3333839f7d88ab5690e2be79b1e06b292cae5baa2f3baf03007c6a2617efc13079d62a86582beb2fdb13069a4586b3ae22da8efe689f9080", - "gasLimit": "0x7a1200", - "gasUsed": "0x0", - "minDigest": "0x0000000000000000000000000000000000000000000000000000000000000000", - "nonce": "0x0000000000000000", - "number": "0x7d0", - "parentHash": "0x9887e5ccdf1e53f2857ecc31426280a38182617c0e72c91853872dd12f71fc83", - "receiptHash": "0x0c26c8fa37c6951b3f012347cfcc98f44068e027035a50571e0ae53ed2068b78", - "root": "0xba396db6fffc6209c941330b925e3b8fa6a1a63c9dca393ac4ae1b2d5504480b", - "time": "0x62a2f7e8", - "txHash": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" - } - }` - - res, err := dailRpc().TransactionSendAwait( - ctx, - from, - endPoint, - []action.Action{ - action.NewFunctionCall(MethodOfUpdateBlockHeader, []byte(s), types.DefaultFunctionCallGas, types.Balance{}), - }, - client.WithLatestBlock(), - client.WithKeyPair(kp), - ) - - if err != nil { - t.Errorf("failed to do txn: %s", err) - } - t.Logf("sendTx success %v", res) -} - -func Test_new(t *testing.T) { - kp, err := keystore.NearKeyPairFrom("local", "/Users/xm", from) - if err != nil { - t.Fatalf("keypair err %v", err) - } - - ctx := client.ContextWithKeyPair(context.Background(), kp) - s := `{ - "threshold": 3, - "epoch": 1, - "epoch_size": 1000, - "validators": [ - { - "address": "0xb4e1bc0856f70a55764fd6b3f8dd27f2162108e9", - "weight": 1, - "g1_pub_key": { - "x": "0x13524ec450b9ac611fb332a25b6c2eb436d13ac8a540f69a50d6ff8d4fe9f249", - "y": "0x2b7d0f6e80e80e9b5f9c7a9fa2d482c2e8ea6c1657057c5548b7e30412d48bc3" - }, - "_BLSPublicKey": "0x1446c55bf2cd8f31d31eaa58b081b30cea50b4d8d9096682576688c2f9ae627d27f97e09b64c99b0e49e7c33c864c089ba5c03cf27e04af4ac457edb46d12ce92aa1ca438667203f7d1696549bd861bf6f11cd3cb7d67738222428137ecadac91b68426ad13c8af92a9b8dc62475fbb1617640c635b812733efc9b7d21c8ab49", - "_BLSG1PublicKey": "0x13524ec450b9ac611fb332a25b6c2eb436d13ac8a540f69a50d6ff8d4fe9f2492b7d0f6e80e80e9b5f9c7a9fa2d482c2e8ea6c1657057c5548b7e30412d48bc3", - "_UncompressedBLSPublicKey": "FEbFW/LNjzHTHqpYsIGzDOpQtNjZCWaCV2aIwvmuYn0n+X4JtkyZsOSefDPIZMCJulwDzyfgSvSsRX7bRtEs6SqhykOGZyA/fRaWVJvYYb9vEc08t9Z3OCIkKBN+ytrJG2hCatE8ivkqm43GJHX7sWF2QMY1uBJzPvybfSHIq0k=" - }, - { - "address": "0x7a3a26123dbd9cfefc1725fe7779580b987251cb", - "weight": 1, - "g1_pub_key": { - "x": "0x0e3450c5b583e57d8fe736d276e9e4bb2ce4b38a5e9ac77b1289ba14a5e9cf58", - "y": "0x1ce786f52d5bd0e77c1eacfa3dd5df0e22464888fa4bfab6eff9f29e8f86084b" - }, - "_BLSPublicKey": "0x25f8387695e95f4224919051cfebe64efa2efb4ca8b82bd04cada59edb9e54920a10ea0f9064067049aaf12299592b4746fe4085516fc3f00fbc7dbdd1c545fe126f7bd8d6b5eff857e6fa227c58eea0da0984b80922f5bb33dba1832cf8722f26dc97985df5bf1b4db96f102b905c6982192feecf860ffba2d5eb4db3a64bda", - "_BLSG1PublicKey": "0x0e3450c5b583e57d8fe736d276e9e4bb2ce4b38a5e9ac77b1289ba14a5e9cf581ce786f52d5bd0e77c1eacfa3dd5df0e22464888fa4bfab6eff9f29e8f86084b", - "_UncompressedBLSPublicKey": "Jfg4dpXpX0IkkZBRz+vmTvou+0youCvQTK2lntueVJIKEOoPkGQGcEmq8SKZWStHRv5AhVFvw/APvH290cVF/hJve9jWte/4V+b6InxY7qDaCYS4CSL1uzPboYMs+HIvJtyXmF31vxtNuW8QK5BcaYIZL+7Phg/7otXrTbOmS9o=" - }, - { - "address": "0x7607c9cdd733d8cda0a644839ec2bac5fa180ed4", - "weight": 1, - "g1_pub_key": { - "x": "0x2f6dd4eda4296d9cf85064adbe2507901fcd4ece425cc996827ba4a2c111c812", - "y": "0x1e6fe59e1d18c107d480077debf3ea265a52325725a853a710f7ec3af5e32869" - }, - "_BLSPublicKey": "0x2c87c9887cd5af4e33cf09b0a7c4840f87b53bfe5a21d9e18051228577fb191615bb9e374b2625f11e47737292a8688c9ce1c8533ab8000f495a4cc2e55f5531303a6a1542be1e2b6a0e6f37fe2f3f2d60d39b7516f831cb9a3811e82f2a2f1825467b24b96006ee5f494e7469b5a599ec6ab885df02d0ead0926ca45c4f2a1b", - "_BLSG1PublicKey": "0x2f6dd4eda4296d9cf85064adbe2507901fcd4ece425cc996827ba4a2c111c8121e6fe59e1d18c107d480077debf3ea265a52325725a853a710f7ec3af5e32869", - "_UncompressedBLSPublicKey": "LIfJiHzVr04zzwmwp8SED4e1O/5aIdnhgFEihXf7GRYVu543SyYl8R5Hc3KSqGiMnOHIUzq4AA9JWkzC5V9VMTA6ahVCvh4rag5vN/4vPy1g05t1Fvgxy5o4EegvKi8YJUZ7JLlgBu5fSU50abWlmexquIXfAtDq0JJspFxPKhs=" - }, - { - "address": "0x65b3fee569bf82ff148bdded9c3793fb685f9333", - "weight": 1, - "g1_pub_key": { - "x": "0x05fde1416ab5b30e4b140ad4a29a52cd9bc85ca27bd4662ba842a2e22118bea6", - "y": "0x0dc32694f317d886daac5419b39412a33ee89e07d39d557e4e2b0e48696ac311" - }, - "_BLSPublicKey": "0x138cf64f20414eed4eb6e5b1b0e08b03944d368d2df78461b493c16cee52fca12741fc9a64ca55a6c08987eba75fc1d1e13a64b9e1e6f6a4413acda3b4997adf184ae5b75a5bd807d5d03d698cd0366d443786276749d2831416dd497d3e53170b14f7028a3245c0383e378130ed3c439aff3b29be9195d778c13e462e4a4afa", - "_BLSG1PublicKey": "0x05fde1416ab5b30e4b140ad4a29a52cd9bc85ca27bd4662ba842a2e22118bea60dc32694f317d886daac5419b39412a33ee89e07d39d557e4e2b0e48696ac311", - "_UncompressedBLSPublicKey": "E4z2TyBBTu1OtuWxsOCLA5RNNo0t94RhtJPBbO5S/KEnQfyaZMpVpsCJh+unX8HR4TpkueHm9qRBOs2jtJl63xhK5bdaW9gH1dA9aYzQNm1EN4YnZ0nSgxQW3Ul9PlMXCxT3AooyRcA4PjeBMO08Q5r/Oym+kZXXeME+Ri5KSvo=" - } - ] -}` - data, _ := json.Marshal(s) - res, err := dailRpc().TransactionSendAwait( - ctx, - from, - endPoint, - []action.Action{ - action.NewFunctionCall("new", data, 0, types.Balance{}), - }, - client.WithLatestBlock(), - client.WithKeyPair(kp), - ) - - if err != nil { - t.Errorf("failed to do txn: %s", err) - } - t.Logf("sendTx success %+v", res) -} - -func Test_get_sync_header_height(t *testing.T) { - //args := []byte("{}") - res, err := dailRpc().ContractViewCallFunction(context.Background(), to, "get_header_height", "e30=", block.FinalityFinal()) - if err != nil { - t.Fatalf("pack lightNode headerHeight Input failed, err is %v", err.Error()) - } - - if res.Error != nil { - t.Fatalf("request back resp, exist error, err is %v", res.Error) - } - - result := &Result{} - err = json.Unmarshal(res.Result, result) - if err != nil { - t.Fatalf("json marshal failed, err is %v, data is %v", err.Error(), string(res.Result)) - } - t.Logf("resp is ----------- %v", result.Result) - t.Logf("resp is ----------- %v", string(result.Result)) - height, _ := new(big.Int).SetString(string(result.Result), 10) - t.Logf("---------------- height %v", height) -} - -type Result struct { - BlockHash string `json:"block_hash"` - BlockHeight int `json:"block_height"` - Logs []interface{} `json:"logs"` - Result []byte `json:"result"` -} - -func Test_Json(t *testing.T) { - str := "{\"block\":{\"author\":\"cryptium.poolv1.near\",\"chunks\":[{\"balance_burnt\":\"3673917769667200000000\",\"chunk_hash\":\"3518YUTebvcpTT25pPVDR1AZ7bNazoj66HAfZ3gJqSNN\",\"encoded_length\":7195,\"encoded_merkle_root\":\"2Fs41gBKVAKNAxHq5xYhngL2QHGYgRLF3UyBDNTNniqM\",\"gas_limit\":1000000000000000,\"gas_used\":69125569346482,\"height_created\":92764782,\"height_included\":92764782,\"outcome_root\":\"5CDva6FguHqqRbLA6ZyhDCYCEwv7aQxRntkopdjwtpEp\",\"outgoing_receipts_root\":\"9b9JpF3dVZZFUdC2hbKYQTQPCuDp98aW5pnBRqJsdqcD\",\"prev_block_hash\":\"3eB4b25NLhCE4eSa5UsQNeSZxd1qpG46wDCMBZTuWdhp\",\"prev_state_root\":\"3Evr1EQKgDxcMXzucMDKZAeG6Xggi967dKpvA783dZtP\",\"rent_paid\":\"0\",\"shard_id\":0,\"signature\":\"ed25519:4d591Wh2iqeEyTVdy8ugmCgaAnccTBotpHnoRqmnwa6JxP8fzspu4GzAqSLXBUEZd6QEi9unFnK9p4fc8aV5DyyY\",\"tx_root\":\"GikyZtkzXpiXtLEZAkcqiJrcr2gMZ8VAUiX7Wn4kmZSN\",\"validator_proposals\":[],\"validator_reward\":\"0\"},{\"balance_burnt\":\"830964127214000000000\",\"chunk_hash\":\"HEvcb6D3ccK3uBa2jvPR1cyJKtizmajSetCtfzDTJuX4\",\"encoded_length\":314,\"encoded_merkle_root\":\"HGcw4GhAFX3miVA8Cd3comzt54JeMwS6xsAGmvPRaGvd\",\"gas_limit\":1000000000000000,\"gas_used\":9789559232514,\"height_created\":92764782,\"height_included\":92764782,\"outcome_root\":\"EGNwA73SqFkV2oFR5J5QiPkjqzUx3nBYA2evTTtr1NQV\",\"outgoing_receipts_root\":\"AAUZMgaJxUNLt98ZsjSEhZ7vYu2jQHjujc2HfNT5Bf5R\",\"prev_block_hash\":\"3eB4b25NLhCE4eSa5UsQNeSZxd1qpG46wDCMBZTuWdhp\",\"prev_state_root\":\"8jtQjg2MMSowY6oF6Shvdc3Z4dhibEk7sR8LiAHUm9GA\",\"rent_paid\":\"0\",\"shard_id\":1,\"signature\":\"ed25519:2SNLCU3NHGuaerJ5jPa275wwtxnnu4DQvBh4ozMvXJZuzgs4EJPCfhb2vesnJ5CrF1RyQc9dfDZBn91FRLRP9Njp\",\"tx_root\":\"11111111111111111111111111111111\",\"validator_proposals\":[],\"validator_reward\":\"0\"},{\"balance_burnt\":\"728420795086600000000\",\"chunk_hash\":\"HjHqxNa9rqi4PAuLcrtaM4zuAvLPdaedigT16oUucKmE\",\"encoded_length\":3112,\"encoded_merkle_root\":\"rwG6Cm5h14wnXdeKaFk9WhXRJF8hbi8zXTkEe5vrc15\",\"gas_limit\":1000000000000000,\"gas_used\":32557076638366,\"height_created\":92764782,\"height_included\":92764782,\"outcome_root\":\"28VCHwcMJusGdHxdVsT1ApioKXjL4oKDFZtjS8artpej\",\"outgoing_receipts_root\":\"GnMYZchhfax4ZSYKt4EvcgS8vPYDV6P9aWtBTZxUgaBp\",\"prev_block_hash\":\"3eB4b25NLhCE4eSa5UsQNeSZxd1qpG46wDCMBZTuWdhp\",\"prev_state_root\":\"88eTF9FGBspzrHGuqH327iwSdT9aqvpuMe3ViVkB4Z97\",\"rent_paid\":\"0\",\"shard_id\":2,\"signature\":\"ed25519:5z1AgUsUvmmHW7kZoffsTnFvTzKvtHzFvKpY6UwvJLB6nnbh1k8dHbch3yWkj2urTkgtRRW8F6sJBi8Rcoqe6ZsZ\",\"tx_root\":\"6hq1U2Wu8LyjtKcAH6VDRhwYdjMGaw1evTqSdWfnFjDB\",\"validator_proposals\":[],\"validator_reward\":\"0\"},{\"balance_burnt\":\"4431194740007700000000\",\"chunk_hash\":\"FGrEj1N5jaPWQv3Mwk9k46ueeLbhbJoovLB541E8dQ7T\",\"encoded_length\":4150,\"encoded_merkle_root\":\"B17LQpVRJpA6rBEan5GE5t7hE6VTEUZGXk1weNopMhVo\",\"gas_limit\":1000000000000000,\"gas_used\":47693094182334,\"height_created\":92764782,\"height_included\":92764782,\"outcome_root\":\"6vwLNVugzL1qsNJQbKFgbZHWWhyXNHCzDmSoFgpMqM5o\",\"outgoing_receipts_root\":\"Gh239kg5WpGJvWhgyV7dUa9h9ZTWdrc61SRiwkmUzxrT\",\"prev_block_hash\":\"3eB4b25NLhCE4eSa5UsQNeSZxd1qpG46wDCMBZTuWdhp\",\"prev_state_root\":\"CtbeSZLSj7agT6Br5hPU3azbfEyns9bf3sGZKNwbLCR5\",\"rent_paid\":\"0\",\"shard_id\":3,\"signature\":\"ed25519:3K6h2mYkjbLzrz4B9UkzydVfVjHNrdBSY4vaoyLEX71w1KZUQQUFuPG8ZTXym2HJCxgRSRVZo6LBgtJUWqv3FPmC\",\"tx_root\":\"BdrjJVKTui5UgFNxCW1Yze6t1obLssHR3yevdk59TzmU\",\"validator_proposals\":[],\"validator_reward\":\"0\"}],\"header\":{\"approvals\":[null,\"ed25519:eCd8KKP1x3d8TWw26wncRdvA2xEDYmQLcDqUWHpz4YjSK5CUrYJFeN2YXH3fEbSceJjzE3Vc2WYGsNdjdCDreGm\",\"ed25519:4nvFrj3Q8oQaVjw4ShQ6boZ4EXbypP4Vopdhj6usWU93EqdvA2cTHtDNj2UWnD3vRTe4gzGEfjFHxixwhJkKGD8h\",\"ed25519:4YXoCi5sBqDrwNKUvtkoxgPxbthciY15JXSfWa2UMfnLixfBrbkj4njR3huvcbRB1MN9cGg7t6CvCjEqc5pHrEMb\",null,\"ed25519:fwKdNSk5iP5EwubBA3ciMZArQUCfuN2j6GSVKaB25EvALfBwZujooMszp4NWYNcceUKPqoDkiz8bx7keSa6qxPZ\",null,null,\"ed25519:k4KxAzi148Aidgowo3ndJgndThaEWXx6mxZwvxQHpQRzfPTfuzdSPf1SZ5XPw1yy1GNLHugMgBvXz8juxYdMqpZ\",null,null,null,\"ed25519:5iRJQ89rcJHCSfJCajjhYriJ9sw579uEcS5Qfu5v2qD51bCtccUgTR7SMgC9rn9rUNTE3VDm7PycCdwh6D2ZjNQm\",\"ed25519:jfgaJEh1U4b2hKwg6bU84qJzjFa3paKe97PToj67ZCjsaF9j4J4TqXzGDErfWp2B2RXYjVmhfdzWiHv4ugMaQ7o\",\"ed25519:4ZfT8eVwj1fw9mzRqDssDqPtcm7uXmki8yzoAiEfAgnNiY6dwhxPv6yrLfTvkpnZNCmMVW5LvQw9ASsLDUgG9Kvg\",\"ed25519:4JBPSvS4yt9FmdKs6qqNDtfKEmHymgmJeFB3x8bc6xUwD8aoD53e7w35YSz5ATfhANm48HsBrvPg4jUkXC77oWkg\",\"ed25519:kaEzztJV5ribPMQZKvvdtkxaf9VrHULtZJ9iBCHcxNNBPqT43iLBUQ1LDXPZMw3z8BSDEaKqJyKRFWqpBcj9ixN\",\"ed25519:3iPL5AbGTKdB3XrzA5q76wStk9QvBycu7ECaZsgsohkWb72gPncUejvNNT8LFqT9fY5cyBR3fSQm6AbCkFT6cyAJ\",\"ed25519:4Xp1LMYePNxm4fhyaiHcBzy8xGBY4nSxQ3xmwGvCKpkke3BZ4GrS27CPchQALTZccVoAyy4GsppUujqmnhEhqnci\",\"ed25519:3srFV7qAerVAFC9mC6CEGePx7S2782RhxHnH8eMP6puUrxAWeUppqPQ1Az4y7fYJpqMPtGQ2aYDB2nucFiPaB9i6\",\"ed25519:26jvFvpzQP9388bQNzEHNGN4SmZyF6KPbwKVWeMFqpdrE5hvRukTbKQx5MgQj1q7yzBRCrZcwfbUU7WMNa4Fwhsd\",\"ed25519:4kWDdyM3XmLzvoTDVYasfo1FSxec66wdbeHb2xmH288RpzrGrtPpnxpLY5AiFUcV5Vtgc7UKnQXiK4DpfV1csKip\",\"ed25519:5NpeprDfUYaswnzQTmUGEuJN7hzGHRqZGR8dn5TC7hkEVv3dGBSHLcFHooLSSb8FE6j9FGBzQKKA57QKZ3iKnGaq\",\"ed25519:2kTsbh2R8BgG75sWAPraRzgcZ65NQ4uYrc7N7rcVx5QVZQ8Wg9DPuu9GdXi7whY8LjyapaE5rqmjjtmVWwWnB6DX\",\"ed25519:5uGi5vx7oxGRW4oq2Xo3adGprwSy1f9Uw8TVj6Z51cYw4SuYgSyyGJYxvtAdQXHaQ73FvURMoJgaQpDtPgvdHLHN\",\"ed25519:21ETACHzBMffKsrwxj7i3RezFRdmdiK1zV19Rxhxg4jfFhJR7DNXiomDHJZ2tNKozTzBEA2uVpoExnJHmMsTMutk\",\"ed25519:5NnA63h1CkyMfTuhNioo95kG6THzLZabcCCVvx3yCQcevDVJgPRZfoLgVCnQhzP34ctiBpaxBsH5BDeL9gpymNxe\",\"ed25519:2bEgFu5w5oJRSBgaGFpCsUt25HatHpRUkRQhRdVTazFbedby96Dgx3NnVsmpwKNDBZxBd2nUV9NjsmGngCmEQ8kb\",null,\"ed25519:4bWkPqPLuuvhLWqbCCaHgY8trM2Le842aNZ7Ux5ntxcCk9F1zfLaBFJbthcHccCegabrd5bp3bDy4c5QeTjqryw8\",\"ed25519:jhgqkCRtM2aSW5AbyseCTAVGKm9DANuJRG396DF2UZnivUjXQLaCzryu9erCEChtpzKkXt3nNM8UcXWCMnrd4db\",\"ed25519:3WAPn1R1Lec59guHPAirN5V4uvKTAC91h4LG4TfYkzksdN1VytMpdaGxBRSQpD7mDjMtuq1nYrDRsvRPDNeZja7J\",null,null,\"ed25519:4Rh2skZoVPSwc6jJZXDNgSne9nfzSEAsqRxSA6aCrGv1E8mLJfae26K3ZvmDG3BfPH5Uc9eMxuRbtt8sdqwRawuy\",\"ed25519:3feqAGznE8X93xA6c11Baq7mWbAkhTP7jN4faAPXvWgWDFaV4hKVPJyd22Q7c1b2siVUuSEBRzv6Yh5piWucG3ge\",\"ed25519:5kZDoyossBzuqK651voUtKYGvmJf4NzrTTNYsJn5356GT9WFikCMv3E96CE9fetuNsfD6MYdSB77r1QGpshz7gqn\",\"ed25519:38iMTv1RwvhCG51ZNP2PgC1Kke199nmiDcYKjQRRMbqibjaRr5ALrm7LKYFpwUjQUkiGAWWcDKk6DYHtMoNtWRQT\",\"ed25519:55QQTAM2K8fAMLRH2kG19z9KTxyR1U3LrArz19AhVRJPbyWBudKtA1tSLneBDkPHLHnDLNb5NHB74ZCzVy7PaCrS\",\"ed25519:4gTCSxdSZzVgvCEHEuJixVEmtSB4mbnJiwCrE9JYSwxXc1enBK6SxoRnFK5Y3sxZ7QYxrQR1bYfLRXnediwUdx13\",\"ed25519:41unugwRXVdp52B2FGFjE6VCV6kRNsjPoYyMcJtcHSj7sB68sZ33eC1wtdLymHb95KFByyVuTkKTNjBSXvLyibAg\",\"ed25519:qwykXLhB8jkTj2F4H744BYJhNmq6ywE3mfEn343APBJ5e9HrB7QrJcxyoUD1dme3eUsLUrA61uxjp55o1KBByWb\",\"ed25519:4GDu4pjts2sxYeNFK65tsGYK7YvZWJSrCAPZuJsyPNDowi1BcVw8RXW2m83AytL1ZF2txeWhP3ruwmrUagXZKLVp\",null,null,\"ed25519:3S1qhwBVrQb2kQF2CJ4ELeUwoWQdpz7DdzWF5PKjbTRpa1eRRxgDQzi1Ce67CmSeeantHZuYNtxvWk1tdqivVhK6\",null,\"ed25519:2VVc1dec1zyriQQnYQ1t2zSxtXvHj2CopqNzhAU4Fv6V5bMGwpWWNDuhEpg2KvaTSz37AKpBYu1Pd7mCpZm3jsdc\",\"ed25519:2EkJn7K9UfHiALVsSrLajf3Zep1pVbZdBQBPSuJ2t7dfBeTij8yEeSaVEjfZ2iopbUEzPSHsRSjpvD1AH9SqRGGn\",\"ed25519:5TGiURvj8TCUJeprQukespyFSMyRoB55x3Hz6Zn7SfKzryTaaJLD3TnjwWcnCzVBpub2uySHmrYrCvPsdJkTh9y\",\"ed25519:2BuD2XHasEGdsBPCngDYXrAr4Hg7mDYqYfogc32eGDamLKLPtE4njjKMgWGm4fZifFCBHzvFRQke2YhKJV9xwfFi\",\"ed25519:2BEPbsc4BkBJrmjgAeFxiXcxTvLYtfcAZrKscA8gzEGuQMxeJh7eNMR1EWwtYh4mqfHsLDMyR5seF89iV65Kn6G5\",\"ed25519:3UUoWxkFmZnXJszEqYF6hiKjxywR7zPxjdgEHJUDnin8EMro93zv8yNVER215at2dDxqZpDm2yxNS34aHg2f5PaR\",\"ed25519:bFiA8wxSSRPx7QmvsmwpoWj7WVjB7LHnvVvAJG7Wao7wA2Dt3zxjLpm3njf8FH2YohjHk8XUHowHfaUeBU4aBnv\",\"ed25519:iN5Xj1bSSy2SeBjnhVLn8sdiJGjaNRmkzoKc6KBc9wEzp1tazmusa7ySTJEuNXoy25aXBq7XQzZqbV8hqjHTKF7\",\"ed25519:Wg3yK5AQcURJUjpLFFshv6WwSnYTuKAoy3zdvDFmdPZFUn6TpJzrfg7VmJs4eoWJqzTwxCQqKxJTD82gSCUr3bU\",\"ed25519:2fbLm2DZsjJUgbctcYMr7C3nfQ2PBZGrBRzHwWLMEmrbSdNZ3fg3o3ufc4aQtDe1gJnUVV2XdRdx8sH3dWdsNNNb\",\"ed25519:3nF1bQWPqUWtos1jWvJdgckZRoiE4vrduMGTm8mSW225D26uFs9wmvYva751B3EsWPEnwLG7BBKernf5N1YXXNCZ\",\"ed25519:4fUczkvw5BWwfm4MD6VQe1CqrAXyskj7DCJswXdQRipxrieeaBj1vhdESJ7WCmGhCv99kq5wANh69ifbUYrMX1FH\",\"ed25519:5Y8vTvxMFDVAqFyyTBDWARNv2S2yAfxms8NCydxogTv5NsrX5DwBLcAoNPAHcEfZNvNc4mDxwX6pQab7aPbNJ24\",\"ed25519:stYY1HAyMh23PzighAdTPsUMRxaeRUmFAMKHZ1dqff9Ah18KefWvt4jLeqAkFmGDNworNow8T5qLEjr4HzDvxKQ\",null,\"ed25519:5zbyJRJPjdrMtGcYmx4CozRbwQYahbrMC9RvAkXDNDJwu7iXwhuu3SsR2NkVvMK5KyHUzarz8XQ8SVybGg5px7gJ\",\"ed25519:3Z8nZYnzyeZjxXHUgiBRDyTtmMkwAHw2KNRKXYXKU74buj5VZ8rLoCc1GZ6hUegJQp7xDo482H2tfa3hY4bVTRFj\",\"ed25519:vXJnFzrUALMQxTzw6SUkmAhKMev3b2BHHsSP2zwbWVYUMQxJonNoUF314NK1SogxiQJ9XyPbmbUZedESKP7JMLg\",null,\"ed25519:zVn1uPVGd3JcpvaLNRx5Am1Bs6G5QuVXU8cYYmCZrxwDGCJZpQ6jg45ssKtY6yQ33AGFPPdtynCu41o9uxK7ikV\",\"ed25519:nWVUJFqBKinAqm2tXaWebFKoJ5H7wjgbwrTpC2YmhZSFfShRrgTZrpF6Jy3nBCYh4QTPedmRczQhkSrETQ1UpDa\",\"ed25519:3zQK6ppmN46mZkP6mukCEigCgtfeBUVge8ahWuvUgARfVRuzyuTtuMDRHiLmAcmiXhP3woFDe8Mwvq8bdyXFpJ3x\",\"ed25519:3SBXpwiWhgTmncaVqew1kxmYPpKj5HX9LzGjMg3aq8bLn58SKx2jPwaSwk1Bb4g8NuXCqNi7unGXMU6qYwJcYjeK\",\"ed25519:2XVAKNKiWQ5Bs4dVNR1gXjNwaMxJNXy6tLVjDFzbHfJFceuXsG3kR3ikVttfdqugEt6hMrtLFyp1jAEW23aK7ZHu\",\"ed25519:3cHqt3yvkZGXYNz3VvWjSJHhnfafZQMTLhYM2sVRpUwY9WqLbNqjgLPCbenwA9XrLWN69M7tyzdVck3VaTtZcZrP\",null,\"ed25519:wJYsZei4toE73V2S2exMhBFdpxjRC29BR5grGkuHxHN3qvt3gqrGn4yAfPeZfbehHWA5deq3iskQQspDSaE3vW1\",\"ed25519:3uKW8oYUFmYfCKrMYpBD571qnDUdY6kDwQiJxDRQBNTncHdoH7JorNWdKqjbsbRqymhHdRN5V7Y5M2GA7woNXKQ7\",null,\"ed25519:2sbVxGXx21qkMAU2w8s6hPhBt6uEvdrPiGpLhgizRc7ZX6FAt4oWJ7D4z8UoFPUBXay8DY7iZt2Wj7cgiL4sNozT\",\"ed25519:5Hw2no22fWrqKRNPHMGkCSJmYJtBTaXN7FJvr7rTNPtGVx2cbseDGP1XgC8pMKuJL8Rsy6oyYZyMxvsH3JJJ5wbe\",\"ed25519:5gATsDEW3kJwmDVoGYw9hyZK3UDvQ6kq9N9mcksoF3GK3NHH8rMjodjHxM1C9NFAGvPU7MXBpvq3Cvpxbb8mC9M\",\"ed25519:2whiGFBoA1FtDdD9ZSiDTsVvgvE9D93ouNLsyX14R6dvhGN75uXhvmGL92QmZJRwqZMFEhohSQGXC2uXAHUZuqN3\",\"ed25519:2ZMfn2SD6gsFGFBNFSsGqV7VvGqPmE3KLfRu1WLSPNsBNuBU9PXrnYEM2tdrg7LKmXYR1HGjhtVAtiyPY5WVBSMA\",\"ed25519:2NLcY5v4miS3JWMuTUPFnD5PB8hZk9jMJGh3TPjynAKmcz8zhogbSssRxJHP8SmrdNfpTNhJaRJmoqHuSeHprCzx\",\"ed25519:65nKEveCXYc8gBA9PKpNhXQNJuVkrR17vb5WdJ43SJsaQzoiwn5mUFg1nUoSYo1BQCt3ik3kKedmVz5firVJQC1\",\"ed25519:2Vay5w643mnBqCBym2aLTpiPKAo44wtJEdE7nRjMSFoFsJE9gKK6CfhhaBzNS9iBBWztv2JsDy5aqcfaF4K2TUvW\",null,\"ed25519:5yKdRPiPG8pVhpfsUS5sLBALev7Qz13cEtURDNAFpRPH4rMGSDNjcvU7vCQURUqopd4N3V5YXwdQBriBNibPSvUr\",null,\"ed25519:4UAx2iJUTtuUsPaCjJAvKP9eKWhhneFEeHWjpqJ7ee29uWo26JSF9ev3uVL5WAGj9YXR65UkyrzPRfGaXL9kRjqC\",\"ed25519:3qM8adhK3P663i2BThbPCXZ69Uj37TLkPiBBGGjaWxjHSUJjiSCuuALYRRyuVswLRaacoWxfWt8rPWwuVwnFNbGC\",\"ed25519:5gxYuKU5StJHG87Wni5AfzE3eT9iti9VrP77KwHuTjhHhawYVXfp9dvvbSRrYHAq9nZoZySXag27LtUFJ6yycHh6\",\"ed25519:TRAQVHY6BRXQmgKNT7ZCzxvjT5dsG3yWn61g7NMMtZuaskjRjnZnWboSRxEJQCWjWvNxMNR8nvWf7EuaFP64GLG\",\"ed25519:7p1FQ39HjzTakkT8jfayA2RRdw8EBHEtmfBWEwHQG1pK3NMoArhsbZmv2tKrUwT38TbWxXVKHDYiCfgqYgDYxaV\",\"ed25519:tYRPcLJspJsUTa2TCG3AUuuSpxVwr37zA6YX59BGhNRPFt5xptFfur3quydpgrTc6LpvfYr9fJiuGnFqvtAEfEA\",\"ed25519:5SaLTSxK2M6ZWpqQgSnuDvPDxmJNVhMWfZvCJGn3mdFDHGSLgf21i9ZXoJPnxkjZvE3XobR5Lxh9tHWcsTYvMwr4\",null,null,\"ed25519:49qtGSAbejxi32jAGNmaZ7tm5RzyB5xoHu8TLxNV381Qu6WGWN8NCDawC2NK9a9sHLk9FUwM27MNMXXU8vvRpRTJ\",null,\"ed25519:34MER6t7bRZ9mRqK1sdEAwHg4srWoJ1Bq6GYMJxWw5g6PCB3jYCEaZbgVZGih2UWRKQy2E65ZqjhKjUkn5UUXWdJ\",\"ed25519:doWjdHEmP2yLhDVLBhvL2MGNwYoqvy9sitiReXqdMHdjk8sPGobm5hMgZ8M3TVLqvciPf6VMAzpPTtwnc4DjTNp\"],\"block_merkle_root\":\"AQpJdEWniTQt2vGV8rwec8hcqBFR4LeFv5xQt5FRkB3N\",\"block_ordinal\":82716163,\"challenges_result\":[],\"challenges_root\":\"11111111111111111111111111111111\",\"chunk_headers_root\":\"DCUwn6yMtLpei4bpDDCkHUvu4qE91Wxs5ktsTr5MnKmz\",\"chunk_mask\":[true,true,true,true],\"chunk_receipts_root\":\"FBCpZToM7huLoqunHmddEmuttvRvCGCSc6FAoUaKt4gK\",\"chunk_tx_root\":\"7HYSbfJG3PNgitbw8Ap5jv92ATu65LHGFjrhRWT3J7Qp\",\"chunks_included\":4,\"epoch_id\":\"AcySQ4RQTqSHu5nScK67GgRDjjbWhi8hyhTZgonA6qMX\",\"epoch_sync_data_hash\":null,\"gas_price\":\"100000000\",\"hash\":\"9DBzUMMZEvipLQRk8uYHspC1xmjV8hTxPgmfFjZcpwSa\",\"height\":92764782,\"last_ds_final_block\":\"3eB4b25NLhCE4eSa5UsQNeSZxd1qpG46wDCMBZTuWdhp\",\"last_final_block\":\"C4dvkQmz1cTkMT7RiQUxofKVYDimuBBMaC32Vu9e5cg4\",\"latest_protocol_version\":60,\"next_bp_hash\":\"DKskg8RHMyRfCgLSmGaDjJByaufGrzvL5LKeaVUsh8WL\",\"next_epoch_id\":\"2XQVEh6YG1DergPk89PNBQdMQpFZG51iqrA66q43392Q\",\"outcome_root\":\"APsRn1xM9v551kRpyAMgvRFudrYeGisaNWBn4onB1idB\",\"prev_hash\":\"3eB4b25NLhCE4eSa5UsQNeSZxd1qpG46wDCMBZTuWdhp\",\"prev_height\":92764781,\"prev_state_root\":\"2teD5VbzszQgi4SDH6re5LAMTJ4rJW7YjfWqbgrYtaHA\",\"random_value\":\"DoMa3oanQVPK9rfJLQ8uanv1F38mp4VmKzyVjTMsS1m\",\"rent_paid\":\"0\",\"signature\":\"ed25519:266K5gX8WYX2F8PVtBYjyiMqMKkbtxndVRZgACP8QUK5aL4Km8MgeASAZ6CrCngzJmScBXwWDAHmEWUBdN5sEgf2\",\"timestamp\":1685118680614918699,\"timestamp_nanosec\":\"1685118680614918699\",\"total_supply\":\"1136439149802763608645345483700628\",\"validator_proposals\":[],\"validator_reward\":\"0\"}},\"shards\":[{\"chunk\":{\"author\":\"stardust.poolv1.near\",\"header\":{\"balance_burnt\":\"3673917769667200000000\",\"chunk_hash\":\"3518YUTebvcpTT25pPVDR1AZ7bNazoj66HAfZ3gJqSNN\",\"encoded_length\":7195,\"encoded_merkle_root\":\"2Fs41gBKVAKNAxHq5xYhngL2QHGYgRLF3UyBDNTNniqM\",\"gas_limit\":1000000000000000,\"gas_used\":69125569346482,\"height_created\":92764782,\"height_included\":92764782,\"outcome_root\":\"5CDva6FguHqqRbLA6ZyhDCYCEwv7aQxRntkopdjwtpEp\",\"outgoing_receipts_root\":\"9b9JpF3dVZZFUdC2hbKYQTQPCuDp98aW5pnBRqJsdqcD\",\"prev_block_hash\":\"3eB4b25NLhCE4eSa5UsQNeSZxd1qpG46wDCMBZTuWdhp\",\"prev_state_root\":\"3Evr1EQKgDxcMXzucMDKZAeG6Xggi967dKpvA783dZtP\",\"rent_paid\":\"0\",\"shard_id\":0,\"signature\":\"ed25519:4d591Wh2iqeEyTVdy8ugmCgaAnccTBotpHnoRqmnwa6JxP8fzspu4GzAqSLXBUEZd6QEi9unFnK9p4fc8aV5DyyY\",\"tx_root\":\"GikyZtkzXpiXtLEZAkcqiJrcr2gMZ8VAUiX7Wn4kmZSN\",\"validator_proposals\":[],\"validator_reward\":\"0\"},\"receipts\":[{\"predecessor_id\":\"app.nearcrowd.near\",\"receipt\":{\"Action\":{\"actions\":[{\"FunctionCall\":{\"args\":\"eyJhY2NvdW50X2lkIjoicmFib3RhcGVybTMubmVhciIsInNvbHV0aW9uX2hhc2giOlsxODAsMjMsMTQ5LDE3OCwxNzQsMTMwLDM3LDg3LDIwOCwxOTIsOTgsMTg3LDE4OSw0Niw2MSwxNzAsMTA3LDIzMCw5NSwxODcsNjQsMTA0LDIzMywyMTcsMTMyLDE2NCwxOCwxMzksMjI3LDU5LDEwMiwxMThdfQ==\",\"deposit\":\"0\",\"gas\":200000000000000,\"method_name\":\"approve_solution\"}}],\"gas_price\":\"335989893\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"app.nearcrowd.near\",\"signer_public_key\":\"ed25519:aSgLALWzkhfCa5D66V8x8QgP1qU46mWVA2CikGJNYVm\"}},\"receipt_id\":\"5ZmodVAgA86mwcXsh2nYwyyfzkvFNKdwDkaUJRKzb86N\",\"receiver_id\":\"app.nearcrowd.near\"},{\"predecessor_id\":\"6faeffa480a502a1ec0fcb25a4237c4d53ec1fff9455e67b842caf84c927a917\",\"receipt\":{\"Action\":{\"actions\":[{\"FunctionCall\":{\"args\":\"eyJyZWNlaXZlcl9pZCI6InJld2FyZC1vcHRpbi5zd2VhdCIsImFtb3VudCI6IjEwMDAwMDAwMDAwMDAwMDAwMDAiLCJtZW1vIjoic3c6cmV3Om9wdGluOko5ZGp6cVlYblktNmZhZWZmYTQ4MGE1MDJhMWVjMGZjYjI1YTQyMzdjNGQ1M2VjMWZmZjk0NTVlNjdiODQyY2FmODRjOTI3YTkxNyJ9\",\"deposit\":\"1\",\"gas\":14000000000000,\"method_name\":\"ft_transfer\"}}],\"gas_price\":\"109272700\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"6faeffa480a502a1ec0fcb25a4237c4d53ec1fff9455e67b842caf84c927a917\",\"signer_public_key\":\"ed25519:4BiExDrNAgX822LmEJLP6mjcADnQfNwoimRNrnuvtmuL\"}},\"receipt_id\":\"Fma1RnScq8DEB8wmY1antx4tBsVx84rffvs2o5S2vcBR\",\"receiver_id\":\"token.sweat\"},{\"predecessor_id\":\"a081b1bb750d7c1e20e2a033e6237cba2f2709b4f7aebd3a3623ca198a7dbd35\",\"receipt\":{\"Action\":{\"actions\":[{\"FunctionCall\":{\"args\":\"eyJhY2NvdW50X2lkIjoiYTA4MWIxYmI3NTBkN2MxZTIwZTJhMDMzZTYyMzdjYmEyZjI3MDliNGY3YWViZDNhMzYyM2NhMTk4YTdkYmQzNSJ9\",\"deposit\":\"1250000000000000000000\",\"gas\":30000000000000,\"method_name\":\"storage_deposit\"}}],\"gas_price\":\"122987387\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"a081b1bb750d7c1e20e2a033e6237cba2f2709b4f7aebd3a3623ca198a7dbd35\",\"signer_public_key\":\"ed25519:BoYwAfniA8RwSet9fyqaa1o9eCkodzx6vENZs1FasDq6\"}},\"receipt_id\":\"8LyaPknFFRiEwZn9Zg76NDvfDShTg4P1CoiAVXYTcB3S\",\"receiver_id\":\"usdt.tether-token.near\"},{\"predecessor_id\":\"0182e5d62f1c3d6a4b26b49c934d58a0052e0f9cadf046e22dfa5cff1e92d835\",\"receipt\":{\"Action\":{\"actions\":[{\"FunctionCall\":{\"args\":\"e30=\",\"deposit\":\"0\",\"gas\":100000000000000,\"method_name\":\"claim\"}}],\"gas_price\":\"186029458\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"0182e5d62f1c3d6a4b26b49c934d58a0052e0f9cadf046e22dfa5cff1e92d835\",\"signer_public_key\":\"ed25519:6uB7bgkaNN1aRVGJ4MtS44jcN5AcBa5UwEodUK3jxfn\"}},\"receipt_id\":\"GKCJmBtpCqvvz9oYxydyaY1n5a3Ly41ueXKFTTj8fiac\",\"receiver_id\":\"tge-lockup.sweat\"},{\"predecessor_id\":\"3d50d495-a.embr.playember_reserve.near\",\"receipt\":{\"Action\":{\"actions\":[{\"FunctionCall\":{\"args\":\"eyJhcGlfaWQiOiJteXRlc3RhcGkuZW1ici5wbGF5ZW1iZXJfcmVzZXJ2ZS5uZWFyIn0=\",\"deposit\":\"0\",\"gas\":30000000000000,\"method_name\":\"register_account_as_player\"}}],\"gas_price\":\"122987387\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"3d50d495-a.embr.playember_reserve.near\",\"signer_public_key\":\"ed25519:BLepEWpZwFvZSjT8XARNKbZZ9qYcjBLzsQUNoRJjxAF9\"}},\"receipt_id\":\"9C6nmXFWSGEUjxvFfW43qfEv5zWpnbju4AyuR63dVP9a\",\"receiver_id\":\"embr.playember_reserve.near\"},{\"predecessor_id\":\"64abffbe659f5da752d0821a72d9f0cb660c4bc84e90b1104a4b4065d98a6c75\",\"receipt\":{\"Action\":{\"actions\":[{\"FunctionCall\":{\"args\":\"eyJhY2NvdW50X2lkIjoiNjRhYmZmYmU2NTlmNWRhNzUyZDA4MjFhNzJkOWYwY2I2NjBjNGJjODRlOTBiMTEwNGE0YjQwNjVkOThhNmM3NSJ9\",\"deposit\":\"1250000000000000000000\",\"gas\":30000000000000,\"method_name\":\"storage_deposit\"}}],\"gas_price\":\"122987387\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"64abffbe659f5da752d0821a72d9f0cb660c4bc84e90b1104a4b4065d98a6c75\",\"signer_public_key\":\"ed25519:7mytRQ2oBzrUjXBkcjKUNeum9N6obX3Z3E5GYpgiq5Yp\"}},\"receipt_id\":\"9Se9uAo3caHJG6wAFFh4VmPpjyZwLmR7zcVNWaKrrFb3\",\"receiver_id\":\"usdt.tether-token.near\"},{\"predecessor_id\":\"1d13d463b67d3a6794f5a056c4d6a9e6aea90b76d0f0ced512cb179c81ba08f7\",\"receipt\":{\"Action\":{\"actions\":[{\"FunctionCall\":{\"args\":\"eyJyZWNlaXZlcl9pZCI6InJld2FyZC1vcHRpbi5zd2VhdCIsImFtb3VudCI6IjEwMDAwMDAwMDAwMDAwMDAwMDAiLCJtZW1vIjoic3c6cmV3Om9wdGluOko5ZGp6cVlYblktMWQxM2Q0NjNiNjdkM2E2Nzk0ZjVhMDU2YzRkNmE5ZTZhZWE5MGI3NmQwZjBjZWQ1MTJjYjE3OWM4MWJhMDhmNyJ9\",\"deposit\":\"1\",\"gas\":14000000000000,\"method_name\":\"ft_transfer\"}}],\"gas_price\":\"109272700\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"1d13d463b67d3a6794f5a056c4d6a9e6aea90b76d0f0ced512cb179c81ba08f7\",\"signer_public_key\":\"ed25519:2xWMvK1meQnUGoaxNs1ZDVeerCcq3kufNQnwz398d3jU\"}},\"receipt_id\":\"HRxnJyEFygJg1QtWzMFN5DMRfPyemPQbFEGYdUUrD43T\",\"receiver_id\":\"token.sweat\"},{\"predecessor_id\":\"a3e1f5b1724f18cba5cf35ad3d20037feaf7e7c5709e8838b83759d7504b0bcc\",\"receipt\":{\"Action\":{\"actions\":[{\"FunctionCall\":{\"args\":\"eyJhY2NvdW50X2lkIjoiYTNlMWY1YjE3MjRmMThjYmE1Y2YzNWFkM2QyMDAzN2ZlYWY3ZTdjNTcwOWU4ODM4YjgzNzU5ZDc1MDRiMGJjYyJ9\",\"deposit\":\"1250000000000000000000\",\"gas\":30000000000000,\"method_name\":\"storage_deposit\"}}],\"gas_price\":\"122987387\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"a3e1f5b1724f18cba5cf35ad3d20037feaf7e7c5709e8838b83759d7504b0bcc\",\"signer_public_key\":\"ed25519:C2jJ6HMnY24Srb58aivEoy5DKkxBsXffp29ZcMpBxHZu\"}},\"receipt_id\":\"7NQ2puUQk5YdphCtyESCCdav1gMNCNcBC22Ub99yqPDm\",\"receiver_id\":\"usdt.tether-token.near\"},{\"predecessor_id\":\"system\",\"receipt\":{\"Action\":{\"actions\":[{\"Transfer\":{\"deposit\":\"67682515494078360916120\"}}],\"gas_price\":\"0\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"app.nearcrowd.near\",\"signer_public_key\":\"ed25519:6MP4bCPHEud33eKXM9kg7f9fVNhmn97CNUyn5ZwM375U\"}},\"receipt_id\":\"wkEmrrch8JHi6WyZGwLeQLxPia8jAKWFty3BSQKo2mL\",\"receiver_id\":\"app.nearcrowd.near\"},{\"predecessor_id\":\"a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48.factory.bridge.near\",\"receipt\":{\"Action\":{\"actions\":[{\"FunctionCall\":{\"args\":\"eyJzZW5kZXJfaWQiOiJlMDMzNjFmNTY1MjdiMjc5MjUzMzQyNTA5OTNmZGNiODY2MjNlOTA4MjU0YjhmOGFlZDhhZTAzN2ZmMmUxYmI1IiwiYW1vdW50IjoiNDcwNTk0OTYiLCJtc2ciOiJ7XCJ0eXBlXCI6XCJUcmFuc2ZlclwiLFwidG9cIjpcIjB4MDc1N2JGOUIxNDg4NDUzM2E0QjNFODlGRDhEODc4ZjU0OENGQ0M0RVwiLFwidG9fY2hhaW5cIjpcIjIyNzc2XCJ9In0=\",\"deposit\":\"0\",\"gas\":270000000000000,\"method_name\":\"ft_on_transfer\"}}],\"gas_price\":\"625040174\",\"input_data_ids\":[],\"output_data_receivers\":[{\"data_id\":\"DJzQmhhaummUUFNzP99semWjwgwjmjo86A4pAqUBzch3\",\"receiver_id\":\"a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48.factory.bridge.near\"}],\"signer_id\":\"e03361f56527b27925334250993fdcb86623e908254b8f8aed8ae037ff2e1bb5\",\"signer_public_key\":\"ed25519:G6BmWT85Uu4At6rPxkma6ERZGFQd5opn8JunAzTu8UMA\"}},\"receipt_id\":\"5jAZr8vHTCWmmCSnvbCxa4fiwLQrdwuXSNHQft6UZ1io\",\"receiver_id\":\"mos.mfac.butternetwork.near\"},{\"predecessor_id\":\"a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48.factory.bridge.near\",\"receipt\":{\"Action\":{\"actions\":[{\"FunctionCall\":{\"args\":\"eyJzZW5kZXJfaWQiOiJlMDMzNjFmNTY1MjdiMjc5MjUzMzQyNTA5OTNmZGNiODY2MjNlOTA4MjU0YjhmOGFlZDhhZTAzN2ZmMmUxYmI1IiwicmVjZWl2ZXJfaWQiOiJtb3MubWZhYy5idXR0ZXJuZXR3b3JrLm5lYXIiLCJhbW91bnQiOiI0NzA1OTQ5NiJ9\",\"deposit\":\"0\",\"gas\":5000000000000,\"method_name\":\"ft_resolve_transfer\"}}],\"gas_price\":\"625040174\",\"input_data_ids\":[\"DJzQmhhaummUUFNzP99semWjwgwjmjo86A4pAqUBzch3\"],\"output_data_receivers\":[],\"signer_id\":\"e03361f56527b27925334250993fdcb86623e908254b8f8aed8ae037ff2e1bb5\",\"signer_public_key\":\"ed25519:G6BmWT85Uu4At6rPxkma6ERZGFQd5opn8JunAzTu8UMA\"}},\"receipt_id\":\"D4r4dFz1v6hhAWSeEznH89yLWfw2pjotmmX6AwqyQbCE\",\"receiver_id\":\"a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48.factory.bridge.near\"},{\"predecessor_id\":\"system\",\"receipt\":{\"Action\":{\"actions\":[{\"Transfer\":{\"deposit\":\"13211855362853269146864\"}}],\"gas_price\":\"0\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"e03361f56527b27925334250993fdcb86623e908254b8f8aed8ae037ff2e1bb5\",\"signer_public_key\":\"ed25519:G6BmWT85Uu4At6rPxkma6ERZGFQd5opn8JunAzTu8UMA\"}},\"receipt_id\":\"BDqp8fioCtqie4jtZnsHf2dVFAyGURNoFnba463s4tdt\",\"receiver_id\":\"e03361f56527b27925334250993fdcb86623e908254b8f8aed8ae037ff2e1bb5\"},{\"predecessor_id\":\"system\",\"receipt\":{\"Action\":{\"actions\":[{\"Transfer\":{\"deposit\":\"13214028874009742651168\"}}],\"gas_price\":\"0\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"nearcrowd_2.near\",\"signer_public_key\":\"ed25519:2RRwQPTGRZkavm5sf1gJEbay34MpBMpw7LTriD3ZeLBZ\"}},\"receipt_id\":\"EVzjwprJmpvwATvvy6vMDB5Y5UJWfksE8aWb9PvcNepm\",\"receiver_id\":\"nearcrowd_2.near\"},{\"predecessor_id\":\"system\",\"receipt\":{\"Action\":{\"actions\":[{\"Transfer\":{\"deposit\":\"669547687500000000\"}}],\"gas_price\":\"0\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"mytestapi.embr.playember_reserve.near\",\"signer_public_key\":\"ed25519:CKyBFz2ncy7GP9oqDqUojEQm4aPzntmQf4zswVyj4kSH\"}},\"receipt_id\":\"CtQACcsYrAuAWoGPoUE7uM6c3JoZ9rHQNfhtMMbJoyYD\",\"receiver_id\":\"mytestapi.embr.playember_reserve.near\"},{\"predecessor_id\":\"system\",\"receipt\":{\"Action\":{\"actions\":[{\"Transfer\":{\"deposit\":\"13236703872667742651168\"}}],\"gas_price\":\"0\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"rezerv-42.near\",\"signer_public_key\":\"ed25519:5NVcZnEZY9xcknHjb5BzmzhHdD7P8TD8LvQ9kBJWNbbQ\"}},\"receipt_id\":\"4AztGSk1EGUy7WU7NgoZKe1Wrnh59zcQc114vxvM7ubf\",\"receiver_id\":\"rezerv-42.near\"}],\"transactions\":[{\"outcome\":{\"execution_outcome\":{\"block_hash\":\"9DBzUMMZEvipLQRk8uYHspC1xmjV8hTxPgmfFjZcpwSa\",\"id\":\"HVua5uD1PUjoakRF3mVKW5a3qaRzugvAoYgYkVHxcyd\",\"outcome\":{\"executor_id\":\"89addbfbfc6b34ae6403f39ee2c92280827d80a98dc40d15729824d232be343d\",\"gas_burnt\":2428135649664,\"logs\":[],\"metadata\":{\"gas_profile\":null,\"version\":1},\"receipt_ids\":[\"9zBu3257Zd4ierBx8jNW458zM3C4DzarmrYhZUvW1VsJ\"],\"status\":{\"SuccessReceiptId\":\"9zBu3257Zd4ierBx8jNW458zM3C4DzarmrYhZUvW1VsJ\"},\"tokens_burnt\":\"242813564966400000000\"},\"proof\":[{\"direction\":\"Right\",\"hash\":\"4HpCDZB1i1torRYMPV1eCFpUp8S9juoMiv1tzpfzMqPn\"},{\"direction\":\"Right\",\"hash\":\"FbcQDRUthNMUCeYqgdqx6JGrPAK9Ni3d6vr6urhiRgbx\"},{\"direction\":\"Right\",\"hash\":\"DYL3X5j4XT1tj57z2qChMWGmwSp53gtyN9fMRuJGeomy\"},{\"direction\":\"Right\",\"hash\":\"DDEAhsCW9dyfhBsviTNRy7mnrg2sH2Nynh9ujbUhn9Uy\"}]},\"receipt\":null},\"transaction\":{\"actions\":[{\"FunctionCall\":{\"args\":\"eyJhY2NvdW50X2lkIjoiODlhZGRiZmJmYzZiMzRhZTY0MDNmMzllZTJjOTIyODA4MjdkODBhOThkYzQwZDE1NzI5ODI0ZDIzMmJlMzQzZCJ9\",\"deposit\":\"1250000000000000000000\",\"gas\":30000000000000,\"method_name\":\"storage_deposit\"}}],\"hash\":\"HVua5uD1PUjoakRF3mVKW5a3qaRzugvAoYgYkVHxcyd\",\"nonce\":73754297000120,\"public_key\":\"ed25519:AGScmR9rZXuSuKaSZtZYzGZsxKor1NPCfNam6aaFbdMN\",\"receiver_id\":\"usdt.tether-token.near\",\"signature\":\"ed25519:2uNaLs1anQbYkutHT1pDWp1nnFBhuwgX2pACE7omnbNr4vDeyS2GwBV4Y4aujuNMnHkxw4utkdeLEhkPjSFUaug4\",\"signer_id\":\"89addbfbfc6b34ae6403f39ee2c92280827d80a98dc40d15729824d232be343d\"}},{\"outcome\":{\"execution_outcome\":{\"block_hash\":\"9DBzUMMZEvipLQRk8uYHspC1xmjV8hTxPgmfFjZcpwSa\",\"id\":\"9PYCn1h6f3UwP2fGoUKLToZRPvUmDTJ3aHhyBrPqEKTd\",\"outcome\":{\"executor_id\":\"1d6c1c8b24edf29e581613a2b5501d023ab762b55541d731bbd6f1926a857978\",\"gas_burnt\":2427936651538,\"logs\":[],\"metadata\":{\"gas_profile\":null,\"version\":1},\"receipt_ids\":[\"Hf5mXqej3Sqfx32wDvdw8e3crUz7FRontCW63ezVNiDW\"],\"status\":{\"SuccessReceiptId\":\"Hf5mXqej3Sqfx32wDvdw8e3crUz7FRontCW63ezVNiDW\"},\"tokens_burnt\":\"242793665153800000000\"},\"proof\":[{\"direction\":\"Left\",\"hash\":\"DxBTaA7HNpj7Rtsc4apH5Vz9MP3gbem3BxVnvBkiP65A\"},{\"direction\":\"Right\",\"hash\":\"FbcQDRUthNMUCeYqgdqx6JGrPAK9Ni3d6vr6urhiRgbx\"},{\"direction\":\"Right\",\"hash\":\"DYL3X5j4XT1tj57z2qChMWGmwSp53gtyN9fMRuJGeomy\"},{\"direction\":\"Right\",\"hash\":\"DDEAhsCW9dyfhBsviTNRy7mnrg2sH2Nynh9ujbUhn9Uy\"}]},\"receipt\":null},\"transaction\":{\"actions\":[{\"FunctionCall\":{\"args\":\"e30=\",\"deposit\":\"0\",\"gas\":100000000000000,\"method_name\":\"claim\"}}],\"hash\":\"9PYCn1h6f3UwP2fGoUKLToZRPvUmDTJ3aHhyBrPqEKTd\",\"nonce\":82709690000066,\"public_key\":\"ed25519:5hF5RjYCQsW1PAfVbT68gBRHZ7wSy3Zqtz8TeeX4mCaD\",\"receiver_id\":\"tge-lockup.sweat\",\"signature\":\"ed25519:4HhLFaaYiQy7nawsWf5hEexYe9NsoPZ7Nra8tQ2SGzmGjkfrnNakJpogWfmEpoD2hsAaV5c8vwwgQ4temdCmt54o\",\"signer_id\":\"1d6c1c8b24edf29e581613a2b5501d023ab762b55541d731bbd6f1926a857978\"}},{\"outcome\":{\"execution_outcome\":{\"block_hash\":\"9DBzUMMZEvipLQRk8uYHspC1xmjV8hTxPgmfFjZcpwSa\",\"id\":\"4zPqfd2F5DGfADGLLAMK4Ya4atDeXWgWpunRkhaTRdm6\",\"outcome\":{\"executor_id\":\"7fc1dd34509cf7b0d6692179bb99ab99ae71f224e3e6d119dbc7e40b6a5458d0\",\"gas_burnt\":2428314524384,\"logs\":[],\"metadata\":{\"gas_profile\":null,\"version\":1},\"receipt_ids\":[\"Bnyhao6bmyymAuJMymzBvi4WjxV1BoJUbw2dFvs7t23y\"],\"status\":{\"SuccessReceiptId\":\"Bnyhao6bmyymAuJMymzBvi4WjxV1BoJUbw2dFvs7t23y\"},\"tokens_burnt\":\"242831452438400000000\"},\"proof\":[{\"direction\":\"Right\",\"hash\":\"HgejmBu9zQ3nAsnBm1rzLEHUdwmm5zeqxBoSpwEs6Qsi\"},{\"direction\":\"Left\",\"hash\":\"BKmUYuHMznYU84EshTJSgJBsDqzMGnRj1cwMMxnNxoDG\"},{\"direction\":\"Right\",\"hash\":\"DYL3X5j4XT1tj57z2qChMWGmwSp53gtyN9fMRuJGeomy\"},{\"direction\":\"Right\",\"hash\":\"DDEAhsCW9dyfhBsviTNRy7mnrg2sH2Nynh9ujbUhn9Uy\"}]},\"receipt\":null},\"transaction\":{\"actions\":[{\"FunctionCall\":{\"args\":\"eyJyZWNlaXZlcl9pZCI6InJld2FyZC1vcHRpbi5zd2VhdCIsImFtb3VudCI6IjEwMDAwMDAwMDAwMDAwMDAwMDAiLCJtZW1vIjoic3c6cmV3Om9wdGluOnlFWldFUFo0YTAtN2ZjMWRkMzQ1MDljZjdiMGQ2NjkyMTc5YmI5OWFiOTlhZTcxZjIyNGUzZTZkMTE5ZGJjN2U0MGI2YTU0NThkMCJ9\",\"deposit\":\"1\",\"gas\":14000000000000,\"method_name\":\"ft_transfer\"}}],\"hash\":\"4zPqfd2F5DGfADGLLAMK4Ya4atDeXWgWpunRkhaTRdm6\",\"nonce\":73110403000008,\"public_key\":\"ed25519:9biETR76Ar5A9gdcN4M1VCRCYNh95bMkbKUV2wZYv41m\",\"receiver_id\":\"token.sweat\",\"signature\":\"ed25519:3n5z9pzozpQi8uvZrJC1s9idcJTv7xBcfZ6Wix7Yfz54zGBn4JYL7kD3B3dRRvt1CppBQFojVRyE2GAoZNvt2G6G\",\"signer_id\":\"7fc1dd34509cf7b0d6692179bb99ab99ae71f224e3e6d119dbc7e40b6a5458d0\"}},{\"outcome\":{\"execution_outcome\":{\"block_hash\":\"9DBzUMMZEvipLQRk8uYHspC1xmjV8hTxPgmfFjZcpwSa\",\"id\":\"4Fgd5NkSW8KAw4vo6yoa9uWN7evpgkRFxDLw68ZZUdas\",\"outcome\":{\"executor_id\":\"998aef31da68f8a525d54d3ce3dc8a68adfd9392969b4e1ce1a943a275d667b4\",\"gas_burnt\":4748337011632,\"logs\":[],\"metadata\":{\"gas_profile\":null,\"version\":1},\"receipt_ids\":[\"2gFryBxfNpuo6hsD2sKdS3qQykWv89AQFVPafoiT3jxD\"],\"status\":{\"SuccessReceiptId\":\"2gFryBxfNpuo6hsD2sKdS3qQykWv89AQFVPafoiT3jxD\"},\"tokens_burnt\":\"474833701163200000000\"},\"proof\":[{\"direction\":\"Left\",\"hash\":\"4GzT1nWTDHgYcKrZFFQ3QcFCGGXTivnscxZHua8Tdteh\"},{\"direction\":\"Left\",\"hash\":\"BKmUYuHMznYU84EshTJSgJBsDqzMGnRj1cwMMxnNxoDG\"},{\"direction\":\"Right\",\"hash\":\"DYL3X5j4XT1tj57z2qChMWGmwSp53gtyN9fMRuJGeomy\"},{\"direction\":\"Right\",\"hash\":\"DDEAhsCW9dyfhBsviTNRy7mnrg2sH2Nynh9ujbUhn9Uy\"}]},\"receipt\":null},\"transaction\":{\"actions\":[{\"FunctionCall\":{\"args\":\"eyJyZWNlaXZlcl9pZCI6ImYxZGI2MjEwM2ZiNDczZGY0ZDJiODlhZTc3MTBmMzAzYmE4Y2UyNGNhYWQ5ZTQ0Yjg4NWY3Yzg4OGI5YjFkNjIiLCJhbW91bnQiOiI4NjYwMDAwMDAwMDAwMDAwMDAwIiwibWVtbyI6InN3OnQ6TFE2TkwxYWxRRCJ9\",\"deposit\":\"1\",\"gas\":14000000000000,\"method_name\":\"ft_transfer\"}},{\"FunctionCall\":{\"args\":\"eyJyZWNlaXZlcl9pZCI6ImZlZXMuc3dlYXQiLCJhbW91bnQiOiIxMTIwMDAwMDAwMDAwMDAwMDAwIiwibWVtbyI6InN3OnQ6ZmVlOkxRNk5MMWFsUUQifQ==\",\"deposit\":\"1\",\"gas\":14000000000000,\"method_name\":\"ft_transfer\"}}],\"hash\":\"4Fgd5NkSW8KAw4vo6yoa9uWN7evpgkRFxDLw68ZZUdas\",\"nonce\":86193362000020,\"public_key\":\"ed25519:Ds2WiuryPoxnHUGgKEoQP89Un3rcACu52az89zv6pFke\",\"receiver_id\":\"token.sweat\",\"signature\":\"ed25519:2hM7VDJmNDgFhGQCQ75P8YfWEVVXRDLjABiKTAhmz94XsCBnSKuawm7CN2YaMBHd4TC9auzVH3desBm35h1AX5Au\",\"signer_id\":\"998aef31da68f8a525d54d3ce3dc8a68adfd9392969b4e1ce1a943a275d667b4\"}},{\"outcome\":{\"execution_outcome\":{\"block_hash\":\"9DBzUMMZEvipLQRk8uYHspC1xmjV8hTxPgmfFjZcpwSa\",\"id\":\"725pXT1Xa3y3VaeW8oTb66MuVh28bU11YdzhRQSfnbuQ\",\"outcome\":{\"executor_id\":\"633df47e6fe62de8d6b3db7cb410f85a7b12a957a5e84d49236aa683c962016b\",\"gas_burnt\":2428314524384,\"logs\":[],\"metadata\":{\"gas_profile\":null,\"version\":1},\"receipt_ids\":[\"9wXtaskQ13Dreb7JUYuaP1Ap5v63osZWEh2TYSqCbBWr\"],\"status\":{\"SuccessReceiptId\":\"9wXtaskQ13Dreb7JUYuaP1Ap5v63osZWEh2TYSqCbBWr\"},\"tokens_burnt\":\"242831452438400000000\"},\"proof\":[{\"direction\":\"Right\",\"hash\":\"88X6qHEGKb5RmFMgZoUYUsnKuhMpmJZMGXdjCSDNr7rK\"},{\"direction\":\"Right\",\"hash\":\"6eHyprQvWcJxkAwseG3mXnX2mb4gesgevFUFmMZgzHNo\"},{\"direction\":\"Left\",\"hash\":\"7Dfb2vHxCahwTCZugK7xWamCwSmRYNogcaKbN63jwzLE\"},{\"direction\":\"Right\",\"hash\":\"DDEAhsCW9dyfhBsviTNRy7mnrg2sH2Nynh9ujbUhn9Uy\"}]},\"receipt\":null},\"transaction\":{\"actions\":[{\"FunctionCall\":{\"args\":\"eyJyZWNlaXZlcl9pZCI6InJld2FyZC1vcHRpbi5zd2VhdCIsImFtb3VudCI6IjEwMDAwMDAwMDAwMDAwMDAwMDAiLCJtZW1vIjoic3c6cmV3Om9wdGluOnlLNVdyRTk0MTItNjMzZGY0N2U2ZmU2MmRlOGQ2YjNkYjdjYjQxMGY4NWE3YjEyYTk1N2E1ZTg0ZDQ5MjM2YWE2ODNjOTYyMDE2YiJ9\",\"deposit\":\"1\",\"gas\":14000000000000,\"method_name\":\"ft_transfer\"}}],\"hash\":\"725pXT1Xa3y3VaeW8oTb66MuVh28bU11YdzhRQSfnbuQ\",\"nonce\":66746200000070,\"public_key\":\"ed25519:7gQA1ugkWgJWHzBNqPofUVh3cuXo3Xjx6tQ4BBbhto4E\",\"receiver_id\":\"token.sweat\",\"signature\":\"ed25519:43rfgqojWh8B89uNHh1qKPEPz44SAjhteDrWfgQ85BZNyayjykKZZAVJfVcZxkU1biLf7HziCd4Fqmf7Lh1wh75k\",\"signer_id\":\"633df47e6fe62de8d6b3db7cb410f85a7b12a957a5e84d49236aa683c962016b\"}},{\"outcome\":{\"execution_outcome\":{\"block_hash\":\"9DBzUMMZEvipLQRk8uYHspC1xmjV8hTxPgmfFjZcpwSa\",\"id\":\"6c7eBqD46vA51qxUivd6jJBfef2HGy6aB8kM3F4r6aQf\",\"outcome\":{\"executor_id\":\"app.nearcrowd.near\",\"gas_burnt\":2428334647790,\"logs\":[],\"metadata\":{\"gas_profile\":null,\"version\":1},\"receipt_ids\":[\"5ZmodVAgA86mwcXsh2nYwyyfzkvFNKdwDkaUJRKzb86N\"],\"status\":{\"SuccessReceiptId\":\"5ZmodVAgA86mwcXsh2nYwyyfzkvFNKdwDkaUJRKzb86N\"},\"tokens_burnt\":\"242833464779000000000\"},\"proof\":[{\"direction\":\"Left\",\"hash\":\"DuxkimWfk3KRaUY2RzspW5vpyivd6D4xweWgWJ4Bh7E3\"},{\"direction\":\"Right\",\"hash\":\"6eHyprQvWcJxkAwseG3mXnX2mb4gesgevFUFmMZgzHNo\"},{\"direction\":\"Left\",\"hash\":\"7Dfb2vHxCahwTCZugK7xWamCwSmRYNogcaKbN63jwzLE\"},{\"direction\":\"Right\",\"hash\":\"DDEAhsCW9dyfhBsviTNRy7mnrg2sH2Nynh9ujbUhn9Uy\"}]},\"receipt\":null},\"transaction\":{\"actions\":[{\"FunctionCall\":{\"args\":\"eyJhY2NvdW50X2lkIjoicmFib3RhcGVybTMubmVhciIsInNvbHV0aW9uX2hhc2giOlsxODAsMjMsMTQ5LDE3OCwxNzQsMTMwLDM3LDg3LDIwOCwxOTIsOTgsMTg3LDE4OSw0Niw2MSwxNzAsMTA3LDIzMCw5NSwxODcsNjQsMTA0LDIzMywyMTcsMTMyLDE2NCwxOCwxMzksMjI3LDU5LDEwMiwxMThdfQ==\",\"deposit\":\"0\",\"gas\":200000000000000,\"method_name\":\"approve_solution\"}}],\"hash\":\"6c7eBqD46vA51qxUivd6jJBfef2HGy6aB8kM3F4r6aQf\",\"nonce\":43616664839556,\"public_key\":\"ed25519:aSgLALWzkhfCa5D66V8x8QgP1qU46mWVA2CikGJNYVm\",\"receiver_id\":\"app.nearcrowd.near\",\"signature\":\"ed25519:VrzQPazZW6XSwW9b5jRNZyfiCFn4kUnaUjhANccts2B6R2hvRvB5W9bXKgmPpvCBdFMtnW7ensKVEdWa9gkuqGo\",\"signer_id\":\"app.nearcrowd.near\"}}]},\"receipt_execution_outcomes\":[{\"execution_outcome\":{\"block_hash\":\"9DBzUMMZEvipLQRk8uYHspC1xmjV8hTxPgmfFjZcpwSa\",\"id\":\"5ZmodVAgA86mwcXsh2nYwyyfzkvFNKdwDkaUJRKzb86N\",\"outcome\":{\"executor_id\":\"app.nearcrowd.near\",\"gas_burnt\":3268580321039,\"logs\":[],\"metadata\":{\"gas_profile\":[{\"cost\":\"BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"3177217332\"},{\"cost\":\"CONTRACT_LOADING_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"35445963\"},{\"cost\":\"CONTRACT_LOADING_BYTES\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"104961404250\"},{\"cost\":\"READ_CACHED_TRIE_NODE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"86640000000\"},{\"cost\":\"READ_MEMORY_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"13049316000\"},{\"cost\":\"READ_MEMORY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"323113305\"},{\"cost\":\"READ_REGISTER_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"7551495558\"},{\"cost\":\"READ_REGISTER_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"20599458\"},{\"cost\":\"STORAGE_READ_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"56356845750\"},{\"cost\":\"STORAGE_READ_KEY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"154762665\"},{\"cost\":\"STORAGE_READ_VALUE_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"123442110\"},{\"cost\":\"STORAGE_WRITE_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"128393472000\"},{\"cost\":\"STORAGE_WRITE_EVICTED_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"706580754\"},{\"cost\":\"STORAGE_WRITE_KEY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"1832554542\"},{\"cost\":\"STORAGE_WRITE_VALUE_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"1675001106\"},{\"cost\":\"TOUCHING_TRIE_NODE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"386446942224\"},{\"cost\":\"WASM_INSTRUCTION\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"24629200860\"},{\"cost\":\"WRITE_MEMORY_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"11215179444\"},{\"cost\":\"WRITE_MEMORY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"612848700\"},{\"cost\":\"WRITE_REGISTER_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"11462089944\"},{\"cost\":\"WRITE_REGISTER_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"878161284\"}],\"version\":3},\"receipt_ids\":[\"4S6nFp6Hv5Fvc936k1HE7ryBdXBYtC8a1nyZA9nxEPXA\"],\"status\":{\"SuccessValue\":\"\"},\"tokens_burnt\":\"326858032103900000000\"},\"proof\":[{\"direction\":\"Right\",\"hash\":\"E6xxA1eZsVkcRVnqX68wPwmjmwdvhS2KXsuRZtZMBUE9\"},{\"direction\":\"Left\",\"hash\":\"35WpA5eZTVA6Wo7aw4k1CsyPQWaKrjsCttgsoeedX3X8\"},{\"direction\":\"Left\",\"hash\":\"7Dfb2vHxCahwTCZugK7xWamCwSmRYNogcaKbN63jwzLE\"},{\"direction\":\"Right\",\"hash\":\"DDEAhsCW9dyfhBsviTNRy7mnrg2sH2Nynh9ujbUhn9Uy\"}]},\"receipt\":{\"predecessor_id\":\"app.nearcrowd.near\",\"receipt\":{\"Action\":{\"actions\":[{\"FunctionCall\":{\"args\":\"eyJhY2NvdW50X2lkIjoicmFib3RhcGVybTMubmVhciIsInNvbHV0aW9uX2hhc2giOlsxODAsMjMsMTQ5LDE3OCwxNzQsMTMwLDM3LDg3LDIwOCwxOTIsOTgsMTg3LDE4OSw0Niw2MSwxNzAsMTA3LDIzMCw5NSwxODcsNjQsMTA0LDIzMywyMTcsMTMyLDE2NCwxOCwxMzksMjI3LDU5LDEwMiwxMThdfQ==\",\"deposit\":\"0\",\"gas\":200000000000000,\"method_name\":\"approve_solution\"}}],\"gas_price\":\"335989893\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"app.nearcrowd.near\",\"signer_public_key\":\"ed25519:aSgLALWzkhfCa5D66V8x8QgP1qU46mWVA2CikGJNYVm\"}},\"receipt_id\":\"5ZmodVAgA86mwcXsh2nYwyyfzkvFNKdwDkaUJRKzb86N\",\"receiver_id\":\"app.nearcrowd.near\"}},{\"execution_outcome\":{\"block_hash\":\"9DBzUMMZEvipLQRk8uYHspC1xmjV8hTxPgmfFjZcpwSa\",\"id\":\"wkEmrrch8JHi6WyZGwLeQLxPia8jAKWFty3BSQKo2mL\",\"outcome\":{\"executor_id\":\"app.nearcrowd.near\",\"gas_burnt\":223182562500,\"logs\":[],\"metadata\":{\"gas_profile\":[],\"version\":3},\"receipt_ids\":[],\"status\":{\"SuccessValue\":\"\"},\"tokens_burnt\":\"0\"},\"proof\":[{\"direction\":\"Left\",\"hash\":\"5y1C3zB5tMjn9rx32CathQwFo13JhLXYEaLZEgrimKSz\"},{\"direction\":\"Left\",\"hash\":\"35WpA5eZTVA6Wo7aw4k1CsyPQWaKrjsCttgsoeedX3X8\"},{\"direction\":\"Left\",\"hash\":\"7Dfb2vHxCahwTCZugK7xWamCwSmRYNogcaKbN63jwzLE\"},{\"direction\":\"Right\",\"hash\":\"DDEAhsCW9dyfhBsviTNRy7mnrg2sH2Nynh9ujbUhn9Uy\"}]},\"receipt\":{\"predecessor_id\":\"system\",\"receipt\":{\"Action\":{\"actions\":[{\"Transfer\":{\"deposit\":\"67682515494078360916120\"}}],\"gas_price\":\"0\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"app.nearcrowd.near\",\"signer_public_key\":\"ed25519:6MP4bCPHEud33eKXM9kg7f9fVNhmn97CNUyn5ZwM375U\"}},\"receipt_id\":\"wkEmrrch8JHi6WyZGwLeQLxPia8jAKWFty3BSQKo2mL\",\"receiver_id\":\"app.nearcrowd.near\"}},{\"execution_outcome\":{\"block_hash\":\"9DBzUMMZEvipLQRk8uYHspC1xmjV8hTxPgmfFjZcpwSa\",\"id\":\"EGUtwPTotLcKHePRHSnjf9LMsEabpGaedc8s6aphefLU\",\"outcome\":{\"executor_id\":\"5056c7872cfc439db2ea265d4c4a71bc77a3a7c3286ec2defbce052f80f18b78\",\"gas_burnt\":4174947687500,\"logs\":[],\"metadata\":{\"gas_profile\":[],\"version\":3},\"receipt_ids\":[],\"status\":{\"SuccessValue\":\"\"},\"tokens_burnt\":\"0\"},\"proof\":[{\"direction\":\"Right\",\"hash\":\"ELqyFiTWVun73VTpDseE4ztjAa5ijiDkYBKeS6XptJyP\"},{\"direction\":\"Right\",\"hash\":\"3VD9SLrVM9kXKnyXcpbd7vqFGy5qyPoMnZtKhxzaXUNb\"},{\"direction\":\"Right\",\"hash\":\"hDyE63jjg6jKyB8Wp2enbUJpJVKPBSmVi6TZR5pTbzH\"},{\"direction\":\"Left\",\"hash\":\"6UJVKxW7wsTn5Z9DJQ1N1FuGgRHcuZWFgn5cVxLV7WgJ\"}]},\"receipt\":{\"predecessor_id\":\"system\",\"receipt\":{\"Action\":{\"actions\":[{\"Transfer\":{\"deposit\":\"1387847081208855516800\"}}],\"gas_price\":\"0\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"5056c7872cfc439db2ea265d4c4a71bc77a3a7c3286ec2defbce052f80f18b78\",\"signer_public_key\":\"ed25519:6QcN7PVG1vTXn5D1noy7ySuwp25wNfAjpwMUbew9RAkw\"}},\"receipt_id\":\"EGUtwPTotLcKHePRHSnjf9LMsEabpGaedc8s6aphefLU\",\"receiver_id\":\"5056c7872cfc439db2ea265d4c4a71bc77a3a7c3286ec2defbce052f80f18b78\"}},{\"execution_outcome\":{\"block_hash\":\"9DBzUMMZEvipLQRk8uYHspC1xmjV8hTxPgmfFjZcpwSa\",\"id\":\"7LJHuTJtB1mwCW2d1boxHfrH3yqWEzAL9E5xNacVZ26T\",\"outcome\":{\"executor_id\":\"a4d23d50a736298dc642a3ee1d573a652fabf348741af1506b1f7da70d7444d9\",\"gas_burnt\":4174947687500,\"logs\":[],\"metadata\":{\"gas_profile\":[],\"version\":3},\"receipt_ids\":[],\"status\":{\"SuccessValue\":\"\"},\"tokens_burnt\":\"0\"},\"proof\":[{\"direction\":\"Left\",\"hash\":\"BYwpVDfbUDpwKZ2JXUWuh54VKkTGDnUEqvwDMytrdy94\"},{\"direction\":\"Right\",\"hash\":\"3VD9SLrVM9kXKnyXcpbd7vqFGy5qyPoMnZtKhxzaXUNb\"},{\"direction\":\"Right\",\"hash\":\"hDyE63jjg6jKyB8Wp2enbUJpJVKPBSmVi6TZR5pTbzH\"},{\"direction\":\"Left\",\"hash\":\"6UJVKxW7wsTn5Z9DJQ1N1FuGgRHcuZWFgn5cVxLV7WgJ\"}]},\"receipt\":{\"predecessor_id\":\"system\",\"receipt\":{\"Action\":{\"actions\":[{\"Transfer\":{\"deposit\":\"3644939925066522787968\"}}],\"gas_price\":\"0\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"a4d23d50a736298dc642a3ee1d573a652fabf348741af1506b1f7da70d7444d9\",\"signer_public_key\":\"ed25519:C6PoMvWCUZjn5etgoZtV3AL8uAUguxQvi1YXpztSuXZJ\"}},\"receipt_id\":\"7LJHuTJtB1mwCW2d1boxHfrH3yqWEzAL9E5xNacVZ26T\",\"receiver_id\":\"a4d23d50a736298dc642a3ee1d573a652fabf348741af1506b1f7da70d7444d9\"}},{\"execution_outcome\":{\"block_hash\":\"9DBzUMMZEvipLQRk8uYHspC1xmjV8hTxPgmfFjZcpwSa\",\"id\":\"EfrMsmNUQPuuvqSsEcwUf32gwKUPTmLxza5goBcjD9oM\",\"outcome\":{\"executor_id\":\"62217dd0183ad47712dfb16db9000fd8d0ecc8d6993cd02e2c5f34353086e912\",\"gas_burnt\":4174947687500,\"logs\":[],\"metadata\":{\"gas_profile\":[],\"version\":3},\"receipt_ids\":[],\"status\":{\"SuccessValue\":\"\"},\"tokens_burnt\":\"0\"},\"proof\":[{\"direction\":\"Right\",\"hash\":\"F3m2WYzXtJEuMncqBuiXQaXSQXCXAgvLokymtcT9BPRa\"},{\"direction\":\"Left\",\"hash\":\"6LqosNhAB2DKAQY2HwrBmWG6bqBR8b72YRgMBhktGAAf\"},{\"direction\":\"Right\",\"hash\":\"hDyE63jjg6jKyB8Wp2enbUJpJVKPBSmVi6TZR5pTbzH\"},{\"direction\":\"Left\",\"hash\":\"6UJVKxW7wsTn5Z9DJQ1N1FuGgRHcuZWFgn5cVxLV7WgJ\"}]},\"receipt\":{\"predecessor_id\":\"system\",\"receipt\":{\"Action\":{\"actions\":[{\"Transfer\":{\"deposit\":\"1453947853555455516800\"}}],\"gas_price\":\"0\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"62217dd0183ad47712dfb16db9000fd8d0ecc8d6993cd02e2c5f34353086e912\",\"signer_public_key\":\"ed25519:7c4aKGGRKEXPvs6NyV7KVnPPT989ybzad7WyRpvmReC1\"}},\"receipt_id\":\"EfrMsmNUQPuuvqSsEcwUf32gwKUPTmLxza5goBcjD9oM\",\"receiver_id\":\"62217dd0183ad47712dfb16db9000fd8d0ecc8d6993cd02e2c5f34353086e912\"}},{\"execution_outcome\":{\"block_hash\":\"9DBzUMMZEvipLQRk8uYHspC1xmjV8hTxPgmfFjZcpwSa\",\"id\":\"63uRd5CF4r4nFMyAXt2nxosRgWKwEvY1a3St6UWKnP3B\",\"outcome\":{\"executor_id\":\"3b85021542769d2cf82b2eb5b9cebcd509a1e4722ea67ae36c868d8e93ef12e4\",\"gas_burnt\":4174947687500,\"logs\":[],\"metadata\":{\"gas_profile\":[],\"version\":3},\"receipt_ids\":[],\"status\":{\"SuccessValue\":\"\"},\"tokens_burnt\":\"0\"},\"proof\":[{\"direction\":\"Left\",\"hash\":\"AipnxckbYg3kjZPTtQn7pBuULnaL9ich5jXuHZhocUqa\"},{\"direction\":\"Left\",\"hash\":\"6LqosNhAB2DKAQY2HwrBmWG6bqBR8b72YRgMBhktGAAf\"},{\"direction\":\"Right\",\"hash\":\"hDyE63jjg6jKyB8Wp2enbUJpJVKPBSmVi6TZR5pTbzH\"},{\"direction\":\"Left\",\"hash\":\"6UJVKxW7wsTn5Z9DJQ1N1FuGgRHcuZWFgn5cVxLV7WgJ\"}]},\"receipt\":{\"predecessor_id\":\"system\",\"receipt\":{\"Action\":{\"actions\":[{\"Transfer\":{\"deposit\":\"1453949828169855516800\"}}],\"gas_price\":\"0\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"3b85021542769d2cf82b2eb5b9cebcd509a1e4722ea67ae36c868d8e93ef12e4\",\"signer_public_key\":\"ed25519:Gdyiwso3herrNehT3Y2v5ZeRa3LFH2e7ghvrvzuqT7cV\"}},\"receipt_id\":\"63uRd5CF4r4nFMyAXt2nxosRgWKwEvY1a3St6UWKnP3B\",\"receiver_id\":\"3b85021542769d2cf82b2eb5b9cebcd509a1e4722ea67ae36c868d8e93ef12e4\"}},{\"execution_outcome\":{\"block_hash\":\"9DBzUMMZEvipLQRk8uYHspC1xmjV8hTxPgmfFjZcpwSa\",\"id\":\"EgM2FYLA7MLq1mu2ZEFfJqR2KMcEp9hHTN6itQcRqJS1\",\"outcome\":{\"executor_id\":\"038e48d2b37cf304b256bdec10afae201247ba7496cfa969409a75e4504cc734\",\"gas_burnt\":4174947687500,\"logs\":[],\"metadata\":{\"gas_profile\":[],\"version\":3},\"receipt_ids\":[],\"status\":{\"SuccessValue\":\"\"},\"tokens_burnt\":\"0\"},\"proof\":[{\"direction\":\"Right\",\"hash\":\"CWWXtdxFs6trzreuoePLtZuN9mFKFUhS8yKtAKddzT9F\"},{\"direction\":\"Right\",\"hash\":\"HkjReC1dpNnUyPEXBDF13UcCzSykrj2UTvZZyH2o8Sc1\"},{\"direction\":\"Left\",\"hash\":\"9biivFU7bgitUxdUB2gA2XA7kAmBKQH8QzZYN9RjXJQm\"},{\"direction\":\"Left\",\"hash\":\"6UJVKxW7wsTn5Z9DJQ1N1FuGgRHcuZWFgn5cVxLV7WgJ\"}]},\"receipt\":{\"predecessor_id\":\"system\",\"receipt\":{\"Action\":{\"actions\":[{\"Transfer\":{\"deposit\":\"1453948511760255516800\"}}],\"gas_price\":\"0\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"038e48d2b37cf304b256bdec10afae201247ba7496cfa969409a75e4504cc734\",\"signer_public_key\":\"ed25519:Et4VVriLX9S6gg4pHMfSdWASY4rk5vyJxufe1HnscEw\"}},\"receipt_id\":\"EgM2FYLA7MLq1mu2ZEFfJqR2KMcEp9hHTN6itQcRqJS1\",\"receiver_id\":\"038e48d2b37cf304b256bdec10afae201247ba7496cfa969409a75e4504cc734\"}},{\"execution_outcome\":{\"block_hash\":\"9DBzUMMZEvipLQRk8uYHspC1xmjV8hTxPgmfFjZcpwSa\",\"id\":\"G36EY7JbD8Fuqdhagc5d7QTX8nJwQbMGXzrnQsKZYzsw\",\"outcome\":{\"executor_id\":\"92e86f8284c5604e4445608a071705ad2445a140df75bdae23ed94de2ab49d42\",\"gas_burnt\":4174947687500,\"logs\":[],\"metadata\":{\"gas_profile\":[],\"version\":3},\"receipt_ids\":[],\"status\":{\"SuccessValue\":\"\"},\"tokens_burnt\":\"0\"},\"proof\":[{\"direction\":\"Left\",\"hash\":\"8CevjeiMYtN7CrbuqQNsZNSoKrqrLDFuAogyQV7R5rDe\"},{\"direction\":\"Right\",\"hash\":\"HkjReC1dpNnUyPEXBDF13UcCzSykrj2UTvZZyH2o8Sc1\"},{\"direction\":\"Left\",\"hash\":\"9biivFU7bgitUxdUB2gA2XA7kAmBKQH8QzZYN9RjXJQm\"},{\"direction\":\"Left\",\"hash\":\"6UJVKxW7wsTn5Z9DJQ1N1FuGgRHcuZWFgn5cVxLV7WgJ\"}]},\"receipt\":{\"predecessor_id\":\"system\",\"receipt\":{\"Action\":{\"actions\":[{\"Transfer\":{\"deposit\":\"3676415604628722787968\"}}],\"gas_price\":\"0\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"92e86f8284c5604e4445608a071705ad2445a140df75bdae23ed94de2ab49d42\",\"signer_public_key\":\"ed25519:AtU6HQQSXW3ZpRzFBx5sdgjCssXL4bFdzPBzVeWgqVqb\"}},\"receipt_id\":\"G36EY7JbD8Fuqdhagc5d7QTX8nJwQbMGXzrnQsKZYzsw\",\"receiver_id\":\"92e86f8284c5604e4445608a071705ad2445a140df75bdae23ed94de2ab49d42\"}},{\"execution_outcome\":{\"block_hash\":\"9DBzUMMZEvipLQRk8uYHspC1xmjV8hTxPgmfFjZcpwSa\",\"id\":\"95GSz1TgWKAniZct6ruPsfLsrDhZKJgb5ggRYmMu48x\",\"outcome\":{\"executor_id\":\"39897bf9a78b1d67918ee33c27364b11b480b2b279930b09f0a9c1b926da8aaf\",\"gas_burnt\":4174947687500,\"logs\":[],\"metadata\":{\"gas_profile\":[],\"version\":3},\"receipt_ids\":[],\"status\":{\"SuccessValue\":\"\"},\"tokens_burnt\":\"0\"},\"proof\":[{\"direction\":\"Right\",\"hash\":\"8WTWp8MFkuz2Ka5DR7rcGinWTCfA5nY3n5vF2Km9vZy8\"},{\"direction\":\"Left\",\"hash\":\"EDK54wzVnz68TCA3e397oFX98oPzHTttdiHyWjYkmXSG\"},{\"direction\":\"Left\",\"hash\":\"9biivFU7bgitUxdUB2gA2XA7kAmBKQH8QzZYN9RjXJQm\"},{\"direction\":\"Left\",\"hash\":\"6UJVKxW7wsTn5Z9DJQ1N1FuGgRHcuZWFgn5cVxLV7WgJ\"}]},\"receipt\":{\"predecessor_id\":\"system\",\"receipt\":{\"Action\":{\"actions\":[{\"Transfer\":{\"deposit\":\"3674122231792122787968\"}}],\"gas_price\":\"0\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"39897bf9a78b1d67918ee33c27364b11b480b2b279930b09f0a9c1b926da8aaf\",\"signer_public_key\":\"ed25519:4sbqB2C9gB2opvbppj2dbqSPYL3KAi7WmumHTdXTV2pe\"}},\"receipt_id\":\"95GSz1TgWKAniZct6ruPsfLsrDhZKJgb5ggRYmMu48x\",\"receiver_id\":\"39897bf9a78b1d67918ee33c27364b11b480b2b279930b09f0a9c1b926da8aaf\"}},{\"execution_outcome\":{\"block_hash\":\"9DBzUMMZEvipLQRk8uYHspC1xmjV8hTxPgmfFjZcpwSa\",\"id\":\"JU2BBLxYb2JqxDqvW8bWXvXcaUHmJzySJYLayrtTEPw\",\"outcome\":{\"executor_id\":\"4bfd719f2f327fb9b743925e92f10e3578efa6b25f9144f5cc0776a394b5dd22\",\"gas_burnt\":4174947687500,\"logs\":[],\"metadata\":{\"gas_profile\":[],\"version\":3},\"receipt_ids\":[],\"status\":{\"SuccessValue\":\"\"},\"tokens_burnt\":\"0\"},\"proof\":[{\"direction\":\"Left\",\"hash\":\"EgE8uELbUBBXJ75GuSxgYTXAkPmFKnDdeyA6ry7cpnBD\"},{\"direction\":\"Left\",\"hash\":\"EDK54wzVnz68TCA3e397oFX98oPzHTttdiHyWjYkmXSG\"},{\"direction\":\"Left\",\"hash\":\"9biivFU7bgitUxdUB2gA2XA7kAmBKQH8QzZYN9RjXJQm\"},{\"direction\":\"Left\",\"hash\":\"6UJVKxW7wsTn5Z9DJQ1N1FuGgRHcuZWFgn5cVxLV7WgJ\"}]},\"receipt\":{\"predecessor_id\":\"system\",\"receipt\":{\"Action\":{\"actions\":[{\"Transfer\":{\"deposit\":\"3679637641325922787968\"}}],\"gas_price\":\"0\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"4bfd719f2f327fb9b743925e92f10e3578efa6b25f9144f5cc0776a394b5dd22\",\"signer_public_key\":\"ed25519:67dj1hMYcS9Nywx8SVscss3fuFC8w8D84UknNDdZCJqf\"}},\"receipt_id\":\"JU2BBLxYb2JqxDqvW8bWXvXcaUHmJzySJYLayrtTEPw\",\"receiver_id\":\"4bfd719f2f327fb9b743925e92f10e3578efa6b25f9144f5cc0776a394b5dd22\"}}],\"shard_id\":0,\"state_changes\":[{\"cause\":{\"receipt_hash\":\"EgM2FYLA7MLq1mu2ZEFfJqR2KMcEp9hHTN6itQcRqJS1\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"038e48d2b37cf304b256bdec10afae201247ba7496cfa969409a75e4504cc734\",\"amount\":\"39487555560414499999988\",\"code_hash\":\"11111111111111111111111111111111\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":182},\"type\":\"account_update\"},{\"cause\":{\"tx_hash\":\"9PYCn1h6f3UwP2fGoUKLToZRPvUmDTJ3aHhyBrPqEKTd\",\"type\":\"transaction_processing\"},\"change\":{\"account_id\":\"1d6c1c8b24edf29e581613a2b5501d023ab762b55541d731bbd6f1926a857978\",\"amount\":\"90554939608117150993531\",\"code_hash\":\"11111111111111111111111111111111\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":182},\"type\":\"account_update\"},{\"cause\":{\"receipt_hash\":\"95GSz1TgWKAniZct6ruPsfLsrDhZKJgb5ggRYmMu48x\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"39897bf9a78b1d67918ee33c27364b11b480b2b279930b09f0a9c1b926da8aaf\",\"amount\":\"48193056997992000000000\",\"code_hash\":\"11111111111111111111111111111111\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":182},\"type\":\"account_update\"},{\"cause\":{\"receipt_hash\":\"63uRd5CF4r4nFMyAXt2nxosRgWKwEvY1a3St6UWKnP3B\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"3b85021542769d2cf82b2eb5b9cebcd509a1e4722ea67ae36c868d8e93ef12e4\",\"amount\":\"38118153165737999999925\",\"code_hash\":\"11111111111111111111111111111111\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":182},\"type\":\"account_update\"},{\"cause\":{\"receipt_hash\":\"JU2BBLxYb2JqxDqvW8bWXvXcaUHmJzySJYLayrtTEPw\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"4bfd719f2f327fb9b743925e92f10e3578efa6b25f9144f5cc0776a394b5dd22\",\"amount\":\"27744945708671399999981\",\"code_hash\":\"11111111111111111111111111111111\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":264},\"type\":\"account_update\"},{\"cause\":{\"receipt_hash\":\"EGUtwPTotLcKHePRHSnjf9LMsEabpGaedc8s6aphefLU\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"5056c7872cfc439db2ea265d4c4a71bc77a3a7c3286ec2defbce052f80f18b78\",\"amount\":\"69878118593702699999951\",\"code_hash\":\"11111111111111111111111111111111\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":182},\"type\":\"account_update\"},{\"cause\":{\"receipt_hash\":\"EfrMsmNUQPuuvqSsEcwUf32gwKUPTmLxza5goBcjD9oM\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"62217dd0183ad47712dfb16db9000fd8d0ecc8d6993cd02e2c5f34353086e912\",\"amount\":\"58063870523474699999955\",\"code_hash\":\"11111111111111111111111111111111\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":182},\"type\":\"account_update\"},{\"cause\":{\"tx_hash\":\"725pXT1Xa3y3VaeW8oTb66MuVh28bU11YdzhRQSfnbuQ\",\"type\":\"transaction_processing\"},\"change\":{\"account_id\":\"633df47e6fe62de8d6b3db7cb410f85a7b12a957a5e84d49236aa683c962016b\",\"amount\":\"39124549646773544483143\",\"code_hash\":\"11111111111111111111111111111111\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":182},\"type\":\"account_update\"},{\"cause\":{\"tx_hash\":\"4zPqfd2F5DGfADGLLAMK4Ya4atDeXWgWpunRkhaTRdm6\",\"type\":\"transaction_processing\"},\"change\":{\"account_id\":\"7fc1dd34509cf7b0d6692179bb99ab99ae71f224e3e6d119dbc7e40b6a5458d0\",\"amount\":\"42560438434895244483193\",\"code_hash\":\"11111111111111111111111111111111\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":182},\"type\":\"account_update\"},{\"cause\":{\"tx_hash\":\"HVua5uD1PUjoakRF3mVKW5a3qaRzugvAoYgYkVHxcyd\",\"type\":\"transaction_processing\"},\"change\":{\"account_id\":\"89addbfbfc6b34ae6403f39ee2c92280827d80a98dc40d15729824d232be343d\",\"amount\":\"1973088651770369477211934\",\"code_hash\":\"11111111111111111111111111111111\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":182},\"type\":\"account_update\"},{\"cause\":{\"receipt_hash\":\"G36EY7JbD8Fuqdhagc5d7QTX8nJwQbMGXzrnQsKZYzsw\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"92e86f8284c5604e4445608a071705ad2445a140df75bdae23ed94de2ab49d42\",\"amount\":\"33419251951148899999990\",\"code_hash\":\"11111111111111111111111111111111\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":182},\"type\":\"account_update\"},{\"cause\":{\"tx_hash\":\"4Fgd5NkSW8KAw4vo6yoa9uWN7evpgkRFxDLw68ZZUdas\",\"type\":\"transaction_processing\"},\"change\":{\"account_id\":\"998aef31da68f8a525d54d3ce3dc8a68adfd9392969b4e1ce1a943a275d667b4\",\"amount\":\"61306954596810168364616\",\"code_hash\":\"11111111111111111111111111111111\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":182},\"type\":\"account_update\"},{\"cause\":{\"receipt_hash\":\"7LJHuTJtB1mwCW2d1boxHfrH3yqWEzAL9E5xNacVZ26T\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"a4d23d50a736298dc642a3ee1d573a652fabf348741af1506b1f7da70d7444d9\",\"amount\":\"48163874691266400000000\",\"code_hash\":\"11111111111111111111111111111111\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":182},\"type\":\"account_update\"},{\"cause\":{\"tx_hash\":\"6c7eBqD46vA51qxUivd6jJBfef2HGy6aB8kM3F4r6aQf\",\"type\":\"transaction_processing\"},\"change\":{\"account_id\":\"app.nearcrowd.near\",\"amount\":\"3906305571940326122040431880\",\"code_hash\":\"DyHG2t99dBZWiPgX53Z4UbbBQR6JJoxmqXwaKD4hTeyP\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":3655277},\"type\":\"account_update\"},{\"cause\":{\"receipt_hash\":\"5ZmodVAgA86mwcXsh2nYwyyfzkvFNKdwDkaUJRKzb86N\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"app.nearcrowd.near\",\"amount\":\"3906305571940326122040431880\",\"code_hash\":\"DyHG2t99dBZWiPgX53Z4UbbBQR6JJoxmqXwaKD4hTeyP\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":3655370},\"type\":\"account_update\"},{\"cause\":{\"receipt_hash\":\"5ZmodVAgA86mwcXsh2nYwyyfzkvFNKdwDkaUJRKzb86N\",\"type\":\"action_receipt_gas_reward\"},\"change\":{\"account_id\":\"app.nearcrowd.near\",\"amount\":\"3906305597147696319440431880\",\"code_hash\":\"DyHG2t99dBZWiPgX53Z4UbbBQR6JJoxmqXwaKD4hTeyP\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":3655370},\"type\":\"account_update\"},{\"cause\":{\"receipt_hash\":\"wkEmrrch8JHi6WyZGwLeQLxPia8jAKWFty3BSQKo2mL\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"app.nearcrowd.near\",\"amount\":\"3906373279663190397801348000\",\"code_hash\":\"DyHG2t99dBZWiPgX53Z4UbbBQR6JJoxmqXwaKD4hTeyP\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":3655370},\"type\":\"account_update\"},{\"cause\":{\"tx_hash\":\"9PYCn1h6f3UwP2fGoUKLToZRPvUmDTJ3aHhyBrPqEKTd\",\"type\":\"transaction_processing\"},\"change\":{\"access_key\":{\"nonce\":82709690000066,\"permission\":\"FullAccess\"},\"account_id\":\"1d6c1c8b24edf29e581613a2b5501d023ab762b55541d731bbd6f1926a857978\",\"public_key\":\"ed25519:5hF5RjYCQsW1PAfVbT68gBRHZ7wSy3Zqtz8TeeX4mCaD\"},\"type\":\"access_key_update\"},{\"cause\":{\"tx_hash\":\"725pXT1Xa3y3VaeW8oTb66MuVh28bU11YdzhRQSfnbuQ\",\"type\":\"transaction_processing\"},\"change\":{\"access_key\":{\"nonce\":66746200000070,\"permission\":\"FullAccess\"},\"account_id\":\"633df47e6fe62de8d6b3db7cb410f85a7b12a957a5e84d49236aa683c962016b\",\"public_key\":\"ed25519:7gQA1ugkWgJWHzBNqPofUVh3cuXo3Xjx6tQ4BBbhto4E\"},\"type\":\"access_key_update\"},{\"cause\":{\"tx_hash\":\"4zPqfd2F5DGfADGLLAMK4Ya4atDeXWgWpunRkhaTRdm6\",\"type\":\"transaction_processing\"},\"change\":{\"access_key\":{\"nonce\":73110403000008,\"permission\":\"FullAccess\"},\"account_id\":\"7fc1dd34509cf7b0d6692179bb99ab99ae71f224e3e6d119dbc7e40b6a5458d0\",\"public_key\":\"ed25519:9biETR76Ar5A9gdcN4M1VCRCYNh95bMkbKUV2wZYv41m\"},\"type\":\"access_key_update\"},{\"cause\":{\"tx_hash\":\"HVua5uD1PUjoakRF3mVKW5a3qaRzugvAoYgYkVHxcyd\",\"type\":\"transaction_processing\"},\"change\":{\"access_key\":{\"nonce\":73754297000120,\"permission\":\"FullAccess\"},\"account_id\":\"89addbfbfc6b34ae6403f39ee2c92280827d80a98dc40d15729824d232be343d\",\"public_key\":\"ed25519:AGScmR9rZXuSuKaSZtZYzGZsxKor1NPCfNam6aaFbdMN\"},\"type\":\"access_key_update\"},{\"cause\":{\"tx_hash\":\"4Fgd5NkSW8KAw4vo6yoa9uWN7evpgkRFxDLw68ZZUdas\",\"type\":\"transaction_processing\"},\"change\":{\"access_key\":{\"nonce\":86193362000020,\"permission\":\"FullAccess\"},\"account_id\":\"998aef31da68f8a525d54d3ce3dc8a68adfd9392969b4e1ce1a943a275d667b4\",\"public_key\":\"ed25519:Ds2WiuryPoxnHUGgKEoQP89Un3rcACu52az89zv6pFke\"},\"type\":\"access_key_update\"},{\"cause\":{\"tx_hash\":\"6c7eBqD46vA51qxUivd6jJBfef2HGy6aB8kM3F4r6aQf\",\"type\":\"transaction_processing\"},\"change\":{\"access_key\":{\"nonce\":43616664839556,\"permission\":\"FullAccess\"},\"account_id\":\"app.nearcrowd.near\",\"public_key\":\"ed25519:aSgLALWzkhfCa5D66V8x8QgP1qU46mWVA2CikGJNYVm\"},\"type\":\"access_key_update\"},{\"cause\":{\"receipt_hash\":\"5ZmodVAgA86mwcXsh2nYwyyfzkvFNKdwDkaUJRKzb86N\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"app.nearcrowd.near\",\"key_base64\":\"U1RBVEU=\",\"value_base64\":\"EgAAAGFwcC5uZWFyY3Jvd2QubmVhcg==\"},\"type\":\"data_update\"},{\"cause\":{\"receipt_hash\":\"5ZmodVAgA86mwcXsh2nYwyyfzkvFNKdwDkaUJRKzb86N\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"app.nearcrowd.near\",\"key_base64\":\"YRAAAAByYWJvdGFwZXJtMy5uZWFy\",\"value_base64\":\"tBeVsq6CJVfQwGK7vS49qmvmX7tAaOnZhKQSi+M7ZnY=\"},\"type\":\"data_update\"}]},{\"chunk\":{\"author\":\"figment.poolv1.near\",\"header\":{\"balance_burnt\":\"830964127214000000000\",\"chunk_hash\":\"HEvcb6D3ccK3uBa2jvPR1cyJKtizmajSetCtfzDTJuX4\",\"encoded_length\":314,\"encoded_merkle_root\":\"HGcw4GhAFX3miVA8Cd3comzt54JeMwS6xsAGmvPRaGvd\",\"gas_limit\":1000000000000000,\"gas_used\":9789559232514,\"height_created\":92764782,\"height_included\":92764782,\"outcome_root\":\"EGNwA73SqFkV2oFR5J5QiPkjqzUx3nBYA2evTTtr1NQV\",\"outgoing_receipts_root\":\"AAUZMgaJxUNLt98ZsjSEhZ7vYu2jQHjujc2HfNT5Bf5R\",\"prev_block_hash\":\"3eB4b25NLhCE4eSa5UsQNeSZxd1qpG46wDCMBZTuWdhp\",\"prev_state_root\":\"8jtQjg2MMSowY6oF6Shvdc3Z4dhibEk7sR8LiAHUm9GA\",\"rent_paid\":\"0\",\"shard_id\":1,\"signature\":\"ed25519:2SNLCU3NHGuaerJ5jPa275wwtxnnu4DQvBh4ozMvXJZuzgs4EJPCfhb2vesnJ5CrF1RyQc9dfDZBn91FRLRP9Njp\",\"tx_root\":\"11111111111111111111111111111111\",\"validator_proposals\":[],\"validator_reward\":\"0\"},\"receipts\":[{\"predecessor_id\":\"system\",\"receipt\":{\"Action\":{\"actions\":[{\"Transfer\":{\"deposit\":\"188376657220304586639852\"}}],\"gas_price\":\"0\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"relay.aurora\",\"signer_public_key\":\"ed25519:F2nobX5Ruw6LR5mxErzJ41u6J4p6YHmuPYr5Lq8roXp1\"}},\"receipt_id\":\"6f3TNmYXE8VXotRzhDxajmP3GThEEn56DJMRyUKRFL6\",\"receiver_id\":\"relay.aurora\"},{\"predecessor_id\":\"system\",\"receipt\":{\"Action\":{\"actions\":[{\"Transfer\":{\"deposit\":\"188703998464321986639852\"}}],\"gas_price\":\"0\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"relay.aurora\",\"signer_public_key\":\"ed25519:ECTjgvJKWrpoCNzC5BGyMAWZcFjqe24n3mMV9ndFcpfy\"}},\"receipt_id\":\"bm7V3pZbt3hbo3dq5NndWdEe89smD7UWBXKqHF8q3MY\",\"receiver_id\":\"relay.aurora\"}],\"transactions\":[]},\"receipt_execution_outcomes\":[],\"shard_id\":1,\"state_changes\":[]},{\"chunk\":{\"author\":\"binancenode1.poolv1.near\",\"header\":{\"balance_burnt\":\"728420795086600000000\",\"chunk_hash\":\"HjHqxNa9rqi4PAuLcrtaM4zuAvLPdaedigT16oUucKmE\",\"encoded_length\":3112,\"encoded_merkle_root\":\"rwG6Cm5h14wnXdeKaFk9WhXRJF8hbi8zXTkEe5vrc15\",\"gas_limit\":1000000000000000,\"gas_used\":32557076638366,\"height_created\":92764782,\"height_included\":92764782,\"outcome_root\":\"28VCHwcMJusGdHxdVsT1ApioKXjL4oKDFZtjS8artpej\",\"outgoing_receipts_root\":\"GnMYZchhfax4ZSYKt4EvcgS8vPYDV6P9aWtBTZxUgaBp\",\"prev_block_hash\":\"3eB4b25NLhCE4eSa5UsQNeSZxd1qpG46wDCMBZTuWdhp\",\"prev_state_root\":\"88eTF9FGBspzrHGuqH327iwSdT9aqvpuMe3ViVkB4Z97\",\"rent_paid\":\"0\",\"shard_id\":2,\"signature\":\"ed25519:5z1AgUsUvmmHW7kZoffsTnFvTzKvtHzFvKpY6UwvJLB6nnbh1k8dHbch3yWkj2urTkgtRRW8F6sJBi8Rcoqe6ZsZ\",\"tx_root\":\"6hq1U2Wu8LyjtKcAH6VDRhwYdjMGaw1evTqSdWfnFjDB\",\"validator_proposals\":[],\"validator_reward\":\"0\"},\"receipts\":[{\"predecessor_id\":\"b5acefe75a5e4b2ddb252d43d3f1b8df457001ba1f589dfb2769470c02a36b9a\",\"receipt\":{\"Action\":{\"actions\":[{\"FunctionCall\":{\"args\":\"eyJhY2NvdW50X2lkIjoiYjVhY2VmZTc1YTVlNGIyZGRiMjUyZDQzZDNmMWI4ZGY0NTcwMDFiYTFmNTg5ZGZiMjc2OTQ3MGMwMmEzNmI5YSJ9\",\"deposit\":\"1250000000000000000000\",\"gas\":30000000000000,\"method_name\":\"storage_deposit\"}}],\"gas_price\":\"122987387\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"b5acefe75a5e4b2ddb252d43d3f1b8df457001ba1f589dfb2769470c02a36b9a\",\"signer_public_key\":\"ed25519:3y5fUDm1yY1SK8TRaj7DEMJMLHgh9Fq85AbN1K1ifCZr\"}},\"receipt_id\":\"6Xb4nNi8zGg6KdVhXRWM8uUURfhzFbX4R82E3soep9ES\",\"receiver_id\":\"usdt.tether-token.near\"},{\"predecessor_id\":\"e52871e21c00eb1df7d672dc2cd8d0033fbb1ee6babcb84a9165b1d081a293c4\",\"receipt\":{\"Action\":{\"actions\":[{\"FunctionCall\":{\"args\":\"e30=\",\"deposit\":\"0\",\"gas\":100000000000000,\"method_name\":\"claim\"}}],\"gas_price\":\"186029458\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"e52871e21c00eb1df7d672dc2cd8d0033fbb1ee6babcb84a9165b1d081a293c4\",\"signer_public_key\":\"ed25519:GRY8gUPSMduGWDapXpgVu2dvDxqdmtyJAPzPxvEDRUom\"}},\"receipt_id\":\"BdSkBCq7HtNPybcChSk6o2suvDz42hFB94HxCDePVCci\",\"receiver_id\":\"tge-lockup.sweat\"},{\"predecessor_id\":\"ca3615a0d2e244761f8452be382defc99caad8e5e89ef6e72836d2c622ff4c08\",\"receipt\":{\"Action\":{\"actions\":[{\"FunctionCall\":{\"args\":\"eyJhY2NvdW50X2lkIjoiY2EzNjE1YTBkMmUyNDQ3NjFmODQ1MmJlMzgyZGVmYzk5Y2FhZDhlNWU4OWVmNmU3MjgzNmQyYzYyMmZmNGMwOCJ9\",\"deposit\":\"1250000000000000000000\",\"gas\":30000000000000,\"method_name\":\"storage_deposit\"}}],\"gas_price\":\"122987387\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"ca3615a0d2e244761f8452be382defc99caad8e5e89ef6e72836d2c622ff4c08\",\"signer_public_key\":\"ed25519:EcMBstSN5TXWkvVLQpchNchogUPXQwrN1ehkG7ALshSX\"}},\"receipt_id\":\"BEHb8nxPsFPjbd7tjkBrVbtj5TBy6xbDCBXKhQvwuFLH\",\"receiver_id\":\"usdt.tether-token.near\"}],\"transactions\":[{\"outcome\":{\"execution_outcome\":{\"block_hash\":\"9DBzUMMZEvipLQRk8uYHspC1xmjV8hTxPgmfFjZcpwSa\",\"id\":\"HiBtdcgFjGr8Dhzcz2zXKzsyc9v7cLDT2ZxLybyduVgN\",\"outcome\":{\"executor_id\":\"e2a4479e0abd3c275feafc676906652b9cf22095bc26dc3a4814f56e4cc01b62\",\"gas_burnt\":2428135649664,\"logs\":[],\"metadata\":{\"gas_profile\":null,\"version\":1},\"receipt_ids\":[\"FMCxCw3waZhnb1f5WueZXbxuU4fwG8VLjgJHvcfhYmxs\"],\"status\":{\"SuccessReceiptId\":\"FMCxCw3waZhnb1f5WueZXbxuU4fwG8VLjgJHvcfhYmxs\"},\"tokens_burnt\":\"242813564966400000000\"},\"proof\":[{\"direction\":\"Right\",\"hash\":\"2Bs2Rcpw5BcKWLKG9xmmWHT6CqLaGLt5jbdjx16hcKyL\"},{\"direction\":\"Right\",\"hash\":\"H1E8teAEF4UR971WTTihFDxJkNHztNqyTR1TwHPJN4m6\"},{\"direction\":\"Right\",\"hash\":\"Bez2jppo61YH72P2mW5SjKgacW3da9UvtvgZLvJQ4W9a\"},{\"direction\":\"Right\",\"hash\":\"7oMEED6TMfCbuuULc3Ew22bUT3g64WVJwCyjD5CssBgp\"}]},\"receipt\":null},\"transaction\":{\"actions\":[{\"FunctionCall\":{\"args\":\"eyJhY2NvdW50X2lkIjoiZTJhNDQ3OWUwYWJkM2MyNzVmZWFmYzY3NjkwNjY1MmI5Y2YyMjA5NWJjMjZkYzNhNDgxNGY1NmU0Y2MwMWI2MiJ9\",\"deposit\":\"1250000000000000000000\",\"gas\":30000000000000,\"method_name\":\"storage_deposit\"}}],\"hash\":\"HiBtdcgFjGr8Dhzcz2zXKzsyc9v7cLDT2ZxLybyduVgN\",\"nonce\":92364842000001,\"public_key\":\"ed25519:GFiRuysw4vnSqhwgjKe3U4WZHLq2uhGa3Gs8yRM78Bgm\",\"receiver_id\":\"usdt.tether-token.near\",\"signature\":\"ed25519:5SepUC9fShDneSAmJnCV92AZRKUK2nu2r4bdwnuZV2Xa4XRZNGbaXxFapJvGUocjyALC3pq7KpLQg6jRkUUXaYeW\",\"signer_id\":\"e2a4479e0abd3c275feafc676906652b9cf22095bc26dc3a4814f56e4cc01b62\"}},{\"outcome\":{\"execution_outcome\":{\"block_hash\":\"9DBzUMMZEvipLQRk8uYHspC1xmjV8hTxPgmfFjZcpwSa\",\"id\":\"4JmRYstCvLy6buVi4YuDPSneDSnTFAu7zrjuSTkNKrot\",\"outcome\":{\"executor_id\":\"d6b519b284df72f2ac632984323b4eb96a80e021702848bc0afd8f73396fc903\",\"gas_burnt\":2427936651538,\"logs\":[],\"metadata\":{\"gas_profile\":null,\"version\":1},\"receipt_ids\":[\"215N9jh3rAqLwc4Pons9Df3ZCaDZ2iCAGgLmFCrpHtED\"],\"status\":{\"SuccessReceiptId\":\"215N9jh3rAqLwc4Pons9Df3ZCaDZ2iCAGgLmFCrpHtED\"},\"tokens_burnt\":\"242793665153800000000\"},\"proof\":[{\"direction\":\"Left\",\"hash\":\"CqPhJFL7R9Myqg5Pqy4teN4FbC7UVhs6oFLdZipFfE6J\"},{\"direction\":\"Right\",\"hash\":\"H1E8teAEF4UR971WTTihFDxJkNHztNqyTR1TwHPJN4m6\"},{\"direction\":\"Right\",\"hash\":\"Bez2jppo61YH72P2mW5SjKgacW3da9UvtvgZLvJQ4W9a\"},{\"direction\":\"Right\",\"hash\":\"7oMEED6TMfCbuuULc3Ew22bUT3g64WVJwCyjD5CssBgp\"}]},\"receipt\":null},\"transaction\":{\"actions\":[{\"FunctionCall\":{\"args\":\"e30=\",\"deposit\":\"0\",\"gas\":100000000000000,\"method_name\":\"claim\"}}],\"hash\":\"4JmRYstCvLy6buVi4YuDPSneDSnTFAu7zrjuSTkNKrot\",\"nonce\":73672043000039,\"public_key\":\"ed25519:FT8QyjH4GfZQvbynxqVUaAAMZwzy3pqCBPFXqhR6szJ6\",\"receiver_id\":\"tge-lockup.sweat\",\"signature\":\"ed25519:27SvxqeAghD2b1sN1pHFEcmzsav2SP7kmwNqNhdEhvr7gEEh53ALcTywc99GtYwggQydLEb7yWjNrnjMUmmtTW8e\",\"signer_id\":\"d6b519b284df72f2ac632984323b4eb96a80e021702848bc0afd8f73396fc903\"}},{\"outcome\":{\"execution_outcome\":{\"block_hash\":\"9DBzUMMZEvipLQRk8uYHspC1xmjV8hTxPgmfFjZcpwSa\",\"id\":\"DHkBYbjiL84Dc5dmyYtLvk1yS3mVco8HBH2bPy5su7Y5\",\"outcome\":{\"executor_id\":\"ef18bfaf4c0dd0578d8321a90e10942bbfe44b4e381ca9cf8cf25c679f5f1221\",\"gas_burnt\":2428135649664,\"logs\":[],\"metadata\":{\"gas_profile\":null,\"version\":1},\"receipt_ids\":[\"HPCBzuEK1iNw5VJw2aVNDfuaFXX2pn7Gf54MBrTcUQGD\"],\"status\":{\"SuccessReceiptId\":\"HPCBzuEK1iNw5VJw2aVNDfuaFXX2pn7Gf54MBrTcUQGD\"},\"tokens_burnt\":\"242813564966400000000\"},\"proof\":[{\"direction\":\"Right\",\"hash\":\"CTCyfeHtu6nAgnwRsPDWcLL9rTXZvrg3bwpGXAPNeiTT\"},{\"direction\":\"Left\",\"hash\":\"9Z37Tmt8fyeLMmxRX19u1VYHafYHCGHiDmiC3UzVLX6E\"},{\"direction\":\"Right\",\"hash\":\"Bez2jppo61YH72P2mW5SjKgacW3da9UvtvgZLvJQ4W9a\"},{\"direction\":\"Right\",\"hash\":\"7oMEED6TMfCbuuULc3Ew22bUT3g64WVJwCyjD5CssBgp\"}]},\"receipt\":null},\"transaction\":{\"actions\":[{\"FunctionCall\":{\"args\":\"eyJhY2NvdW50X2lkIjoiZWYxOGJmYWY0YzBkZDA1NzhkODMyMWE5MGUxMDk0MmJiZmU0NGI0ZTM4MWNhOWNmOGNmMjVjNjc5ZjVmMTIyMSJ9\",\"deposit\":\"1250000000000000000000\",\"gas\":30000000000000,\"method_name\":\"storage_deposit\"}}],\"hash\":\"DHkBYbjiL84Dc5dmyYtLvk1yS3mVco8HBH2bPy5su7Y5\",\"nonce\":63871139000097,\"public_key\":\"ed25519:H6LL1PTifVj6sTTUtPGVKVN6QaN1Fy1swVu7tqk11xv4\",\"receiver_id\":\"usdt.tether-token.near\",\"signature\":\"ed25519:2HW7MiP1xcKd7jyJiexyNVN4Hw51PzSsAzmQpQsNw1iRT6mdxKF4hgC2PCVJ7qUKUTR58iaywWZ8ugouh65xmNR\",\"signer_id\":\"ef18bfaf4c0dd0578d8321a90e10942bbfe44b4e381ca9cf8cf25c679f5f1221\"}},{\"outcome\":{\"execution_outcome\":{\"block_hash\":\"9DBzUMMZEvipLQRk8uYHspC1xmjV8hTxPgmfFjZcpwSa\",\"id\":\"AFvit7ckbH3uGJtvYXa12AAb9eQCGm8752Xi4du63Dz6\",\"outcome\":{\"executor_id\":\"iorange.near\",\"gas_burnt\":2427992549888,\"logs\":[],\"metadata\":{\"gas_profile\":null,\"version\":1},\"receipt_ids\":[\"62o8pgs23gEV9nzm8HXaL1awHc5u32qq7W9xG77p7KNM\"],\"status\":{\"SuccessReceiptId\":\"62o8pgs23gEV9nzm8HXaL1awHc5u32qq7W9xG77p7KNM\"},\"tokens_burnt\":\"242799254988800000000\"},\"proof\":[{\"direction\":\"Left\",\"hash\":\"9E7YXVXic57VatmqJHPzSu4N19bzxSDaU35D7QM9xnkT\"},{\"direction\":\"Left\",\"hash\":\"9Z37Tmt8fyeLMmxRX19u1VYHafYHCGHiDmiC3UzVLX6E\"},{\"direction\":\"Right\",\"hash\":\"Bez2jppo61YH72P2mW5SjKgacW3da9UvtvgZLvJQ4W9a\"},{\"direction\":\"Right\",\"hash\":\"7oMEED6TMfCbuuULc3Ew22bUT3g64WVJwCyjD5CssBgp\"}]},\"receipt\":null},\"transaction\":{\"actions\":[{\"FunctionCall\":{\"args\":\"eyJuZXdfdGFza19vcmQiOjF9\",\"deposit\":\"0\",\"gas\":30000000000000,\"method_name\":\"change_taskset\"}}],\"hash\":\"AFvit7ckbH3uGJtvYXa12AAb9eQCGm8752Xi4du63Dz6\",\"nonce\":91395695002427,\"public_key\":\"ed25519:6RrJuhH5xkdYJVQPEPWoRWjYhRSyATQ8bk89D8X3Q2gB\",\"receiver_id\":\"app.nearcrowd.near\",\"signature\":\"ed25519:2kiBC8mNBRSzHvWbvGgyK4eaRYWZiY4FwrY8gvH7AeDUhGXBia4mPiu2gNKkgURufM3puJaVjGaKW7GRPKrwb1rb\",\"signer_id\":\"iorange.near\"}},{\"outcome\":{\"execution_outcome\":{\"block_hash\":\"9DBzUMMZEvipLQRk8uYHspC1xmjV8hTxPgmfFjZcpwSa\",\"id\":\"HVywQx2CGR2uv5DEbay4QJyHuP4xLgtNsh5ZVrCAsVju\",\"outcome\":{\"executor_id\":\"c49e13a65bee574b944d7d5d4fd69fb74314dff7b75254bdd0806eedb9277dcf\",\"gas_burnt\":2428135649664,\"logs\":[],\"metadata\":{\"gas_profile\":null,\"version\":1},\"receipt_ids\":[\"Bo1JTY4ZRp3wX9mJr1fNYyzYE2eeikxBP4k2x1HwgKRy\"],\"status\":{\"SuccessReceiptId\":\"Bo1JTY4ZRp3wX9mJr1fNYyzYE2eeikxBP4k2x1HwgKRy\"},\"tokens_burnt\":\"242813564966400000000\"},\"proof\":[{\"direction\":\"Right\",\"hash\":\"FqDhNjv27TVLYoPrdZAGYUM7XJ5dUyoowAx6goYZy4F2\"},{\"direction\":\"Right\",\"hash\":\"D8TWTXSwttZtoAPSSWSYsQ8soDaBJ1BLVG8VSeUmhScr\"},{\"direction\":\"Left\",\"hash\":\"BoHGsztE67nUJUDnXSG5p8NwWHrsKzUhAJUEYDa1Wk86\"},{\"direction\":\"Right\",\"hash\":\"7oMEED6TMfCbuuULc3Ew22bUT3g64WVJwCyjD5CssBgp\"}]},\"receipt\":null},\"transaction\":{\"actions\":[{\"FunctionCall\":{\"args\":\"eyJhY2NvdW50X2lkIjoiYzQ5ZTEzYTY1YmVlNTc0Yjk0NGQ3ZDVkNGZkNjlmYjc0MzE0ZGZmN2I3NTI1NGJkZDA4MDZlZWRiOTI3N2RjZiJ9\",\"deposit\":\"1250000000000000000000\",\"gas\":30000000000000,\"method_name\":\"storage_deposit\"}}],\"hash\":\"HVywQx2CGR2uv5DEbay4QJyHuP4xLgtNsh5ZVrCAsVju\",\"nonce\":92376352000001,\"public_key\":\"ed25519:EEWiLLuYq41bMgyWxsDsHz3UHWPrhoMUhPfmFyMeetES\",\"receiver_id\":\"usdt.tether-token.near\",\"signature\":\"ed25519:2V9ptBnpqoA3U42dY18DmYGPYuPYiiMqqqLmwxFRRzFBzeTK12S7GNYqYAxXihWpay6K11eerVGg3riyv2fz5N77\",\"signer_id\":\"c49e13a65bee574b944d7d5d4fd69fb74314dff7b75254bdd0806eedb9277dcf\"}},{\"outcome\":{\"execution_outcome\":{\"block_hash\":\"9DBzUMMZEvipLQRk8uYHspC1xmjV8hTxPgmfFjZcpwSa\",\"id\":\"6b72yL4bRL3CREdxRKRPCPCD41zNzFCURfByi3b1GVuZ\",\"outcome\":{\"executor_id\":\"b864da0e88a03cd2e1d533bdca9335a70ed206eff93666ba1773a38987e443c9\",\"gas_burnt\":2428314524384,\"logs\":[],\"metadata\":{\"gas_profile\":null,\"version\":1},\"receipt_ids\":[\"Ch3bcjnGdqwhKUc7VVnKiyMtqWwvEVsWYvh6xF8pLHHQ\"],\"status\":{\"SuccessReceiptId\":\"Ch3bcjnGdqwhKUc7VVnKiyMtqWwvEVsWYvh6xF8pLHHQ\"},\"tokens_burnt\":\"242831452438400000000\"},\"proof\":[{\"direction\":\"Left\",\"hash\":\"FGGqzwNpjacAZKsNUEsxXRKkKXq4dT7M8o2pDXTJogLH\"},{\"direction\":\"Right\",\"hash\":\"D8TWTXSwttZtoAPSSWSYsQ8soDaBJ1BLVG8VSeUmhScr\"},{\"direction\":\"Left\",\"hash\":\"BoHGsztE67nUJUDnXSG5p8NwWHrsKzUhAJUEYDa1Wk86\"},{\"direction\":\"Right\",\"hash\":\"7oMEED6TMfCbuuULc3Ew22bUT3g64WVJwCyjD5CssBgp\"}]},\"receipt\":null},\"transaction\":{\"actions\":[{\"FunctionCall\":{\"args\":\"eyJyZWNlaXZlcl9pZCI6InJld2FyZC1vcHRpbi5zd2VhdCIsImFtb3VudCI6IjEwMDAwMDAwMDAwMDAwMDAwMDAiLCJtZW1vIjoic3c6cmV3Om9wdGluOko5ZGp6cVlYblktYjg2NGRhMGU4OGEwM2NkMmUxZDUzM2JkY2E5MzM1YTcwZWQyMDZlZmY5MzY2NmJhMTc3M2EzODk4N2U0NDNjOSJ9\",\"deposit\":\"1\",\"gas\":14000000000000,\"method_name\":\"ft_transfer\"}}],\"hash\":\"6b72yL4bRL3CREdxRKRPCPCD41zNzFCURfByi3b1GVuZ\",\"nonce\":63942231000084,\"public_key\":\"ed25519:DQoDCAvazAK9wqBkgtnrxAofiDy9KHr5Z5tMjiwaLtoi\",\"receiver_id\":\"token.sweat\",\"signature\":\"ed25519:4gcsxUzf11Gaskt6z4xPQAwue65sj991tkDru3GwKSqw7VVXbmFZmPWzyqtLfacWEReYHrzwtkVuGZ1VVruG8o8v\",\"signer_id\":\"b864da0e88a03cd2e1d533bdca9335a70ed206eff93666ba1773a38987e443c9\"}}]},\"receipt_execution_outcomes\":[{\"execution_outcome\":{\"block_hash\":\"9DBzUMMZEvipLQRk8uYHspC1xmjV8hTxPgmfFjZcpwSa\",\"id\":\"9C6nmXFWSGEUjxvFfW43qfEv5zWpnbju4AyuR63dVP9a\",\"outcome\":{\"executor_id\":\"embr.playember_reserve.near\",\"gas_burnt\":3834744708490,\"logs\":[\"Registering existing Account @AccountId(\\\\\\\"3d50d495-a.embr.playember_reserve.near\\\\\\\")\"],\"metadata\":{\"gas_profile\":[{\"cost\":\"BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"4501057887\"},{\"cost\":\"CONTRACT_LOADING_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"35445963\"},{\"cost\":\"CONTRACT_LOADING_BYTES\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"454267901250\"},{\"cost\":\"LOG_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"3543313050\"},{\"cost\":\"LOG_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"1069102071\"},{\"cost\":\"READ_CACHED_TRIE_NODE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"95760000000\"},{\"cost\":\"READ_MEMORY_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"18269042400\"},{\"cost\":\"READ_MEMORY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"1151803899\"},{\"cost\":\"READ_REGISTER_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"10068660744\"},{\"cost\":\"READ_REGISTER_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"23359194\"},{\"cost\":\"STORAGE_HAS_KEY_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"54039896625\"},{\"cost\":\"STORAGE_HAS_KEY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"1293215490\"},{\"cost\":\"STORAGE_READ_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"56356845750\"},{\"cost\":\"STORAGE_READ_KEY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"154762665\"},{\"cost\":\"STORAGE_READ_VALUE_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"622821555\"},{\"cost\":\"STORAGE_WRITE_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"128393472000\"},{\"cost\":\"STORAGE_WRITE_EVICTED_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"3565021077\"},{\"cost\":\"STORAGE_WRITE_KEY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"3383177616\"},{\"cost\":\"STORAGE_WRITE_VALUE_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"3939354453\"},{\"cost\":\"TOUCHING_TRIE_NODE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"466956721854\"},{\"cost\":\"UTF8_DECODING_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"3111779061\"},{\"cost\":\"UTF8_DECODING_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"23618018799\"},{\"cost\":\"WASM_INSTRUCTION\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"42170358780\"},{\"cost\":\"WRITE_MEMORY_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"14018974305\"},{\"cost\":\"WRITE_MEMORY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"689114316\"},{\"cost\":\"WRITE_REGISTER_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"14327612430\"},{\"cost\":\"WRITE_REGISTER_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"1322944272\"}],\"version\":3},\"receipt_ids\":[\"2F2oSF2THosqKG9KQnnzNBtQyRC3YkZAKSB16bKrCRH8\"],\"status\":{\"SuccessValue\":\"\"},\"tokens_burnt\":\"383474470849000000000\"},\"proof\":[{\"direction\":\"Right\",\"hash\":\"4YKnst42B2MqW97LvmTDvvDmFwzGiAaamjpJ1ZhKiuzd\"},{\"direction\":\"Left\",\"hash\":\"Azs36BgwrSD4zvNbGX2yGNSb6AA66LzhYp2UhdYVbFS5\"},{\"direction\":\"Left\",\"hash\":\"BoHGsztE67nUJUDnXSG5p8NwWHrsKzUhAJUEYDa1Wk86\"},{\"direction\":\"Right\",\"hash\":\"7oMEED6TMfCbuuULc3Ew22bUT3g64WVJwCyjD5CssBgp\"}]},\"receipt\":{\"predecessor_id\":\"3d50d495-a.embr.playember_reserve.near\",\"receipt\":{\"Action\":{\"actions\":[{\"FunctionCall\":{\"args\":\"eyJhcGlfaWQiOiJteXRlc3RhcGkuZW1ici5wbGF5ZW1iZXJfcmVzZXJ2ZS5uZWFyIn0=\",\"deposit\":\"0\",\"gas\":30000000000000,\"method_name\":\"register_account_as_player\"}}],\"gas_price\":\"122987387\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"3d50d495-a.embr.playember_reserve.near\",\"signer_public_key\":\"ed25519:BLepEWpZwFvZSjT8XARNKbZZ9qYcjBLzsQUNoRJjxAF9\"}},\"receipt_id\":\"9C6nmXFWSGEUjxvFfW43qfEv5zWpnbju4AyuR63dVP9a\",\"receiver_id\":\"embr.playember_reserve.near\"}},{\"execution_outcome\":{\"block_hash\":\"9DBzUMMZEvipLQRk8uYHspC1xmjV8hTxPgmfFjZcpwSa\",\"id\":\"BDqp8fioCtqie4jtZnsHf2dVFAyGURNoFnba463s4tdt\",\"outcome\":{\"executor_id\":\"e03361f56527b27925334250993fdcb86623e908254b8f8aed8ae037ff2e1bb5\",\"gas_burnt\":4174947687500,\"logs\":[],\"metadata\":{\"gas_profile\":[],\"version\":3},\"receipt_ids\":[],\"status\":{\"SuccessValue\":\"\"},\"tokens_burnt\":\"0\"},\"proof\":[{\"direction\":\"Left\",\"hash\":\"GrvaJGduwotHMVs5mo2v2n93n6fWaVHoKgcjA5KQaKr4\"},{\"direction\":\"Left\",\"hash\":\"Azs36BgwrSD4zvNbGX2yGNSb6AA66LzhYp2UhdYVbFS5\"},{\"direction\":\"Left\",\"hash\":\"BoHGsztE67nUJUDnXSG5p8NwWHrsKzUhAJUEYDa1Wk86\"},{\"direction\":\"Right\",\"hash\":\"7oMEED6TMfCbuuULc3Ew22bUT3g64WVJwCyjD5CssBgp\"}]},\"receipt\":{\"predecessor_id\":\"system\",\"receipt\":{\"Action\":{\"actions\":[{\"Transfer\":{\"deposit\":\"13211855362853269146864\"}}],\"gas_price\":\"0\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"e03361f56527b27925334250993fdcb86623e908254b8f8aed8ae037ff2e1bb5\",\"signer_public_key\":\"ed25519:G6BmWT85Uu4At6rPxkma6ERZGFQd5opn8JunAzTu8UMA\"}},\"receipt_id\":\"BDqp8fioCtqie4jtZnsHf2dVFAyGURNoFnba463s4tdt\",\"receiver_id\":\"e03361f56527b27925334250993fdcb86623e908254b8f8aed8ae037ff2e1bb5\"}},{\"execution_outcome\":{\"block_hash\":\"9DBzUMMZEvipLQRk8uYHspC1xmjV8hTxPgmfFjZcpwSa\",\"id\":\"9YMjqYMCcfeVmWRbnt9QanAfj5ttTnT1VryMRga1CzZU\",\"outcome\":{\"executor_id\":\"d03bfd6987d885750d832e1160b64ff84199213ab10ffe555bb0dcc699c27816\",\"gas_burnt\":4174947687500,\"logs\":[],\"metadata\":{\"gas_profile\":[],\"version\":3},\"receipt_ids\":[],\"status\":{\"SuccessValue\":\"\"},\"tokens_burnt\":\"0\"},\"proof\":[{\"direction\":\"Right\",\"hash\":\"BfQ6Y61H1zfGaFC1VqXz5AufmXKSbWGmtXkdnMrApJsv\"},{\"direction\":\"Right\",\"hash\":\"e9RXBLQ6psQu7XqoQMyThhUPfnyAo9z3inunTKVyGwy\"},{\"direction\":\"Left\",\"hash\":\"4XRdz1yujywjrQW9qCUKUpPJccRhbvnHFskWh9BUQncL\"}]},\"receipt\":{\"predecessor_id\":\"system\",\"receipt\":{\"Action\":{\"actions\":[{\"Transfer\":{\"deposit\":\"3677797800221322787968\"}}],\"gas_price\":\"0\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"d03bfd6987d885750d832e1160b64ff84199213ab10ffe555bb0dcc699c27816\",\"signer_public_key\":\"ed25519:F1rrgG8yisGFTCLKuVUTeKAeXxHn1fQN6FyBw2HgobZo\"}},\"receipt_id\":\"9YMjqYMCcfeVmWRbnt9QanAfj5ttTnT1VryMRga1CzZU\",\"receiver_id\":\"d03bfd6987d885750d832e1160b64ff84199213ab10ffe555bb0dcc699c27816\"}},{\"execution_outcome\":{\"block_hash\":\"9DBzUMMZEvipLQRk8uYHspC1xmjV8hTxPgmfFjZcpwSa\",\"id\":\"7VzREkbKrh789KUmK9Uu23ubNBtmLfYzjRHNCPn8JaqT\",\"outcome\":{\"executor_id\":\"e6a4413a9a3073fddd20d9ff597bfb633bc5a19ca77d8fc645d3c2f659ca469e\",\"gas_burnt\":4174947687500,\"logs\":[],\"metadata\":{\"gas_profile\":[],\"version\":3},\"receipt_ids\":[],\"status\":{\"SuccessValue\":\"\"},\"tokens_burnt\":\"0\"},\"proof\":[{\"direction\":\"Left\",\"hash\":\"CHKhVpawseJCYYkEh8R2hzvsa9cTRSLpR42HgqMqZKb\"},{\"direction\":\"Right\",\"hash\":\"e9RXBLQ6psQu7XqoQMyThhUPfnyAo9z3inunTKVyGwy\"},{\"direction\":\"Left\",\"hash\":\"4XRdz1yujywjrQW9qCUKUpPJccRhbvnHFskWh9BUQncL\"}]},\"receipt\":{\"predecessor_id\":\"system\",\"receipt\":{\"Action\":{\"actions\":[{\"Transfer\":{\"deposit\":\"1455789998376855516800\"}}],\"gas_price\":\"0\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"e6a4413a9a3073fddd20d9ff597bfb633bc5a19ca77d8fc645d3c2f659ca469e\",\"signer_public_key\":\"ed25519:GXL3DidCeD3TThExQZ5RLDHtgHd6qJhH1pZ4XJvafEwo\"}},\"receipt_id\":\"7VzREkbKrh789KUmK9Uu23ubNBtmLfYzjRHNCPn8JaqT\",\"receiver_id\":\"e6a4413a9a3073fddd20d9ff597bfb633bc5a19ca77d8fc645d3c2f659ca469e\"}},{\"execution_outcome\":{\"block_hash\":\"9DBzUMMZEvipLQRk8uYHspC1xmjV8hTxPgmfFjZcpwSa\",\"id\":\"9M3DkQGf3rLEtx8d4tBrSpQEiA3XZBLZAav4xZNxMnKi\",\"outcome\":{\"executor_id\":\"bd3040965be489fd80ed8d58950eeb5f8baf48f709d4cca475eee598031baf59\",\"gas_burnt\":4174947687500,\"logs\":[],\"metadata\":{\"gas_profile\":[],\"version\":3},\"receipt_ids\":[],\"status\":{\"SuccessValue\":\"\"},\"tokens_burnt\":\"0\"},\"proof\":[{\"direction\":\"Left\",\"hash\":\"AxCNwPS43jjcEeseKdgekn9RBRear5j3aR3suexYxwNf\"},{\"direction\":\"Left\",\"hash\":\"4XRdz1yujywjrQW9qCUKUpPJccRhbvnHFskWh9BUQncL\"}]},\"receipt\":{\"predecessor_id\":\"system\",\"receipt\":{\"Action\":{\"actions\":[{\"Transfer\":{\"deposit\":\"3677802736757322787968\"}}],\"gas_price\":\"0\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"bd3040965be489fd80ed8d58950eeb5f8baf48f709d4cca475eee598031baf59\",\"signer_public_key\":\"ed25519:7ufz9DV3Z2wFcyag1U3LztRtvvd5tfLHon2TNHjXPQif\"}},\"receipt_id\":\"9M3DkQGf3rLEtx8d4tBrSpQEiA3XZBLZAav4xZNxMnKi\",\"receiver_id\":\"bd3040965be489fd80ed8d58950eeb5f8baf48f709d4cca475eee598031baf59\"}}],\"shard_id\":2,\"state_changes\":[{\"cause\":{\"tx_hash\":\"6b72yL4bRL3CREdxRKRPCPCD41zNzFCURfByi3b1GVuZ\",\"type\":\"transaction_processing\"},\"change\":{\"account_id\":\"b864da0e88a03cd2e1d533bdca9335a70ed206eff93666ba1773a38987e443c9\",\"amount\":\"31081520545391144483135\",\"code_hash\":\"11111111111111111111111111111111\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":182},\"type\":\"account_update\"},{\"cause\":{\"receipt_hash\":\"9M3DkQGf3rLEtx8d4tBrSpQEiA3XZBLZAav4xZNxMnKi\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"bd3040965be489fd80ed8d58950eeb5f8baf48f709d4cca475eee598031baf59\",\"amount\":\"44632323927606599999997\",\"code_hash\":\"11111111111111111111111111111111\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":182},\"type\":\"account_update\"},{\"cause\":{\"tx_hash\":\"HVywQx2CGR2uv5DEbay4QJyHuP4xLgtNsh5ZVrCAsVju\",\"type\":\"transaction_processing\"},\"change\":{\"account_id\":\"c49e13a65bee574b944d7d5d4fd69fb74314dff7b75254bdd0806eedb9277dcf\",\"amount\":\"44518934766199877212032\",\"code_hash\":\"11111111111111111111111111111111\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":182},\"type\":\"account_update\"},{\"cause\":{\"receipt_hash\":\"9YMjqYMCcfeVmWRbnt9QanAfj5ttTnT1VryMRga1CzZU\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"d03bfd6987d885750d832e1160b64ff84199213ab10ffe555bb0dcc699c27816\",\"amount\":\"54495011390494499999994\",\"code_hash\":\"11111111111111111111111111111111\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":182},\"type\":\"account_update\"},{\"cause\":{\"tx_hash\":\"4JmRYstCvLy6buVi4YuDPSneDSnTFAu7zrjuSTkNKrot\",\"type\":\"transaction_processing\"},\"change\":{\"account_id\":\"d6b519b284df72f2ac632984323b4eb96a80e021702848bc0afd8f73396fc903\",\"amount\":\"38998708633258850993574\",\"code_hash\":\"11111111111111111111111111111111\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":182},\"type\":\"account_update\"},{\"cause\":{\"receipt_hash\":\"BDqp8fioCtqie4jtZnsHf2dVFAyGURNoFnba463s4tdt\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"e03361f56527b27925334250993fdcb86623e908254b8f8aed8ae037ff2e1bb5\",\"amount\":\"1777027078396319415447193\",\"code_hash\":\"11111111111111111111111111111111\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":182},\"type\":\"account_update\"},{\"cause\":{\"tx_hash\":\"HiBtdcgFjGr8Dhzcz2zXKzsyc9v7cLDT2ZxLybyduVgN\",\"type\":\"transaction_processing\"},\"change\":{\"account_id\":\"e2a4479e0abd3c275feafc676906652b9cf22095bc26dc3a4814f56e4cc01b62\",\"amount\":\"44518934766199877212032\",\"code_hash\":\"11111111111111111111111111111111\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":182},\"type\":\"account_update\"},{\"cause\":{\"receipt_hash\":\"7VzREkbKrh789KUmK9Uu23ubNBtmLfYzjRHNCPn8JaqT\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"e6a4413a9a3073fddd20d9ff597bfb633bc5a19ca77d8fc645d3c2f659ca469e\",\"amount\":\"41722487016619799999995\",\"code_hash\":\"11111111111111111111111111111111\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":182},\"type\":\"account_update\"},{\"cause\":{\"tx_hash\":\"DHkBYbjiL84Dc5dmyYtLvk1yS3mVco8HBH2bPy5su7Y5\",\"type\":\"transaction_processing\"},\"change\":{\"account_id\":\"ef18bfaf4c0dd0578d8321a90e10942bbfe44b4e381ca9cf8cf25c679f5f1221\",\"amount\":\"66439411269296377211948\",\"code_hash\":\"11111111111111111111111111111111\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":182},\"type\":\"account_update\"},{\"cause\":{\"receipt_hash\":\"9C6nmXFWSGEUjxvFfW43qfEv5zWpnbju4AyuR63dVP9a\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"embr.playember_reserve.near\",\"amount\":\"932786899124499425661976983\",\"code_hash\":\"ArmoZroKpV3XEfBaz4JpUL2wMXFsJDupQmz4UHFnkL6J\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":27959187},\"type\":\"account_update\"},{\"cause\":{\"receipt_hash\":\"9C6nmXFWSGEUjxvFfW43qfEv5zWpnbju4AyuR63dVP9a\",\"type\":\"action_receipt_gas_reward\"},\"change\":{\"account_id\":\"embr.playember_reserve.near\",\"amount\":\"932786941324112750761976983\",\"code_hash\":\"ArmoZroKpV3XEfBaz4JpUL2wMXFsJDupQmz4UHFnkL6J\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":27959187},\"type\":\"account_update\"},{\"cause\":{\"tx_hash\":\"AFvit7ckbH3uGJtvYXa12AAb9eQCGm8752Xi4du63Dz6\",\"type\":\"transaction_processing\"},\"change\":{\"account_id\":\"iorange.near\",\"amount\":\"11784962720167065821887231\",\"code_hash\":\"11111111111111111111111111111111\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":881},\"type\":\"account_update\"},{\"cause\":{\"tx_hash\":\"6b72yL4bRL3CREdxRKRPCPCD41zNzFCURfByi3b1GVuZ\",\"type\":\"transaction_processing\"},\"change\":{\"access_key\":{\"nonce\":63942231000084,\"permission\":\"FullAccess\"},\"account_id\":\"b864da0e88a03cd2e1d533bdca9335a70ed206eff93666ba1773a38987e443c9\",\"public_key\":\"ed25519:DQoDCAvazAK9wqBkgtnrxAofiDy9KHr5Z5tMjiwaLtoi\"},\"type\":\"access_key_update\"},{\"cause\":{\"tx_hash\":\"HVywQx2CGR2uv5DEbay4QJyHuP4xLgtNsh5ZVrCAsVju\",\"type\":\"transaction_processing\"},\"change\":{\"access_key\":{\"nonce\":92376352000001,\"permission\":\"FullAccess\"},\"account_id\":\"c49e13a65bee574b944d7d5d4fd69fb74314dff7b75254bdd0806eedb9277dcf\",\"public_key\":\"ed25519:EEWiLLuYq41bMgyWxsDsHz3UHWPrhoMUhPfmFyMeetES\"},\"type\":\"access_key_update\"},{\"cause\":{\"tx_hash\":\"4JmRYstCvLy6buVi4YuDPSneDSnTFAu7zrjuSTkNKrot\",\"type\":\"transaction_processing\"},\"change\":{\"access_key\":{\"nonce\":73672043000039,\"permission\":\"FullAccess\"},\"account_id\":\"d6b519b284df72f2ac632984323b4eb96a80e021702848bc0afd8f73396fc903\",\"public_key\":\"ed25519:FT8QyjH4GfZQvbynxqVUaAAMZwzy3pqCBPFXqhR6szJ6\"},\"type\":\"access_key_update\"},{\"cause\":{\"tx_hash\":\"HiBtdcgFjGr8Dhzcz2zXKzsyc9v7cLDT2ZxLybyduVgN\",\"type\":\"transaction_processing\"},\"change\":{\"access_key\":{\"nonce\":92364842000001,\"permission\":\"FullAccess\"},\"account_id\":\"e2a4479e0abd3c275feafc676906652b9cf22095bc26dc3a4814f56e4cc01b62\",\"public_key\":\"ed25519:GFiRuysw4vnSqhwgjKe3U4WZHLq2uhGa3Gs8yRM78Bgm\"},\"type\":\"access_key_update\"},{\"cause\":{\"tx_hash\":\"DHkBYbjiL84Dc5dmyYtLvk1yS3mVco8HBH2bPy5su7Y5\",\"type\":\"transaction_processing\"},\"change\":{\"access_key\":{\"nonce\":63871139000097,\"permission\":\"FullAccess\"},\"account_id\":\"ef18bfaf4c0dd0578d8321a90e10942bbfe44b4e381ca9cf8cf25c679f5f1221\",\"public_key\":\"ed25519:H6LL1PTifVj6sTTUtPGVKVN6QaN1Fy1swVu7tqk11xv4\"},\"type\":\"access_key_update\"},{\"cause\":{\"tx_hash\":\"AFvit7ckbH3uGJtvYXa12AAb9eQCGm8752Xi4du63Dz6\",\"type\":\"transaction_processing\"},\"change\":{\"access_key\":{\"nonce\":91395695002427,\"permission\":{\"FunctionCall\":{\"allowance\":\"277031005033055107737344\",\"method_names\":[],\"receiver_id\":\"app.nearcrowd.near\"}}},\"account_id\":\"iorange.near\",\"public_key\":\"ed25519:6RrJuhH5xkdYJVQPEPWoRWjYhRSyATQ8bk89D8X3Q2gB\"},\"type\":\"access_key_update\"},{\"cause\":{\"receipt_hash\":\"9C6nmXFWSGEUjxvFfW43qfEv5zWpnbju4AyuR63dVP9a\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"embr.playember_reserve.near\",\"key_base64\":\"U1RBVEU=\",\"value_base64\":\"AQAAAGEA4fUFAAAAAAAAAAAAAAAAfQAAAAAAAAABAAAAbRYAAABwbGF5ZW1iZXJfcmVzZXJ2ZS5uZWFyAQAAAG8BAAAAZwEAAABjGwAAAGVtYnIucGxheWVtYmVyX3Jlc2VydmUubmVhcgEAAABw\"},\"type\":\"data_update\"},{\"cause\":{\"receipt_hash\":\"9C6nmXFWSGEUjxvFfW43qfEv5zWpnbju4AyuR63dVP9a\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"embr.playember_reserve.near\",\"key_base64\":\"YyYAAAAzZDUwZDQ5NS1hLmVtYnIucGxheWVtYmVyX3Jlc2VydmUubmVhcg==\",\"value_base64\":\"AAAAAAAAAAAAAAAAAAAAAA==\"},\"type\":\"data_update\"}]},{\"chunk\":{\"author\":\"dqw9k3e4422cxt92masmy.poolv1.near\",\"header\":{\"balance_burnt\":\"4431194740007700000000\",\"chunk_hash\":\"FGrEj1N5jaPWQv3Mwk9k46ueeLbhbJoovLB541E8dQ7T\",\"encoded_length\":4150,\"encoded_merkle_root\":\"B17LQpVRJpA6rBEan5GE5t7hE6VTEUZGXk1weNopMhVo\",\"gas_limit\":1000000000000000,\"gas_used\":47693094182334,\"height_created\":92764782,\"height_included\":92764782,\"outcome_root\":\"6vwLNVugzL1qsNJQbKFgbZHWWhyXNHCzDmSoFgpMqM5o\",\"outgoing_receipts_root\":\"Gh239kg5WpGJvWhgyV7dUa9h9ZTWdrc61SRiwkmUzxrT\",\"prev_block_hash\":\"3eB4b25NLhCE4eSa5UsQNeSZxd1qpG46wDCMBZTuWdhp\",\"prev_state_root\":\"CtbeSZLSj7agT6Br5hPU3azbfEyns9bf3sGZKNwbLCR5\",\"rent_paid\":\"0\",\"shard_id\":3,\"signature\":\"ed25519:3K6h2mYkjbLzrz4B9UkzydVfVjHNrdBSY4vaoyLEX71w1KZUQQUFuPG8ZTXym2HJCxgRSRVZo6LBgtJUWqv3FPmC\",\"tx_root\":\"BdrjJVKTui5UgFNxCW1Yze6t1obLssHR3yevdk59TzmU\",\"validator_proposals\":[],\"validator_reward\":\"0\"},\"receipts\":[{\"predecessor_id\":\"papaya.recurforever.near\",\"receipt\":{\"Action\":{\"actions\":[{\"FunctionCall\":{\"args\":\"eyJ0byI6IjQyMDZjNDE0ZjE0ZTNmMzhkMjQ1ZTcyOWY3ZTYwNzY3ZTQ0ZDA3Mjg2ZjAwYjUyMGU1ZjA0YmJkZjZmMzExZWEiLCJ0b2tlbl9pZCI6IjM2NDA1NiIsInJveWFsdHlfcGVyY2VudCI6MTAwMH0=\",\"deposit\":\"5000000000000000000000\",\"gas\":100000000000000,\"method_name\":\"mint\"}}],\"gas_price\":\"180611124\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"papaya.recurforever.near\",\"signer_public_key\":\"secp256k1:icvWegs3SdDR5Hgvxg9HJX1m2SWbrVTfECFx6AT7z3vZn7QANnDieH6sLunNcR4T7XmcfkwMFxLnFtC2k5C41Bn\"}},\"receipt_id\":\"DZdLEbDeBRKapvRo4tUkx3hxgjCwRzKox2m3PZLVuUyJ\",\"receiver_id\":\"papaya.recurforever.near\"},{\"predecessor_id\":\"learn.sweat\",\"receipt\":{\"Action\":{\"actions\":[{\"FunctionCall\":{\"args\":\"eyJyZWNlaXZlcl9pZCI6ImUwNWNmMmQzMDM2NDVkYTE0ZjcxOGVjYWZiNTYxYzdiNzkwMmE0YjBmYjdkMGI5MzliYzIzNmYxMDQ3OTBhMjUiLCJhbW91bnQiOiIxMDAwMDAwIiwibWVtbyI6InN3OnRyOm13V1IyeG1XNnEifQ==\",\"deposit\":\"1\",\"gas\":30000000000000,\"method_name\":\"ft_transfer\"}}],\"gas_price\":\"122987387\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"learn.sweat\",\"signer_public_key\":\"ed25519:9wRicBBHSqTtPzooqYTmhijZcQXonJM7FjQxvh6cfKzo\"}},\"receipt_id\":\"HFhq6ajK6euvmbz6pRCDeZhBAvLe5b5QaFZdfJeKNTxU\",\"receiver_id\":\"usdt.tether-token.near\"},{\"predecessor_id\":\"watcher02.ref-watchdog.near\",\"receipt\":{\"Action\":{\"actions\":[{\"FunctionCall\":{\"args\":\"eyJ0b2tlbl9pZCI6Im1ldGEtcG9vbC5uZWFyIn0=\",\"deposit\":\"0\",\"gas\":100000000000000,\"method_name\":\"update_token_rate\"}}],\"gas_price\":\"186029458\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"watcher02.ref-watchdog.near\",\"signer_public_key\":\"ed25519:3g2J3UmwRdmo9scukmM6A9qQzKbu7pCPFaQPU9pngMce\"}},\"receipt_id\":\"6B1ZnWtTQPLyYmhWcZ4rQ5iFpt6NjLtRWPa9CyqBjeYH\",\"receiver_id\":\"v2.ref-finance.near\"},{\"predecessor_id\":\"system\",\"receipt\":{\"Action\":{\"actions\":[{\"Transfer\":{\"deposit\":\"1387847081208855516800\"}}],\"gas_price\":\"0\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"5056c7872cfc439db2ea265d4c4a71bc77a3a7c3286ec2defbce052f80f18b78\",\"signer_public_key\":\"ed25519:6QcN7PVG1vTXn5D1noy7ySuwp25wNfAjpwMUbew9RAkw\"}},\"receipt_id\":\"EGUtwPTotLcKHePRHSnjf9LMsEabpGaedc8s6aphefLU\",\"receiver_id\":\"5056c7872cfc439db2ea265d4c4a71bc77a3a7c3286ec2defbce052f80f18b78\"},{\"predecessor_id\":\"system\",\"receipt\":{\"Action\":{\"actions\":[{\"Transfer\":{\"deposit\":\"3644939925066522787968\"}}],\"gas_price\":\"0\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"a4d23d50a736298dc642a3ee1d573a652fabf348741af1506b1f7da70d7444d9\",\"signer_public_key\":\"ed25519:C6PoMvWCUZjn5etgoZtV3AL8uAUguxQvi1YXpztSuXZJ\"}},\"receipt_id\":\"7LJHuTJtB1mwCW2d1boxHfrH3yqWEzAL9E5xNacVZ26T\",\"receiver_id\":\"a4d23d50a736298dc642a3ee1d573a652fabf348741af1506b1f7da70d7444d9\"},{\"predecessor_id\":\"system\",\"receipt\":{\"Action\":{\"actions\":[{\"Transfer\":{\"deposit\":\"1453947853555455516800\"}}],\"gas_price\":\"0\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"62217dd0183ad47712dfb16db9000fd8d0ecc8d6993cd02e2c5f34353086e912\",\"signer_public_key\":\"ed25519:7c4aKGGRKEXPvs6NyV7KVnPPT989ybzad7WyRpvmReC1\"}},\"receipt_id\":\"EfrMsmNUQPuuvqSsEcwUf32gwKUPTmLxza5goBcjD9oM\",\"receiver_id\":\"62217dd0183ad47712dfb16db9000fd8d0ecc8d6993cd02e2c5f34353086e912\"},{\"predecessor_id\":\"system\",\"receipt\":{\"Action\":{\"actions\":[{\"Transfer\":{\"deposit\":\"1453949828169855516800\"}}],\"gas_price\":\"0\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"3b85021542769d2cf82b2eb5b9cebcd509a1e4722ea67ae36c868d8e93ef12e4\",\"signer_public_key\":\"ed25519:Gdyiwso3herrNehT3Y2v5ZeRa3LFH2e7ghvrvzuqT7cV\"}},\"receipt_id\":\"63uRd5CF4r4nFMyAXt2nxosRgWKwEvY1a3St6UWKnP3B\",\"receiver_id\":\"3b85021542769d2cf82b2eb5b9cebcd509a1e4722ea67ae36c868d8e93ef12e4\"},{\"predecessor_id\":\"system\",\"receipt\":{\"Action\":{\"actions\":[{\"Transfer\":{\"deposit\":\"1453948511760255516800\"}}],\"gas_price\":\"0\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"038e48d2b37cf304b256bdec10afae201247ba7496cfa969409a75e4504cc734\",\"signer_public_key\":\"ed25519:Et4VVriLX9S6gg4pHMfSdWASY4rk5vyJxufe1HnscEw\"}},\"receipt_id\":\"EgM2FYLA7MLq1mu2ZEFfJqR2KMcEp9hHTN6itQcRqJS1\",\"receiver_id\":\"038e48d2b37cf304b256bdec10afae201247ba7496cfa969409a75e4504cc734\"},{\"predecessor_id\":\"system\",\"receipt\":{\"Action\":{\"actions\":[{\"Transfer\":{\"deposit\":\"3676415604628722787968\"}}],\"gas_price\":\"0\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"92e86f8284c5604e4445608a071705ad2445a140df75bdae23ed94de2ab49d42\",\"signer_public_key\":\"ed25519:AtU6HQQSXW3ZpRzFBx5sdgjCssXL4bFdzPBzVeWgqVqb\"}},\"receipt_id\":\"G36EY7JbD8Fuqdhagc5d7QTX8nJwQbMGXzrnQsKZYzsw\",\"receiver_id\":\"92e86f8284c5604e4445608a071705ad2445a140df75bdae23ed94de2ab49d42\"},{\"predecessor_id\":\"system\",\"receipt\":{\"Action\":{\"actions\":[{\"Transfer\":{\"deposit\":\"3674122231792122787968\"}}],\"gas_price\":\"0\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"39897bf9a78b1d67918ee33c27364b11b480b2b279930b09f0a9c1b926da8aaf\",\"signer_public_key\":\"ed25519:4sbqB2C9gB2opvbppj2dbqSPYL3KAi7WmumHTdXTV2pe\"}},\"receipt_id\":\"95GSz1TgWKAniZct6ruPsfLsrDhZKJgb5ggRYmMu48x\",\"receiver_id\":\"39897bf9a78b1d67918ee33c27364b11b480b2b279930b09f0a9c1b926da8aaf\"},{\"predecessor_id\":\"system\",\"receipt\":{\"Action\":{\"actions\":[{\"Transfer\":{\"deposit\":\"3679637641325922787968\"}}],\"gas_price\":\"0\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"4bfd719f2f327fb9b743925e92f10e3578efa6b25f9144f5cc0776a394b5dd22\",\"signer_public_key\":\"ed25519:67dj1hMYcS9Nywx8SVscss3fuFC8w8D84UknNDdZCJqf\"}},\"receipt_id\":\"JU2BBLxYb2JqxDqvW8bWXvXcaUHmJzySJYLayrtTEPw\",\"receiver_id\":\"4bfd719f2f327fb9b743925e92f10e3578efa6b25f9144f5cc0776a394b5dd22\"},{\"predecessor_id\":\"system\",\"receipt\":{\"Action\":{\"actions\":[{\"Transfer\":{\"deposit\":\"3677797800221322787968\"}}],\"gas_price\":\"0\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"d03bfd6987d885750d832e1160b64ff84199213ab10ffe555bb0dcc699c27816\",\"signer_public_key\":\"ed25519:F1rrgG8yisGFTCLKuVUTeKAeXxHn1fQN6FyBw2HgobZo\"}},\"receipt_id\":\"9YMjqYMCcfeVmWRbnt9QanAfj5ttTnT1VryMRga1CzZU\",\"receiver_id\":\"d03bfd6987d885750d832e1160b64ff84199213ab10ffe555bb0dcc699c27816\"},{\"predecessor_id\":\"system\",\"receipt\":{\"Action\":{\"actions\":[{\"Transfer\":{\"deposit\":\"1455789998376855516800\"}}],\"gas_price\":\"0\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"e6a4413a9a3073fddd20d9ff597bfb633bc5a19ca77d8fc645d3c2f659ca469e\",\"signer_public_key\":\"ed25519:GXL3DidCeD3TThExQZ5RLDHtgHd6qJhH1pZ4XJvafEwo\"}},\"receipt_id\":\"7VzREkbKrh789KUmK9Uu23ubNBtmLfYzjRHNCPn8JaqT\",\"receiver_id\":\"e6a4413a9a3073fddd20d9ff597bfb633bc5a19ca77d8fc645d3c2f659ca469e\"},{\"predecessor_id\":\"system\",\"receipt\":{\"Action\":{\"actions\":[{\"Transfer\":{\"deposit\":\"3677802736757322787968\"}}],\"gas_price\":\"0\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"bd3040965be489fd80ed8d58950eeb5f8baf48f709d4cca475eee598031baf59\",\"signer_public_key\":\"ed25519:7ufz9DV3Z2wFcyag1U3LztRtvvd5tfLHon2TNHjXPQif\"}},\"receipt_id\":\"9M3DkQGf3rLEtx8d4tBrSpQEiA3XZBLZAav4xZNxMnKi\",\"receiver_id\":\"bd3040965be489fd80ed8d58950eeb5f8baf48f709d4cca475eee598031baf59\"},{\"predecessor_id\":\"system\",\"receipt\":{\"Action\":{\"actions\":[{\"Transfer\":{\"deposit\":\"69757213628944665882360\"}}],\"gas_price\":\"0\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"operator.meta-pool.near\",\"signer_public_key\":\"ed25519:3hpXGXHhxxq4C3KFWYcSApTLPhgerNLcU2NgCB3WGz5M\"}},\"receipt_id\":\"Cu26A2ouAPUXSxi6yofGNJ5henyxHyYShtLr8BFnX1DD\",\"receiver_id\":\"operator.meta-pool.near\"},{\"predecessor_id\":\"system\",\"receipt\":{\"Action\":{\"actions\":[{\"Transfer\":{\"deposit\":\"188712065628723398213284\"}}],\"gas_price\":\"0\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"stader-epoch-runner.near\",\"signer_public_key\":\"ed25519:AVv8KsWqKd8acYPVdbCnrXAZ2FB2jjxJH1c3djHuW2JD\"}},\"receipt_id\":\"CZAqWPwfgBrykmfZPZoLMJMxg4FsGFNLvapr3qXNeBWV\",\"receiver_id\":\"stader-epoch-runner.near\"}],\"transactions\":[{\"outcome\":{\"execution_outcome\":{\"block_hash\":\"9DBzUMMZEvipLQRk8uYHspC1xmjV8hTxPgmfFjZcpwSa\",\"id\":\"CWhKBgYmHHR5woSixizwqThvF9NgE7kRdBQzVuf429qw\",\"outcome\":{\"executor_id\":\"papaya.recurforever.near\",\"gas_burnt\":2428189312080,\"logs\":[],\"metadata\":{\"gas_profile\":null,\"version\":1},\"receipt_ids\":[\"DZdLEbDeBRKapvRo4tUkx3hxgjCwRzKox2m3PZLVuUyJ\"],\"status\":{\"SuccessReceiptId\":\"DZdLEbDeBRKapvRo4tUkx3hxgjCwRzKox2m3PZLVuUyJ\"},\"tokens_burnt\":\"242818931208000000000\"},\"proof\":[{\"direction\":\"Right\",\"hash\":\"3q1oFDPZYDKTSNH3kaKoU3dR6eVB1KWriTyfK7TEzwTY\"},{\"direction\":\"Right\",\"hash\":\"APb2m5m2AKf6g3drTbXkDdWyUmcG64PavHq6t4gTn32v\"},{\"direction\":\"Right\",\"hash\":\"HZzdU8o8fyvRFqS822KJvx9TbaqU4FVqJVqy7e7grk9J\"},{\"direction\":\"Right\",\"hash\":\"C9DMvDZzpN646SVCFWCuz2xzP2pQtGLGV6A2mpwuyaRM\"},{\"direction\":\"Right\",\"hash\":\"6p6EovC3S8VAfuksHKXsbvPJimxLCJPj7JxDMEi2aos5\"}]},\"receipt\":null},\"transaction\":{\"actions\":[{\"FunctionCall\":{\"args\":\"eyJ0byI6IjQyMDZjNDE0ZjE0ZTNmMzhkMjQ1ZTcyOWY3ZTYwNzY3ZTQ0ZDA3Mjg2ZjAwYjUyMGU1ZjA0YmJkZjZmMzExZWEiLCJ0b2tlbl9pZCI6IjM2NDA1NiIsInJveWFsdHlfcGVyY2VudCI6MTAwMH0=\",\"deposit\":\"5000000000000000000000\",\"gas\":100000000000000,\"method_name\":\"mint\"}}],\"hash\":\"CWhKBgYmHHR5woSixizwqThvF9NgE7kRdBQzVuf429qw\",\"nonce\":88017794000106,\"public_key\":\"secp256k1:icvWegs3SdDR5Hgvxg9HJX1m2SWbrVTfECFx6AT7z3vZn7QANnDieH6sLunNcR4T7XmcfkwMFxLnFtC2k5C41Bn\",\"receiver_id\":\"papaya.recurforever.near\",\"signature\":\"secp256k1:JTWxtgUbpEA9NkDigFJ8euThD7nZbxfqrcmp32QR8c2yAZnvpLJS3ezwxQawFA287GGwEKqchjqyC5j4KTPjTvzwR\",\"signer_id\":\"papaya.recurforever.near\"}}]},\"receipt_execution_outcomes\":[{\"execution_outcome\":{\"block_hash\":\"9DBzUMMZEvipLQRk8uYHspC1xmjV8hTxPgmfFjZcpwSa\",\"id\":\"DZdLEbDeBRKapvRo4tUkx3hxgjCwRzKox2m3PZLVuUyJ\",\"outcome\":{\"executor_id\":\"papaya.recurforever.near\",\"gas_burnt\":32672866473111,\"logs\":[\"EVENT_JSON:{\\\\\\\"standard\\\\\\\":\\\\\\\"nep171\\\\\\\",\\\\\\\"version\\\\\\\":\\\\\\\"1.0.0\\\\\\\",\\\\\\\"event\\\\\\\":\\\\\\\"nft_mint\\\\\\\",\\\\\\\"data\\\\\\\":[{\\\\\\\"owner_id\\\\\\\":\\\\\\\"4206c414f14e3f38d245e729f7e60767e44d07286f00b520e5f04bbdf6f311ea\\\\\\\",\\\\\\\"token_ids\\\\\\\":[\\\\\\\"364056\\\\\\\"],\\\\\\\"royalty_percent\\\\\\\":{\\\\\\\"364056\\\\\\\":\\\\\\\"1000\\\\\\\"}}]}\"],\"metadata\":{\"gas_profile\":[{\"cost\":\"BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"8207811441\"},{\"cost\":\"CONTRACT_LOADING_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"35445963\"},{\"cost\":\"CONTRACT_LOADING_BYTES\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"127377255750\"},{\"cost\":\"LOG_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"3543313050\"},{\"cost\":\"LOG_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"2864137647\"},{\"cost\":\"READ_CACHED_TRIE_NODE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"433200000000\"},{\"cost\":\"READ_MEMORY_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"41757811200\"},{\"cost\":\"READ_MEMORY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"5671588836\"},{\"cost\":\"READ_REGISTER_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"15102991116\"},{\"cost\":\"READ_REGISTER_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"78356790\"},{\"cost\":\"STORAGE_HAS_KEY_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"216159586500\"},{\"cost\":\"STORAGE_HAS_KEY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"9545161950\"},{\"cost\":\"STORAGE_READ_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"169070537250\"},{\"cost\":\"STORAGE_READ_KEY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"2383345041\"},{\"cost\":\"STORAGE_READ_VALUE_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"3360991995\"},{\"cost\":\"STORAGE_WRITE_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"256786944000\"},{\"cost\":\"STORAGE_WRITE_EVICTED_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"19238266893\"},{\"cost\":\"STORAGE_WRITE_KEY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"5709112227\"},{\"cost\":\"STORAGE_WRITE_VALUE_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"25031960973\"},{\"cost\":\"TOUCHING_TRIE_NODE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"515262589632\"},{\"cost\":\"UTF8_DECODING_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"3111779061\"},{\"cost\":\"UTF8_DECODING_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"63272963943\"},{\"cost\":\"WASM_INSTRUCTION\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"28270833279084\"},{\"cost\":\"WRITE_MEMORY_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"19626564027\"},{\"cost\":\"WRITE_MEMORY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"2208979092\"},{\"cost\":\"WRITE_REGISTER_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"20058657402\"},{\"cost\":\"WRITE_REGISTER_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"5177730168\"}],\"version\":3},\"receipt_ids\":[\"B7rMKDGzowqLxxDAJtXwNYoYXDTg91hvpCod8UKUMd7A\"],\"status\":{\"SuccessValue\":\"\"},\"tokens_burnt\":\"3267286647311100000000\"},\"proof\":[{\"direction\":\"Left\",\"hash\":\"GR9hJghQsZfHdkvEcP5Y1pczWmQjgyKD5DqfxUVUhFYg\"},{\"direction\":\"Right\",\"hash\":\"APb2m5m2AKf6g3drTbXkDdWyUmcG64PavHq6t4gTn32v\"},{\"direction\":\"Right\",\"hash\":\"HZzdU8o8fyvRFqS822KJvx9TbaqU4FVqJVqy7e7grk9J\"},{\"direction\":\"Right\",\"hash\":\"C9DMvDZzpN646SVCFWCuz2xzP2pQtGLGV6A2mpwuyaRM\"},{\"direction\":\"Right\",\"hash\":\"6p6EovC3S8VAfuksHKXsbvPJimxLCJPj7JxDMEi2aos5\"}]},\"receipt\":{\"predecessor_id\":\"papaya.recurforever.near\",\"receipt\":{\"Action\":{\"actions\":[{\"FunctionCall\":{\"args\":\"eyJ0byI6IjQyMDZjNDE0ZjE0ZTNmMzhkMjQ1ZTcyOWY3ZTYwNzY3ZTQ0ZDA3Mjg2ZjAwYjUyMGU1ZjA0YmJkZjZmMzExZWEiLCJ0b2tlbl9pZCI6IjM2NDA1NiIsInJveWFsdHlfcGVyY2VudCI6MTAwMH0=\",\"deposit\":\"5000000000000000000000\",\"gas\":100000000000000,\"method_name\":\"mint\"}}],\"gas_price\":\"180611124\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"papaya.recurforever.near\",\"signer_public_key\":\"secp256k1:icvWegs3SdDR5Hgvxg9HJX1m2SWbrVTfECFx6AT7z3vZn7QANnDieH6sLunNcR4T7XmcfkwMFxLnFtC2k5C41Bn\"}},\"receipt_id\":\"DZdLEbDeBRKapvRo4tUkx3hxgjCwRzKox2m3PZLVuUyJ\",\"receiver_id\":\"papaya.recurforever.near\"}},{\"execution_outcome\":{\"block_hash\":\"9DBzUMMZEvipLQRk8uYHspC1xmjV8hTxPgmfFjZcpwSa\",\"id\":\"6f3TNmYXE8VXotRzhDxajmP3GThEEn56DJMRyUKRFL6\",\"outcome\":{\"executor_id\":\"relay.aurora\",\"gas_burnt\":223182562500,\"logs\":[],\"metadata\":{\"gas_profile\":[],\"version\":3},\"receipt_ids\":[],\"status\":{\"SuccessValue\":\"\"},\"tokens_burnt\":\"0\"},\"proof\":[{\"direction\":\"Right\",\"hash\":\"fTrMsxtTwcNN2LMEq7KtCDVsDbwYY1AfcFdMkgtHXiC\"},{\"direction\":\"Left\",\"hash\":\"C68JmkiFShiDMH1a9WKBvan76HnJYVAFnM9Kxh83r96N\"},{\"direction\":\"Right\",\"hash\":\"HZzdU8o8fyvRFqS822KJvx9TbaqU4FVqJVqy7e7grk9J\"},{\"direction\":\"Right\",\"hash\":\"C9DMvDZzpN646SVCFWCuz2xzP2pQtGLGV6A2mpwuyaRM\"},{\"direction\":\"Right\",\"hash\":\"6p6EovC3S8VAfuksHKXsbvPJimxLCJPj7JxDMEi2aos5\"}]},\"receipt\":{\"predecessor_id\":\"system\",\"receipt\":{\"Action\":{\"actions\":[{\"Transfer\":{\"deposit\":\"188376657220304586639852\"}}],\"gas_price\":\"0\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"relay.aurora\",\"signer_public_key\":\"ed25519:F2nobX5Ruw6LR5mxErzJ41u6J4p6YHmuPYr5Lq8roXp1\"}},\"receipt_id\":\"6f3TNmYXE8VXotRzhDxajmP3GThEEn56DJMRyUKRFL6\",\"receiver_id\":\"relay.aurora\"}},{\"execution_outcome\":{\"block_hash\":\"9DBzUMMZEvipLQRk8uYHspC1xmjV8hTxPgmfFjZcpwSa\",\"id\":\"bm7V3pZbt3hbo3dq5NndWdEe89smD7UWBXKqHF8q3MY\",\"outcome\":{\"executor_id\":\"relay.aurora\",\"gas_burnt\":223182562500,\"logs\":[],\"metadata\":{\"gas_profile\":[],\"version\":3},\"receipt_ids\":[],\"status\":{\"SuccessValue\":\"\"},\"tokens_burnt\":\"0\"},\"proof\":[{\"direction\":\"Left\",\"hash\":\"HaucqGKNawiCu6FPwqrqcb2F3PXx4UzpbjBVcyjYK7NR\"},{\"direction\":\"Left\",\"hash\":\"C68JmkiFShiDMH1a9WKBvan76HnJYVAFnM9Kxh83r96N\"},{\"direction\":\"Right\",\"hash\":\"HZzdU8o8fyvRFqS822KJvx9TbaqU4FVqJVqy7e7grk9J\"},{\"direction\":\"Right\",\"hash\":\"C9DMvDZzpN646SVCFWCuz2xzP2pQtGLGV6A2mpwuyaRM\"},{\"direction\":\"Right\",\"hash\":\"6p6EovC3S8VAfuksHKXsbvPJimxLCJPj7JxDMEi2aos5\"}]},\"receipt\":{\"predecessor_id\":\"system\",\"receipt\":{\"Action\":{\"actions\":[{\"Transfer\":{\"deposit\":\"188703998464321986639852\"}}],\"gas_price\":\"0\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"relay.aurora\",\"signer_public_key\":\"ed25519:ECTjgvJKWrpoCNzC5BGyMAWZcFjqe24n3mMV9ndFcpfy\"}},\"receipt_id\":\"bm7V3pZbt3hbo3dq5NndWdEe89smD7UWBXKqHF8q3MY\",\"receiver_id\":\"relay.aurora\"}},{\"execution_outcome\":{\"block_hash\":\"9DBzUMMZEvipLQRk8uYHspC1xmjV8hTxPgmfFjZcpwSa\",\"id\":\"Fma1RnScq8DEB8wmY1antx4tBsVx84rffvs2o5S2vcBR\",\"outcome\":{\"executor_id\":\"token.sweat\",\"gas_burnt\":3999515671520,\"logs\":[\"EVENT_JSON:{\\\\\\\"standard\\\\\\\":\\\\\\\"nep141\\\\\\\",\\\\\\\"version\\\\\\\":\\\\\\\"1.0.0\\\\\\\",\\\\\\\"event\\\\\\\":\\\\\\\"ft_transfer\\\\\\\",\\\\\\\"data\\\\\\\":[{\\\\\\\"old_owner_id\\\\\\\":\\\\\\\"6faeffa480a502a1ec0fcb25a4237c4d53ec1fff9455e67b842caf84c927a917\\\\\\\",\\\\\\\"new_owner_id\\\\\\\":\\\\\\\"reward-optin.sweat\\\\\\\",\\\\\\\"amount\\\\\\\":\\\\\\\"1000000000000000000\\\\\\\",\\\\\\\"memo\\\\\\\":\\\\\\\"sw:rew:optin:J9djzqYXnY-6faeffa480a502a1ec0fcb25a4237c4d53ec1fff9455e67b842caf84c927a917\\\\\\\"}]}\"],\"metadata\":{\"gas_profile\":[{\"cost\":\"BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"7413507108\"},{\"cost\":\"CONTRACT_LOADING_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"35445963\"},{\"cost\":\"CONTRACT_LOADING_BYTES\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"44831486250\"},{\"cost\":\"LOG_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"3543313050\"},{\"cost\":\"LOG_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"4355601030\"},{\"cost\":\"READ_CACHED_TRIE_NODE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"287280000000\"},{\"cost\":\"READ_MEMORY_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"36538084800\"},{\"cost\":\"READ_MEMORY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"2820589086\"},{\"cost\":\"READ_REGISTER_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"27688817046\"},{\"cost\":\"READ_REGISTER_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"48393942\"},{\"cost\":\"SHA256_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"18163881000\"},{\"cost\":\"SHA256_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"3955245564\"},{\"cost\":\"STORAGE_READ_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"169070537250\"},{\"cost\":\"STORAGE_READ_KEY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"2259534909\"},{\"cost\":\"STORAGE_READ_VALUE_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"572322510\"},{\"cost\":\"STORAGE_WRITE_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"192590208000\"},{\"cost\":\"STORAGE_WRITE_EVICTED_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"3275965314\"},{\"cost\":\"STORAGE_WRITE_KEY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"5145249291\"},{\"cost\":\"STORAGE_WRITE_VALUE_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"3163890978\"},{\"cost\":\"TOUCHING_TRIE_NODE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"531364545558\"},{\"cost\":\"UTF8_DECODING_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"3111779061\"},{\"cost\":\"UTF8_DECODING_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"96221558070\"},{\"cost\":\"WASM_INSTRUCTION\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"56205753384\"},{\"cost\":\"WRITE_MEMORY_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"33645538332\"},{\"cost\":\"WRITE_MEMORY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"1380952404\"},{\"cost\":\"WRITE_REGISTER_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"34386269832\"},{\"cost\":\"WRITE_REGISTER_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"2132677404\"}],\"version\":3},\"receipt_ids\":[\"DPbMx82LuY9QYTeGw2JcXaKkqQzH2FXcA8LzAFKLCqUR\"],\"status\":{\"SuccessValue\":\"\"},\"tokens_burnt\":\"399951567152000000000\"},\"proof\":[{\"direction\":\"Right\",\"hash\":\"E9n2bHZ1MTNTdGLpJiow7VHw95gyCf6RammEwNRLQ3UC\"},{\"direction\":\"Right\",\"hash\":\"8APBq7Bgt3V3XyTtwCgDaB89Spmms5t5rRNL5Y64KVd1\"},{\"direction\":\"Left\",\"hash\":\"ARNjm5JG8FecnGsFH78aREzs8Vb6vYPSgpqo3CJsh9CZ\"},{\"direction\":\"Right\",\"hash\":\"C9DMvDZzpN646SVCFWCuz2xzP2pQtGLGV6A2mpwuyaRM\"},{\"direction\":\"Right\",\"hash\":\"6p6EovC3S8VAfuksHKXsbvPJimxLCJPj7JxDMEi2aos5\"}]},\"receipt\":{\"predecessor_id\":\"6faeffa480a502a1ec0fcb25a4237c4d53ec1fff9455e67b842caf84c927a917\",\"receipt\":{\"Action\":{\"actions\":[{\"FunctionCall\":{\"args\":\"eyJyZWNlaXZlcl9pZCI6InJld2FyZC1vcHRpbi5zd2VhdCIsImFtb3VudCI6IjEwMDAwMDAwMDAwMDAwMDAwMDAiLCJtZW1vIjoic3c6cmV3Om9wdGluOko5ZGp6cVlYblktNmZhZWZmYTQ4MGE1MDJhMWVjMGZjYjI1YTQyMzdjNGQ1M2VjMWZmZjk0NTVlNjdiODQyY2FmODRjOTI3YTkxNyJ9\",\"deposit\":\"1\",\"gas\":14000000000000,\"method_name\":\"ft_transfer\"}}],\"gas_price\":\"109272700\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"6faeffa480a502a1ec0fcb25a4237c4d53ec1fff9455e67b842caf84c927a917\",\"signer_public_key\":\"ed25519:4BiExDrNAgX822LmEJLP6mjcADnQfNwoimRNrnuvtmuL\"}},\"receipt_id\":\"Fma1RnScq8DEB8wmY1antx4tBsVx84rffvs2o5S2vcBR\",\"receiver_id\":\"token.sweat\"}},{\"execution_outcome\":{\"block_hash\":\"9DBzUMMZEvipLQRk8uYHspC1xmjV8hTxPgmfFjZcpwSa\",\"id\":\"8LyaPknFFRiEwZn9Zg76NDvfDShTg4P1CoiAVXYTcB3S\",\"outcome\":{\"executor_id\":\"usdt.tether-token.near\",\"gas_burnt\":3433084527432,\"logs\":[],\"metadata\":{\"gas_profile\":[{\"cost\":\"BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"3177217332\"},{\"cost\":\"CONTRACT_LOADING_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"35445963\"},{\"cost\":\"CONTRACT_LOADING_BYTES\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"60194509500\"},{\"cost\":\"READ_CACHED_TRIE_NODE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"145920000000\"},{\"cost\":\"READ_MEMORY_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"20878905600\"},{\"cost\":\"READ_MEMORY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"1493923869\"},{\"cost\":\"READ_REGISTER_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"5034330372\"},{\"cost\":\"READ_REGISTER_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"18825342\"},{\"cost\":\"STORAGE_HAS_KEY_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"108079793250\"},{\"cost\":\"STORAGE_HAS_KEY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"4249136610\"},{\"cost\":\"STORAGE_READ_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"56356845750\"},{\"cost\":\"STORAGE_READ_KEY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"154762665\"},{\"cost\":\"STORAGE_READ_VALUE_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"617210550\"},{\"cost\":\"STORAGE_WRITE_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"128393472000\"},{\"cost\":\"STORAGE_WRITE_EVICTED_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"3532903770\"},{\"cost\":\"STORAGE_WRITE_KEY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"5215732158\"},{\"cost\":\"STORAGE_WRITE_VALUE_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"3908335914\"},{\"cost\":\"TOUCHING_TRIE_NODE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"402548898150\"},{\"cost\":\"WASM_INSTRUCTION\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"36422585364\"},{\"cost\":\"WRITE_MEMORY_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"8411384583\"},{\"cost\":\"WRITE_MEMORY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"563820804\"},{\"cost\":\"WRITE_REGISTER_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"8596567458\"},{\"cost\":\"WRITE_REGISTER_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"1144270764\"}],\"version\":3},\"receipt_ids\":[\"6zZJuVeUuxuj1MF8S1Esj6jKndBbzxughUzDoAXnXmmS\"],\"status\":{\"SuccessValue\":\"eyJ0b3RhbCI6IjEyNTAwMDAwMDAwMDAwMDAwMDAwMDAiLCJhdmFpbGFibGUiOiIwIn0=\"},\"tokens_burnt\":\"343308452743200000000\"},\"proof\":[{\"direction\":\"Left\",\"hash\":\"EkoQerRU468jeKuXwkzxRTMUL2dNyZizKu5MoShdSVV3\"},{\"direction\":\"Right\",\"hash\":\"8APBq7Bgt3V3XyTtwCgDaB89Spmms5t5rRNL5Y64KVd1\"},{\"direction\":\"Left\",\"hash\":\"ARNjm5JG8FecnGsFH78aREzs8Vb6vYPSgpqo3CJsh9CZ\"},{\"direction\":\"Right\",\"hash\":\"C9DMvDZzpN646SVCFWCuz2xzP2pQtGLGV6A2mpwuyaRM\"},{\"direction\":\"Right\",\"hash\":\"6p6EovC3S8VAfuksHKXsbvPJimxLCJPj7JxDMEi2aos5\"}]},\"receipt\":{\"predecessor_id\":\"a081b1bb750d7c1e20e2a033e6237cba2f2709b4f7aebd3a3623ca198a7dbd35\",\"receipt\":{\"Action\":{\"actions\":[{\"FunctionCall\":{\"args\":\"eyJhY2NvdW50X2lkIjoiYTA4MWIxYmI3NTBkN2MxZTIwZTJhMDMzZTYyMzdjYmEyZjI3MDliNGY3YWViZDNhMzYyM2NhMTk4YTdkYmQzNSJ9\",\"deposit\":\"1250000000000000000000\",\"gas\":30000000000000,\"method_name\":\"storage_deposit\"}}],\"gas_price\":\"122987387\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"a081b1bb750d7c1e20e2a033e6237cba2f2709b4f7aebd3a3623ca198a7dbd35\",\"signer_public_key\":\"ed25519:BoYwAfniA8RwSet9fyqaa1o9eCkodzx6vENZs1FasDq6\"}},\"receipt_id\":\"8LyaPknFFRiEwZn9Zg76NDvfDShTg4P1CoiAVXYTcB3S\",\"receiver_id\":\"usdt.tether-token.near\"}},{\"execution_outcome\":{\"block_hash\":\"9DBzUMMZEvipLQRk8uYHspC1xmjV8hTxPgmfFjZcpwSa\",\"id\":\"GKCJmBtpCqvvz9oYxydyaY1n5a3Ly41ueXKFTTj8fiac\",\"outcome\":{\"executor_id\":\"tge-lockup.sweat\",\"gas_burnt\":8545263986541,\"logs\":[\"Claiming 117050908932009518924 form lockup #78957\",\"Total claim 117050908932009518924\"],\"metadata\":{\"gas_profile\":[{\"cost\":\"FUNCTION_CALL_BASE\",\"cost_category\":\"ACTION_COST\",\"gas_used\":\"4639723000000\"},{\"cost\":\"FUNCTION_CALL_BYTE\",\"cost_category\":\"ACTION_COST\",\"gas_used\":\"889901732\"},{\"cost\":\"NEW_ACTION_RECEIPT\",\"cost_category\":\"ACTION_COST\",\"gas_used\":\"289092464624\"},{\"cost\":\"BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"8472579552\"},{\"cost\":\"CONTRACT_LOADING_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"35445963\"},{\"cost\":\"CONTRACT_LOADING_BYTES\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"50686337250\"},{\"cost\":\"LOG_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"7086626100\"},{\"cost\":\"LOG_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"1082300862\"},{\"cost\":\"PROMISE_RETURN\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"560152386\"},{\"cost\":\"READ_CACHED_TRIE_NODE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"123120000000\"},{\"cost\":\"READ_MEMORY_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"46977537600\"},{\"cost\":\"READ_MEMORY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"3200722386\"},{\"cost\":\"READ_REGISTER_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"17620156302\"},{\"cost\":\"READ_REGISTER_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"44845710\"},{\"cost\":\"STORAGE_READ_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"169070537250\"},{\"cost\":\"STORAGE_READ_KEY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"2569060239\"},{\"cost\":\"STORAGE_READ_VALUE_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"1178311050\"},{\"cost\":\"STORAGE_WRITE_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"128393472000\"},{\"cost\":\"STORAGE_WRITE_EVICTED_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"6487696014\"},{\"cost\":\"STORAGE_WRITE_KEY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"986760138\"},{\"cost\":\"STORAGE_WRITE_VALUE_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"6265744878\"},{\"cost\":\"TOUCHING_TRIE_NODE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"450854765928\"},{\"cost\":\"UTF8_DECODING_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"12447116244\"},{\"cost\":\"UTF8_DECODING_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"31782272211\"},{\"cost\":\"WASM_INSTRUCTION\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"70130898684\"},{\"cost\":\"WRITE_MEMORY_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"22430358888\"},{\"cost\":\"WRITE_MEMORY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"1282896612\"},{\"cost\":\"WRITE_REGISTER_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"22924179888\"},{\"cost\":\"WRITE_REGISTER_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"1931194512\"}],\"version\":3},\"receipt_ids\":[\"5RUpKZyknLY7YYQGm9KWvDHKHvsDNb6ABtrz7qAi8Cds\",\"79rykPk9g6DWttZeYQqzc4ePEwouLn5QbsX5ys8GhnxK\",\"CxFh99xfh2a3kFLCXatXPmvyod83hdM7VvPqMFCtvZS5\"],\"status\":{\"SuccessReceiptId\":\"79rykPk9g6DWttZeYQqzc4ePEwouLn5QbsX5ys8GhnxK\"},\"tokens_burnt\":\"854526398654100000000\"},\"proof\":[{\"direction\":\"Right\",\"hash\":\"7s4c1zuK9cgwc5Hiwsw7fZjzDHXrzJet4E3mGuVbfFn3\"},{\"direction\":\"Left\",\"hash\":\"7sF8aXeWJKnC6PZudGpfHptSNVbybt2bkYekqmHuBMxL\"},{\"direction\":\"Left\",\"hash\":\"ARNjm5JG8FecnGsFH78aREzs8Vb6vYPSgpqo3CJsh9CZ\"},{\"direction\":\"Right\",\"hash\":\"C9DMvDZzpN646SVCFWCuz2xzP2pQtGLGV6A2mpwuyaRM\"},{\"direction\":\"Right\",\"hash\":\"6p6EovC3S8VAfuksHKXsbvPJimxLCJPj7JxDMEi2aos5\"}]},\"receipt\":{\"predecessor_id\":\"0182e5d62f1c3d6a4b26b49c934d58a0052e0f9cadf046e22dfa5cff1e92d835\",\"receipt\":{\"Action\":{\"actions\":[{\"FunctionCall\":{\"args\":\"e30=\",\"deposit\":\"0\",\"gas\":100000000000000,\"method_name\":\"claim\"}}],\"gas_price\":\"186029458\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"0182e5d62f1c3d6a4b26b49c934d58a0052e0f9cadf046e22dfa5cff1e92d835\",\"signer_public_key\":\"ed25519:6uB7bgkaNN1aRVGJ4MtS44jcN5AcBa5UwEodUK3jxfn\"}},\"receipt_id\":\"GKCJmBtpCqvvz9oYxydyaY1n5a3Ly41ueXKFTTj8fiac\",\"receiver_id\":\"tge-lockup.sweat\"}},{\"execution_outcome\":{\"block_hash\":\"9DBzUMMZEvipLQRk8uYHspC1xmjV8hTxPgmfFjZcpwSa\",\"id\":\"9Se9uAo3caHJG6wAFFh4VmPpjyZwLmR7zcVNWaKrrFb3\",\"outcome\":{\"executor_id\":\"usdt.tether-token.near\",\"gas_burnt\":3118327731810,\"logs\":[],\"metadata\":{\"gas_profile\":[{\"cost\":\"BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"3177217332\"},{\"cost\":\"CONTRACT_LOADING_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"35445963\"},{\"cost\":\"CONTRACT_LOADING_BYTES\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"60194509500\"},{\"cost\":\"READ_CACHED_TRIE_NODE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"104880000000\"},{\"cost\":\"READ_MEMORY_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"20878905600\"},{\"cost\":\"READ_MEMORY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"1493923869\"},{\"cost\":\"READ_REGISTER_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"5034330372\"},{\"cost\":\"READ_REGISTER_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"18825342\"},{\"cost\":\"STORAGE_HAS_KEY_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"108079793250\"},{\"cost\":\"STORAGE_HAS_KEY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"4249136610\"},{\"cost\":\"STORAGE_READ_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"56356845750\"},{\"cost\":\"STORAGE_READ_KEY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"154762665\"},{\"cost\":\"STORAGE_READ_VALUE_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"617210550\"},{\"cost\":\"STORAGE_WRITE_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"128393472000\"},{\"cost\":\"STORAGE_WRITE_EVICTED_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"3532903770\"},{\"cost\":\"STORAGE_WRITE_KEY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"5215732158\"},{\"cost\":\"STORAGE_WRITE_VALUE_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"3908335914\"},{\"cost\":\"TOUCHING_TRIE_NODE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"128815647408\"},{\"cost\":\"WASM_INSTRUCTION\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"36439040484\"},{\"cost\":\"WRITE_MEMORY_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"8411384583\"},{\"cost\":\"WRITE_MEMORY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"563820804\"},{\"cost\":\"WRITE_REGISTER_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"8596567458\"},{\"cost\":\"WRITE_REGISTER_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"1144270764\"}],\"version\":3},\"receipt_ids\":[\"9ytgtqFVJhmS1ZcedkUBMM66guh59F3eq4Xjo9JzJ777\"],\"status\":{\"SuccessValue\":\"eyJ0b3RhbCI6IjEyNTAwMDAwMDAwMDAwMDAwMDAwMDAiLCJhdmFpbGFibGUiOiIwIn0=\"},\"tokens_burnt\":\"311832773181000000000\"},\"proof\":[{\"direction\":\"Left\",\"hash\":\"7bKza1fcc3MpmuT3Hfx2mmnkc99ZA5aFGmXkinYWwo3n\"},{\"direction\":\"Left\",\"hash\":\"7sF8aXeWJKnC6PZudGpfHptSNVbybt2bkYekqmHuBMxL\"},{\"direction\":\"Left\",\"hash\":\"ARNjm5JG8FecnGsFH78aREzs8Vb6vYPSgpqo3CJsh9CZ\"},{\"direction\":\"Right\",\"hash\":\"C9DMvDZzpN646SVCFWCuz2xzP2pQtGLGV6A2mpwuyaRM\"},{\"direction\":\"Right\",\"hash\":\"6p6EovC3S8VAfuksHKXsbvPJimxLCJPj7JxDMEi2aos5\"}]},\"receipt\":{\"predecessor_id\":\"64abffbe659f5da752d0821a72d9f0cb660c4bc84e90b1104a4b4065d98a6c75\",\"receipt\":{\"Action\":{\"actions\":[{\"FunctionCall\":{\"args\":\"eyJhY2NvdW50X2lkIjoiNjRhYmZmYmU2NTlmNWRhNzUyZDA4MjFhNzJkOWYwY2I2NjBjNGJjODRlOTBiMTEwNGE0YjQwNjVkOThhNmM3NSJ9\",\"deposit\":\"1250000000000000000000\",\"gas\":30000000000000,\"method_name\":\"storage_deposit\"}}],\"gas_price\":\"122987387\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"64abffbe659f5da752d0821a72d9f0cb660c4bc84e90b1104a4b4065d98a6c75\",\"signer_public_key\":\"ed25519:7mytRQ2oBzrUjXBkcjKUNeum9N6obX3Z3E5GYpgiq5Yp\"}},\"receipt_id\":\"9Se9uAo3caHJG6wAFFh4VmPpjyZwLmR7zcVNWaKrrFb3\",\"receiver_id\":\"usdt.tether-token.near\"}},{\"execution_outcome\":{\"block_hash\":\"9DBzUMMZEvipLQRk8uYHspC1xmjV8hTxPgmfFjZcpwSa\",\"id\":\"HRxnJyEFygJg1QtWzMFN5DMRfPyemPQbFEGYdUUrD43T\",\"outcome\":{\"executor_id\":\"token.sweat\",\"gas_burnt\":3412157981540,\"logs\":[\"EVENT_JSON:{\\\\\\\"standard\\\\\\\":\\\\\\\"nep141\\\\\\\",\\\\\\\"version\\\\\\\":\\\\\\\"1.0.0\\\\\\\",\\\\\\\"event\\\\\\\":\\\\\\\"ft_transfer\\\\\\\",\\\\\\\"data\\\\\\\":[{\\\\\\\"old_owner_id\\\\\\\":\\\\\\\"1d13d463b67d3a6794f5a056c4d6a9e6aea90b76d0f0ced512cb179c81ba08f7\\\\\\\",\\\\\\\"new_owner_id\\\\\\\":\\\\\\\"reward-optin.sweat\\\\\\\",\\\\\\\"amount\\\\\\\":\\\\\\\"1000000000000000000\\\\\\\",\\\\\\\"memo\\\\\\\":\\\\\\\"sw:rew:optin:J9djzqYXnY-1d13d463b67d3a6794f5a056c4d6a9e6aea90b76d0f0ced512cb179c81ba08f7\\\\\\\"}]}\"],\"metadata\":{\"gas_profile\":[{\"cost\":\"BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"7413507108\"},{\"cost\":\"CONTRACT_LOADING_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"35445963\"},{\"cost\":\"CONTRACT_LOADING_BYTES\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"44831486250\"},{\"cost\":\"LOG_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"3543313050\"},{\"cost\":\"LOG_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"4355601030\"},{\"cost\":\"READ_CACHED_TRIE_NODE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"118560000000\"},{\"cost\":\"READ_MEMORY_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"36538084800\"},{\"cost\":\"READ_MEMORY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"2820589086\"},{\"cost\":\"READ_REGISTER_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"27688817046\"},{\"cost\":\"READ_REGISTER_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"48393942\"},{\"cost\":\"SHA256_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"18163881000\"},{\"cost\":\"SHA256_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"3955245564\"},{\"cost\":\"STORAGE_READ_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"169070537250\"},{\"cost\":\"STORAGE_READ_KEY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"2259534909\"},{\"cost\":\"STORAGE_READ_VALUE_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"572322510\"},{\"cost\":\"STORAGE_WRITE_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"192590208000\"},{\"cost\":\"STORAGE_WRITE_EVICTED_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"3275965314\"},{\"cost\":\"STORAGE_WRITE_KEY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"5145249291\"},{\"cost\":\"STORAGE_WRITE_VALUE_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"3163890978\"},{\"cost\":\"TOUCHING_TRIE_NODE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"112713691482\"},{\"cost\":\"UTF8_DECODING_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"3111779061\"},{\"cost\":\"UTF8_DECODING_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"96221558070\"},{\"cost\":\"WASM_INSTRUCTION\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"56218917480\"},{\"cost\":\"WRITE_MEMORY_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"33645538332\"},{\"cost\":\"WRITE_MEMORY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"1380952404\"},{\"cost\":\"WRITE_REGISTER_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"34386269832\"},{\"cost\":\"WRITE_REGISTER_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"2132677404\"}],\"version\":3},\"receipt_ids\":[\"BDJHv84oMe8gCuNEfRWBKfTqfrbwvXomqAsQtUkbTjGa\"],\"status\":{\"SuccessValue\":\"\"},\"tokens_burnt\":\"341215798154000000000\"},\"proof\":[{\"direction\":\"Right\",\"hash\":\"G6HUgG9ykWjXvX1CbJE73st2AxpBc29qwZModqTAojrR\"},{\"direction\":\"Right\",\"hash\":\"74VZPjX17DSwsKm4B49KdLYNPcSbQZNNLNwzqWemKfpa\"},{\"direction\":\"Right\",\"hash\":\"9kwjECYJQyMcjc6CvM145Xxy12BeXLkPtunNGKeMtbCk\"},{\"direction\":\"Left\",\"hash\":\"DTaeeWiNENGLW1CdiC3RNSqyqez3ARiUcA68b7GFBJDN\"},{\"direction\":\"Right\",\"hash\":\"6p6EovC3S8VAfuksHKXsbvPJimxLCJPj7JxDMEi2aos5\"}]},\"receipt\":{\"predecessor_id\":\"1d13d463b67d3a6794f5a056c4d6a9e6aea90b76d0f0ced512cb179c81ba08f7\",\"receipt\":{\"Action\":{\"actions\":[{\"FunctionCall\":{\"args\":\"eyJyZWNlaXZlcl9pZCI6InJld2FyZC1vcHRpbi5zd2VhdCIsImFtb3VudCI6IjEwMDAwMDAwMDAwMDAwMDAwMDAiLCJtZW1vIjoic3c6cmV3Om9wdGluOko5ZGp6cVlYblktMWQxM2Q0NjNiNjdkM2E2Nzk0ZjVhMDU2YzRkNmE5ZTZhZWE5MGI3NmQwZjBjZWQ1MTJjYjE3OWM4MWJhMDhmNyJ9\",\"deposit\":\"1\",\"gas\":14000000000000,\"method_name\":\"ft_transfer\"}}],\"gas_price\":\"109272700\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"1d13d463b67d3a6794f5a056c4d6a9e6aea90b76d0f0ced512cb179c81ba08f7\",\"signer_public_key\":\"ed25519:2xWMvK1meQnUGoaxNs1ZDVeerCcq3kufNQnwz398d3jU\"}},\"receipt_id\":\"HRxnJyEFygJg1QtWzMFN5DMRfPyemPQbFEGYdUUrD43T\",\"receiver_id\":\"token.sweat\"}},{\"execution_outcome\":{\"block_hash\":\"9DBzUMMZEvipLQRk8uYHspC1xmjV8hTxPgmfFjZcpwSa\",\"id\":\"7NQ2puUQk5YdphCtyESCCdav1gMNCNcBC22Ub99yqPDm\",\"outcome\":{\"executor_id\":\"usdt.tether-token.near\",\"gas_burnt\":3095235592398,\"logs\":[],\"metadata\":{\"gas_profile\":[{\"cost\":\"BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"3177217332\"},{\"cost\":\"CONTRACT_LOADING_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"35445963\"},{\"cost\":\"CONTRACT_LOADING_BYTES\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"60194509500\"},{\"cost\":\"READ_CACHED_TRIE_NODE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"114000000000\"},{\"cost\":\"READ_MEMORY_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"20878905600\"},{\"cost\":\"READ_MEMORY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"1493923869\"},{\"cost\":\"READ_REGISTER_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"5034330372\"},{\"cost\":\"READ_REGISTER_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"18825342\"},{\"cost\":\"STORAGE_HAS_KEY_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"108079793250\"},{\"cost\":\"STORAGE_HAS_KEY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"4249136610\"},{\"cost\":\"STORAGE_READ_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"56356845750\"},{\"cost\":\"STORAGE_READ_KEY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"154762665\"},{\"cost\":\"STORAGE_READ_VALUE_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"617210550\"},{\"cost\":\"STORAGE_WRITE_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"128393472000\"},{\"cost\":\"STORAGE_WRITE_EVICTED_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"3532903770\"},{\"cost\":\"STORAGE_WRITE_KEY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"5215732158\"},{\"cost\":\"STORAGE_WRITE_VALUE_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"3908335914\"},{\"cost\":\"TOUCHING_TRIE_NODE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"96611735556\"},{\"cost\":\"WASM_INSTRUCTION\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"36430812924\"},{\"cost\":\"WRITE_MEMORY_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"8411384583\"},{\"cost\":\"WRITE_MEMORY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"563820804\"},{\"cost\":\"WRITE_REGISTER_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"8596567458\"},{\"cost\":\"WRITE_REGISTER_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"1144270764\"}],\"version\":3},\"receipt_ids\":[\"BPfaXbaZFDRRTv9goDHfsnH8V5hANe9UqaFauqqrQLnt\"],\"status\":{\"SuccessValue\":\"eyJ0b3RhbCI6IjEyNTAwMDAwMDAwMDAwMDAwMDAwMDAiLCJhdmFpbGFibGUiOiIwIn0=\"},\"tokens_burnt\":\"309523559239800000000\"},\"proof\":[{\"direction\":\"Left\",\"hash\":\"8TqstA3pYhukrnnbbYGegaNwLdJSwQgqNwfe1LXHoKsr\"},{\"direction\":\"Right\",\"hash\":\"74VZPjX17DSwsKm4B49KdLYNPcSbQZNNLNwzqWemKfpa\"},{\"direction\":\"Right\",\"hash\":\"9kwjECYJQyMcjc6CvM145Xxy12BeXLkPtunNGKeMtbCk\"},{\"direction\":\"Left\",\"hash\":\"DTaeeWiNENGLW1CdiC3RNSqyqez3ARiUcA68b7GFBJDN\"},{\"direction\":\"Right\",\"hash\":\"6p6EovC3S8VAfuksHKXsbvPJimxLCJPj7JxDMEi2aos5\"}]},\"receipt\":{\"predecessor_id\":\"a3e1f5b1724f18cba5cf35ad3d20037feaf7e7c5709e8838b83759d7504b0bcc\",\"receipt\":{\"Action\":{\"actions\":[{\"FunctionCall\":{\"args\":\"eyJhY2NvdW50X2lkIjoiYTNlMWY1YjE3MjRmMThjYmE1Y2YzNWFkM2QyMDAzN2ZlYWY3ZTdjNTcwOWU4ODM4YjgzNzU5ZDc1MDRiMGJjYyJ9\",\"deposit\":\"1250000000000000000000\",\"gas\":30000000000000,\"method_name\":\"storage_deposit\"}}],\"gas_price\":\"122987387\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"a3e1f5b1724f18cba5cf35ad3d20037feaf7e7c5709e8838b83759d7504b0bcc\",\"signer_public_key\":\"ed25519:C2jJ6HMnY24Srb58aivEoy5DKkxBsXffp29ZcMpBxHZu\"}},\"receipt_id\":\"7NQ2puUQk5YdphCtyESCCdav1gMNCNcBC22Ub99yqPDm\",\"receiver_id\":\"usdt.tether-token.near\"}},{\"execution_outcome\":{\"block_hash\":\"9DBzUMMZEvipLQRk8uYHspC1xmjV8hTxPgmfFjZcpwSa\",\"id\":\"5jAZr8vHTCWmmCSnvbCxa4fiwLQrdwuXSNHQft6UZ1io\",\"outcome\":{\"executor_id\":\"mos.mfac.butternetwork.near\",\"gas_burnt\":4393831001662,\"logs\":[\"transfer out: {\\\\\\\"from_chain\\\\\\\":\\\\\\\"1360100178526209\\\\\\\",\\\\\\\"to_chain\\\\\\\":\\\\\\\"22776\\\\\\\",\\\\\\\"order_id\\\\\\\":\\\\\\\"0x80ca3f9550bb152087161001c7228f5213270dc82111a6112e431efdab6e29de\\\\\\\",\\\\\\\"token\\\\\\\":[97,48,98,56,54,57,57,49,99,54,50,49,56,98,51,54,99,49,100,49,57,100,52,97,50,101,57,101,98,48,99,101,51,54,48,54,101,98,52,56,46,102,97,99,116,111,114,121,46,98,114,105,100,103,101,46,110,101,97,114],\\\\\\\"from\\\\\\\":[101,48,51,51,54,49,102,53,54,53,50,55,98,50,55,57,50,53,51,51,52,50,53,48,57,57,51,102,100,99,98,56,54,54,50,51,101,57,48,56,50,53,52,98,56,102,56,97,101,100,56,97,101,48,51,55,102,102,50,101,49,98,98,53],\\\\\\\"to\\\\\\\":[7,87,191,155,20,136,69,51,164,179,232,159,216,216,120,245,72,207,204,78],\\\\\\\"amount\\\\\\\":\\\\\\\"47059496\\\\\\\",\\\\\\\"to_chain_token\\\\\\\":[]}\",\"2ef1cdf83614a69568ed2c96a275dd7fb2e63a464aa3a0ffe79f55d538c8b3b5f8c78704d501000000018258f8a080ca3f9550bb152087161001c7228f5213270dc82111a6112e431efdab6e29deb83c613062383639393163363231386233366331643139643461326539656230636533363036656234382e666163746f72792e6272696467652e6e656172b84065303333363166353635323762323739323533333432353039393366646362383636323365393038323534623866386165643861653033376666326531626235940757bf9b14884533a4b3e89fd8d878f548cfcc4e8402ce122880\"],\"metadata\":{\"gas_profile\":[{\"cost\":\"NEW_DATA_RECEIPT_BYTE\",\"cost_category\":\"ACTION_COST\",\"gas_used\":\"103272066\"},{\"cost\":\"BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"7943043330\"},{\"cost\":\"CONTRACT_LOADING_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"35445963\"},{\"cost\":\"CONTRACT_LOADING_BYTES\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"198397994250\"},{\"cost\":\"LOG_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"7086626100\"},{\"cost\":\"LOG_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"15218206023\"},{\"cost\":\"READ_CACHED_TRIE_NODE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"173280000000\"},{\"cost\":\"READ_MEMORY_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"28708495200\"},{\"cost\":\"READ_MEMORY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"8210879280\"},{\"cost\":\"READ_REGISTER_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"22654486674\"},{\"cost\":\"READ_REGISTER_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"108023952\"},{\"cost\":\"SHA256_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"4540970250\"},{\"cost\":\"SHA256_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"3834658809\"},{\"cost\":\"STORAGE_READ_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"281784228750\"},{\"cost\":\"STORAGE_READ_KEY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"4859547681\"},{\"cost\":\"STORAGE_READ_VALUE_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"4309251840\"},{\"cost\":\"STORAGE_WRITE_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"64196736000\"},{\"cost\":\"STORAGE_WRITE_EVICTED_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"21936120681\"},{\"cost\":\"STORAGE_WRITE_KEY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"352414335\"},{\"cost\":\"STORAGE_WRITE_VALUE_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"21185662137\"},{\"cost\":\"TOUCHING_TRIE_NODE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"483058677780\"},{\"cost\":\"UTF8_DECODING_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"6223558122\"},{\"cost\":\"UTF8_DECODING_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"336192292287\"},{\"cost\":\"WASM_INSTRUCTION\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"204705806580\"},{\"cost\":\"WRITE_MEMORY_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"28037948610\"},{\"cost\":\"WRITE_MEMORY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"3028834464\"},{\"cost\":\"WRITE_REGISTER_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"28655224860\"},{\"cost\":\"WRITE_REGISTER_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"6762982356\"}],\"version\":3},\"receipt_ids\":[\"CjrEGsSxUrbSSWizWUCJhSyHMGcqGZ99QGEPSwua9kwo\"],\"status\":{\"SuccessValue\":\"IjAi\"},\"tokens_burnt\":\"439383100166200000000\"},\"proof\":[{\"direction\":\"Right\",\"hash\":\"BsvaMht3DWLfh4Hh8J1Tvkb4TarDc1eLhEkj8iNZYTLn\"},{\"direction\":\"Left\",\"hash\":\"329geyiXck8GcSWvGETw44d9etCScCqZkUnaP1sTvsjb\"},{\"direction\":\"Right\",\"hash\":\"9kwjECYJQyMcjc6CvM145Xxy12BeXLkPtunNGKeMtbCk\"},{\"direction\":\"Left\",\"hash\":\"DTaeeWiNENGLW1CdiC3RNSqyqez3ARiUcA68b7GFBJDN\"},{\"direction\":\"Right\",\"hash\":\"6p6EovC3S8VAfuksHKXsbvPJimxLCJPj7JxDMEi2aos5\"}]},\"receipt\":{\"predecessor_id\":\"a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48.factory.bridge.near\",\"receipt\":{\"Action\":{\"actions\":[{\"FunctionCall\":{\"args\":\"eyJzZW5kZXJfaWQiOiJlMDMzNjFmNTY1MjdiMjc5MjUzMzQyNTA5OTNmZGNiODY2MjNlOTA4MjU0YjhmOGFlZDhhZTAzN2ZmMmUxYmI1IiwiYW1vdW50IjoiNDcwNTk0OTYiLCJtc2ciOiJ7XCJ0eXBlXCI6XCJUcmFuc2ZlclwiLFwidG9cIjpcIjB4MDc1N2JGOUIxNDg4NDUzM2E0QjNFODlGRDhEODc4ZjU0OENGQ0M0RVwiLFwidG9fY2hhaW5cIjpcIjIyNzc2XCJ9In0=\",\"deposit\":\"0\",\"gas\":270000000000000,\"method_name\":\"ft_on_transfer\"}}],\"gas_price\":\"625040174\",\"input_data_ids\":[],\"output_data_receivers\":[{\"data_id\":\"DJzQmhhaummUUFNzP99semWjwgwjmjo86A4pAqUBzch3\",\"receiver_id\":\"a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48.factory.bridge.near\"}],\"signer_id\":\"e03361f56527b27925334250993fdcb86623e908254b8f8aed8ae037ff2e1bb5\",\"signer_public_key\":\"ed25519:G6BmWT85Uu4At6rPxkma6ERZGFQd5opn8JunAzTu8UMA\"}},\"receipt_id\":\"5jAZr8vHTCWmmCSnvbCxa4fiwLQrdwuXSNHQft6UZ1io\",\"receiver_id\":\"mos.mfac.butternetwork.near\"}},{\"execution_outcome\":{\"block_hash\":\"9DBzUMMZEvipLQRk8uYHspC1xmjV8hTxPgmfFjZcpwSa\",\"id\":\"EVzjwprJmpvwATvvy6vMDB5Y5UJWfksE8aWb9PvcNepm\",\"outcome\":{\"executor_id\":\"nearcrowd_2.near\",\"gas_burnt\":223182562500,\"logs\":[],\"metadata\":{\"gas_profile\":[],\"version\":3},\"receipt_ids\":[],\"status\":{\"SuccessValue\":\"\"},\"tokens_burnt\":\"0\"},\"proof\":[{\"direction\":\"Left\",\"hash\":\"5wvf7p1Y4sJFdk7pHsVkc3MQa7QCPKjo11MrCUDw1RCG\"},{\"direction\":\"Left\",\"hash\":\"329geyiXck8GcSWvGETw44d9etCScCqZkUnaP1sTvsjb\"},{\"direction\":\"Right\",\"hash\":\"9kwjECYJQyMcjc6CvM145Xxy12BeXLkPtunNGKeMtbCk\"},{\"direction\":\"Left\",\"hash\":\"DTaeeWiNENGLW1CdiC3RNSqyqez3ARiUcA68b7GFBJDN\"},{\"direction\":\"Right\",\"hash\":\"6p6EovC3S8VAfuksHKXsbvPJimxLCJPj7JxDMEi2aos5\"}]},\"receipt\":{\"predecessor_id\":\"system\",\"receipt\":{\"Action\":{\"actions\":[{\"Transfer\":{\"deposit\":\"13214028874009742651168\"}}],\"gas_price\":\"0\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"nearcrowd_2.near\",\"signer_public_key\":\"ed25519:2RRwQPTGRZkavm5sf1gJEbay34MpBMpw7LTriD3ZeLBZ\"}},\"receipt_id\":\"EVzjwprJmpvwATvvy6vMDB5Y5UJWfksE8aWb9PvcNepm\",\"receiver_id\":\"nearcrowd_2.near\"}},{\"execution_outcome\":{\"block_hash\":\"9DBzUMMZEvipLQRk8uYHspC1xmjV8hTxPgmfFjZcpwSa\",\"id\":\"CtQACcsYrAuAWoGPoUE7uM6c3JoZ9rHQNfhtMMbJoyYD\",\"outcome\":{\"executor_id\":\"mytestapi.embr.playember_reserve.near\",\"gas_burnt\":223182562500,\"logs\":[],\"metadata\":{\"gas_profile\":[],\"version\":3},\"receipt_ids\":[],\"status\":{\"SuccessValue\":\"\"},\"tokens_burnt\":\"0\"},\"proof\":[{\"direction\":\"Right\",\"hash\":\"As9h8f8UZdPNLbopn8vVxJvvxXzkR3xUyivDbReB6v25\"},{\"direction\":\"Right\",\"hash\":\"5uQQ5YdK91ZFg56TgpJADpYenvNYEaWVjcqyLk3c15Yh\"},{\"direction\":\"Left\",\"hash\":\"62f4EWTnhFEq8XaRqQmR7Y5NVHb89Ge29MS7FMWJWGJt\"},{\"direction\":\"Left\",\"hash\":\"DTaeeWiNENGLW1CdiC3RNSqyqez3ARiUcA68b7GFBJDN\"},{\"direction\":\"Right\",\"hash\":\"6p6EovC3S8VAfuksHKXsbvPJimxLCJPj7JxDMEi2aos5\"}]},\"receipt\":{\"predecessor_id\":\"system\",\"receipt\":{\"Action\":{\"actions\":[{\"Transfer\":{\"deposit\":\"669547687500000000\"}}],\"gas_price\":\"0\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"mytestapi.embr.playember_reserve.near\",\"signer_public_key\":\"ed25519:CKyBFz2ncy7GP9oqDqUojEQm4aPzntmQf4zswVyj4kSH\"}},\"receipt_id\":\"CtQACcsYrAuAWoGPoUE7uM6c3JoZ9rHQNfhtMMbJoyYD\",\"receiver_id\":\"mytestapi.embr.playember_reserve.near\"}},{\"execution_outcome\":{\"block_hash\":\"9DBzUMMZEvipLQRk8uYHspC1xmjV8hTxPgmfFjZcpwSa\",\"id\":\"4AztGSk1EGUy7WU7NgoZKe1Wrnh59zcQc114vxvM7ubf\",\"outcome\":{\"executor_id\":\"rezerv-42.near\",\"gas_burnt\":223182562500,\"logs\":[],\"metadata\":{\"gas_profile\":[],\"version\":3},\"receipt_ids\":[],\"status\":{\"SuccessValue\":\"\"},\"tokens_burnt\":\"0\"},\"proof\":[{\"direction\":\"Left\",\"hash\":\"6WPacWUweJPEtbkkAwmnr5EjdPqofedzQJBF8DgcpLYC\"},{\"direction\":\"Right\",\"hash\":\"5uQQ5YdK91ZFg56TgpJADpYenvNYEaWVjcqyLk3c15Yh\"},{\"direction\":\"Left\",\"hash\":\"62f4EWTnhFEq8XaRqQmR7Y5NVHb89Ge29MS7FMWJWGJt\"},{\"direction\":\"Left\",\"hash\":\"DTaeeWiNENGLW1CdiC3RNSqyqez3ARiUcA68b7GFBJDN\"},{\"direction\":\"Right\",\"hash\":\"6p6EovC3S8VAfuksHKXsbvPJimxLCJPj7JxDMEi2aos5\"}]},\"receipt\":{\"predecessor_id\":\"system\",\"receipt\":{\"Action\":{\"actions\":[{\"Transfer\":{\"deposit\":\"13236703872667742651168\"}}],\"gas_price\":\"0\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"rezerv-42.near\",\"signer_public_key\":\"ed25519:5NVcZnEZY9xcknHjb5BzmzhHdD7P8TD8LvQ9kBJWNbbQ\"}},\"receipt_id\":\"4AztGSk1EGUy7WU7NgoZKe1Wrnh59zcQc114vxvM7ubf\",\"receiver_id\":\"rezerv-42.near\"}},{\"execution_outcome\":{\"block_hash\":\"9DBzUMMZEvipLQRk8uYHspC1xmjV8hTxPgmfFjZcpwSa\",\"id\":\"6Xb4nNi8zGg6KdVhXRWM8uUURfhzFbX4R82E3soep9ES\",\"outcome\":{\"executor_id\":\"usdt.tether-token.near\",\"gas_burnt\":3086099137278,\"logs\":[],\"metadata\":{\"gas_profile\":[{\"cost\":\"BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"3177217332\"},{\"cost\":\"CONTRACT_LOADING_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"35445963\"},{\"cost\":\"CONTRACT_LOADING_BYTES\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"60194509500\"},{\"cost\":\"READ_CACHED_TRIE_NODE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"104880000000\"},{\"cost\":\"READ_MEMORY_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"20878905600\"},{\"cost\":\"READ_MEMORY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"1493923869\"},{\"cost\":\"READ_REGISTER_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"5034330372\"},{\"cost\":\"READ_REGISTER_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"18825342\"},{\"cost\":\"STORAGE_HAS_KEY_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"108079793250\"},{\"cost\":\"STORAGE_HAS_KEY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"4249136610\"},{\"cost\":\"STORAGE_READ_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"56356845750\"},{\"cost\":\"STORAGE_READ_KEY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"154762665\"},{\"cost\":\"STORAGE_READ_VALUE_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"617210550\"},{\"cost\":\"STORAGE_WRITE_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"128393472000\"},{\"cost\":\"STORAGE_WRITE_EVICTED_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"3532903770\"},{\"cost\":\"STORAGE_WRITE_KEY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"5215732158\"},{\"cost\":\"STORAGE_WRITE_VALUE_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"3908335914\"},{\"cost\":\"TOUCHING_TRIE_NODE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"96611735556\"},{\"cost\":\"WASM_INSTRUCTION\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"36414357804\"},{\"cost\":\"WRITE_MEMORY_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"8411384583\"},{\"cost\":\"WRITE_MEMORY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"563820804\"},{\"cost\":\"WRITE_REGISTER_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"8596567458\"},{\"cost\":\"WRITE_REGISTER_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"1144270764\"}],\"version\":3},\"receipt_ids\":[\"CNa2SnH47PXc9hWTQUJdVx3JRkiHd1Wqzr1LJd2Gs4EW\"],\"status\":{\"SuccessValue\":\"eyJ0b3RhbCI6IjEyNTAwMDAwMDAwMDAwMDAwMDAwMDAiLCJhdmFpbGFibGUiOiIwIn0=\"},\"tokens_burnt\":\"308609913727800000000\"},\"proof\":[{\"direction\":\"Right\",\"hash\":\"4RAEmJPbThMn6wpHEnxnrp6jXkg4ftFEm87oWrazqGAZ\"},{\"direction\":\"Left\",\"hash\":\"6B3gvAqo7HVr2WzxtmZNmh5C5o4tV4UAgd1tYjPis2F2\"},{\"direction\":\"Left\",\"hash\":\"62f4EWTnhFEq8XaRqQmR7Y5NVHb89Ge29MS7FMWJWGJt\"},{\"direction\":\"Left\",\"hash\":\"DTaeeWiNENGLW1CdiC3RNSqyqez3ARiUcA68b7GFBJDN\"},{\"direction\":\"Right\",\"hash\":\"6p6EovC3S8VAfuksHKXsbvPJimxLCJPj7JxDMEi2aos5\"}]},\"receipt\":{\"predecessor_id\":\"b5acefe75a5e4b2ddb252d43d3f1b8df457001ba1f589dfb2769470c02a36b9a\",\"receipt\":{\"Action\":{\"actions\":[{\"FunctionCall\":{\"args\":\"eyJhY2NvdW50X2lkIjoiYjVhY2VmZTc1YTVlNGIyZGRiMjUyZDQzZDNmMWI4ZGY0NTcwMDFiYTFmNTg5ZGZiMjc2OTQ3MGMwMmEzNmI5YSJ9\",\"deposit\":\"1250000000000000000000\",\"gas\":30000000000000,\"method_name\":\"storage_deposit\"}}],\"gas_price\":\"122987387\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"b5acefe75a5e4b2ddb252d43d3f1b8df457001ba1f589dfb2769470c02a36b9a\",\"signer_public_key\":\"ed25519:3y5fUDm1yY1SK8TRaj7DEMJMLHgh9Fq85AbN1K1ifCZr\"}},\"receipt_id\":\"6Xb4nNi8zGg6KdVhXRWM8uUURfhzFbX4R82E3soep9ES\",\"receiver_id\":\"usdt.tether-token.near\"}},{\"execution_outcome\":{\"block_hash\":\"9DBzUMMZEvipLQRk8uYHspC1xmjV8hTxPgmfFjZcpwSa\",\"id\":\"BdSkBCq7HtNPybcChSk6o2suvDz42hFB94HxCDePVCci\",\"outcome\":{\"executor_id\":\"tge-lockup.sweat\",\"gas_burnt\":8371735803441,\"logs\":[\"Claiming 413481309571140133379 form lockup #12061336\",\"Total claim 413481309571140133379\"],\"metadata\":{\"gas_profile\":[{\"cost\":\"FUNCTION_CALL_BASE\",\"cost_category\":\"ACTION_COST\",\"gas_used\":\"4639723000000\"},{\"cost\":\"FUNCTION_CALL_BYTE\",\"cost_category\":\"ACTION_COST\",\"gas_used\":\"896609534\"},{\"cost\":\"NEW_ACTION_RECEIPT\",\"cost_category\":\"ACTION_COST\",\"gas_used\":\"289092464624\"},{\"cost\":\"BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"8472579552\"},{\"cost\":\"CONTRACT_LOADING_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"35445963\"},{\"cost\":\"CONTRACT_LOADING_BYTES\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"50686337250\"},{\"cost\":\"LOG_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"7086626100\"},{\"cost\":\"LOG_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"1121897235\"},{\"cost\":\"PROMISE_RETURN\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"560152386\"},{\"cost\":\"READ_CACHED_TRIE_NODE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"93480000000\"},{\"cost\":\"READ_MEMORY_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"46977537600\"},{\"cost\":\"READ_MEMORY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"3223530384\"},{\"cost\":\"READ_REGISTER_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"17620156302\"},{\"cost\":\"READ_REGISTER_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"44845710\"},{\"cost\":\"STORAGE_READ_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"169070537250\"},{\"cost\":\"STORAGE_READ_KEY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"2569060239\"},{\"cost\":\"STORAGE_READ_VALUE_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"1178311050\"},{\"cost\":\"STORAGE_WRITE_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"128393472000\"},{\"cost\":\"STORAGE_WRITE_EVICTED_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"6487696014\"},{\"cost\":\"STORAGE_WRITE_KEY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"986760138\"},{\"cost\":\"STORAGE_WRITE_VALUE_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"6265744878\"},{\"cost\":\"TOUCHING_TRIE_NODE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"305937162594\"},{\"cost\":\"UTF8_DECODING_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"12447116244\"},{\"cost\":\"UTF8_DECODING_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"32657013648\"},{\"cost\":\"WASM_INSTRUCTION\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"70216465308\"},{\"cost\":\"WRITE_MEMORY_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"22430358888\"},{\"cost\":\"WRITE_MEMORY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"1282896612\"},{\"cost\":\"WRITE_REGISTER_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"22924179888\"},{\"cost\":\"WRITE_REGISTER_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"1931194512\"}],\"version\":3},\"receipt_ids\":[\"BschasESynttNVH91Sn8ZeE3pP7mgT2T1mjoJBjTUZn7\",\"9p35Fe9ydop9Ud5R7U91aQQZzpyNasj38kpNYhAYGZCz\",\"6ZUsqMkHnUaGhpYPwvykgeSpyJh8z2p5QeeAkznSnA4\"],\"status\":{\"SuccessReceiptId\":\"9p35Fe9ydop9Ud5R7U91aQQZzpyNasj38kpNYhAYGZCz\"},\"tokens_burnt\":\"837173580344100000000\"},\"proof\":[{\"direction\":\"Left\",\"hash\":\"9TaV4tVLZU5W1fsn1XWH5jK23v3ETTpyMDA29NjWU5xS\"},{\"direction\":\"Left\",\"hash\":\"6B3gvAqo7HVr2WzxtmZNmh5C5o4tV4UAgd1tYjPis2F2\"},{\"direction\":\"Left\",\"hash\":\"62f4EWTnhFEq8XaRqQmR7Y5NVHb89Ge29MS7FMWJWGJt\"},{\"direction\":\"Left\",\"hash\":\"DTaeeWiNENGLW1CdiC3RNSqyqez3ARiUcA68b7GFBJDN\"},{\"direction\":\"Right\",\"hash\":\"6p6EovC3S8VAfuksHKXsbvPJimxLCJPj7JxDMEi2aos5\"}]},\"receipt\":{\"predecessor_id\":\"e52871e21c00eb1df7d672dc2cd8d0033fbb1ee6babcb84a9165b1d081a293c4\",\"receipt\":{\"Action\":{\"actions\":[{\"FunctionCall\":{\"args\":\"e30=\",\"deposit\":\"0\",\"gas\":100000000000000,\"method_name\":\"claim\"}}],\"gas_price\":\"186029458\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"e52871e21c00eb1df7d672dc2cd8d0033fbb1ee6babcb84a9165b1d081a293c4\",\"signer_public_key\":\"ed25519:GRY8gUPSMduGWDapXpgVu2dvDxqdmtyJAPzPxvEDRUom\"}},\"receipt_id\":\"BdSkBCq7HtNPybcChSk6o2suvDz42hFB94HxCDePVCci\",\"receiver_id\":\"tge-lockup.sweat\"}},{\"execution_outcome\":{\"block_hash\":\"9DBzUMMZEvipLQRk8uYHspC1xmjV8hTxPgmfFjZcpwSa\",\"id\":\"BEHb8nxPsFPjbd7tjkBrVbtj5TBy6xbDCBXKhQvwuFLH\",\"outcome\":{\"executor_id\":\"usdt.tether-token.near\",\"gas_burnt\":3086115592398,\"logs\":[],\"metadata\":{\"gas_profile\":[{\"cost\":\"BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"3177217332\"},{\"cost\":\"CONTRACT_LOADING_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"35445963\"},{\"cost\":\"CONTRACT_LOADING_BYTES\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"60194509500\"},{\"cost\":\"READ_CACHED_TRIE_NODE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"104880000000\"},{\"cost\":\"READ_MEMORY_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"20878905600\"},{\"cost\":\"READ_MEMORY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"1493923869\"},{\"cost\":\"READ_REGISTER_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"5034330372\"},{\"cost\":\"READ_REGISTER_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"18825342\"},{\"cost\":\"STORAGE_HAS_KEY_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"108079793250\"},{\"cost\":\"STORAGE_HAS_KEY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"4249136610\"},{\"cost\":\"STORAGE_READ_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"56356845750\"},{\"cost\":\"STORAGE_READ_KEY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"154762665\"},{\"cost\":\"STORAGE_READ_VALUE_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"617210550\"},{\"cost\":\"STORAGE_WRITE_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"128393472000\"},{\"cost\":\"STORAGE_WRITE_EVICTED_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"3532903770\"},{\"cost\":\"STORAGE_WRITE_KEY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"5215732158\"},{\"cost\":\"STORAGE_WRITE_VALUE_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"3908335914\"},{\"cost\":\"TOUCHING_TRIE_NODE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"96611735556\"},{\"cost\":\"WASM_INSTRUCTION\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"36430812924\"},{\"cost\":\"WRITE_MEMORY_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"8411384583\"},{\"cost\":\"WRITE_MEMORY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"563820804\"},{\"cost\":\"WRITE_REGISTER_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"8596567458\"},{\"cost\":\"WRITE_REGISTER_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"1144270764\"}],\"version\":3},\"receipt_ids\":[\"GiBqUZeqLG62Evf6bEWSv8DDS2YUNgEpk2m27VBDUSpt\"],\"status\":{\"SuccessValue\":\"eyJ0b3RhbCI6IjEyNTAwMDAwMDAwMDAwMDAwMDAwMDAiLCJhdmFpbGFibGUiOiIwIn0=\"},\"tokens_burnt\":\"308611559239800000000\"},\"proof\":[{\"direction\":\"Right\",\"hash\":\"7Jpvn9QpXQUdUUXu1J8B1tiR9MRpacVv8uz62czAYmft\"},{\"direction\":\"Right\",\"hash\":\"C61mVYcrDFnoZLshDjkswsD3Ar6sz1Du7AkBWfX4Bpk8\"},{\"direction\":\"Right\",\"hash\":\"HrXzQEZzTxoQMCL9oJidcz8RBFQZwnTi3RJm4NnLDC8U\"},{\"direction\":\"Left\",\"hash\":\"BGpbfgADZjZniQsjKyuKYHzdSDroTeDZJYJxYRJyiNvB\"}]},\"receipt\":{\"predecessor_id\":\"ca3615a0d2e244761f8452be382defc99caad8e5e89ef6e72836d2c622ff4c08\",\"receipt\":{\"Action\":{\"actions\":[{\"FunctionCall\":{\"args\":\"eyJhY2NvdW50X2lkIjoiY2EzNjE1YTBkMmUyNDQ3NjFmODQ1MmJlMzgyZGVmYzk5Y2FhZDhlNWU4OWVmNmU3MjgzNmQyYzYyMmZmNGMwOCJ9\",\"deposit\":\"1250000000000000000000\",\"gas\":30000000000000,\"method_name\":\"storage_deposit\"}}],\"gas_price\":\"122987387\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"ca3615a0d2e244761f8452be382defc99caad8e5e89ef6e72836d2c622ff4c08\",\"signer_public_key\":\"ed25519:EcMBstSN5TXWkvVLQpchNchogUPXQwrN1ehkG7ALshSX\"}},\"receipt_id\":\"BEHb8nxPsFPjbd7tjkBrVbtj5TBy6xbDCBXKhQvwuFLH\",\"receiver_id\":\"usdt.tether-token.near\"}},{\"execution_outcome\":{\"block_hash\":\"9DBzUMMZEvipLQRk8uYHspC1xmjV8hTxPgmfFjZcpwSa\",\"id\":\"HFhq6ajK6euvmbz6pRCDeZhBAvLe5b5QaFZdfJeKNTxU\",\"outcome\":{\"executor_id\":\"usdt.tether-token.near\",\"gas_burnt\":3649532331252,\"logs\":[\"EVENT_JSON:{\\\\\\\"standard\\\\\\\":\\\\\\\"nep141\\\\\\\",\\\\\\\"version\\\\\\\":\\\\\\\"1.0.0\\\\\\\",\\\\\\\"event\\\\\\\":\\\\\\\"ft_transfer\\\\\\\",\\\\\\\"data\\\\\\\":[{\\\\\\\"old_owner_id\\\\\\\":\\\\\\\"learn.sweat\\\\\\\",\\\\\\\"new_owner_id\\\\\\\":\\\\\\\"e05cf2d303645da14f718ecafb561c7b7902a4b0fb7d0b939bc236f104790a25\\\\\\\",\\\\\\\"amount\\\\\\\":\\\\\\\"1000000\\\\\\\",\\\\\\\"memo\\\\\\\":\\\\\\\"sw:tr:mwWR2xmW6q\\\\\\\"}]}\"],\"metadata\":{\"gas_profile\":[{\"cost\":\"BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"7413507108\"},{\"cost\":\"CONTRACT_LOADING_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"35445963\"},{\"cost\":\"CONTRACT_LOADING_BYTES\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"60194509500\"},{\"cost\":\"LOG_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"3543313050\"},{\"cost\":\"LOG_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"3154511049\"},{\"cost\":\"READ_CACHED_TRIE_NODE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"241680000000\"},{\"cost\":\"READ_MEMORY_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"28708495200\"},{\"cost\":\"READ_MEMORY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"2193369141\"},{\"cost\":\"READ_REGISTER_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"20137321488\"},{\"cost\":\"READ_REGISTER_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"31835526\"},{\"cost\":\"STORAGE_READ_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"225427383000\"},{\"cost\":\"STORAGE_READ_KEY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"3280968498\"},{\"cost\":\"STORAGE_READ_VALUE_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"796762710\"},{\"cost\":\"STORAGE_WRITE_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"192590208000\"},{\"cost\":\"STORAGE_WRITE_EVICTED_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"4560657594\"},{\"cost\":\"STORAGE_WRITE_KEY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"6343458030\"},{\"cost\":\"STORAGE_WRITE_VALUE_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"4404632538\"},{\"cost\":\"TOUCHING_TRIE_NODE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"225427382964\"},{\"cost\":\"UTF8_DECODING_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"3111779061\"},{\"cost\":\"UTF8_DECODING_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"69687734481\"},{\"cost\":\"WASM_INSTRUCTION\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"64986205416\"},{\"cost\":\"WRITE_MEMORY_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"25234153749\"},{\"cost\":\"WRITE_MEMORY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"923358708\"},{\"cost\":\"WRITE_REGISTER_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"25789702374\"},{\"cost\":\"WRITE_REGISTER_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"1646077212\"}],\"version\":3},\"receipt_ids\":[\"EgpWB3ret7L6pMncazaueV8xwAvcVkmT8dsEdqruCRV5\"],\"status\":{\"SuccessValue\":\"\"},\"tokens_burnt\":\"364953233125200000000\"},\"proof\":[{\"direction\":\"Left\",\"hash\":\"5rkuqJE5zh6NanNtZdf3baFAqDMUq7Se8gWXY9b9w7aK\"},{\"direction\":\"Right\",\"hash\":\"C61mVYcrDFnoZLshDjkswsD3Ar6sz1Du7AkBWfX4Bpk8\"},{\"direction\":\"Right\",\"hash\":\"HrXzQEZzTxoQMCL9oJidcz8RBFQZwnTi3RJm4NnLDC8U\"},{\"direction\":\"Left\",\"hash\":\"BGpbfgADZjZniQsjKyuKYHzdSDroTeDZJYJxYRJyiNvB\"}]},\"receipt\":{\"predecessor_id\":\"learn.sweat\",\"receipt\":{\"Action\":{\"actions\":[{\"FunctionCall\":{\"args\":\"eyJyZWNlaXZlcl9pZCI6ImUwNWNmMmQzMDM2NDVkYTE0ZjcxOGVjYWZiNTYxYzdiNzkwMmE0YjBmYjdkMGI5MzliYzIzNmYxMDQ3OTBhMjUiLCJhbW91bnQiOiIxMDAwMDAwIiwibWVtbyI6InN3OnRyOm13V1IyeG1XNnEifQ==\",\"deposit\":\"1\",\"gas\":30000000000000,\"method_name\":\"ft_transfer\"}}],\"gas_price\":\"122987387\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"learn.sweat\",\"signer_public_key\":\"ed25519:9wRicBBHSqTtPzooqYTmhijZcQXonJM7FjQxvh6cfKzo\"}},\"receipt_id\":\"HFhq6ajK6euvmbz6pRCDeZhBAvLe5b5QaFZdfJeKNTxU\",\"receiver_id\":\"usdt.tether-token.near\"}},{\"execution_outcome\":{\"block_hash\":\"9DBzUMMZEvipLQRk8uYHspC1xmjV8hTxPgmfFjZcpwSa\",\"id\":\"6B1ZnWtTQPLyYmhWcZ4rQ5iFpt6NjLtRWPa9CyqBjeYH\",\"outcome\":{\"executor_id\":\"v2.ref-finance.near\",\"gas_burnt\":8109117838804,\"logs\":[\"Caller watcher02.ref-watchdog.near invokes token meta-pool.near rait async-update.\"],\"metadata\":{\"gas_profile\":[{\"cost\":\"FUNCTION_CALL_BASE\",\"cost_category\":\"ACTION_COST\",\"gas_used\":\"4639723000000\"},{\"cost\":\"FUNCTION_CALL_BYTE\",\"cost_category\":\"ACTION_COST\",\"gas_used\":\"160987248\"},{\"cost\":\"NEW_ACTION_RECEIPT\",\"cost_category\":\"ACTION_COST\",\"gas_used\":\"289092464624\"},{\"cost\":\"BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"5824898442\"},{\"cost\":\"CONTRACT_LOADING_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"35445963\"},{\"cost\":\"CONTRACT_LOADING_BYTES\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"160704302250\"},{\"cost\":\"LOG_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"3543313050\"},{\"cost\":\"LOG_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"1082300862\"},{\"cost\":\"PROMISE_RETURN\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"560152386\"},{\"cost\":\"READ_CACHED_TRIE_NODE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"41040000000\"},{\"cost\":\"READ_MEMORY_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"31318358400\"},{\"cost\":\"READ_MEMORY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"923723919\"},{\"cost\":\"READ_REGISTER_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"12585825930\"},{\"cost\":\"READ_REGISTER_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"51449364\"},{\"cost\":\"STORAGE_READ_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"112713691500\"},{\"cost\":\"STORAGE_READ_KEY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"619050660\"},{\"cost\":\"STORAGE_READ_VALUE_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"2508119235\"},{\"cost\":\"TOUCHING_TRIE_NODE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"193223471112\"},{\"cost\":\"UTF8_DECODING_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"9335337183\"},{\"cost\":\"UTF8_DECODING_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"33531755085\"},{\"cost\":\"WASM_INSTRUCTION\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"110763526500\"},{\"cost\":\"WRITE_MEMORY_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"14018974305\"},{\"cost\":\"WRITE_MEMORY_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"1421808984\"},{\"cost\":\"WRITE_REGISTER_BASE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"14327612430\"},{\"cost\":\"WRITE_REGISTER_BYTE\",\"cost_category\":\"WASM_HOST_COST\",\"gas_used\":\"1984416408\"}],\"version\":3},\"receipt_ids\":[\"4uDz75BmNVeEmHnb7nEqmCnQLZMSD5pXW2r6bZ95gsb7\",\"E8h66oyjeDaCEiRNCYgxa3uB7k5Rydj3BNy91t6XcSpa\",\"JEF2Yst14azL3VPXhVdRrV5654gAgxB5wqJmRH5coo2T\"],\"status\":{\"SuccessReceiptId\":\"E8h66oyjeDaCEiRNCYgxa3uB7k5Rydj3BNy91t6XcSpa\"},\"tokens_burnt\":\"810911783880400000000\"},\"proof\":[{\"direction\":\"Right\",\"hash\":\"5EBfTpZR6RTSaN5EqBo3s3rzy3pH4SPxC3EJa1QxcjLR\"},{\"direction\":\"Left\",\"hash\":\"BVpsMELbZCRqqYqu9fF8bGeRAMLQ77PixMouD8Yo3UPC\"},{\"direction\":\"Right\",\"hash\":\"HrXzQEZzTxoQMCL9oJidcz8RBFQZwnTi3RJm4NnLDC8U\"},{\"direction\":\"Left\",\"hash\":\"BGpbfgADZjZniQsjKyuKYHzdSDroTeDZJYJxYRJyiNvB\"}]},\"receipt\":{\"predecessor_id\":\"watcher02.ref-watchdog.near\",\"receipt\":{\"Action\":{\"actions\":[{\"FunctionCall\":{\"args\":\"eyJ0b2tlbl9pZCI6Im1ldGEtcG9vbC5uZWFyIn0=\",\"deposit\":\"0\",\"gas\":100000000000000,\"method_name\":\"update_token_rate\"}}],\"gas_price\":\"186029458\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"watcher02.ref-watchdog.near\",\"signer_public_key\":\"ed25519:3g2J3UmwRdmo9scukmM6A9qQzKbu7pCPFaQPU9pngMce\"}},\"receipt_id\":\"6B1ZnWtTQPLyYmhWcZ4rQ5iFpt6NjLtRWPa9CyqBjeYH\",\"receiver_id\":\"v2.ref-finance.near\"}},{\"execution_outcome\":{\"block_hash\":\"9DBzUMMZEvipLQRk8uYHspC1xmjV8hTxPgmfFjZcpwSa\",\"id\":\"Cu26A2ouAPUXSxi6yofGNJ5henyxHyYShtLr8BFnX1DD\",\"outcome\":{\"executor_id\":\"operator.meta-pool.near\",\"gas_burnt\":223182562500,\"logs\":[],\"metadata\":{\"gas_profile\":[],\"version\":3},\"receipt_ids\":[],\"status\":{\"SuccessValue\":\"\"},\"tokens_burnt\":\"0\"},\"proof\":[{\"direction\":\"Left\",\"hash\":\"CJSi9hF8zJEAefYoxTequpQ7TML7XEk46if4EyePr53j\"},{\"direction\":\"Left\",\"hash\":\"BVpsMELbZCRqqYqu9fF8bGeRAMLQ77PixMouD8Yo3UPC\"},{\"direction\":\"Right\",\"hash\":\"HrXzQEZzTxoQMCL9oJidcz8RBFQZwnTi3RJm4NnLDC8U\"},{\"direction\":\"Left\",\"hash\":\"BGpbfgADZjZniQsjKyuKYHzdSDroTeDZJYJxYRJyiNvB\"}]},\"receipt\":{\"predecessor_id\":\"system\",\"receipt\":{\"Action\":{\"actions\":[{\"Transfer\":{\"deposit\":\"69757213628944665882360\"}}],\"gas_price\":\"0\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"operator.meta-pool.near\",\"signer_public_key\":\"ed25519:3hpXGXHhxxq4C3KFWYcSApTLPhgerNLcU2NgCB3WGz5M\"}},\"receipt_id\":\"Cu26A2ouAPUXSxi6yofGNJ5henyxHyYShtLr8BFnX1DD\",\"receiver_id\":\"operator.meta-pool.near\"}},{\"execution_outcome\":{\"block_hash\":\"9DBzUMMZEvipLQRk8uYHspC1xmjV8hTxPgmfFjZcpwSa\",\"id\":\"CZAqWPwfgBrykmfZPZoLMJMxg4FsGFNLvapr3qXNeBWV\",\"outcome\":{\"executor_id\":\"stader-epoch-runner.near\",\"gas_burnt\":223182562500,\"logs\":[],\"metadata\":{\"gas_profile\":[],\"version\":3},\"receipt_ids\":[],\"status\":{\"SuccessValue\":\"\"},\"tokens_burnt\":\"0\"},\"proof\":[{\"direction\":\"Left\",\"hash\":\"F1SED3zPduvsyCZi1pFeRVGn9mcRz5SKXww2dNzp8XB8\"},{\"direction\":\"Left\",\"hash\":\"BGpbfgADZjZniQsjKyuKYHzdSDroTeDZJYJxYRJyiNvB\"}]},\"receipt\":{\"predecessor_id\":\"system\",\"receipt\":{\"Action\":{\"actions\":[{\"Transfer\":{\"deposit\":\"188712065628723398213284\"}}],\"gas_price\":\"0\",\"input_data_ids\":[],\"output_data_receivers\":[],\"signer_id\":\"stader-epoch-runner.near\",\"signer_public_key\":\"ed25519:AVv8KsWqKd8acYPVdbCnrXAZ2FB2jjxJH1c3djHuW2JD\"}},\"receipt_id\":\"CZAqWPwfgBrykmfZPZoLMJMxg4FsGFNLvapr3qXNeBWV\",\"receiver_id\":\"stader-epoch-runner.near\"}}],\"shard_id\":3,\"state_changes\":[{\"cause\":{\"receipt_hash\":\"5jAZr8vHTCWmmCSnvbCxa4fiwLQrdwuXSNHQft6UZ1io\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"mos.mfac.butternetwork.near\",\"amount\":\"267177595630699948599985632\",\"code_hash\":\"aGvH4wVFr7yiKZtm6iWGyvm7KrTjHQtSBPv7SLQHuHz\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":5645337},\"type\":\"account_update\"},{\"cause\":{\"receipt_hash\":\"5jAZr8vHTCWmmCSnvbCxa4fiwLQrdwuXSNHQft6UZ1io\",\"type\":\"action_receipt_gas_reward\"},\"change\":{\"account_id\":\"mos.mfac.butternetwork.near\",\"amount\":\"267177654593041599999985632\",\"code_hash\":\"aGvH4wVFr7yiKZtm6iWGyvm7KrTjHQtSBPv7SLQHuHz\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":5645337},\"type\":\"account_update\"},{\"cause\":{\"receipt_hash\":\"CtQACcsYrAuAWoGPoUE7uM6c3JoZ9rHQNfhtMMbJoyYD\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"mytestapi.embr.playember_reserve.near\",\"amount\":\"142724515333661303291726970\",\"code_hash\":\"11111111111111111111111111111111\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":182},\"type\":\"account_update\"},{\"cause\":{\"receipt_hash\":\"EVzjwprJmpvwATvvy6vMDB5Y5UJWfksE8aWb9PvcNepm\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"nearcrowd_2.near\",\"amount\":\"2281060988056732006815357\",\"code_hash\":\"B6cTvbdTFEoDXs1Y8MGjmQTUgJTBjdq9ALDGdPfUtTr1\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":149064},\"type\":\"account_update\"},{\"cause\":{\"receipt_hash\":\"Cu26A2ouAPUXSxi6yofGNJ5henyxHyYShtLr8BFnX1DD\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"operator.meta-pool.near\",\"amount\":\"49629261360520277173001174\",\"code_hash\":\"11111111111111111111111111111111\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":182},\"type\":\"account_update\"},{\"cause\":{\"tx_hash\":\"CWhKBgYmHHR5woSixizwqThvF9NgE7kRdBQzVuf429qw\",\"type\":\"transaction_processing\"},\"change\":{\"account_id\":\"papaya.recurforever.near\",\"amount\":\"9695286352516597344422080\",\"code_hash\":\"FVNRYiwRzkDABcHGcCVgJMHLNFLCuxpa4mK1hLgPY6n6\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":619479},\"type\":\"account_update\"},{\"cause\":{\"receipt_hash\":\"DZdLEbDeBRKapvRo4tUkx3hxgjCwRzKox2m3PZLVuUyJ\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"papaya.recurforever.near\",\"amount\":\"9700286352516597344422080\",\"code_hash\":\"FVNRYiwRzkDABcHGcCVgJMHLNFLCuxpa4mK1hLgPY6n6\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":619778},\"type\":\"account_update\"},{\"cause\":{\"receipt_hash\":\"DZdLEbDeBRKapvRo4tUkx3hxgjCwRzKox2m3PZLVuUyJ\",\"type\":\"action_receipt_gas_reward\"},\"change\":{\"account_id\":\"papaya.recurforever.near\",\"amount\":\"9701193692831428244422080\",\"code_hash\":\"FVNRYiwRzkDABcHGcCVgJMHLNFLCuxpa4mK1hLgPY6n6\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":619778},\"type\":\"account_update\"},{\"cause\":{\"receipt_hash\":\"6f3TNmYXE8VXotRzhDxajmP3GThEEn56DJMRyUKRFL6\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"relay.aurora\",\"amount\":\"3722792617337240846198093947\",\"code_hash\":\"11111111111111111111111111111111\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":149094},\"type\":\"account_update\"},{\"cause\":{\"receipt_hash\":\"bm7V3pZbt3hbo3dq5NndWdEe89smD7UWBXKqHF8q3MY\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"relay.aurora\",\"amount\":\"3722981321335705168184733799\",\"code_hash\":\"11111111111111111111111111111111\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":149094},\"type\":\"account_update\"},{\"cause\":{\"receipt_hash\":\"4AztGSk1EGUy7WU7NgoZKe1Wrnh59zcQc114vxvM7ubf\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"rezerv-42.near\",\"amount\":\"187734276231567460276833\",\"code_hash\":\"7DcAdMUT1MjaZ9s7zhXdyxKvQsRsSfnmBGdzeZaquqDE\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":1493},\"type\":\"account_update\"},{\"cause\":{\"receipt_hash\":\"CZAqWPwfgBrykmfZPZoLMJMxg4FsGFNLvapr3qXNeBWV\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"stader-epoch-runner.near\",\"amount\":\"29951657418180409375197454\",\"code_hash\":\"11111111111111111111111111111111\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":1590},\"type\":\"account_update\"},{\"cause\":{\"receipt_hash\":\"GKCJmBtpCqvvz9oYxydyaY1n5a3Ly41ueXKFTTj8fiac\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"tge-lockup.sweat\",\"amount\":\"51413046802067504674395940938\",\"code_hash\":\"21wTg75GYpVCanPeoiX1F8BfFTfZmJS3FqS5pG9UF9dN\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":4249534161},\"type\":\"account_update\"},{\"cause\":{\"receipt_hash\":\"GKCJmBtpCqvvz9oYxydyaY1n5a3Ly41ueXKFTTj8fiac\",\"type\":\"action_receipt_gas_reward\"},\"change\":{\"account_id\":\"tge-lockup.sweat\",\"amount\":\"51413046985587324724395940938\",\"code_hash\":\"21wTg75GYpVCanPeoiX1F8BfFTfZmJS3FqS5pG9UF9dN\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":4249534161},\"type\":\"account_update\"},{\"cause\":{\"receipt_hash\":\"BdSkBCq7HtNPybcChSk6o2suvDz42hFB94HxCDePVCci\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"tge-lockup.sweat\",\"amount\":\"51413046985587324724395940937\",\"code_hash\":\"21wTg75GYpVCanPeoiX1F8BfFTfZmJS3FqS5pG9UF9dN\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":4249534161},\"type\":\"account_update\"},{\"cause\":{\"receipt_hash\":\"BdSkBCq7HtNPybcChSk6o2suvDz42hFB94HxCDePVCci\",\"type\":\"action_receipt_gas_reward\"},\"change\":{\"account_id\":\"tge-lockup.sweat\",\"amount\":\"51413047163901299281395940937\",\"code_hash\":\"21wTg75GYpVCanPeoiX1F8BfFTfZmJS3FqS5pG9UF9dN\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":4249534161},\"type\":\"account_update\"},{\"cause\":{\"receipt_hash\":\"Fma1RnScq8DEB8wmY1antx4tBsVx84rffvs2o5S2vcBR\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"token.sweat\",\"amount\":\"41999895590807248257459564804\",\"code_hash\":\"FMy4MTxATGtfxqTg5PZfGhQpRWej9Ppbttwo7FWF13wA\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":1746773038},\"type\":\"account_update\"},{\"cause\":{\"receipt_hash\":\"Fma1RnScq8DEB8wmY1antx4tBsVx84rffvs2o5S2vcBR\",\"type\":\"action_receipt_gas_reward\"},\"change\":{\"account_id\":\"token.sweat\",\"amount\":\"41999895637943282671459564804\",\"code_hash\":\"FMy4MTxATGtfxqTg5PZfGhQpRWej9Ppbttwo7FWF13wA\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":1746773038},\"type\":\"account_update\"},{\"cause\":{\"receipt_hash\":\"HRxnJyEFygJg1QtWzMFN5DMRfPyemPQbFEGYdUUrD43T\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"token.sweat\",\"amount\":\"41999895637943282671459564805\",\"code_hash\":\"FMy4MTxATGtfxqTg5PZfGhQpRWej9Ppbttwo7FWF13wA\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":1746773038},\"type\":\"account_update\"},{\"cause\":{\"receipt_hash\":\"HRxnJyEFygJg1QtWzMFN5DMRfPyemPQbFEGYdUUrD43T\",\"type\":\"action_receipt_gas_reward\"},\"change\":{\"account_id\":\"token.sweat\",\"amount\":\"41999895667458586386059564805\",\"code_hash\":\"FMy4MTxATGtfxqTg5PZfGhQpRWej9Ppbttwo7FWF13wA\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":1746773038},\"type\":\"account_update\"},{\"cause\":{\"receipt_hash\":\"8LyaPknFFRiEwZn9Zg76NDvfDShTg4P1CoiAVXYTcB3S\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"usdt.tether-token.near\",\"amount\":\"174792511483090334888327208\",\"code_hash\":\"51tHbmQkA8qAi8c6MoUor5mCx6CnL6tZyC2sqQifKPZC\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":14108213},\"type\":\"account_update\"},{\"cause\":{\"receipt_hash\":\"8LyaPknFFRiEwZn9Zg76NDvfDShTg4P1CoiAVXYTcB3S\",\"type\":\"action_receipt_gas_reward\"},\"change\":{\"account_id\":\"usdt.tether-token.near\",\"amount\":\"174792541631556667888327208\",\"code_hash\":\"51tHbmQkA8qAi8c6MoUor5mCx6CnL6tZyC2sqQifKPZC\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":14108213},\"type\":\"account_update\"},{\"cause\":{\"receipt_hash\":\"9Se9uAo3caHJG6wAFFh4VmPpjyZwLmR7zcVNWaKrrFb3\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"usdt.tether-token.near\",\"amount\":\"174793791631556667888327208\",\"code_hash\":\"51tHbmQkA8qAi8c6MoUor5mCx6CnL6tZyC2sqQifKPZC\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":14108338},\"type\":\"account_update\"},{\"cause\":{\"receipt_hash\":\"9Se9uAo3caHJG6wAFFh4VmPpjyZwLmR7zcVNWaKrrFb3\",\"type\":\"action_receipt_gas_reward\"},\"change\":{\"account_id\":\"usdt.tether-token.near\",\"amount\":\"174793812337319132188327208\",\"code_hash\":\"51tHbmQkA8qAi8c6MoUor5mCx6CnL6tZyC2sqQifKPZC\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":14108338},\"type\":\"account_update\"},{\"cause\":{\"receipt_hash\":\"7NQ2puUQk5YdphCtyESCCdav1gMNCNcBC22Ub99yqPDm\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"usdt.tether-token.near\",\"amount\":\"174795062337319132188327208\",\"code_hash\":\"51tHbmQkA8qAi8c6MoUor5mCx6CnL6tZyC2sqQifKPZC\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":14108463},\"type\":\"account_update\"},{\"cause\":{\"receipt_hash\":\"7NQ2puUQk5YdphCtyESCCdav1gMNCNcBC22Ub99yqPDm\",\"type\":\"action_receipt_gas_reward\"},\"change\":{\"account_id\":\"usdt.tether-token.near\",\"amount\":\"174795082350317414188327208\",\"code_hash\":\"51tHbmQkA8qAi8c6MoUor5mCx6CnL6tZyC2sqQifKPZC\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":14108463},\"type\":\"account_update\"},{\"cause\":{\"receipt_hash\":\"6Xb4nNi8zGg6KdVhXRWM8uUURfhzFbX4R82E3soep9ES\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"usdt.tether-token.near\",\"amount\":\"174796332350317414188327208\",\"code_hash\":\"51tHbmQkA8qAi8c6MoUor5mCx6CnL6tZyC2sqQifKPZC\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":14108588},\"type\":\"account_update\"},{\"cause\":{\"receipt_hash\":\"6Xb4nNi8zGg6KdVhXRWM8uUURfhzFbX4R82E3soep9ES\",\"type\":\"action_receipt_gas_reward\"},\"change\":{\"account_id\":\"usdt.tether-token.near\",\"amount\":\"174796352089222042588327208\",\"code_hash\":\"51tHbmQkA8qAi8c6MoUor5mCx6CnL6tZyC2sqQifKPZC\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":14108588},\"type\":\"account_update\"},{\"cause\":{\"receipt_hash\":\"BEHb8nxPsFPjbd7tjkBrVbtj5TBy6xbDCBXKhQvwuFLH\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"usdt.tether-token.near\",\"amount\":\"174797602089222042588327208\",\"code_hash\":\"51tHbmQkA8qAi8c6MoUor5mCx6CnL6tZyC2sqQifKPZC\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":14108713},\"type\":\"account_update\"},{\"cause\":{\"receipt_hash\":\"BEHb8nxPsFPjbd7tjkBrVbtj5TBy6xbDCBXKhQvwuFLH\",\"type\":\"action_receipt_gas_reward\"},\"change\":{\"account_id\":\"usdt.tether-token.near\",\"amount\":\"174797621828620324588327208\",\"code_hash\":\"51tHbmQkA8qAi8c6MoUor5mCx6CnL6tZyC2sqQifKPZC\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":14108713},\"type\":\"account_update\"},{\"cause\":{\"receipt_hash\":\"HFhq6ajK6euvmbz6pRCDeZhBAvLe5b5QaFZdfJeKNTxU\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"usdt.tether-token.near\",\"amount\":\"174797621828620324588327209\",\"code_hash\":\"51tHbmQkA8qAi8c6MoUor5mCx6CnL6tZyC2sqQifKPZC\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":14108713},\"type\":\"account_update\"},{\"cause\":{\"receipt_hash\":\"HFhq6ajK6euvmbz6pRCDeZhBAvLe5b5QaFZdfJeKNTxU\",\"type\":\"action_receipt_gas_reward\"},\"change\":{\"account_id\":\"usdt.tether-token.near\",\"amount\":\"174797658467703495388327209\",\"code_hash\":\"51tHbmQkA8qAi8c6MoUor5mCx6CnL6tZyC2sqQifKPZC\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":14108713},\"type\":\"account_update\"},{\"cause\":{\"receipt_hash\":\"6B1ZnWtTQPLyYmhWcZ4rQ5iFpt6NjLtRWPa9CyqBjeYH\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"v2.ref-finance.near\",\"amount\":\"3692521320485906631549188673\",\"code_hash\":\"ELTWoZ9sfPgNZp48GQeetbYfvofhjZidLWF9p9n77diH\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":56828952},\"type\":\"account_update\"},{\"cause\":{\"receipt_hash\":\"6B1ZnWtTQPLyYmhWcZ4rQ5iFpt6NjLtRWPa9CyqBjeYH\",\"type\":\"action_receipt_gas_reward\"},\"change\":{\"account_id\":\"v2.ref-finance.near\",\"amount\":\"3692521490918726206749188673\",\"code_hash\":\"ELTWoZ9sfPgNZp48GQeetbYfvofhjZidLWF9p9n77diH\",\"locked\":\"0\",\"storage_paid_at\":0,\"storage_usage\":56828952},\"type\":\"account_update\"},{\"cause\":{\"receipt_hash\":\"EVzjwprJmpvwATvvy6vMDB5Y5UJWfksE8aWb9PvcNepm\",\"type\":\"receipt_processing\"},\"change\":{\"access_key\":{\"nonce\":91718936001631,\"permission\":{\"FunctionCall\":{\"allowance\":\"8457582309680570200000000\",\"method_names\":[],\"receiver_id\":\"app.nearcrowd.near\"}}},\"account_id\":\"nearcrowd_2.near\",\"public_key\":\"ed25519:2RRwQPTGRZkavm5sf1gJEbay34MpBMpw7LTriD3ZeLBZ\"},\"type\":\"access_key_update\"},{\"cause\":{\"tx_hash\":\"CWhKBgYmHHR5woSixizwqThvF9NgE7kRdBQzVuf429qw\",\"type\":\"transaction_processing\"},\"change\":{\"access_key\":{\"nonce\":88017794000106,\"permission\":\"FullAccess\"},\"account_id\":\"papaya.recurforever.near\",\"public_key\":\"secp256k1:icvWegs3SdDR5Hgvxg9HJX1m2SWbrVTfECFx6AT7z3vZn7QANnDieH6sLunNcR4T7XmcfkwMFxLnFtC2k5C41Bn\"},\"type\":\"access_key_update\"},{\"cause\":{\"receipt_hash\":\"4AztGSk1EGUy7WU7NgoZKe1Wrnh59zcQc114vxvM7ubf\",\"type\":\"receipt_processing\"},\"change\":{\"access_key\":{\"nonce\":92395788000736,\"permission\":{\"FunctionCall\":{\"allowance\":\"8763028714718603800000000\",\"method_names\":[],\"receiver_id\":\"app.nearcrowd.near\"}}},\"account_id\":\"rezerv-42.near\",\"public_key\":\"ed25519:5NVcZnEZY9xcknHjb5BzmzhHdD7P8TD8LvQ9kBJWNbbQ\"},\"type\":\"access_key_update\"},{\"cause\":{\"receipt_hash\":\"5jAZr8vHTCWmmCSnvbCxa4fiwLQrdwuXSNHQft6UZ1io\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"mos.mfac.butternetwork.near\",\"key_base64\":\"U1RBVEU=\",\"value_base64\":\"HQAAAGNsaWVudDIuY2ZhYy5tYXBwcm90b2NvbC5uZWFyYwEFGJxxFGZ6cXmqV/B2R6X0K38CAAAAbWkBAAAAAAAAAAIAAABtawEAAAAAAAAAAgAAAG12AgAAAGdpAwAAAAAAAAACAAAAZ2sDAAAAAAAAAAIAAABndgIAAABiaQQAAAAAAAAAAgAAAGJrBAAAAAAAAAACAAAAYnYCAAAAbGkFAAAAAAAAAAIAAABsawUAAAAAAAAAAgAAAGx2AAAAAAIAAABjaQQAAAAAAAAAAgAAAGNrBAAAAAAAAAACAAAAY3YCAAAAdWk5OAAAAAAAAAIAAAB1ZQIAAAAGaTI4AAAAAAAAAgAAAAZlIAAAAG11bHRpc2lnLm1mYWMuYnV0dGVybmV0d29yay5uZWFyAABIVjcZPMNDAAAAAAAAAAkAAAB3cmFwLm5lYXIBAAAAAdUEAAAAAAAAAAAA+FgAAAAAAAAAAAAAAAAAAPQ3AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAHJpBQAAAAAAAAACAAAAcmsFAAAAAAAAAAIAAABydhMAAAB2Mi5yZWYtZmluYW5jZS5uZWFyAgAAACEAAABjb3JlMTEuY29yZWZhYy5idXR0ZXJuZXR3b3JrLm5lYXIhAAAAY29yZTEwLmNvcmVmYWMuYnV0dGVybmV0d29yay5uZWFyAwAAACAAAABjb3JlMS5jb3JlZmFjLmJ1dHRlcm5ldHdvcmsubmVhciEAAABjb3JlMTAuY29yZWZhYy5idXR0ZXJuZXR3b3JrLm5lYXIhAAAAY29yZTExLmNvcmVmYWMuYnV0dGVybmV0d29yay5uZWFyAAAAAAIAAABuaQAAAAAAAAAAAgAAAG5rAAAAAAAAAAACAAAAbnY=\"},\"type\":\"data_update\"},{\"cause\":{\"receipt_hash\":\"DZdLEbDeBRKapvRo4tUkx3hxgjCwRzKox2m3PZLVuUyJ\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"papaya.recurforever.near\",\"key_base64\":\"MDM2NDA1Ng==\",\"value_base64\":\"MTAw\"},\"type\":\"data_update\"},{\"cause\":{\"receipt_hash\":\"DZdLEbDeBRKapvRo4tUkx3hxgjCwRzKox2m3PZLVuUyJ\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"papaya.recurforever.near\",\"key_base64\":\"MzQyMDZjNDE0ZjE0ZTNmMzhkMjQ1ZTcyOWY3ZTYwNzY3ZTQ0ZDA3Mjg2ZjAwYjUyMGU1ZjA0YmJkZjZmMzExZWE=\",\"value_base64\":\"eyJ0b2tlbl9pZHMiOlsiMTYzMjkwIiwiMzM5NzciLCIzNjQwNTYiXX0=\"},\"type\":\"data_update\"},{\"cause\":{\"receipt_hash\":\"DZdLEbDeBRKapvRo4tUkx3hxgjCwRzKox2m3PZLVuUyJ\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"papaya.recurforever.near\",\"key_base64\":\"U1RBVEU=\",\"value_base64\":\"eyJzeW1ib2wiOiJORlRVIiwibmFtZSI6Ik5GVFUiLCJpY29uIjoiIiwiYmFzZV91cmkiOiJodHRwczovL3VzZTEtY29tbW9uLXJlc3RhcGkucHJvZC5yZWN1cmZvcmV2ZXIuY29tL3BsYXRmb3JtLWxhbWJkYXMvbWV0YWRhdGEvdG9rZW4vUEFQQVlBLyIsInJveWFsdHlfcGF5bWVudF9hZGRyZXNzIjoiOWE3ZGFkZDUxYzFlMjQzZDJhMWQ2OWY5YmIyYzYwMjg5NjllMmFlYWMyY2Y3NjA4MWE2ZjhhODFhMjI0ODZkMSIsInRlcm1zX29mX3NlcnZpY2VfdGV4dCI6Imh0dHBzOi8vd3d3LnJlY3VyZm9yZXZlci5jb20vdGVybXMtb2Ytc2VydmljZSIsInRva2VuX2NvdW50IjoxMDEsImlzX3BhdXNlZCI6ZmFsc2UsIm93bmVyX2FjY291bnQiOiJwYXBheWEucmVjdXJmb3JldmVyLm5lYXIiLCJ0b2tlbnMiOnsicHJlZml4IjoiIiwibGVuZ3RoIjoxMDF9LCJ0b2tlbl90b19pbmRleCI6eyJrZXlQcmVmaXgiOiIwIn0sImJsYWNrbGlzdGVkX2FjY291bnRzIjp7ImtleVByZWZpeCI6IjEifSwibG9ja2VkX3Rva2VucyI6eyJrZXlQcmVmaXgiOiIyIn0sIm93bmVyX3Rva2VucyI6eyJrZXlQcmVmaXgiOiIzIn19\"},\"type\":\"data_update\"},{\"cause\":{\"receipt_hash\":\"DZdLEbDeBRKapvRo4tUkx3hxgjCwRzKox2m3PZLVuUyJ\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"papaya.recurforever.near\",\"key_base64\":\"ZAAAAA==\",\"value_base64\":\"eyJ0b2tlbl9pZCI6IjM2NDA1NiIsIm93bmVyX2lkIjoiNDIwNmM0MTRmMTRlM2YzOGQyNDVlNzI5ZjdlNjA3NjdlNDRkMDcyODZmMDBiNTIwZTVmMDRiYmRmNmYzMTFlYSIsInJveWFsdHlfcGVyY2VudCI6MTAwMCwiaXNzdWVkX2F0IjoxNjg1MTE4NjgwNjE0LCJhcHByb3ZlZF9hY2NvdW50c19pZHMiOnt9LCJuZXh0X2FwcHJvdmFsX2lkIjowfQ==\"},\"type\":\"data_update\"},{\"cause\":{\"receipt_hash\":\"GKCJmBtpCqvvz9oYxydyaY1n5a3Ly41ueXKFTTj8fiac\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"tge-lockup.sweat\",\"key_base64\":\"AG00AQAAAAAA\",\"value_base64\":\"QAAAADAxODJlNWQ2MmYxYzNkNmE0YjI2YjQ5YzkzNGQ1OGEwMDUyZTBmOWNhZGYwNDZlMjJkZmE1Y2ZmMWU5MmQ4MzUDAAAAj0YgYwAAAAAAAAAAAAAAAAAAAACQRiBjAND9nOlSbMkdAAAAAAAAABD/42YAIOohID073ikBAAAAAAAAqgrQLh1vIWt7AAAAAAAAAAA=\"},\"type\":\"data_update\"},{\"cause\":{\"receipt_hash\":\"BdSkBCq7HtNPybcChSk6o2suvDz42hFB94HxCDePVCci\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"tge-lockup.sweat\",\"key_base64\":\"AJgKuAAAAAAA\",\"value_base64\":\"QAAAAGU1Mjg3MWUyMWMwMGViMWRmN2Q2NzJkYzJjZDhkMDAzM2ZiYjFlZTZiYWJjYjg0YTkxNjViMWQwODFhMjkzYzQDAAAAj0YgYwAAAAAAAAAAAAAAAAAAAACQRiBjABCWY+gyLxsJAAAAAAAAABD/42YAoNzjE/3XD1sAAAAAAAAAoztcICjHA7slAAAAAAAAAAA=\"},\"type\":\"data_update\"},{\"cause\":{\"receipt_hash\":\"GKCJmBtpCqvvz9oYxydyaY1n5a3Ly41ueXKFTTj8fiac\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"tge-lockup.sweat\",\"key_base64\":\"U1RBVEU=\",\"value_base64\":\"CwAAAHRva2VuLnN3ZWF0ydbNAAAAAAABAAAAAAEAAAABAgAAAAJpAQAAAAAAAAACAAAAAmU=\"},\"type\":\"data_update\"},{\"cause\":{\"receipt_hash\":\"BdSkBCq7HtNPybcChSk6o2suvDz42hFB94HxCDePVCci\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"tge-lockup.sweat\",\"key_base64\":\"U1RBVEU=\",\"value_base64\":\"CwAAAHRva2VuLnN3ZWF0ydbNAAAAAAABAAAAAAEAAAABAgAAAAJpAQAAAAAAAAACAAAAAmU=\"},\"type\":\"data_update\"},{\"cause\":{\"receipt_hash\":\"Fma1RnScq8DEB8wmY1antx4tBsVx84rffvs2o5S2vcBR\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"token.sweat\",\"key_base64\":\"U1RBVEU=\",\"value_base64\":\"AgAAAHNpAQAAAAAAAAACAAAAc2UBAAAAdAEIAAAALnUuc3dlYXTZhTiyDwE8EXwk3kgAAAAAWgAAAAAAAADernXIFAMAAA==\"},\"type\":\"data_update\"},{\"cause\":{\"receipt_hash\":\"HRxnJyEFygJg1QtWzMFN5DMRfPyemPQbFEGYdUUrD43T\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"token.sweat\",\"key_base64\":\"U1RBVEU=\",\"value_base64\":\"AgAAAHNpAQAAAAAAAAACAAAAc2UBAAAAdAEIAAAALnUuc3dlYXTZhTiyDwE8EXwk3kgAAAAAWgAAAAAAAADernXIFAMAAA==\"},\"type\":\"data_update\"},{\"cause\":{\"receipt_hash\":\"Fma1RnScq8DEB8wmY1antx4tBsVx84rffvs2o5S2vcBR\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"token.sweat\",\"key_base64\":\"dAAIwtNTIl0oBqKzqsbwvTl9sKe+80DRyHN+1AGj4RbjWQ==\",\"value_base64\":\"xCl/gGfl58QAAAAAAAAAAA==\"},\"type\":\"data_update\"},{\"cause\":{\"receipt_hash\":\"HRxnJyEFygJg1QtWzMFN5DMRfPyemPQbFEGYdUUrD43T\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"token.sweat\",\"key_base64\":\"dACGEzizsoMxL2O52QbNDpf5P9RYAzbWaOsGDToxPCiSmg==\",\"value_base64\":\"j4QT/Z2PjNIAAAAAAAAAAA==\"},\"type\":\"data_update\"},{\"cause\":{\"receipt_hash\":\"Fma1RnScq8DEB8wmY1antx4tBsVx84rffvs2o5S2vcBR\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"token.sweat\",\"key_base64\":\"dADCUiigKPOTAl1jqrFvCFMV6YPDQuu8kGehwLHx0CgpIw==\",\"value_base64\":\"AABSVjuGS9b/AwIAAAAAAA==\"},\"type\":\"data_update\"},{\"cause\":{\"receipt_hash\":\"HRxnJyEFygJg1QtWzMFN5DMRfPyemPQbFEGYdUUrD43T\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"token.sweat\",\"key_base64\":\"dADCUiigKPOTAl1jqrFvCFMV6YPDQuu8kGehwLHx0CgpIw==\",\"value_base64\":\"AAC2/e48LOT/AwIAAAAAAA==\"},\"type\":\"data_update\"},{\"cause\":{\"receipt_hash\":\"8LyaPknFFRiEwZn9Zg76NDvfDShTg4P1CoiAVXYTcB3S\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"usdt.tether-token.near\",\"key_base64\":\"U1RBVEU=\",\"value_base64\":\"FQAAAHRldGhlci5tdWx0aXNhZmUubmVhchUAAAB0ZXRoZXIubXVsdGlzYWZlLm5lYXIBAAAAYUCSSCeMBAAAAAAAAAAAAAB9AAAAAAAAAAEAAABtAgAAAGNpAAAAAAAAAAACAAAAY2UBAAAAYgA=\"},\"type\":\"data_update\"},{\"cause\":{\"receipt_hash\":\"9Se9uAo3caHJG6wAFFh4VmPpjyZwLmR7zcVNWaKrrFb3\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"usdt.tether-token.near\",\"key_base64\":\"U1RBVEU=\",\"value_base64\":\"FQAAAHRldGhlci5tdWx0aXNhZmUubmVhchUAAAB0ZXRoZXIubXVsdGlzYWZlLm5lYXIBAAAAYUCSSCeMBAAAAAAAAAAAAAB9AAAAAAAAAAEAAABtAgAAAGNpAAAAAAAAAAACAAAAY2UBAAAAYgA=\"},\"type\":\"data_update\"},{\"cause\":{\"receipt_hash\":\"7NQ2puUQk5YdphCtyESCCdav1gMNCNcBC22Ub99yqPDm\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"usdt.tether-token.near\",\"key_base64\":\"U1RBVEU=\",\"value_base64\":\"FQAAAHRldGhlci5tdWx0aXNhZmUubmVhchUAAAB0ZXRoZXIubXVsdGlzYWZlLm5lYXIBAAAAYUCSSCeMBAAAAAAAAAAAAAB9AAAAAAAAAAEAAABtAgAAAGNpAAAAAAAAAAACAAAAY2UBAAAAYgA=\"},\"type\":\"data_update\"},{\"cause\":{\"receipt_hash\":\"6Xb4nNi8zGg6KdVhXRWM8uUURfhzFbX4R82E3soep9ES\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"usdt.tether-token.near\",\"key_base64\":\"U1RBVEU=\",\"value_base64\":\"FQAAAHRldGhlci5tdWx0aXNhZmUubmVhchUAAAB0ZXRoZXIubXVsdGlzYWZlLm5lYXIBAAAAYUCSSCeMBAAAAAAAAAAAAAB9AAAAAAAAAAEAAABtAgAAAGNpAAAAAAAAAAACAAAAY2UBAAAAYgA=\"},\"type\":\"data_update\"},{\"cause\":{\"receipt_hash\":\"BEHb8nxPsFPjbd7tjkBrVbtj5TBy6xbDCBXKhQvwuFLH\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"usdt.tether-token.near\",\"key_base64\":\"U1RBVEU=\",\"value_base64\":\"FQAAAHRldGhlci5tdWx0aXNhZmUubmVhchUAAAB0ZXRoZXIubXVsdGlzYWZlLm5lYXIBAAAAYUCSSCeMBAAAAAAAAAAAAAB9AAAAAAAAAAEAAABtAgAAAGNpAAAAAAAAAAACAAAAY2UBAAAAYgA=\"},\"type\":\"data_update\"},{\"cause\":{\"receipt_hash\":\"HFhq6ajK6euvmbz6pRCDeZhBAvLe5b5QaFZdfJeKNTxU\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"usdt.tether-token.near\",\"key_base64\":\"U1RBVEU=\",\"value_base64\":\"FQAAAHRldGhlci5tdWx0aXNhZmUubmVhchUAAAB0ZXRoZXIubXVsdGlzYWZlLm5lYXIBAAAAYUCSSCeMBAAAAAAAAAAAAAB9AAAAAAAAAAEAAABtAgAAAGNpAAAAAAAAAAACAAAAY2UBAAAAYgA=\"},\"type\":\"data_update\"},{\"cause\":{\"receipt_hash\":\"HFhq6ajK6euvmbz6pRCDeZhBAvLe5b5QaFZdfJeKNTxU\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"usdt.tether-token.near\",\"key_base64\":\"YQsAAABsZWFybi5zd2VhdA==\",\"value_base64\":\"AJxRGhEAAAAAAAAAAAAAAA==\"},\"type\":\"data_update\"},{\"cause\":{\"receipt_hash\":\"9Se9uAo3caHJG6wAFFh4VmPpjyZwLmR7zcVNWaKrrFb3\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"usdt.tether-token.near\",\"key_base64\":\"YUAAAAA2NGFiZmZiZTY1OWY1ZGE3NTJkMDgyMWE3MmQ5ZjBjYjY2MGM0YmM4NGU5MGIxMTA0YTRiNDA2NWQ5OGE2Yzc1\",\"value_base64\":\"AAAAAAAAAAAAAAAAAAAAAA==\"},\"type\":\"data_update\"},{\"cause\":{\"receipt_hash\":\"8LyaPknFFRiEwZn9Zg76NDvfDShTg4P1CoiAVXYTcB3S\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"usdt.tether-token.near\",\"key_base64\":\"YUAAAABhMDgxYjFiYjc1MGQ3YzFlMjBlMmEwMzNlNjIzN2NiYTJmMjcwOWI0ZjdhZWJkM2EzNjIzY2ExOThhN2RiZDM1\",\"value_base64\":\"AAAAAAAAAAAAAAAAAAAAAA==\"},\"type\":\"data_update\"},{\"cause\":{\"receipt_hash\":\"7NQ2puUQk5YdphCtyESCCdav1gMNCNcBC22Ub99yqPDm\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"usdt.tether-token.near\",\"key_base64\":\"YUAAAABhM2UxZjViMTcyNGYxOGNiYTVjZjM1YWQzZDIwMDM3ZmVhZjdlN2M1NzA5ZTg4MzhiODM3NTlkNzUwNGIwYmNj\",\"value_base64\":\"AAAAAAAAAAAAAAAAAAAAAA==\"},\"type\":\"data_update\"},{\"cause\":{\"receipt_hash\":\"6Xb4nNi8zGg6KdVhXRWM8uUURfhzFbX4R82E3soep9ES\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"usdt.tether-token.near\",\"key_base64\":\"YUAAAABiNWFjZWZlNzVhNWU0YjJkZGIyNTJkNDNkM2YxYjhkZjQ1NzAwMWJhMWY1ODlkZmIyNzY5NDcwYzAyYTM2Yjlh\",\"value_base64\":\"AAAAAAAAAAAAAAAAAAAAAA==\"},\"type\":\"data_update\"},{\"cause\":{\"receipt_hash\":\"BEHb8nxPsFPjbd7tjkBrVbtj5TBy6xbDCBXKhQvwuFLH\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"usdt.tether-token.near\",\"key_base64\":\"YUAAAABjYTM2MTVhMGQyZTI0NDc2MWY4NDUyYmUzODJkZWZjOTljYWFkOGU1ZTg5ZWY2ZTcyODM2ZDJjNjIyZmY0YzA4\",\"value_base64\":\"AAAAAAAAAAAAAAAAAAAAAA==\"},\"type\":\"data_update\"},{\"cause\":{\"receipt_hash\":\"HFhq6ajK6euvmbz6pRCDeZhBAvLe5b5QaFZdfJeKNTxU\",\"type\":\"receipt_processing\"},\"change\":{\"account_id\":\"usdt.tether-token.near\",\"key_base64\":\"YUAAAABlMDVjZjJkMzAzNjQ1ZGExNGY3MThlY2FmYjU2MWM3Yjc5MDJhNGIwZmI3ZDBiOTM5YmMyMzZmMTA0NzkwYTI1\",\"value_base64\":\"QEIPAAAAAAAAAAAAAAAAAA==\"},\"type\":\"data_update\"}]}]}" - - data := mapprotocol.StreamerMessage{} - fmt.Println("err --------------- ", json.Unmarshal([]byte(str), &data)) - fmt.Println("data --------------- ", data) -} diff --git a/chains/sol/chain.go b/chains/sol/chain.go deleted file mode 100644 index 96dc3b93..00000000 --- a/chains/sol/chain.go +++ /dev/null @@ -1,107 +0,0 @@ -package sol - -import ( - "github.com/ChainSafe/log15" - "github.com/ethereum/go-ethereum/log" - "github.com/gagliardetto/solana-go" - "github.com/mapprotocol/compass/core" - "github.com/mapprotocol/compass/internal/chain" - "github.com/mapprotocol/compass/internal/mapprotocol" - "github.com/mapprotocol/compass/pkg/msg" -) - -type Chain struct { - cfg *core.ChainConfig - conn core.Connection - writer *Writer - stop chan<- int - listen core.Listener -} - -func New() *Chain { - return &Chain{} -} - -func (c *Chain) New(chainCfg *core.ChainConfig, logger log15.Logger, sysErr chan<- error, role mapprotocol.Role) (core.Chain, error) { - return createChain(chainCfg, logger, sysErr, role) -} - -func createChain(chainCfg *core.ChainConfig, logger log15.Logger, sysErr chan<- error, role mapprotocol.Role) (core.Chain, error) { - config, err := parseCfg(chainCfg) - if err != nil { - return nil, err - } - - conn := NewConnection(config.Endpoint, logger) - err = conn.Connect() - if err != nil { - return nil, err - } - - _, err = solana.PrivateKeyFromBase58(config.Pri) - if err != nil { - return nil, err - } - - var ( - stop = make(chan int) - listen core.Listener - ) - bs, err := chain.SetupBlockStore(&config.Config, role) - if err != nil { - return nil, err - } - cs := chain.NewCommonSync(nil, &config.Config, logger, stop, sysErr, bs) - - switch role { - case mapprotocol.RoleOfMessenger: - listen = newSync(cs, mosHandler, conn, config) - case mapprotocol.RoleOfOracle: - listen = newSync(cs, oracleHandler, conn, config) - } - mapprotocol.MosMapping[config.Id] = config.McsContract[0] - - return &Chain{ - conn: conn, - stop: stop, - listen: listen, - cfg: chainCfg, - writer: newWriter(conn, config, logger, stop, sysErr), - }, nil -} - -func (c *Chain) SetRouter(r core.Router) { - r.Listen(c.cfg.Id, c.writer) - c.listen.SetRouter(r) -} - -func (c *Chain) Start() error { - err := c.listen.Sync() - if err != nil { - return err - } - - log.Debug("Successfully started Chain") - return nil -} - -func (c *Chain) Id() msg.ChainId { - return c.cfg.Id -} - -func (c *Chain) Name() string { - return c.cfg.Name -} - -// Stop signals to any running routines to exit -func (c *Chain) Stop() { - close(c.stop) - if c.conn != nil { - c.conn.Close() - } -} - -// Conn return Connection interface for relayer register -func (c *Chain) Conn() core.Connection { - return c.conn -} diff --git a/chains/sol/config.go b/chains/sol/config.go deleted file mode 100644 index e3d4d13f..00000000 --- a/chains/sol/config.go +++ /dev/null @@ -1,59 +0,0 @@ -package sol - -import ( - "github.com/mapprotocol/compass/core" - "github.com/mapprotocol/compass/internal/chain" - "strings" -) - -type Config struct { - chain.Config - Pri string - MessageIn string - LightNode string - McsContract []string - SolEvent []string - UsdcAda string - WsolAda string - ButterHost string -} - -func parseCfg(chainCfg *core.ChainConfig) (*Config, error) { - cfg, err := chain.ParseConfig(chainCfg) - if err != nil { - return nil, err - } - ret := Config{ - Config: *cfg, - LightNode: "", - McsContract: nil, - ButterHost: chainCfg.ButterHost, - } - - if ele, ok := chainCfg.Opts[chain.LightNode]; ok && ele != "" { - ret.LightNode = ele - } - if ele, ok := chainCfg.Opts[chain.Private]; ok && ele != "" { - ret.Pri = ele - } - if ele, ok := chainCfg.Opts["messageIn"]; ok && ele != "" { - ret.MessageIn = ele - } - if ele, ok := chainCfg.Opts["usdcAda"]; ok && ele != "" { - ret.UsdcAda = ele - } - if ele, ok := chainCfg.Opts["wsolAda"]; ok && ele != "" { - ret.WsolAda = ele - } - if ele, ok := chainCfg.Opts[chain.McsOpt]; ok && ele != "" { - for _, addr := range strings.Split(ele, ",") { - ret.McsContract = append(ret.McsContract, addr) - } - } - - if v, ok := chainCfg.Opts[chain.Event]; ok && v != "" { - ret.SolEvent = append(ret.SolEvent, strings.Split(v, "|")...) - } - - return &ret, nil -} diff --git a/chains/sol/conn.go b/chains/sol/conn.go deleted file mode 100644 index 799d435a..00000000 --- a/chains/sol/conn.go +++ /dev/null @@ -1,93 +0,0 @@ -package sol - -import ( - "context" - "math/big" - "time" - - "github.com/ChainSafe/log15" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/accounts/keystore" - ethcommon "github.com/ethereum/go-ethereum/common" - "github.com/gagliardetto/solana-go/rpc" - "github.com/mapprotocol/compass/internal/constant" - "github.com/mapprotocol/compass/pkg/ethclient" -) - -type Connection struct { - endpoint string - cli *rpc.Client - log log15.Logger - stop chan int - reqTime, cacheBlockNumber int64 -} - -func NewConnection(endpoint string, log log15.Logger) *Connection { - return &Connection{ - endpoint: endpoint, - log: log, - stop: make(chan int), - } -} - -// Connect starts the ethereum WS connection -func (c *Connection) Connect() error { - c.cli = rpc.New(c.endpoint) - return nil -} - -func (c *Connection) Keypair() *keystore.Key { - return nil -} - -func (c *Connection) Client() *ethclient.Client { - return nil -} - -func (c *Connection) Opts() *bind.TransactOpts { - return nil -} - -func (c *Connection) CallOpts() *bind.CallOpts { - return nil -} - -func (c *Connection) UnlockOpts() { -} - -func (c *Connection) LockAndUpdateOpts(needNewNonce bool) error { - return nil -} - -// LatestBlock returns the latest block from the current chain -func (c *Connection) LatestBlock() (*big.Int, error) { - // 1s req - if time.Now().Unix()-c.reqTime < constant.ReqInterval { - return big.NewInt(0).SetInt64(c.cacheBlockNumber), nil - } - - bnum, err := c.cli.GetBlockHeight(context.Background(), rpc.CommitmentFinalized) - if err != nil { - return nil, err - } - c.cacheBlockNumber = int64(bnum) - c.reqTime = time.Now().Unix() - - return big.NewInt(0).SetInt64(c.cacheBlockNumber), nil -} - -// EnsureHasBytecode asserts if contract code exists at the specified address -func (c *Connection) EnsureHasBytecode(addr ethcommon.Address) error { - return nil -} - -func (c *Connection) WaitForBlock(targetBlock *big.Int, delay *big.Int) error { - return nil -} - -func (c *Connection) Close() { - if c.cli != nil { - _ = c.cli.Close() - } - close(c.stop) -} diff --git a/chains/sol/event.go b/chains/sol/event.go deleted file mode 100644 index e94ca0dd..00000000 --- a/chains/sol/event.go +++ /dev/null @@ -1,162 +0,0 @@ -package sol - -import ( - "encoding/hex" - "fmt" - "github.com/ethereum/go-ethereum/common" - "math/big" - "strings" - - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/core/types" -) - -const ( - EventMessageRelay = "MessageRelay" -) - -var ( - messageRelayABI, _ = abi.JSON(strings.NewReader(`[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"orderId","type":"bytes32"},{"indexed":true,"internalType":"uint256","name":"chainAndGasLimit","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"payload","type":"bytes"}],"name":"MessageRelay","type":"event"}]`)) -) - -type Swap struct { - ToToken []byte - Receiver []byte - MinAmount *big.Int -} - -type Relay struct { - Version *big.Int - MessageType *big.Int - OrderId [32]byte // MessageRelay.OrderId - SrcChain *big.Int // MessageRelay.ChainAndGasLimit 0:8 - Sender string // MessageRelayPayload.From - DstChain *big.Int // MessageRelay.ChainAndGasLimit 8:16 - DstToken []byte // MessageRelayPayload.TokenAddress - OutAmount *big.Int // MessageRelayPayload.TokenAmount - Receiver []byte // MessageRelayPayload.To - Payload []byte - Swap *Swap -} - -type Contract struct { - abi abi.ABI -} - -func NewContract(abi abi.ABI) *Contract { - return &Contract{abi: abi} -} - -func (c *Contract) UnpackLog(ret interface{}, event string, log types.Log) error { - if log.Topics[0] != c.abi.Events[event].ID { - return fmt.Errorf("event signature mismatch") - } - if len(log.Data) > 0 { - if err := c.abi.UnpackIntoInterface(ret, event, log.Data); err != nil { - return err - } - } - var indexed abi.Arguments - for _, arg := range c.abi.Events[event].Inputs { - if arg.Indexed { - indexed = append(indexed, arg) - } - } - return abi.ParseTopics(ret, indexed, log.Topics[1:]) -} - -type MessageRelay struct { - OrderId [32]byte - ChainAndGasLimit *big.Int // fromChain (8 bytes) | toChain (8 bytes) | reserved (8 bytes) | gasLimit (8 bytes) - Payload []byte // MessageRelayPayload -} - -func UnpackMessageRelay(log types.Log) (*MessageRelay, error) { - ret := &MessageRelay{} - if err := NewContract(messageRelayABI).UnpackLog(ret, EventMessageRelay, log); err != nil { - return nil, err - } - return ret, nil -} - -func DecodeMessageRelay(topics []common.Hash, data string) (*Relay, error) { - bytesData, err := hex.DecodeString(data) - if err != nil { - return nil, err - } - log := types.Log{ - Topics: topics, - Data: bytesData, - } - messageRelay, err := UnpackMessageRelay(log) - if err != nil { - return nil, err - } - - payload := messageRelay.Payload - // Helper function to parse a big.Int from a substring - parseBigInt := func(start, length int) *big.Int { - substr := payload[start : start+length] - return new(big.Int).SetBytes(substr) - } - - version := parseBigInt(0, 1) - //ret.Version = version - messageType := parseBigInt(1, 1) - //ret.MessageType = messageType - // Extract values based on offsets - tokenLen := parseBigInt(2, 1) - mosLen := parseBigInt(3, 1) - fromLen := parseBigInt(4, 1) - toLen := parseBigInt(5, 1) - payloadLen := parseBigInt(6, 2) - tokenAmount := parseBigInt(16, 16) - - // Calculate dynamic offsets - // token - start := 32 - end := start + int(tokenLen.Int64()) - tokenAddress := payload[start:end] - - // mos - start = end - end = start + int(mosLen.Int64()) - - // from - start = end - end = start + int(fromLen.Int64()) - from := common.BytesToAddress(payload[start:end]) - - // to - start = end - end = start + int(toLen.Int64()) - to := payload[start:end] - - start = end - end = start + int(payloadLen.Int64()) - swapData := payload[start:end] - - b := common.LeftPadBytes(messageRelay.ChainAndGasLimit.Bytes(), 32) - ret := &Relay{ - Version: version, - MessageType: messageType, - OrderId: messageRelay.OrderId, - SrcChain: new(big.Int).SetBytes(b[:8]), - Sender: from.Hex(), - DstChain: new(big.Int).SetBytes(b[8:16]), - DstToken: tokenAddress, - OutAmount: tokenAmount, - Receiver: to, - Payload: swapData, - } - if len(swapData) != 0 { - s := Swap{ - ToToken: swapData[2:34], - Receiver: swapData[34:66], - MinAmount: big.NewInt(0).SetBytes(swapData[66:98]), - } - ret.Swap = &s - } - - return ret, nil -} diff --git a/chains/sol/proof.go b/chains/sol/proof.go deleted file mode 100644 index 753e77b9..00000000 --- a/chains/sol/proof.go +++ /dev/null @@ -1,188 +0,0 @@ -package sol - -import ( - "bytes" - "encoding/binary" - "fmt" - "github.com/pkg/errors" - "math/big" - "strconv" -) - -type Pubkey [32]byte - -type RouteOrder struct { - OrderID [32]byte - Payer Pubkey - User Pubkey - FromChainID uint64 - ToChainID uint64 - FromToken Pubkey - TokenAmount uint128 // uint128 is implemented as a custom struct - AmountOut uint64 - SwapData []byte -} - -func (ro *RouteOrder) Encode() ([]byte, error) { - buffer := new(bytes.Buffer) - - // Write the fields into the buffer - buffer.Write(ro.OrderID[:]) - buffer.Write(ro.Payer[:]) - buffer.Write(ro.User[:]) - binary.Write(buffer, binary.LittleEndian, ro.FromChainID) - binary.Write(buffer, binary.LittleEndian, ro.ToChainID) - buffer.Write(ro.FromToken[:]) - binary.Write(buffer, binary.LittleEndian, ro.TokenAmount) - binary.Write(buffer, binary.LittleEndian, ro.AmountOut) - buffer.Write(ro.SwapData) - - return buffer.Bytes(), nil -} - -func DecodeRouteOrder(data []byte) (*RouteOrder, error) { - if len(data) < 138 { // Minimum size based on structure fields - return nil, errors.New("invalid message length") - } - - offset := 0 - - // Decode OrderID - var orderID [32]byte - copy(orderID[:], data[offset:offset+32]) - offset += 32 - - // Decode Payer - var payer Pubkey - copy(payer[:], data[offset:offset+32]) - offset += 32 - - // Decode User - var user Pubkey - copy(user[:], data[offset:offset+32]) - offset += 32 - - // Decode FromChainID - fromChainID := binary.LittleEndian.Uint64(data[offset : offset+8]) - offset += 8 - - // Decode ToChainID - toChainID := binary.LittleEndian.Uint64(data[offset : offset+8]) - offset += 8 - - // Decode FromToken - var fromToken Pubkey - copy(fromToken[:], data[offset:offset+32]) - offset += 32 - - // Decode TokenAmount - tokenAmount := uint128{ - Lo: binary.LittleEndian.Uint64(data[offset : offset+8]), - Hi: binary.LittleEndian.Uint64(data[offset+8 : offset+16]), - } - offset += 16 - - // Decode AmountOut - amountOut := binary.LittleEndian.Uint64(data[offset : offset+8]) - offset += 8 - - // Decode SwapData - swapData := data[offset:] - - return &RouteOrder{ - OrderID: orderID, - Payer: payer, - User: user, - FromChainID: fromChainID, - ToChainID: toChainID, - FromToken: fromToken, - TokenAmount: tokenAmount, - AmountOut: amountOut, - SwapData: swapData, - }, nil -} - -// uint128 is a placeholder for a 128-bit unsigned integer. -type uint128 struct { - Lo uint64 - Hi uint64 -} - -func (u *uint128) Bytes() []byte { - buf := make([]byte, 16) - binary.LittleEndian.PutUint64(buf[0:8], u.Lo) - binary.LittleEndian.PutUint64(buf[8:16], u.Hi) - return buf -} - -func (u *uint128) String() string { - return fmt.Sprintf("Hi: %d, Lo: %d", u.Hi, u.Lo) -} - -type SwapData struct { - ToToken []byte `json:"toToken"` - Receiver []byte `json:"receiver"` - Initiator []byte `json:"initiator"` - MinAmountOut *big.Int `json:"minAmountOut"` - Relay bool `json:"relay"` - MessageType *big.Int `json:"messageType"` -} - -func parseSwapData(data []byte) (*SwapData, error) { - offset := 0 - if len(data) < 74 { // min length - return nil, errors.New("data too short to parse") - } - - // parse cross_token_len - crossTokenLen := int(data[offset]) - offset++ - - // parse cross_address_len - crossAddressLen := int(data[offset]) - offset++ - - // enough - expectedLength := 2 + crossTokenLen + 2*crossAddressLen + 32 + 2 - if len(data) < expectedLength { - return nil, errors.New("data length mismatch") - } - - // parse toToken - toToken := data[offset : offset+crossTokenLen] - offset += crossTokenLen - - // parse receiver - receiver := data[offset : offset+crossAddressLen] - offset += crossAddressLen - - // parse initiator - initiator := data[offset : offset+crossAddressLen] - offset += crossAddressLen - - // parse minAmountOut (128) - minAmountOut := binary.BigEndian.Uint64(data[offset+24 : offset+32]) // lower 8 bit - offset += 32 - - // parse relay - relay := data[offset] - offset++ - - // parse messageType - messageType := data[offset] - - // return parse result - relayBool, err := strconv.ParseBool(fmt.Sprintf("%x", relay)) - if err != nil { - return nil, err - } - - return &SwapData{ - ToToken: toToken, - Receiver: receiver, - Initiator: initiator, - MinAmountOut: big.NewInt(0).SetUint64(minAmountOut), - Relay: relayBool, - MessageType: big.NewInt(0).SetBytes([]byte{messageType}), - }, nil -} diff --git a/chains/sol/sync.go b/chains/sol/sync.go deleted file mode 100644 index a7fdfe14..00000000 --- a/chains/sol/sync.go +++ /dev/null @@ -1,408 +0,0 @@ -package sol - -import ( - "context" - "encoding/json" - "fmt" - "github.com/ethereum/go-ethereum/crypto" - "github.com/gagliardetto/solana-go" - "github.com/mapprotocol/compass/internal/abi" - "github.com/mapprotocol/compass/internal/contract" - "github.com/mapprotocol/compass/internal/mapprotocol" - "github.com/mapprotocol/compass/internal/proof" - "github.com/mapprotocol/compass/internal/stream" - "github.com/mapprotocol/compass/pkg/msg" - "github.com/mr-tron/base58" - "math/big" - "strings" - "time" - - "github.com/ethereum/go-ethereum/common" - "github.com/mapprotocol/compass/core" - "github.com/mapprotocol/compass/internal/chain" - "github.com/mapprotocol/compass/internal/constant" - "github.com/mapprotocol/compass/pkg/util" - "github.com/pkg/errors" -) - -type Handler func(*sync) (int64, error) - -type sync struct { - *chain.CommonSync - handler Handler - conn core.Connection - cfg *Config -} - -func newSync(cs *chain.CommonSync, handler Handler, conn core.Connection, cfg *Config) *sync { - return &sync{CommonSync: cs, handler: handler, conn: conn, cfg: cfg} -} - -func (m *sync) Sync() error { - m.Log.Info("Starting listener...") - if !m.Cfg.SyncToMap { - time.Sleep(time.Hour * 2400) - return nil - } - - select { - case <-m.Stop: - return errors.New("polling terminated") - default: - for { - id, err := m.handler(m) - if err != nil { - if errors.Is(err, chain.NotVerifyAble) { - time.Sleep(constant.BlockRetryInterval) - continue - } - m.Log.Error("Filter Failed to get events for block", "err", err) - util.Alarm(context.Background(), fmt.Sprintf("filter mos failed, chain=%s, err is %s", m.Cfg.Name, err.Error())) - time.Sleep(constant.BlockRetryInterval) - continue - } - if id == 0 { - time.Sleep(constant.MessengerInterval) - continue - } - - m.Cfg.StartBlock = big.NewInt(id) - _ = m.WaitUntilMsgHandled(1) - err = m.BlockStore.StoreBlock(m.Cfg.StartBlock) - if err != nil { - m.Log.Error("Failed to write latest block to blockstore", "err", err) - } - - time.Sleep(constant.MessengerInterval) - } - } -} - -type Log struct { - Id int64 `json:"id"` - BlockNumber int64 `json:"blockNumber"` - Addr string `json:"addr"` - Topic string `json:"topic"` - Data string `json:"data"` - TxHash string `json:"txHash"` -} - -type CrossOutData struct { - Relay bool `json:"relay"` - OrderId string `json:"orderId"` - TokenAmount string `json:"tokenAmount"` - From []byte `json:"from"` - FromToken []byte `json:"fromToken"` - ToToken []byte `json:"toToken"` - SwapTokenOut string `json:"swapTokenOut"` - SwapTokenOutMinAmountOut string `json:"swapTokenOutMinAmountOut"` - MinAmountOut string `json:"minAmountOut"` - SwapTokenOutBeforeBalance string `json:"swapTokenOutBeforeBalance"` - AfterBalance string `json:"afterBalance"` - Receiver string `json:"receiver"` - OriginReceiver []byte `json:"originReceiver"` - ToChain string `json:"toChain"` - FromChainId string `json:"fromChainId"` - AmountOut string `json:"amountOut"` - RefererId []int `json:"refererId"` - FeeRatio []int `json:"feeRatio"` - SwapData string `json:"swapData"` -} - -func filter(m *sync) (*Log, error) { - topic := "" - for idx, ele := range m.cfg.SolEvent { - topic += ele - if idx != len(m.cfg.SolEvent)-1 { - topic += "," - } - } - - data, err := chain.Request(fmt.Sprintf("%s/%s?%s", m.Cfg.FilterHost, constant.FilterUrl, - fmt.Sprintf("id=%d&project_id=%d&chain_id=%d&topic=%s&limit=1", - m.Cfg.StartBlock.Int64(), constant.ProjectOfOther, m.Cfg.Id, topic))) - if err != nil { - return nil, err - } - listData, err := json.Marshal(data) - if err != nil { - return nil, errors.Wrap(err, "marshal resp.Data failed") - } - back := stream.MosListResp{} - err = json.Unmarshal(listData, &back) - if err != nil { - return nil, err - } - if len(back.List) == 0 { - return nil, nil - } - - var ret = Log{} - for _, ele := range back.List { - idx := match(ele.ContractAddress, m.cfg.McsContract) - if idx == -1 { - m.Log.Info("Filter Log Address Not Match", "id", ele.Id, "address", ele.ContractAddress, "txHash", ele.TxHash) - m.Cfg.StartBlock = big.NewInt(ele.Id) - continue - } - - split := strings.Split(ele.Topic, ",") - topics := make([]common.Hash, 0, len(split)) - for _, sp := range split { - topics = append(topics, common.HexToHash(sp)) - } - ret = Log{ - Id: ele.Id, - BlockNumber: int64(ele.BlockNumber), - Addr: ele.ContractAddress, - Topic: ele.Topic, - Data: ele.LogData, - TxHash: ele.TxHash, - } - - m.Log.Info("Filter find Log", "id", ele.Id, "txHash", ele.TxHash) - } - - return &ret, nil -} - -func match(addr string, target []string) int { - for idx, ele := range target { - if ele == addr { - return idx - } - } - return -1 -} - -func mosHandler(m *sync) (int64, error) { - // 通过 filter 过滤 - log, err := filter(m) - if err != nil { - return 0, errors.Wrap(err, "filter failed") - } - if log == nil || log.Id == 0 { - return 0, nil - } - receiptHash, receiptPack, err := m.genReceipt(log) - if err != nil { - return 0, errors.Wrap(err, "gen receipt failed") - } - m.Log.Info("Sol2Evm msger generate", "receiptHash", receiptHash) - proposalInfo, err := chain.GetSigner(big.NewInt(log.BlockNumber), *receiptHash, uint64(m.cfg.Id), uint64(m.cfg.MapChainID)) - if err != nil { - return 0, err - } - var fixedHash [32]byte - for i, v := range receiptHash { - fixedHash[i] = v - } - pd := proof.SignLogData{ - ProofType: 1, - BlockNum: big.NewInt(log.BlockNumber), - ReceiptRoot: fixedHash, - Signatures: proposalInfo.Signatures, - Proof: receiptPack, - } - - input, err := mapprotocol.GetAbi.Methods[mapprotocol.MethodOfGetBytes].Inputs.Pack(pd) - if err != nil { - return 0, errors.Wrap(err, "pack getBytes failed") - } - - tmpData := CrossOutData{} - err = json.Unmarshal([]byte(log.Data), &tmpData) - if err != nil { - return 0, errors.Wrap(err, "unmarshal resp.Data failed") - } - orderId := common.HexToHash(tmpData.OrderId) - finalInput, err := mapprotocol.PackInput(mapprotocol.Mcs, mapprotocol.MethodOfMessageIn, - big.NewInt(0).SetUint64(uint64(m.Cfg.Id)), - big.NewInt(int64(0)), orderId, input) - if err != nil { - return 0, nil - } - - var orderId32 [32]byte - for i, v := range orderId { - orderId32[i] = v - } - message := msg.NewSwapWithProof(m.Cfg.Id, m.Cfg.MapChainID, []interface{}{finalInput, - orderId32, log.BlockNumber, log.TxHash}, m.MsgCh) - err = m.Router.Send(message) - if err != nil { - m.Log.Error("subscription error: failed to route message", "err", err) - return 0, nil - } - - return log.Id, nil -} - -func oracleHandler(m *sync) (int64, error) { - // 通过 filter 过滤 - log, err := filter(m) - if err != nil { - return 0, errors.Wrap(err, "filter failed") - } - if log == nil || log.Id == 0 { - return 0, nil - } - - receiptHash, _, err := m.genReceipt(log) - if err != nil { - return 0, errors.Wrap(err, "gen receipt failed") - } - m.Log.Info("Sol2Evm oracle generate", "receiptHash", receiptHash) - - ret, err := chain.MulSignInfo(0, uint64(m.Cfg.MapChainID)) - if err != nil { - return 0, errors.Wrap(err, "mul sign failed") - } - - version := make([]byte, 0) - for _, v := range ret.Version { - version = append(version, byte(v)) - } - - bn := big.NewInt(log.BlockNumber) - input, err := mapprotocol.PackAbi.Methods[mapprotocol.MethodOfSolidityPack].Inputs.Pack(receiptHash, - ret.Version, bn, big.NewInt(int64(m.Cfg.Id))) - if err != nil { - return 0, errors.Wrap(err, "oracle pack input failed") - } - - message := msg.NewProposal(m.Cfg.Id, m.Cfg.MapChainID, []interface{}{input, receiptHash, bn}, m.MsgCh) - err = m.Router.Send(message) - if err != nil { - m.Log.Error("subscription error: failed to route message", "err", err) - return 0, nil - } - - return log.Id, nil -} - -const ( - UsdcOfSol = "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v" - WsolOfSol = "So11111111111111111111111111111111111111112" -) - -func (m *sync) genReceipt(log *Log) (*common.Hash, []byte, error) { - // 解析 - tmpData := CrossOutData{} - err := json.Unmarshal([]byte(log.Data), &tmpData) - if err != nil { - return nil, nil, errors.Wrap(err, "unmarshal resp.Data failed") - } - fromChain, ok := big.NewInt(0).SetString(tmpData.FromChainId, 16) - if !ok { - return nil, nil, fmt.Errorf("invalid fromChain (%s)", tmpData.FromChainId) - } - toChain, ok := big.NewInt(0).SetString(tmpData.ToChain, 16) - if !ok { - return nil, nil, fmt.Errorf("invalid toChain (%s)", tmpData.ToChain) - } - amount, ok := big.NewInt(0).SetString(tmpData.AmountOut, 16) - if !ok { - return nil, nil, fmt.Errorf("invalid amount (%s)", tmpData.TokenAmount) - } - minAmount, ok := big.NewInt(0).SetString(tmpData.MinAmountOut, 16) - if !ok { - return nil, nil, fmt.Errorf("invalid minAmount (%s)", tmpData.MinAmountOut) - } - orderId := common.HexToHash(tmpData.OrderId) - token := tmpData.ToToken[:20] - form := tmpData.From - to := common.Hex2Bytes(strings.TrimPrefix(tmpData.Receiver, "0x")) - - bridgeParam := &abi.BridgeParam{} - if len(tmpData.SwapData) > 0 { - bridgeParam, err = abi.DecodeBridgeParam(common.Hex2Bytes(strings.TrimPrefix(tmpData.SwapData, "0x"))) - if err != nil { - return nil, nil, errors.Wrap(err, "decode bridge param failed") - } - - if len(bridgeParam.SwapData) > 0 { - // check swapData - rece := tmpData.OriginReceiver[13:] - if toChain.Int64() == constant.BtcChainId { - if isFirst12Zero(tmpData.OriginReceiver) { - rece = tmpData.OriginReceiver[12:] - } else { - rece = tmpData.OriginReceiver[:] - } - } - if common.Bytes2Hex(token) == "0000000000000000000000000000000000425443" { - token = common.Hex2Bytes("425443") - } - pass, err := contract.Validate(tmpData.Relay, toChain, minAmount, token, rece, bridgeParam.SwapData) - if err != nil { - return nil, nil, err - } - if !pass { - return nil, nil, fmt.Errorf("invalid swapData (%s)", tmpData.SwapData) - } - } - } - - bridgeToken := make([]byte, 0) - if tmpData.SwapTokenOut == m.cfg.UsdcAda { - bridgeToken, _ = base58.Decode(UsdcOfSol) - } else if tmpData.SwapTokenOut == m.cfg.WsolAda { - bridgeToken, _ = base58.Decode(WsolOfSol) - } - eo := mapprotocol.MessageOutEvent{ - FromChain: fromChain, - ToChain: toChain, - OrderId: orderId, - Amount: amount, - Token: bridgeToken, - From: form, - SwapData: bridgeParam.SwapData, - GasLimit: big.NewInt(0), - Mos: common.Hex2Bytes("0000317bec33af037b5fab2028f52d14658f6a56"), - Initiator: form, - Relay: tmpData.Relay, - MessageType: uint8(3), - To: to, - } - - fmt.Println("eo.From", base58.Encode(eo.From)) - fmt.Println("eo.Initiator", base58.Encode(eo.Initiator)) - fmt.Println("eo.Relay", eo.Relay) - fmt.Println("eo.to", common.Bytes2Hex(eo.To)) - fmt.Println("eo.FromChain", eo.FromChain) - fmt.Println("eo.ToChain", eo.ToChain) - fmt.Println("eo.OrderId", eo.OrderId) - fmt.Println("eo.Amount", eo.Amount) - fmt.Println("eo.Token", common.Bytes2Hex(eo.Token)) - fmt.Println("eo.SwapData", common.Bytes2Hex(bridgeParam.SwapData)) - - data, err := mapprotocol.SolAbi.Methods[mapprotocol.MethodOfSolEventEncode].Inputs.Pack(&eo) - if err != nil { - return nil, nil, errors.Wrap(err, "marshal event code failed") - } - fmt.Println("log.Addr ", log.Addr) - addr := make([]byte, 0, 64) - for _, ele := range solana.MustPublicKeyFromBase58(log.Addr) { - addr = append(addr, ele) - } - // abi - receiptPack, err := mapprotocol.SolAbi.Methods[mapprotocol.MethodOfSolPackReceipt].Inputs.Pack(addr, []byte("MessageOutEvent"), data) // temp - if err != nil { - return nil, nil, errors.Wrap(err, "marshal sol pack failed") - } - receipt := common.BytesToHash(crypto.Keccak256(receiptPack)) - return &receipt, receiptPack, nil -} - -func isFirst12Zero(data []byte) bool { - if len(data) < 12 { - return false - } - for i := 0; i < 12; i++ { - if data[i] != 0 { - return false - } - } - return true -} diff --git a/chains/sol/writer.go b/chains/sol/writer.go deleted file mode 100644 index 769af013..00000000 --- a/chains/sol/writer.go +++ /dev/null @@ -1,244 +0,0 @@ -package sol - -import ( - "context" - "encoding/hex" - "fmt" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/gagliardetto/solana-go" - "github.com/gagliardetto/solana-go/rpc" - "github.com/mapprotocol/compass/internal/butter" - "github.com/mapprotocol/compass/pkg/msg" - "github.com/mr-tron/base58" - "github.com/pkg/errors" - "strings" - "time" - - "github.com/ChainSafe/log15" - "github.com/mapprotocol/compass/internal/constant" - "github.com/mapprotocol/compass/pkg/util" -) - -type Writer struct { - cfg *Config - log log15.Logger - conn *Connection - stop <-chan int - sysErr chan<- error -} - -func newWriter(conn *Connection, cfg *Config, log log15.Logger, stop <-chan int, sysErr chan<- error) *Writer { - return &Writer{ - cfg: cfg, - conn: conn, - log: log, - stop: stop, - sysErr: sysErr, - } -} - -func (w *Writer) ResolveMessage(m msg.Message) bool { - w.log.Info("Attempting to resolve message", "type", m.Type, "src", m.Source, "dst", m.Destination) - switch m.Type { - case msg.SwapSolProof: - return w.exeMcs(m) - default: - w.log.Error("Unknown message type received", "type", m.Type) - return false - } -} - -func (w *Writer) exeMcs(m msg.Message) bool { - var ( - errorCount int64 - log = m.Payload[0].(*types.Log) - //sign = m.Payload[1].([][]byte) - method = m.Payload[2].(string) - ) - - for { - select { - case <-w.stop: - return false - default: - relayData, err := DecodeMessageRelay(log.Topics, common.Bytes2Hex(log.Data)) - if err != nil { - w.log.Error("Error decoding relay data", "error", err) - time.Sleep(constant.TxRetryInterval) - continue - } - w.log.Info("Relay data", "receiver", base58.Encode(relayData.Receiver), "dstToken", base58.Encode(relayData.DstToken), "outAmount", relayData.OutAmount) - if relayData.Swap != nil { - w.log.Info("Relay Swap data", "toToken", base58.Encode(relayData.Swap.ToToken), "receiver", base58.Encode(relayData.Swap.Receiver), - "amount", relayData.Swap.MinAmount) - } - resp, err := w.solCrossIn(log, relayData) - if err != nil { - w.log.Error("Error in solCross in", "error", err) - time.Sleep(constant.TxRetryInterval) - continue - } - txData := resp.Data[0].TxParam[0].Data - - w.log.Info("Send transaction", "srcHash", log.TxHash, "method", method) - mcsTx, err := w.sendTx(txData) - if err == nil { - w.log.Info("Submitted cross tx execution", "src", m.Source, "dst", m.Destination, "srcHash", log.TxHash, "mcsTx", mcsTx) - err = w.txStatus(*mcsTx) - if err == nil { - w.log.Info("TxHash status is successful, will next tx") - m.DoneCh <- struct{}{} - return true - } - } else if w.cfg.SkipError && errorCount >= 9 { - w.log.Warn("Execution failed, ignore this error, Continue to the next ", "srcHash", log.TxHash, "err", err) - m.DoneCh <- struct{}{} - return true - } else { - for e := range constant.IgnoreError { - if strings.Index(err.Error(), e) != -1 { - w.log.Info("Ignore This Error, Continue to the next", "id", m.Destination, "err", err) - m.DoneCh <- struct{}{} - return true - } - } - w.log.Warn("Execution failed, will retry", "srcHash", log.TxHash, "err", err) - } - errorCount++ - if errorCount >= 10 { - w.mosAlarm(log.TxHash, err) - errorCount = 0 - } - time.Sleep(constant.TxRetryInterval) - } - } -} - -func (w *Writer) sendTx(data string) (*solana.Signature, error) { - w.log.Info("Sending transaction", "data", data) - bbs, err := hex.DecodeString(data) - if err != nil { - return nil, err - } - trx, err := solana.TransactionFromBytes(bbs) - if err != nil { - return nil, err - } - resp, err := w.conn.cli.GetLatestBlockhash(context.Background(), rpc.CommitmentFinalized) - if err != nil { - return nil, err - } - trx.Message.RecentBlockhash = resp.Value.Blockhash - w.log.Info("Sending transaction", "blockHash", resp.Value.Blockhash) - signPri, _ := solana.PrivateKeyFromBase58(w.cfg.Pri) - // sign - _, err = trx.Sign(func(key solana.PublicKey) *solana.PrivateKey { - if key == signPri.PublicKey() { - return &signPri - } - return nil - }) - if err != nil { - return nil, err - } - - w.log.Info("Sending will transaction") - sig, err := w.conn.cli.SendTransactionWithOpts(context.TODO(), trx, rpc.TransactionOpts{ - SkipPreflight: false, - }) - if err != nil { - return nil, err - - } - return &sig, nil -} - -func (w *Writer) txStatus(txHash solana.Signature) error { - var count int64 - time.Sleep(time.Second * 2) - for { - version := uint64(0) - _, err := w.conn.cli.GetTransaction(context.Background(), txHash, &rpc.GetTransactionOpts{ - Encoding: solana.EncodingBase58, - Commitment: rpc.CommitmentFinalized, - MaxSupportedTransactionVersion: &version, - }) - if err != nil { - count++ - w.log.Error("Failed to GetTransaction", "err", err) - time.Sleep(5 * time.Second) - if count >= 30 { - return errors.New("The Tx pending state is too long") - } - continue - } - - txResult, err := w.conn.cli.GetSignatureStatuses(context.Background(), true, txHash) - if err != nil { - count++ - w.log.Error("Failed to GetSignatureStatuses", "err", err) - if count >= 30 { - return errors.New("The Tx pending state is too long") - } - time.Sleep(5 * time.Second) - continue - } - fmt.Println("txResult ------------------ ", txResult) - if txResult.Value == nil || len(txResult.Value) == 0 || txResult.Value[0].Err != nil { - count++ - if count >= 30 { - return errors.New("The Tx pending state is too long") - } - continue - } - - w.log.Info("Tx receipt status is success", "hash", txHash) - return nil - } -} - -func (w *Writer) mosAlarm(tx interface{}, err error) { - util.Alarm(context.Background(), fmt.Sprintf("mos map2sol failed, srcHash=%v err is %s", tx, err.Error())) -} - -func (w *Writer) solCrossIn(l *types.Log, relayData *Relay) (*butter.SolCrossInResp, error) { - signPri, _ := solana.PrivateKeyFromBase58(w.cfg.Pri) - router := signPri.PublicKey().String() - orderId := l.Topics[1] - receiver := relayData.Receiver - dstToken := relayData.DstToken - minAmount := relayData.OutAmount - if relayData.Swap != nil { - receiver = relayData.Swap.Receiver - minAmount = relayData.Swap.MinAmount - dstToken = relayData.Swap.ToToken - } - query := fmt.Sprintf("tokenInAddress=%s&tokenAmount=%s&"+ - "tokenOutAddress=%s&"+ - "router=%s&minAmountOut=%s&orderIdHex=%s&receiver=%s&feeRatio=%s", - base58.Encode(relayData.DstToken), relayData.OutAmount.String(), - base58.Encode(dstToken), - router, minAmount, orderId.Hex(), base58.Encode(receiver), "110", - ) - data, err := butter.SolCrossIn(w.cfg.ButterHost, query) - if err != nil { - w.log.Error("Failed to butter.SolCrossIn", "err", err) - return nil, err - } - - return data, nil -} - -type Resp struct { - Code int `json:"code"` - Message string `json:"message"` - Data struct { - Tx []string `json:"tx"` - SwapData struct { - ToToken string `json:"to_token"` - ToAddress string `json:"to_address"` - MinAmountOutBN string `json:"minAmountOutBN"` - } `json:"swap_data"` - } `json:"data"` -} diff --git a/chains/sol/writer_test.go b/chains/sol/writer_test.go deleted file mode 100644 index dd9baf20..00000000 --- a/chains/sol/writer_test.go +++ /dev/null @@ -1,39 +0,0 @@ -package sol - -import ( - "reflect" - "testing" -) - -func TestDecodeRelayData(t *testing.T) { - type args struct { - data string - } - tests := []struct { - name string - args args - want *MessageData - wantErr bool - }{ - { - name: "relay", - args: args{ - data: "0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000005c1003030314220000000000000000000000000000000000000000000000986f0c7872706d6f730cdae5da23b64bfecd421d6487ffeabf6558828d7244764b4d4364596b67746e427759696568385634393936326a735948577369465500000000", - }, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - got, err := DecodeRelayData(tt.args.data) - if (err != nil) != tt.wantErr { - t.Errorf("DecodeRelayData() error = %v, wantErr %v", err, tt.wantErr) - return - } - t.Log("got ------ ", string(got.To)) - t.Log("got ------ ", got) - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("DecodeRelayData() got = %+v, want %+v", got, tt.want) - } - }) - } -} diff --git a/chains/ton/bridge.go b/chains/ton/bridge.go deleted file mode 100644 index 3e125927..00000000 --- a/chains/ton/bridge.go +++ /dev/null @@ -1,274 +0,0 @@ -package ton - -import ( - "fmt" - "github.com/ethereum/go-ethereum/common" - "github.com/xssnick/tonutils-go/tvm/cell" - "math" - "math/big" - "strings" -) - -type Signature struct { - V uint64 - R *big.Int - S *big.Int -} - -func GenerateMessageInCell( - hash common.Hash, - expectedAddress common.Address, - signs []*Signature, - receiptRoot common.Hash, - version common.Hash, - blockNum int64, - chainId int64, - addr common.Address, - topics []common.Hash, - message []byte, -) (*cell.Cell, error) { - - signsCell := cell.BeginCell() - for i := 0; i < len(signs); i++ { - signsCell = signsCell.MustStoreRef(cell.BeginCell().MustStoreUInt(signs[i].V, 8).MustStoreBigUInt(signs[i].R, 256).MustStoreBigUInt(signs[i].S, 256).EndCell()) - } - - msg, err := EncodeMessage(message) - if err != nil { - return nil, err - } - - return cell.BeginCell(). - MustStoreUInt(0xd5f86120, 32). - MustStoreUInt(0, 64). - MustStoreBigUInt(hash.Big(), 256). - //MustStoreBigUInt(expectedAddress.Big(), 160). - MustStoreBigUInt(new(big.Int).SetBytes(expectedAddress[:]), 160). - MustStoreUInt(uint64(len(signs)), 8). - MustStoreRef(signsCell.EndCell()). - MustStoreRef( - cell.BeginCell(). - MustStoreBigUInt(receiptRoot.Big(), 256). - MustStoreBigUInt(version.Big(), 256). - MustStoreBigUInt(big.NewInt(blockNum), 256). - MustStoreInt(chainId, 64). - EndCell()). - MustStoreRef( - cell.BeginCell(). - //MustStoreBigUInt(addr.Big(), 256). - MustStoreBigUInt(new(big.Int).SetBytes(addr[:]), 256). - MustStoreRef( - cell.BeginCell(). - MustStoreBigUInt(topics[0].Big(), 256). - MustStoreBigUInt(topics[1].Big(), 256). - MustStoreBigUInt(topics[2].Big(), 256). - EndCell()). - MustStoreRef(msg). - EndCell(), - ).EndCell(), nil - -} - -func EncodeMessage(data []byte) (*cell.Cell, error) { - if len(data) < 64 { - return nil, fmt.Errorf("data too short, minimum 64 bytes required") - } - - // Extract metadata and data positions - offset := data[:32] - length := data[32:64] - pos := uint(64) - - // Build metadata cell - metadataCell := cell.BeginCell(). - MustStoreSlice(offset, uint(len(offset))*8). - MustStoreSlice(length, uint(len(length))*8). - EndCell() - - // Read header fields - version := data[pos] - pos++ - relay := data[pos] - pos++ - tokenLen := uint(data[pos]) - pos++ - mosLen := uint(data[pos]) - pos++ - fromLen := uint(data[pos]) - pos++ - toLen := uint(data[pos]) - pos++ - payloadLen := uint(data[pos])<<8 | uint(data[pos+1]) - pos += 2 - - // Read reserved and token amount - reserved := data[pos : pos+8] - pos += 8 - tokenAmount := data[pos : pos+16] - pos += 16 - - // Read addresses - tokenAddr := data[pos : pos+tokenLen] - pos += tokenLen - mosTarget := data[pos : pos+mosLen] - pos += mosLen - fromAddr := data[pos : pos+fromLen] - pos += fromLen - toAddr := data[pos : pos+toLen] - pos += toLen - payload := data[pos : pos+payloadLen] - - // Build header cell - headerCell := cell.BeginCell(). - MustStoreUInt(uint64(version), 8). - MustStoreUInt(uint64(relay), 8). - MustStoreUInt(uint64(tokenLen), 8). - MustStoreUInt(uint64(mosLen), 8). - MustStoreUInt(uint64(fromLen), 8). - MustStoreUInt(uint64(toLen), 8). - MustStoreUInt(uint64(payloadLen), 16). - MustStoreSlice(reserved, uint(len(reserved))*8). - MustStoreSlice(tokenAmount, uint(len(tokenAmount))*8). - EndCell() - - // Build addresses cells - tokenMosCell := cell.BeginCell(). - MustStoreSlice(tokenAddr, uint(len(tokenAddr))*8). - MustStoreSlice(mosTarget, uint(len(mosTarget))*8). - EndCell() - - fromToCell := cell.BeginCell(). - MustStoreSlice(fromAddr, uint(len(fromAddr))*8). - MustStoreSlice(toAddr, uint(len(toAddr))*8). - EndCell() - - // Build payload cell - payloadCell, err := EncodePayload(payload) - if err != nil { - return nil, err - } - - // Link all cells together - metadataAndHeader := cell.BeginCell(). - MustStoreRef(metadataCell). - MustStoreRef(headerCell). - EndCell() - - return cell.BeginCell(). - MustStoreRef(metadataAndHeader). - MustStoreRef(tokenMosCell). - MustStoreRef(fromToCell). - MustStoreRef(payloadCell). - EndCell(), nil -} - -const ( - maxBits = 768 - maxBytesPerCell = maxBits / 8 // ~127 bytes -) - -func bytesToBinary(data []byte) string { - var binary strings.Builder - for _, b := range data { - binary.WriteString(fmt.Sprintf("%08b", b)) - } - return binary.String() -} - -func binaryToBytes(binary string) []byte { - // Pad binary string to multiple of 8 - padding := len(binary) % 8 - if padding != 0 { - binary = binary + strings.Repeat("0", 8-padding) - } - - result := make([]byte, len(binary)/8) - for i := 0; i < len(binary); i += 8 { - end := i + 8 - if end > len(binary) { - end = len(binary) - } - chunk := binary[i:end] - - var val byte - for j, bit := range chunk { - if bit == '1' { - val |= 1 << (7 - j) - } - } - result[i/8] = val - } - return result -} - -func EncodePayload(data []byte) (*cell.Cell, error) { - binaryStr := bytesToBinary(data) - - var cells []*cell.Builder - position := 0 - - for position < len(binaryStr) { - builder := cell.BeginCell() - end := position + maxBits - if end > len(binaryStr) { - end = len(binaryStr) - } - bitsForCurrentCell := binaryStr[position:end] - - for _, bit := range bitsForCurrentCell { - if bit == '1' { - builder.StoreBoolBit(true) - } else { - builder.StoreBoolBit(false) - } - } - - cells = append(cells, builder) - position = end - } - - lastCell := cells[len(cells)-1].EndCell() - for i := len(cells) - 2; i >= 0; i-- { - cells[i].StoreRef(lastCell) - lastCell = cells[i].EndCell() - } - - return lastCell, nil -} - -func DecodePayload(rootCell *cell.Cell) ([]byte, error) { - var binaryResult strings.Builder - currentCell := rootCell - - for { - slice := currentCell.BeginParse() - - for slice.BitsLeft() > 0 { - bit, err := slice.LoadBoolBit() - if err != nil { - return nil, fmt.Errorf("error loading bit: %w", err) - } - if bit { - binaryResult.WriteString("1") - } else { - binaryResult.WriteString("0") - } - } - - if slice.RefsNum() == 0 { - break - } - - nextCell, err := slice.LoadRefCell() - if err != nil { - return nil, fmt.Errorf("error loading next cell: %w", err) - } - currentCell = nextCell - } - - return binaryToBytes(binaryResult.String()), nil -} - -func CalculateCellCount(data []byte) int { - return int(math.Ceil(float64(len(data)) / float64(maxBytesPerCell))) -} diff --git a/chains/ton/chain.go b/chains/ton/chain.go deleted file mode 100644 index f528228c..00000000 --- a/chains/ton/chain.go +++ /dev/null @@ -1,107 +0,0 @@ -package ton - -import ( - "github.com/ChainSafe/log15" - "github.com/ethereum/go-ethereum/log" - "github.com/mapprotocol/compass/internal/mapprotocol" - keystore2 "github.com/mapprotocol/compass/pkg/keystore" - "github.com/mapprotocol/compass/pkg/msg" - - "github.com/mapprotocol/compass/core" - "github.com/mapprotocol/compass/internal/chain" -) - -var _ core.Chain = new(Chain) - -type Chain struct { - cfg *core.ChainConfig // The config of the chain - conn core.Connection // The chains connection - writer *Writer // The writer of the chain - listen core.Listener // The listener of this chain - stop chan<- int -} - -func New() *Chain { - return &Chain{} -} - -func (c *Chain) New(chainCfg *core.ChainConfig, logger log15.Logger, sysErr chan<- error, role mapprotocol.Role) (core.Chain, error) { - cfg, err := parseConfig(chainCfg) - if err != nil { - return nil, err - } - - kpI, err := keystore2.KeypairFromEth(cfg.KeystorePath) - if err != nil { - return nil, err - } - - password := keystore2.GetPassword("Enter password for TON words:") - conn := NewConnection(cfg.Endpoint, cfg.Words, string(password), kpI, logger) - err = conn.Connect() - if err != nil { - return nil, err - } - - var ( - stop = make(chan int) - listen core.Listener - ) - bs, err := chain.SetupBlockStore(&cfg.Config, role) - if err != nil { - return nil, err - } - cs := chain.NewCommonSync(nil, &cfg.Config, logger, stop, sysErr, bs) - - switch role { - case mapprotocol.RoleOfMessenger: - listen = newSync(cs, messengerHandler, conn, cfg) - case mapprotocol.RoleOfOracle: - listen = newSync(cs, oracleHandler, conn, cfg) - } - mapprotocol.MosMapping[cfg.Id] = cfg.McsContract[0] - - return &Chain{ - cfg: chainCfg, - conn: conn, - writer: newWriter(conn, cfg, logger, stop, sysErr), - stop: stop, - listen: listen, - }, nil -} - -func (c *Chain) SetRouter(r core.Router) { - r.Listen(c.cfg.Id, c.writer) - c.listen.SetRouter(r) -} - -func (c *Chain) Start() error { - err := c.listen.Sync() - if err != nil { - return err - } - - log.Debug("Successfully started chain") - return nil -} - -func (c *Chain) Id() msg.ChainId { - return c.cfg.Id -} - -func (c *Chain) Name() string { - return c.cfg.Name -} - -// Stop signals to any running routines to exit -func (c *Chain) Stop() { - close(c.stop) - if c.conn != nil { - c.conn.Close() - } -} - -// Conn return Connection interface for relayer register -func (c *Chain) Conn() core.Connection { - return c.conn -} diff --git a/chains/ton/config.go b/chains/ton/config.go deleted file mode 100644 index 83218fcc..00000000 --- a/chains/ton/config.go +++ /dev/null @@ -1,42 +0,0 @@ -package ton - -import ( - "github.com/mapprotocol/compass/core" - "github.com/mapprotocol/compass/internal/chain" - "strings" -) - -type Config struct { - chain.Config - Words string - McsContract []string - Event []string -} - -func parseConfig(chainCfg *core.ChainConfig) (*Config, error) { - cfg, err := chain.ParseConfig(chainCfg) - if err != nil { - return nil, err - } - ret := Config{ - Config: *cfg, - } - - if words, ok := chainCfg.Opts[chain.Words]; ok && words != "" { - ret.Words = words - } - - if ele, ok := chainCfg.Opts[chain.McsOpt]; ok && ele != "" { - for _, addr := range strings.Split(ele, ",") { - ret.McsContract = append(ret.McsContract, addr) - } - } - - if ele, ok := chainCfg.Opts[chain.Event]; ok && ele != "" { - for _, event := range strings.Split(ele, "|") { - ret.Event = append(ret.Event, event) - } - } - - return &ret, nil -} diff --git a/chains/ton/conn.go b/chains/ton/conn.go deleted file mode 100644 index d2799ffd..00000000 --- a/chains/ton/conn.go +++ /dev/null @@ -1,106 +0,0 @@ -package ton - -import ( - "context" - "math/big" - "strings" - - "github.com/ChainSafe/log15" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/accounts/keystore" - ethcommon "github.com/ethereum/go-ethereum/common" - "github.com/xssnick/tonutils-go/liteclient" - "github.com/xssnick/tonutils-go/ton" - tonwallet "github.com/xssnick/tonutils-go/ton/wallet" - - "github.com/mapprotocol/compass/pkg/ethclient" -) - -type Connection struct { - endpoint string - words string - password string - kp *keystore.Key - client ton.APIClientWrapped - wallet *tonwallet.Wallet - log log15.Logger - stop chan int -} - -func NewConnection(endpoint, words, password string, kp *keystore.Key, log log15.Logger) *Connection { - return &Connection{ - endpoint: endpoint, - words: words, - password: password, - kp: kp, - log: log, - stop: make(chan int), - } -} - -func (c *Connection) Connect() error { - cfg, err := liteclient.GetConfigFromUrl(context.Background(), c.endpoint) - if err != nil { - return err - } - - pool := liteclient.NewConnectionPool() - err = pool.AddConnectionsFromConfig(context.Background(), cfg) - if err != nil { - return err - } - cli := ton.NewAPIClient(pool, ton.ProofCheckPolicySecure).WithRetry() - cli.SetTrustedBlockFromConfig(cfg) - c.client = cli - - // seed words of account, you can generate them with any wallet or using wallet.NewSeed() method - seed := strings.Split(c.words, " ") - - w, err := tonwallet.FromSeedWithPassword(cli, seed, c.password, tonwallet.V3R2) - if err != nil { - return err - } - c.wallet = w - return nil -} - -func (c *Connection) Keypair() *keystore.Key { - return c.kp -} - -func (c *Connection) Client() *ethclient.Client { - return nil -} - -func (c *Connection) Opts() *bind.TransactOpts { - return nil -} - -func (c *Connection) CallOpts() *bind.CallOpts { - return nil -} - -func (c *Connection) UnlockOpts() { -} - -func (c *Connection) LockAndUpdateOpts(needNewNonce bool) error { - return nil -} - -// LatestBlock returns the latest block from the current chain -func (c *Connection) LatestBlock() (*big.Int, error) { - return big.NewInt(0), nil -} - -// EnsureHasBytecode asserts if contract code exists at the specified address -func (c *Connection) EnsureHasBytecode(addr ethcommon.Address) error { - return nil -} - -func (c *Connection) WaitForBlock(targetBlock *big.Int, delay *big.Int) error { - return nil -} - -func (c *Connection) Close() { - close(c.stop) -} diff --git a/chains/ton/proof.go b/chains/ton/proof.go deleted file mode 100644 index 4ed3ec3c..00000000 --- a/chains/ton/proof.go +++ /dev/null @@ -1,274 +0,0 @@ -package ton - -import ( - "fmt" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/common" - "github.com/xssnick/tonutils-go/address" - "github.com/xssnick/tonutils-go/tvm/cell" - "log" - "math/big" -) - -var ( - bytesType, _ = abi.NewType("bytes", "string", nil) - messageOutType, _ = abi.NewType("tuple", "", []abi.ArgumentMarshaling{ - { - Name: "relay", - Type: "bool", - }, - { - Name: "messageType", - Type: "uint8", - }, - { - Name: "fromChain", - Type: "uint256", - }, - { - Name: "toChain", - Type: "uint256", - }, - { - Name: "orderId", - Type: "bytes32", - }, - { - Name: "mos", - Type: "bytes", - }, - { - Name: "token", - Type: "bytes", - }, - { - Name: "initiator", - Type: "bytes", - }, - { - Name: "from", - Type: "bytes", - }, - { - Name: "to", - Type: "bytes", - }, - { - Name: "amount", - Type: "uint256", - }, - { - Name: "gasLimit", - Type: "uint256", - }, - { - Name: "swapData", - Type: "bytes", - }, - }) -) - -var ( - proofArgs = abi.Arguments{ - {Type: bytesType}, - {Type: bytesType}, - {Type: bytesType}, - } - - messageOutArgs = abi.Arguments{ - { - Name: "messageOut", - Type: messageOutType, - }, - } -) - -type Log struct { - Id int64 `json:"id"` - BlockNumber int64 `json:"blockNumber"` - Addr string `json:"addr"` - Topic string `json:"topic"` - Data string `json:"data"` - TxHash string `json:"txHash"` -} - -type MessageOutEvent struct { - Relay bool - MessageType uint8 - FromChain *big.Int - ToChain *big.Int - OrderId [32]byte - Mos []byte - Token []byte - Initiator []byte - From []byte - To []byte - Amount *big.Int - GasLimit *big.Int - SwapData []byte -} - -func parseMessageOutEvent(slice *cell.Slice) (*MessageOutEvent, error) { - data1, err := slice.LoadRef() - if err != nil { - return nil, err - } - relay, err := data1.LoadBigUInt(8) - if err != nil { - return nil, err - } - msgType, err := data1.LoadBigUInt(8) - if err != nil { - return nil, err - } - fromChain, err := data1.LoadBigUInt(64) - if err != nil { - return nil, err - } - toChain, err := data1.LoadBigUInt(64) - if err != nil { - return nil, err - } - gasLimit, err := data1.LoadBigUInt(64) - if err != nil { - return nil, err - } - initiator, err := data1.LoadAddr() - if err != nil { - return nil, err - } - sender, err := data1.LoadAddr() - if err != nil { - return nil, err - } - - data2, err := slice.LoadRef() - if err != nil { - return nil, err - } - target, err := data2.LoadSlice(data2.BitsLeft()) - if err != nil { - return nil, err - } - - data3, err := slice.LoadRef() - if err != nil { - return nil, err - } - payload, err := loadPayload(data3) - if err != nil { - return nil, err - } - - data4, err := slice.LoadRef() - if err != nil { - return nil, err - } - orderID, err := data4.LoadBigUInt(256) - if err != nil { - return nil, err - } - mos, err := data4.LoadBigUInt(256) - if err != nil { - return nil, err - } - token, err := data4.LoadAddr() - if err != nil { - return nil, err - } - amount, err := data4.LoadBigUInt(128) - if err != nil { - return nil, err - } - - isRelay := false - if relay.Uint64() == 1 { - isRelay = true - } - - oid := [32]byte{} - copy(oid[:], common.Hex2Bytes(orderID.Text(16))) - - var tokenBytes []byte - if !token.IsAddrNone() { - tokenBytes = common.Hex2Bytes(convertToHex(token)) - } - - messageOutEvent := &MessageOutEvent{ - Relay: isRelay, - MessageType: uint8(msgType.Uint64()), - FromChain: fromChain, - ToChain: toChain, - OrderId: oid, - Mos: common.Hex2Bytes(mos.Text(16)), - Token: tokenBytes, - Initiator: common.Hex2Bytes(convertToHex(initiator)), - From: common.Hex2Bytes(convertToHex(sender)), - To: target, - Amount: amount, - GasLimit: gasLimit, - SwapData: payload, - } - - // todo remove debug log - fmt.Println("relay: ", messageOutEvent.Relay) - fmt.Println("msgType: ", messageOutEvent.MessageType) - fmt.Println("fromChain: ", messageOutEvent.FromChain) - fmt.Println("toChain: ", messageOutEvent.ToChain) - fmt.Println("orderID: ", common.Bytes2Hex(messageOutEvent.OrderId[:])) - fmt.Println("mos: ", common.Bytes2Hex(messageOutEvent.Mos)) - fmt.Println("token: ", common.Bytes2Hex(messageOutEvent.Token)) - fmt.Println("initiator: ", common.Bytes2Hex(messageOutEvent.Initiator)) - fmt.Println("from: ", common.Bytes2Hex(messageOutEvent.From)) - fmt.Println("to: ", common.Bytes2Hex(messageOutEvent.To)) - fmt.Println("amount: ", messageOutEvent.Amount) - fmt.Println("gasLimit: ", messageOutEvent.GasLimit) - fmt.Println("payload: ", common.Bytes2Hex(messageOutEvent.SwapData)) - - return messageOutEvent, nil -} - -func encodeMessageOutEvent(messageOut *MessageOutEvent) ([]byte, error) { - log.Printf("event: %+v\n", messageOut) - return messageOutArgs.Pack(messageOut) -} - -func encodeProof(addr, topic, data []byte) ([]byte, error) { - // todo remove debug log - fmt.Println("addr: ", common.Bytes2Hex(addr)) - fmt.Println("topic: ", common.Bytes2Hex(topic)) - fmt.Println("data: ", common.Bytes2Hex(data)) - - return proofArgs.Pack(addr, topic, data) -} - -func convertToBytes(addr *address.Address) []byte { - return append(common.LeftPadBytes(big.NewInt(int64(addr.Workchain())).Bytes(), 1), addr.Data()...) -} - -func convertToHex(addr *address.Address) string { - return fmt.Sprintf("%x", append(common.LeftPadBytes(big.NewInt(int64(addr.Workchain())).Bytes(), 1), addr.Data()...)) -} - -func loadPayload(slice *cell.Slice) ([]byte, error) { - payload := make([]byte, 0) - currentSlice := slice - for { - if currentSlice.RefsNum() == 0 { - break - } - - part, err := currentSlice.LoadSlice(currentSlice.BitsLeft()) - if err != nil { - return nil, err - } - payload = append(payload, part...) - - nextSlice, err := currentSlice.LoadRef() - if err != nil { - return nil, err - } - currentSlice = nextSlice - } - return payload, nil -} diff --git a/chains/ton/proof_test.go b/chains/ton/proof_test.go deleted file mode 100644 index d9d5a996..00000000 --- a/chains/ton/proof_test.go +++ /dev/null @@ -1,39 +0,0 @@ -package ton - -import ( - "github.com/xssnick/tonutils-go/address" - "testing" -) - -func Test_convertToHex(t *testing.T) { - type args struct { - addr *address.Address - } - tests := []struct { - name string - args args - want string - }{ - { - name: "t-1", - args: args{ - addr: address.MustParseAddr("EQAu3Kfn-NhsId75-WUCdpqPODvKzR0Fpc4MB7Szn0QOQiOW"), - }, - want: "002edca7e7f8d86c21def9f96502769a8f383bcacd1d05a5ce0c07b4b39f440e42", - }, - { - name: "t-2", - args: args{ - addr: address.MustParseAddr("kQAu3Kfn-NhsId75-WUCdpqPODvKzR0Fpc4MB7Szn0QOQpgc"), - }, - want: "002edca7e7f8d86c21def9f96502769a8f383bcacd1d05a5ce0c07b4b39f440e42", - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - if got := convertToHex(tt.args.addr); got != tt.want { - t.Errorf("convertToHex() = %v, want %v", got, tt.want) - } - }) - } -} diff --git a/chains/ton/sync.go b/chains/ton/sync.go deleted file mode 100644 index 9740af59..00000000 --- a/chains/ton/sync.go +++ /dev/null @@ -1,309 +0,0 @@ -package ton - -import ( - "context" - "encoding/base64" - "encoding/hex" - "encoding/json" - "fmt" - "github.com/mapprotocol/compass/internal/mapprotocol" - "github.com/mapprotocol/compass/pkg/msg" - "github.com/xssnick/tonutils-go/address" - "github.com/xssnick/tonutils-go/tvm/cell" - "math/big" - "strings" - "time" - - "github.com/ethereum/go-ethereum/common" - "github.com/pkg/errors" - - "github.com/ethereum/go-ethereum/crypto" - "github.com/mapprotocol/compass/core" - "github.com/mapprotocol/compass/internal/chain" - "github.com/mapprotocol/compass/internal/constant" - "github.com/mapprotocol/compass/internal/proof" - "github.com/mapprotocol/compass/internal/stream" - "github.com/mapprotocol/compass/pkg/util" -) - -type Handler func(*sync) (int64, error) - -type sync struct { - *chain.CommonSync - handler Handler - conn core.Connection - cfg *Config -} - -func newSync(cs *chain.CommonSync, handler Handler, conn core.Connection, cfg *Config) *sync { - return &sync{CommonSync: cs, handler: handler, conn: conn, cfg: cfg} -} - -func (m *sync) Sync() error { - m.Log.Info("Starting listener...") - if !m.Cfg.SyncToMap { - // todo remove - fmt.Println("sync to mpa sleeping......") - time.Sleep(time.Hour * 2400) - return nil - } - - select { - case <-m.Stop: - return errors.New("polling terminated") - default: - for { - id, err := m.handler(m) - if err != nil { - if errors.Is(err, chain.NotVerifyAble) { - time.Sleep(constant.BlockRetryInterval) - continue - } - m.Log.Error("Filter Failed to get events for block", "err", err) - util.Alarm(context.Background(), fmt.Sprintf("filter mos failed, chain=%s, err is %s", m.Cfg.Name, err.Error())) - time.Sleep(constant.BlockRetryInterval) - continue - } - if id == 0 { - time.Sleep(constant.MessengerInterval) - continue - } - - m.Cfg.StartBlock = big.NewInt(id) - _ = m.WaitUntilMsgHandled(1) - err = m.BlockStore.StoreBlock(m.Cfg.StartBlock) - if err != nil { - m.Log.Error("Failed to write latest block to blockstore", "err", err) - } - - time.Sleep(constant.MessengerInterval) - } - } -} - -func filter(m *sync) (*Log, error) { - topic := "" - for idx, ele := range m.cfg.Event { - topic += ele - if idx != len(m.cfg.Event)-1 { - topic += "," - } - } - data, err := chain.Request(fmt.Sprintf("%s/%s?%s", m.Cfg.FilterHost, constant.FilterUrl, - fmt.Sprintf("id=%d&project_id=%d&chain_id=%d&topic=%s&limit=1", - m.Cfg.StartBlock.Int64(), 7, m.Cfg.Id, topic))) // todo project_id - if err != nil { - return nil, err - } - listData, err := json.Marshal(data) - if err != nil { - return nil, errors.Wrap(err, "marshal resp.Data failed") - } - back := stream.MosListResp{} - err = json.Unmarshal(listData, &back) - if err != nil { - return nil, err - } - if len(back.List) == 0 { - return nil, nil - } - - var ret = Log{} - for _, ele := range back.List { // - idx := match(ele.ContractAddress, m.cfg.McsContract) - if idx == -1 { - m.Log.Info("Filter Log Address Not Match", "id", ele.Id, "address", ele.ContractAddress, "txHash", ele.TxHash) - m.Cfg.StartBlock = big.NewInt(ele.Id) - continue - } - - ret = Log{ - Id: ele.Id, - BlockNumber: int64(ele.BlockNumber), - Addr: ele.ContractAddress, - Topic: ele.Topic, - Data: ele.LogData, - TxHash: ele.TxHash, - } - m.Log.Info("filter find log", "id", ele.Id, "topic", topic, "txHash", ele.TxHash) - } - - return &ret, nil -} - -func messengerHandler(m *sync) (int64, error) { - log, err := filter(m) - if err != nil { - return 0, errors.Wrap(err, "filter failed") - } - if log == nil || log.Id == 0 { - return 0, nil - } - - hexData, err := hex.DecodeString(log.Data) - if err != nil { - return 0, errors.Wrap(err, "failed to decode log data to hex") - } - - body := &cell.Cell{} - if err := json.Unmarshal(hexData, &body); err != nil { - return 0, errors.Wrap(err, "failed to unmarshal log data to cell") - } - - slice := body.BeginParse() - messageOut, err := parseMessageOutEvent(slice) - if err != nil { - return 0, errors.Wrap(err, "failed to parse message out event") - } - - receiptHash, receiptPack, err := genReceiptHash(log.Addr, log.Topic, messageOut) - if err != nil { - return 0, errors.Wrap(err, "gen receipt failed") - } - m.Log.Info("Ton2Evm messenger generate receipt hash", "receiptHash", receiptHash) - proposalInfo, err := getSigner(log.BlockNumber, receiptHash, uint64(m.cfg.Id), uint64(m.cfg.MapChainID)) - if err != nil { - return 0, err - } - - pd := proof.SignLogData{ - ProofType: 1, - BlockNum: big.NewInt(log.BlockNumber), - ReceiptRoot: receiptHash, - Signatures: proposalInfo.Signatures, - Proof: receiptPack, - } - - input, err := mapprotocol.GetAbi.Methods[mapprotocol.MethodOfGetBytes].Inputs.Pack(pd) - if err != nil { - return 0, errors.Wrap(err, "pack getBytes failed") - } - - orderId := common.BytesToHash(messageOut.OrderId[:]) // todo order id 如何处理? - finalInput, err := mapprotocol.PackInput(mapprotocol.Mcs, mapprotocol.MethodOfMessageIn, new(big.Int).SetUint64(uint64(m.Cfg.Id)), big.NewInt(int64(0)), orderId, input) - if err != nil { - return 0, errors.Wrap(err, "pack mcs input failed") - } - - txHash, err := Base64ToHex(log.TxHash) - if err != nil { - return 0, errors.Wrap(err, "failed to convert txHash to hex") - } - message := msg.NewSwapWithProof(m.Cfg.Id, m.Cfg.MapChainID, []interface{}{finalInput, messageOut.OrderId, log.BlockNumber, "0x" + txHash}, m.MsgCh) - err = m.Router.Send(message) - if err != nil { - m.Log.Error("subscription error: failed to route message", "err", err) - return 0, nil - } - - return log.Id, nil -} - -func oracleHandler(m *sync) (int64, error) { - log, err := filter(m) - if err != nil { - return 0, errors.Wrap(err, "failed to filter log") - } - if log == nil || log.Id == 0 { - return 0, nil - } - m.Log.Info("Filter find Log", "id", log.Id, "txHash", log.TxHash) - - hexData, err := hex.DecodeString(log.Data) - if err != nil { - return 0, errors.Wrap(err, "failed to decode log data to hex") - } - - body := &cell.Cell{} - if err := json.Unmarshal(hexData, &body); err != nil { - return 0, errors.Wrap(err, "failed to unmarshal log data to cell") - } - - slice := body.BeginParse() - messageOut, err := parseMessageOutEvent(slice) - if err != nil { - return 0, errors.Wrap(err, "failed to parse message out event") - } - - receiptHash, _, err := genReceiptHash(log.Addr, log.Topic, messageOut) - if err != nil { - return 0, errors.Wrap(err, "gen receipt failed") - } - m.Log.Info("Ton2Evm oracle generate receipt hash", "receiptHash", receiptHash, "srcHash", log.TxHash) - - ret, err := chain.MulSignInfo(0, uint64(m.Cfg.MapChainID)) - if err != nil { - return 0, errors.Wrap(err, "mul sign failed") - } - - bn := big.NewInt(log.BlockNumber) - input, err := mapprotocol.PackAbi.Methods[mapprotocol.MethodOfSolidityPack].Inputs.Pack(receiptHash, ret.Version, bn, big.NewInt(int64(m.Cfg.Id))) - if err != nil { - return 0, errors.Wrap(err, "oracle pack input failed") - } - - message := msg.NewProposal(m.Cfg.Id, m.Cfg.MapChainID, []interface{}{input, &receiptHash, bn}, m.MsgCh) - err = m.Router.Send(message) - if err != nil { - m.Log.Error("subscription error: failed to route message", "err", err) - return 0, nil - } - - return log.Id, nil -} - -func genReceiptHash(addr, topic string, messageOut *MessageOutEvent) (common.Hash, []byte, error) { - - data, err := encodeMessageOutEvent(messageOut) - if err != nil { - return common.Hash{}, nil, errors.Wrap(err, "failed to encode message out event") - } - - parseAddr, err := address.ParseAddr(addr) - if err != nil { - return common.Hash{}, nil, errors.Wrap(err, "failed to parse address") - } - - packedProof, err := encodeProof(convertToBytes(parseAddr), common.Hex2Bytes(topic), data) - if err != nil { - return common.Hash{}, nil, errors.Wrap(err, "failed to encode proof") - } - - receiptHash := common.BytesToHash(crypto.Keccak256(packedProof)) - return receiptHash, packedProof, nil -} - -func getSigner(blockNumber int64, receiptHash common.Hash, selfId, toChainID uint64) (*chain.ProposalInfoResp, error) { - bn := big.NewInt(blockNumber) - ret, err := chain.MulSignInfo(0, toChainID) - if err != nil { - return nil, err - } - - piRet, err := chain.ProposalInfo(0, selfId, toChainID, bn, receiptHash, ret.Version) - if err != nil { - return nil, err - } - if !piRet.CanVerify { - return nil, chain.NotVerifyAble - } - - return piRet, nil -} - -func match(target string, contracts []string) int { - for idx, ele := range contracts { - if strings.ToLower(ele) == strings.ToLower(target) { - return idx - } - } - return -1 -} - -func Base64ToHex(base64Str string) (string, error) { - decodedBytes, err := base64.StdEncoding.DecodeString(base64Str) - if err != nil { - return "", err - } - return hex.EncodeToString(decodedBytes), nil -} diff --git a/chains/ton/writer.go b/chains/ton/writer.go deleted file mode 100644 index 584ab78e..00000000 --- a/chains/ton/writer.go +++ /dev/null @@ -1,191 +0,0 @@ -package ton - -import ( - "context" - "encoding/hex" - "encoding/json" - "fmt" - "github.com/ethereum/go-ethereum/core/types" - "github.com/mapprotocol/compass/internal/mapprotocol" - "github.com/mapprotocol/compass/pkg/msg" - "github.com/mapprotocol/compass/pkg/util" - "math/big" - "time" - - "github.com/ChainSafe/log15" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" - "github.com/lbtsm/gotron-sdk/pkg/keystore" - "github.com/xssnick/tonutils-go/address" - "github.com/xssnick/tonutils-go/tlb" - "github.com/xssnick/tonutils-go/ton/wallet" - - "github.com/mapprotocol/compass/internal/chain" - "github.com/mapprotocol/compass/internal/constant" -) - -type Writer struct { - cfg *Config - log log15.Logger - conn *Connection - stop <-chan int - sysErr chan<- error - pass []byte - ks *keystore.KeyStore - acc *keystore.Account - isRent bool -} - -func newWriter(conn *Connection, cfg *Config, log log15.Logger, stop <-chan int, sysErr chan<- error) *Writer { - return &Writer{ - cfg: cfg, - conn: conn, - log: log, - stop: stop, - sysErr: sysErr, - } -} - -func (w *Writer) ResolveMessage(m msg.Message) bool { - w.log.Info("Attempting to resolve message", "type", m.Type, "src", m.Source, "dst", m.Destination) - switch m.Type { - case msg.SwapWithMapProof: - return w.exeMcs(m) - default: - w.log.Error("Unknown message type received", "type", m.Type) - return false - } -} - -func (w *Writer) exeMcs(m msg.Message) bool { - - var ( - externalError error - errorCount int64 - ) - for { - select { - case <-w.stop: - return false - default: - log := m.Payload[0].(*types.Log) - - if errorCount >= 10 { - w.mosAlarm(log.TxHash, externalError) - errorCount = 0 - } - - ret, err := chain.MulSignInfo(0, uint64(w.cfg.MapChainID)) - if err != nil { - errorCount++ - externalError = err - w.log.Error("failed to get mul sign info", "error", err) - time.Sleep(constant.TxRetryInterval) - continue - } - - receiptHash, err := chain.GenLogReceipt(log) - if err != nil { - errorCount++ - externalError = err - w.log.Error("failed to gen log receipt", "error", err) - time.Sleep(constant.TxRetryInterval) - continue - } - - packed, err := mapprotocol.PackAbi.Methods[mapprotocol.MethodOfSolidityPack].Inputs.Pack(receiptHash, ret.Version, new(big.Int).SetUint64(log.BlockNumber), big.NewInt(int64(w.cfg.MapChainID))) - if err != nil { - errorCount++ - externalError = err - w.log.Error("failed to pack soliditypack input", "error", err) - time.Sleep(constant.TxRetryInterval) - continue - } - - hash := crypto.Keccak256(packed) - sign, err := chain.PersonalSign(string(hash), w.conn.Keypair().PrivateKey) - if err != nil { - errorCount++ - externalError = err - w.log.Error("failed to personal sign", "error", err.Error()) - time.Sleep(constant.TxRetryInterval) - continue - } - signs := []*Signature{ - { - V: new(big.Int).SetBytes([]byte{sign[64]}).Uint64(), - R: new(big.Int).SetBytes(sign[0:32]), - S: new(big.Int).SetBytes(sign[32:64]), - }, - } - - dstAddr, err := address.ParseAddr(w.cfg.McsContract[m.Idx]) - if err != nil { - errorCount++ - externalError = err - w.log.Error("failed to parse ton address", "address", w.cfg.McsContract[m.Idx], "error", err.Error()) - time.Sleep(constant.TxRetryInterval) - continue - } - // todo remove debug log - marshal, _ := json.Marshal(signs) - fmt.Println("hash: ", common.Bytes2Hex(hash)) - fmt.Println("expectedAddress: ", w.conn.Keypair().Address) - fmt.Println("signs: ", string(marshal)) - fmt.Println("receiptRoot: ", *receiptHash) - fmt.Println("version: ", common.BytesToHash(ret.Version[:])) - fmt.Println("blockNum: ", log.BlockNumber) - fmt.Println("chainId: ", int64(m.Source)) - fmt.Println("addr: ", log.Address) - fmt.Println("topics: ", log.Topics) - fmt.Println("message: ", common.Bytes2Hex(log.Data)) - fmt.Println("mcs address: ", w.cfg.McsContract) - - cell, err := GenerateMessageInCell(common.BytesToHash(hash), w.conn.Keypair().Address, signs, *receiptHash, common.BytesToHash(ret.Version[:]), int64(log.BlockNumber), int64(m.Source), log.Address, log.Topics, log.Data) - if err != nil { - errorCount++ - externalError = err - w.log.Error("failed to generate message in cell", "error", err.Error()) - time.Sleep(constant.TxRetryInterval) - continue - } - - // todo remove debug log - data, _ := cell.MarshalJSON() - fmt.Println("generated message in cell: ", string(data)) - - message := &wallet.Message{ - Mode: wallet.PayGasSeparately, // pay fees separately (from balance, not from amount) - InternalMessage: &tlb.InternalMessage{ - Bounce: true, // return amount in case of processing error - DstAddr: dstAddr, - Amount: tlb.MustFromTON("0.1"), - Body: cell, - }, - } - //err = w.conn.wallet.Send(context.Background(), message, false) - tx, _, err := w.conn.wallet.SendWaitTransaction(context.Background(), message) - if err == nil { - w.log.Info("successful send transaction to ton", "src", m.Source, "srcHash", log.TxHash, "dst", m.Destination, "txHash", hex.EncodeToString(tx.Hash)) - m.DoneCh <- struct{}{} - return true - } else { - errorCount++ - externalError = err - data, _ := cell.MarshalJSON() - w.log.Error("failed to send transaction to ton", "src", m.Source, "srcHash", log.TxHash, "dst", m.Destination, "dstAddr", dstAddr, "body", string(data), "error", err) - } - - //errorCount++ - //if errorCount >= 10 { - // w.mosAlarm(log.TxHash, err) - // errorCount = 0 - //} - time.Sleep(constant.TxRetryInterval) - } - } -} - -func (w *Writer) mosAlarm(tx interface{}, err error) { - util.Alarm(context.Background(), fmt.Sprintf("mos map2ton failed, srcHash=%v err is %s", tx, err.Error())) -} diff --git a/chains/tron/chain.go b/chains/tron/chain.go deleted file mode 100644 index 255bf8ed..00000000 --- a/chains/tron/chain.go +++ /dev/null @@ -1,210 +0,0 @@ -package tron - -import ( - "fmt" - "github.com/mapprotocol/compass/internal/mapprotocol" - "github.com/mapprotocol/compass/pkg/keystore" - "github.com/mapprotocol/compass/pkg/msg" - "math/big" - "strconv" - gosync "sync" - - "github.com/ChainSafe/log15" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/log" - connection "github.com/mapprotocol/compass/connections/ethereum" - "github.com/mapprotocol/compass/core" - "github.com/mapprotocol/compass/internal/chain" - "github.com/mapprotocol/compass/internal/constant" - "github.com/mapprotocol/compass/internal/proof" - "github.com/mapprotocol/compass/internal/tx" - "github.com/mapprotocol/compass/pkg/abi" - "github.com/mapprotocol/compass/pkg/contract" - "github.com/mapprotocol/compass/pkg/ethclient" - "github.com/pkg/errors" -) - -type Chain struct { - cfg *core.ChainConfig - conn core.Connection - writer *Writer - stop chan<- int - listen core.Listener -} - -func New() *Chain { - return &Chain{} -} - -func (c *Chain) New(chainCfg *core.ChainConfig, logger log15.Logger, sysErr chan<- error, role mapprotocol.Role) (core.Chain, error) { - return c.createChain(chainCfg, logger, sysErr, role) -} - -func (c *Chain) createChain(chainCfg *core.ChainConfig, logger log15.Logger, sysErr chan<- error, role mapprotocol.Role, opts ...chain.SyncOpt) (core.Chain, error) { - config, err := parseCfg(chainCfg) - if err != nil { - return nil, err - } - - conn := NewConnection(config.Endpoint, logger) - err = conn.Connect() - if err != nil { - return nil, err - } - - ethConn := connection.NewConnection(config.Eth2Endpoint, true, nil, logger, config.GasLimit, config.MaxGasPrice, 0) - err = ethConn.Connect() - if err != nil { - return nil, err - } - - pswd := keystore.GetPassword(fmt.Sprintf("Enter password for key %s:", chainCfg.From)) - - var ( - stop = make(chan int) - listen core.Listener - ) - bs, err := chain.SetupBlockStore(&config.Config, role) - if err != nil { - return nil, err - } - cs := chain.NewCommonSync(ethConn, &config.Config, logger, stop, sysErr, bs) - - switch role { - case mapprotocol.RoleOfMessenger: - handler := messenger - if config.Filter { - handler = filterMos - } - listen = newSync(cs, handler, conn) - case mapprotocol.RoleOfOracle: - oAbi, _ := abi.New(mapprotocol.SignerJson) - oracleCall := contract.New(ethConn, []common.Address{config.OracleNode}, oAbi) - mapprotocol.SingMapping[config.Id] = oracleCall - - otherAbi, _ := abi.New(mapprotocol.OtherAbi) - call := contract.New(conn, []common.Address{common.HexToAddress(config.LightNode)}, otherAbi) - mapprotocol.LightNodeMapping[config.Id] = call - handler := oracle - if config.Filter { - handler = filterOracle - } - listen = newSync(cs, handler, conn) - } - - return &Chain{ - conn: conn, - stop: stop, - listen: listen, - cfg: chainCfg, - writer: newWriter(conn, config, logger, stop, sysErr, pswd), - }, nil -} - -func (c *Chain) SetRouter(r core.Router) { - r.Listen(c.cfg.Id, c.writer) - c.listen.SetRouter(r) -} - -func (c *Chain) Start() error { - err := c.listen.Sync() - if err != nil { - return err - } - - log.Debug("Successfully started Chain") - return nil -} - -func (c *Chain) Id() msg.ChainId { - return c.cfg.Id -} - -func (c *Chain) Name() string { - return c.cfg.Name -} - -// Stop signals to any running routines to exit -func (c *Chain) Stop() { - close(c.stop) - if c.conn != nil { - c.conn.Close() - } -} - -// Conn return Connection interface for relayer register -func (c *Chain) Conn() core.Connection { - return c.conn -} - -func (c *Chain) Connect(id, endpoint, mcs, lightNode, oracleNode string) (*ethclient.Client, error) { - conn := connection.NewConnection(endpoint, true, nil, nil, big.NewInt(chain.DefaultGasLimit), - big.NewInt(chain.DefaultGasPrice), chain.DefaultGasMultiplier) - err := conn.Connect() - if err != nil { - return nil, err - } - - fn := gosync.OnceFunc(func() { - idInt, _ := strconv.ParseUint(id, 10, 64) - oracleAbi, _ := abi.New(mapprotocol.OracleAbiJson) - call := contract.New(conn, []common.Address{common.HexToAddress(mcs)}, oracleAbi) - mapprotocol.ContractMapping[msg.ChainId(idInt)] = call - - oAbi, _ := abi.New(mapprotocol.SignerJson) - oracleCall := contract.New(conn, []common.Address{common.HexToAddress(oracleNode)}, oAbi) - mapprotocol.SingMapping[msg.ChainId(idInt)] = oracleCall - - fn := mapprotocol.Map2EthHeight(constant.ZeroAddress.Hex(), common.HexToAddress(lightNode), conn.Client()) - mapprotocol.Map2OtherHeight[msg.ChainId(idInt)] = fn - }) - fn() - - return conn.Client(), nil -} - -func (c *Chain) Proof(client *ethclient.Client, l *types.Log, endpoint string, proofType int64, selfId, - toChainID uint64, sign [][]byte) ([]byte, error) { - orderId := l.Topics[1] - var ( - bn = big.NewInt(0).SetUint64(l.BlockNumber) - receipts []*types.Receipt - key = strconv.FormatUint(selfId, 10) + "_" + strconv.FormatUint(l.BlockNumber, 10) - ) - var orderId32 [32]byte - for i, v := range orderId { - orderId32[i] = v - } - if v, ok := proof.CacheReceipt.Get(key); ok { - receipts = v.([]*types.Receipt) - } else { - txsHash, err := getTxsByBN(client, bn) - if err != nil { - return nil, fmt.Errorf("unable to get tx hashes Logs: %w", err) - } - receipts, err = tx.GetReceiptsByTxsHash(client, txsHash) - if err != nil { - return nil, fmt.Errorf("unable to get receipts hashes Logs: %w", err) - } - proof.CacheReceipt.Add(key, receipts) - } - - method := chain.GetMethod(l.Topics[0]) - proofType, err := chain.PreSendTx(0, selfId, toChainID, bn, orderId.Bytes()) - if err != nil { - return nil, err - } - - tmp := l - input, err := assembleProof(tmp, receipts, method, msg.ChainId(selfId), msg.ChainId(toChainID), proofType, orderId32) - if err != nil { - return nil, err - } - - return input, nil -} - -func (c *Chain) Maintainer(client *ethclient.Client, selfId, toChainId uint64, srcEndpoint string) ([]byte, error) { - return nil, errors.New("tron not support maintainer") -} diff --git a/chains/tron/config.go b/chains/tron/config.go deleted file mode 100644 index f23cd151..00000000 --- a/chains/tron/config.go +++ /dev/null @@ -1,71 +0,0 @@ -package tron - -import ( - "fmt" - "github.com/ethereum/go-ethereum/common" - "strconv" - "strings" - - "github.com/mapprotocol/compass/core" - "github.com/mapprotocol/compass/internal/chain" -) - -type Config struct { - chain.Config - LightNode, RentNode, FeeKey, FeeType, EnergySupply string - EthFrom common.Address - McsContract []string - Rent bool -} - -func parseCfg(chainCfg *core.ChainConfig) (*Config, error) { - cfg, err := chain.ParseConfig(chainCfg) - if err != nil { - return nil, err - } - ret := Config{ - Config: *cfg, - LightNode: "", - McsContract: nil, - } - - if ele, ok := chainCfg.Opts[chain.LightNode]; ok && ele != "" { - ret.LightNode = ele - } - if ele, ok := chainCfg.Opts[chain.McsOpt]; ok && ele != "" { - for _, addr := range strings.Split(ele, ",") { - ret.McsContract = append(ret.McsContract, addr) - } - } - - if ele, ok := chainCfg.Opts[chain.RentNode]; ok && ele != "" { - ret.RentNode = ele - } - if ele, ok := chainCfg.Opts[chain.EthFrom]; ok && ele != "" { - ret.EthFrom = common.HexToAddress(ele) - } - if ele, ok := chainCfg.Opts[chain.FeeKey]; ok && ele != "" { - ret.FeeKey = ele - } - if ele, ok := chainCfg.Opts[chain.FeeType]; ok && ele != "" { - ret.FeeType = ele - } - if ele, ok := chainCfg.Opts[chain.EnergySupply]; ok && ele != "" { - ret.EnergySupply = ele - } - if ele, ok := chainCfg.Opts[chain.Rent]; ok && ele != "" { - rent, err := strconv.ParseBool(ele) - if err != nil { - return nil, fmt.Errorf("invalid Rent option") - } - ret.Rent = rent - } - - if contract, ok := chainCfg.Opts[chain.TronMcsOpt]; ok && contract != "" { - ret.Config.McsContract = make([]common.Address, 0) - for _, addr := range strings.Split(contract, ",") { - ret.Config.McsContract = append(ret.Config.McsContract, common.HexToAddress(addr)) - } - } - return &ret, nil -} diff --git a/chains/tron/conn.go b/chains/tron/conn.go deleted file mode 100644 index d87db527..00000000 --- a/chains/tron/conn.go +++ /dev/null @@ -1,98 +0,0 @@ -package tron - -import ( - "math/big" - "time" - - "github.com/ethereum/go-ethereum/accounts/keystore" - "github.com/mapprotocol/compass/internal/constant" - "google.golang.org/grpc" - - "github.com/ChainSafe/log15" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - ethcommon "github.com/ethereum/go-ethereum/common" - "github.com/lbtsm/gotron-sdk/pkg/client" - "github.com/mapprotocol/compass/pkg/ethclient" -) - -type Connection struct { - endpoint string - cli *client.GrpcClient - log log15.Logger - stop chan int - reqTime, cacheBlockNumber int64 -} - -func NewConnection(endpoint string, log log15.Logger) *Connection { - return &Connection{ - endpoint: endpoint, - log: log, - stop: make(chan int), - } -} - -// Connect starts the ethereum WS connection -func (c *Connection) Connect() error { - c.cli = client.NewGrpcClient(c.endpoint) - err := c.cli.Start(grpc.WithInsecure()) - if err != nil { - return err - } - return nil -} - -func (c *Connection) Keypair() *keystore.Key { - return nil -} - -func (c *Connection) Client() *ethclient.Client { - return nil -} - -func (c *Connection) Opts() *bind.TransactOpts { - return nil -} - -func (c *Connection) CallOpts() *bind.CallOpts { - return nil -} - -func (c *Connection) UnlockOpts() { -} - -func (c *Connection) LockAndUpdateOpts(needNewNonce bool) error { - return nil -} - -// LatestBlock returns the latest block from the current chain -func (c *Connection) LatestBlock() (*big.Int, error) { - // 1s req - if time.Now().Unix()-c.reqTime < constant.ReqInterval { - return big.NewInt(0).SetInt64(c.cacheBlockNumber), nil - } - - bnum, err := c.cli.GetNowBlock() - if err != nil { - return nil, err - } - c.cacheBlockNumber = bnum.GetBlockHeader().GetRawData().Number - c.reqTime = time.Now().Unix() - - return big.NewInt(0).SetInt64(bnum.GetBlockHeader().GetRawData().Number), nil -} - -// EnsureHasBytecode asserts if contract code exists at the specified address -func (c *Connection) EnsureHasBytecode(addr ethcommon.Address) error { - return nil -} - -func (c *Connection) WaitForBlock(targetBlock *big.Int, delay *big.Int) error { - return nil -} - -func (c *Connection) Close() { - if c.cli != nil { - _ = c.cli.Conn.Close() - } - close(c.stop) -} diff --git a/chains/tron/feee.go b/chains/tron/feee.go deleted file mode 100644 index 30aea6a9..00000000 --- a/chains/tron/feee.go +++ /dev/null @@ -1,138 +0,0 @@ -package tron - -import ( - "bytes" - "encoding/json" - "fmt" - "io" - "net/http" -) - -func GetOrderPrice(key string, resourceValue, rentDuration int64) (*GetOrderPriceResp, error) { - url := fmt.Sprintf("https://feee.io/open/v2/order/price?resource_value=%d&rent_duration=%d&rent_time_unit=d", resourceValue, rentDuration) - fmt.Println("GetOrderPrice url is", url) - method := "GET" - - client := &http.Client{} - req, err := http.NewRequest(method, url, nil) - - if err != nil { - return nil, err - } - req.Header.Add("key", key) - req.Header.Add("User-Agent", "Feee.io Client/1.0.0 (https://feee.io)") - - res, err := client.Do(req) - if err != nil { - return nil, err - } - defer res.Body.Close() - - body, err := io.ReadAll(res.Body) - if err != nil { - return nil, err - } - fmt.Println("GetOrderPrice back", string(body)) - ret := GetOrderPriceResp{} - err = json.Unmarshal(body, &ret) - if err != nil { - return nil, err - } - return &ret, nil -} - -func OrderSubmit(key, addr string, resValue, rentDuration int64) (*OrderResp, error) { - url := "https://feee.io/open/v2/order/submit" - method := "POST" - - data := map[string]interface{}{ - "resource_type": 1, - "receive_address": addr, - "resource_value": resValue, - "rent_duration": rentDuration, - "rent_time_unit": "d", - } - by, _ := json.Marshal(data) - - client := &http.Client{} - req, err := http.NewRequest(method, url, bytes.NewReader(by)) - - if err != nil { - return nil, err - } - req.Header.Add("key", key) - req.Header.Add("User-Agent", "Feee.io Client/1.0.0 (https://feee.io)") - req.Header.Add("Content-Type", "application/json") - - res, err := client.Do(req) - if err != nil { - return nil, err - } - defer res.Body.Close() - - body, err := io.ReadAll(res.Body) - if err != nil { - return nil, err - } - fmt.Println("OrderSubmit back", string(body)) - ret := OrderResp{} - err = json.Unmarshal(body, &ret) - if err != nil { - return nil, err - } - return &ret, nil -} - -type GetOrderPriceResp struct { - Code int `json:"code"` - Msg string `json:"msg"` - RequestID string `json:"request_id"` - Data struct { - ResourceValue int `json:"resource_value"` - PayAmount float64 `json:"pay_amount"` - RentDuration int `json:"rent_duration"` - RentTimeUnit string `json:"rent_time_unit"` - PriceInSun int `json:"price_in_sun"` - } `json:"data"` -} - -type OrderResp struct { - Code int `json:"code"` - Msg string `json:"msg"` - RequestID string `json:"request_id"` - Data struct { - OrderNo string `json:"order_no"` - OrderType int `json:"order_type"` - ResourceType int `json:"resource_type"` - ReceiveAddress string `json:"receive_address"` - PriceInSun int `json:"price_in_sun"` - MinAmount int `json:"min_amount"` - MinPayout int `json:"min_payout"` - MinFreeze int `json:"min_freeze"` - MaxAmount int `json:"max_amount"` - MaxPayout float64 `json:"max_payout"` - MaxFreeze int `json:"max_freeze"` - FreezeTime int `json:"freeze_time"` - UnfreezeTime int `json:"unfreeze_time"` - ExpireTime int `json:"expire_time"` - CreateTime int `json:"create_time"` - ResourceValue int `json:"resource_value"` - ResourceSplitValue int `json:"resource_split_value"` - FrozenResourceValue int `json:"frozen_resource_value"` - RentDuration int `json:"rent_duration"` - RentTimeUnit string `json:"rent_time_unit"` - RentExpireTime int `json:"rent_expire_time"` - FrozenBalance int `json:"frozen_balance"` - FrozenTxID string `json:"frozen_tx_id"` - UnfreezeTxID string `json:"unfreeze_tx_id"` - SettleAmount float64 `json:"settle_amount"` - SettleAddress string `json:"settle_address"` - SettleTime int `json:"settle_time"` - PayTime int `json:"pay_time"` - PayAmount float64 `json:"pay_amount"` - RefundAmount int `json:"refund_amount"` - RefundTime int `json:"refund_time"` - IsSplit int `json:"is_split"` - Status int `json:"status"` - } `json:"data"` -} diff --git a/chains/tron/proof.go b/chains/tron/proof.go deleted file mode 100644 index 87a6d1fd..00000000 --- a/chains/tron/proof.go +++ /dev/null @@ -1,83 +0,0 @@ -package tron - -import ( - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/ethdb/memorydb" - "github.com/ethereum/go-ethereum/trie" - maptypes "github.com/mapprotocol/atlas/core/types" - "github.com/mapprotocol/compass/internal/mapprotocol" - "github.com/mapprotocol/compass/pkg/msg" - "math/big" - - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/rlp" - "github.com/mapprotocol/compass/internal/constant" - "github.com/mapprotocol/compass/internal/proof" - "github.com/mapprotocol/compass/pkg/util" -) - -func assembleProof(log *types.Log, receipts []*types.Receipt, method string, fId, toChainId msg.ChainId, - proofType int64, orderId [32]byte) ([]byte, error) { - receipt, err := mapprotocol.GetTxReceipt(receipts[log.TxIndex]) - if err != nil { - return nil, err - } - prf, err := proof.Get(types.Receipts(receipts), log.TxIndex) - if err != nil { - return nil, err - } - - var key, ret []byte - key = rlp.AppendUint64(key[:0], uint64(log.TxIndex)) - idx := 0 - for i, ele := range receipts[log.TxIndex].Logs { - if ele.Index != log.Index { - continue - } - idx = i - } - - switch proofType { - case constant.ProofTypeOfOracle: - nr := mapprotocol.MapTxReceipt{ - PostStateOrStatus: receipt.PostStateOrStatus, - CumulativeGasUsed: receipt.CumulativeGasUsed, - Bloom: receipt.Bloom, - Logs: receipt.Logs, - } - nrRlp, err := rlp.EncodeToBytes(nr) - if err != nil { - return nil, err - } - pd := proof.NewData{ - BlockNum: big.NewInt(int64(log.BlockNumber)), - ReceiptProof: proof.NewReceiptProof{ - ReceiptType: receipt.ReceiptType, - TxReceipt: nrRlp, - KeyIndex: util.Key2Hex(key, len(prf)), - Proof: prf, - }, - } - ret, err = proof.Pack(fId, method, mapprotocol.ProofAbi, pd) - case constant.ProofTypeOfNewOracle: - fallthrough - case constant.ProofTypeOfLogOracle: - tr, _ := trie.New(common.Hash{}, trie.NewDatabase(memorydb.New())) - tr = proof.DeriveTire(types.Receipts(receipts), tr) - signerRet, err := getSigner(log, tr.Hash(), uint64(fId), uint64(toChainId)) - if err != nil { - return nil, err - } - ret, err = proof.SignOracle(&maptypes.Header{ - ReceiptHash: tr.Hash(), - Number: big.NewInt(int64(log.BlockNumber)), - }, receipt, key, prf, fId, idx, method, signerRet.Signatures, orderId, log, proofType) - default: - panic("not support") - } - - if err != nil { - return nil, err - } - return ret, nil -} diff --git a/chains/tron/sync.go b/chains/tron/sync.go deleted file mode 100644 index 2760234d..00000000 --- a/chains/tron/sync.go +++ /dev/null @@ -1,493 +0,0 @@ -package tron - -import ( - "context" - "encoding/json" - "fmt" - "github.com/mapprotocol/compass/internal/mapprotocol" - "github.com/mapprotocol/compass/pkg/msg" - "math/big" - "strconv" - "strings" - "time" - - "github.com/ChainSafe/log15" - eth "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/ethdb/memorydb" - "github.com/ethereum/go-ethereum/trie" - "github.com/mapprotocol/compass/core" - "github.com/mapprotocol/compass/internal/chain" - "github.com/mapprotocol/compass/internal/constant" - "github.com/mapprotocol/compass/internal/proof" - "github.com/mapprotocol/compass/internal/stream" - "github.com/mapprotocol/compass/internal/tx" - "github.com/mapprotocol/compass/pkg/ethclient" - "github.com/mapprotocol/compass/pkg/util" - "github.com/pkg/errors" -) - -type Maintainer struct { - Log log15.Logger -} - -func NewMaintainer(log log15.Logger) *Maintainer { - return &Maintainer{Log: log} -} - -func (m *Maintainer) Sync() error { - m.Log.Debug("Starting listener...") - go func() { - time.Sleep(time.Hour * 2400) - }() - - return nil -} - -func (m *Maintainer) SetRouter(r core.Router) { - -} - -type Handler func(*sync, *big.Int) (int, error) - -type sync struct { - *chain.CommonSync - handler Handler - conn core.Connection -} - -func newSync(cs *chain.CommonSync, handler Handler, conn core.Connection) *sync { - return &sync{CommonSync: cs, handler: handler, conn: conn} -} - -func (m *sync) Sync() error { - m.Log.Info("Starting listener...") - if !m.Cfg.SyncToMap { - time.Sleep(time.Hour * 2400) - return nil - } - go func() { - err := m.sync() - if err != nil { - m.Log.Error("Polling blocks failed", "err", err) - panic(err) - } - }() - return nil -} - -func (m *sync) sync() error { - if m.Cfg.Filter { - err := m.filter() - if err != nil { - m.Log.Error("Polling blocks failed", "err", err) - return err - } - return nil - } - - var currentBlock = m.Cfg.StartBlock - for { - select { - case <-m.Stop: - return errors.New("polling terminated") - default: - latestBlock, err := m.conn.LatestBlock() - if err != nil { - m.Log.Error("Unable to get latest block", "err", err) - time.Sleep(constant.QueryRetryInterval) - continue - } - - if big.NewInt(0).Sub(latestBlock, currentBlock).Cmp(m.BlockConfirmations) == -1 { - m.Log.Debug("Block not ready, will retry", "currentBlock", currentBlock, "latest", latestBlock) - time.Sleep(constant.BlockRetryInterval) - continue - } - - count, err := m.handler(m, currentBlock) - if err != nil { - m.Log.Error("Failed to get events for block", "block", currentBlock, "err", err) - time.Sleep(constant.BlockRetryInterval) - util.Alarm(context.Background(), fmt.Sprintf("mos failed, chain=%s, err is %s", m.Cfg.Name, err.Error())) - continue - } - - _ = m.WaitUntilMsgHandled(count) - - err = m.BlockStore.StoreBlock(currentBlock) - if err != nil { - m.Log.Error("Failed to write latest block to blockstore", "block", currentBlock, "err", err) - } - - currentBlock.Add(currentBlock, big.NewInt(1)) - if latestBlock.Int64()-currentBlock.Int64() <= m.Cfg.BlockConfirmations.Int64() { - time.Sleep(constant.MessengerInterval) - } - } - } -} - -func (m *sync) filter() error { - for { - select { - case <-m.Stop: - return errors.New("polling terminated") - default: - latestBlock, err := m.FilterLatestBlock() - if err != nil { - m.Log.Error("Unable to get latest block", "err", err) - time.Sleep(constant.QueryRetryInterval) - continue - } - - count, err := m.handler(m, latestBlock) - if m.Cfg.SkipError && errors.Is(err, chain.NotVerifyAble) { - m.Log.Info("Block not verify, will ignore", "startBlock", m.Cfg.StartBlock) - m.Cfg.StartBlock = m.Cfg.StartBlock.Add(m.Cfg.StartBlock, big.NewInt(1)) - err = m.BlockStore.StoreBlock(m.Cfg.StartBlock) - continue - } - if err != nil { - m.Log.Error("Filter Failed to get events for block", "err", err) - if errors.Is(err, chain.NotVerifyAble) { - time.Sleep(constant.BlockRetryInterval) - continue - } - util.Alarm(context.Background(), fmt.Sprintf("filter mos failed, chain=%s, err is %s", m.Cfg.Name, err.Error())) - time.Sleep(constant.BlockRetryInterval) - continue - } - - _ = m.WaitUntilMsgHandled(count) - err = m.BlockStore.StoreBlock(m.Cfg.StartBlock) - if err != nil { - m.Log.Error("Filter Failed to write latest block to blockStore", "err", err) - } - - time.Sleep(constant.MessengerInterval) - } - } -} - -func filterMos(m *sync, latestBlock *big.Int) (int, error) { - count := 0 - topic := "" - for idx, ele := range m.Cfg.Events { - topic += ele.GetTopic().Hex() - if idx != len(m.Cfg.Events)-1 { - topic += "," - } - } - data, err := chain.Request(fmt.Sprintf("%s/%s?%s", m.Cfg.FilterHost, constant.FilterUrl, - fmt.Sprintf("id=%d&project_id=%d&chain_id=%d&topic=%s&limit=1", - m.Cfg.StartBlock.Int64(), constant.ProjectOfMsger, m.Cfg.Id, topic))) - if err != nil { - return 0, err - } - listData, err := json.Marshal(data) - if err != nil { - return 0, errors.Wrap(err, "marshal resp.Data failed") - } - back := stream.MosListResp{} - err = json.Unmarshal(listData, &back) - if err != nil { - return 0, err - } - if len(back.List) == 0 { - return 0, nil - } - - for _, ele := range back.List { - idx := m.Match(ele.ContractAddress) - if idx == -1 { - m.Log.Info("Filter Log Address Not Match", "id", ele.Id, "address", ele.ContractAddress) - m.Cfg.StartBlock = big.NewInt(ele.Id) - continue - } - if latestBlock.Uint64()-ele.BlockNumber < m.BlockConfirmations.Uint64() { - m.Log.Info("Block not ready, will retry", "currentBlock", ele.BlockNumber, "latest", latestBlock) - continue - } - - split := strings.Split(ele.Topic, ",") - topics := make([]common.Hash, 0, len(split)) - for _, sp := range split { - topics = append(topics, common.HexToHash(sp)) - } - log := &types.Log{ - Address: common.HexToAddress(ele.ContractAddress), - Topics: topics, - Data: common.Hex2Bytes(ele.LogData), - BlockNumber: ele.BlockNumber, - TxHash: common.HexToHash(ele.TxHash), - TxIndex: ele.TxIndex, - BlockHash: common.HexToHash(ele.BlockHash), - Index: ele.LogIndex, - } - send, err := log2Msg(m, log, idx) - if err != nil { - return 0, err - } - count += send - m.Cfg.StartBlock = big.NewInt(ele.Id) - } - - return count, nil -} - -func messenger(m *sync, current *big.Int) (int, error) { - count := 0 - for idx, addr := range m.Cfg.McsContract { - query := m.BuildQuery(addr, m.Cfg.Events[0:0], current, current) - query = eth.FilterQuery{ - FromBlock: current, - ToBlock: current, - } - logs, err := m.Conn.Client().FilterLogs(context.Background(), query) - if err != nil { - return 0, fmt.Errorf("unable to Filter Logs: %w", err) - } - - if len(logs) == 0 { - continue - } - for _, l := range logs { - tmp := l - stage, err := log2Msg(m, &tmp, idx) - if err != nil { - return 0, err - } - count += stage - } - } - - return count, nil -} - -func log2Msg(m *sync, l *types.Log, idx int) (int, error) { - if !existTopic(l.Topics[0], m.Cfg.Events) { - m.Log.Info("ignore log, because topics not match", "blockNumber", l.BlockNumber, "logTopic", l.Topics[0]) - return 0, nil - } - - var ( - orderId32 [32]byte - message msg.Message - orderId = l.Topics[1] - receipts []*types.Receipt - current = big.NewInt(0).SetUint64(l.BlockNumber) - key = strconv.FormatUint(uint64(m.Cfg.Id), 10) + "_" + current.String() - ) - for i, v := range orderId { - orderId32[i] = v - } - if v, ok := proof.CacheReceipt.Get(key); ok { - receipts = v.([]*types.Receipt) - m.Log.Info("use cache receipt", "latestBlock ", current, "txHash", l.TxHash) - } else { - txsHash, err := getTxsByBN(m.Conn.Client(), current) - if err != nil { - return 0, fmt.Errorf("unable to get tx hashes Logs: %w", err) - } - receipts, err = tx.GetReceiptsByTxsHash(m.Conn.Client(), txsHash) - if err != nil { - return 0, fmt.Errorf("unable to get receipts hashes Logs: %w", err) - } - proof.CacheReceipt.Add(key, receipts) - } - - method := m.GetMethod(l.Topics[0]) - m.Log.Info("Event found", "txHash", l.TxHash, "logIdx", l.Index, "orderId", orderId, "cIdx", idx) - proofType, err := chain.PreSendTx(idx, uint64(m.Cfg.Id), uint64(m.Cfg.MapChainID), current, orderId.Bytes()) - if errors.Is(err, chain.OrderExist) { - m.Log.Info("This orderId exist", "txHash", l.TxHash, "orderId", orderId) - return 0, nil - } - if err != nil { - return 0, err - } - - tmp := l - input, err := assembleProof(tmp, receipts, method, m.Cfg.Id, m.Cfg.MapChainID, proofType, orderId32) - if err != nil { - return 0, err - } - message = msg.NewSwapWithProof(m.Cfg.Id, m.Cfg.MapChainID, []interface{}{input, orderId32, l.BlockNumber, l.TxHash}, m.MsgCh) - err = m.Router.Send(message) - if err != nil { - m.Log.Error("subscription error: failed to route message", "err", err) - return 0, nil - } - return 1, nil -} - -func existTopic(target common.Hash, dst []constant.EventSig) bool { - for _, d := range dst { - if target == d.GetTopic() { - return true - } - } - return false -} - -func filterOracle(m *sync, latestBlock *big.Int) (int, error) { - topic := "" - for idx, ele := range m.Cfg.Events { - topic += ele.GetTopic().Hex() - if idx != len(m.Cfg.Events)-1 { - topic += "," - } - } - - tmp := int64(0) - defer func() { - if tmp == 0 { - return - } - if tmp > m.Cfg.StartBlock.Int64() { - m.Cfg.StartBlock = big.NewInt(tmp) - } - }() - - data, err := chain.Request(fmt.Sprintf("%s/%s?%s", m.Cfg.FilterHost, constant.FilterUrl, - fmt.Sprintf("id=%d&project_id=%d&chain_id=%d&topic=%s&limit=1", - m.Cfg.StartBlock.Int64(), constant.ProjectOfOracle, m.Cfg.Id, topic))) - fmt.Println("oracle url ----- ", fmt.Sprintf("%s/%s?%s", m.Cfg.FilterHost, constant.FilterUrl, - fmt.Sprintf("id=%d&project_id=%d&chain_id=%d&topic=%s&limit=1", - m.Cfg.StartBlock.Int64(), constant.ProjectOfOracle, m.Cfg.Id, topic))) - if err != nil { - return 0, err - } - listData, err := json.Marshal(data) - if err != nil { - return 0, errors.Wrap(err, "marshal resp.Data failed") - } - back := stream.MosListResp{} - err = json.Unmarshal(listData, &back) - if err != nil { - return 0, err - } - if len(back.List) == 0 { - return 0, nil - } - - for _, ele := range back.List { - if m.Cfg.OracleNode.Hex() != ele.ContractAddress { - m.Log.Info("Filter Log Address Not Match", "id", ele.Id, "address", ele.ContractAddress) - tmp = ele.Id - continue - } - - split := strings.Split(ele.Topic, ",") - topics := make([]common.Hash, 0, len(split)) - for _, sp := range split { - topics = append(topics, common.HexToHash(sp)) - } - log := types.Log{ - Address: common.HexToAddress(ele.ContractAddress), - Topics: topics, - Data: common.Hex2Bytes(ele.LogData), - BlockNumber: ele.BlockNumber, - TxHash: common.HexToHash(ele.TxHash), - TxIndex: ele.TxIndex, - BlockHash: common.HexToHash(ele.BlockHash), - Index: ele.LogIndex, - } - _, err = log2Oracle(m, &log) - if err != nil { - return 0, err - } - tmp = ele.Id - } - - return 1, nil -} - -func oracle(m *sync, latestBlock *big.Int) (int, error) { - query := m.BuildQuery(m.Cfg.OracleNode, m.Cfg.Events[:1], latestBlock, latestBlock) - logs, err := m.Conn.Client().FilterLogs(context.Background(), query) - if err != nil { - return 0, fmt.Errorf("sync unable to Filter Logs: %w", err) - } - if len(logs) == 0 { - return 0, nil - } - m.Log.Info("Find log", "block", latestBlock, "log", len(logs)) - total := 0 - for _, log := range logs { - ele := log - count, err := log2Oracle(m, &ele) - if err != nil { - return 0, err - } - total += count - } - - return total, nil -} - -func log2Oracle(m *sync, l *types.Log) (int, error) { - latestBlock := big.NewInt(0).SetUint64(l.BlockNumber) - txsHash, err := getTxsByBN(m.Conn.Client(), latestBlock) - if err != nil { - return 0, fmt.Errorf("unable to get tx hashes Logs: %w", err) - } - receipts, err := tx.GetReceiptsByTxsHash(m.Conn.Client(), txsHash) - if err != nil { - return 0, fmt.Errorf("unable to get receipts hashes Logs: %w", err) - } - tr, _ := trie.New(common.Hash{}, trie.NewDatabase(memorydb.New())) - tr = proof.DeriveTire(types.Receipts(receipts), tr) - m.Log.Info("Tron Oracle receipt", "blockNumber", latestBlock, "hash", tr.Hash()) - receiptHash := tr.Hash() - ret, err := chain.MulSignInfo(0, uint64(m.Cfg.MapChainID)) - if err != nil { - return 0, err - } - - input, err := mapprotocol.PackAbi.Methods[mapprotocol.MethodOfSolidityPack].Inputs.Pack(receiptHash, ret.Version, latestBlock, big.NewInt(int64(m.Cfg.Id))) - if err != nil { - return 0, err - } - - message := msg.NewProposal(m.Cfg.Id, m.Cfg.MapChainID, []interface{}{input, &receiptHash, latestBlock}, m.MsgCh) - err = m.Router.Send(message) - if err != nil { - m.Log.Error("Subscription error: failed to route message", "err", err) - return 0, nil - } - return 1, nil -} - -func getTxsByBN(conn *ethclient.Client, number *big.Int) ([]common.Hash, error) { - block, err := conn.TronBlockByNumber(context.Background(), number) - if err != nil { - return nil, err - } - - txs := make([]common.Hash, 0, len(block.Transactions)) - for _, tmp := range block.Transactions { - ele := common.HexToHash(tmp.Hash) - txs = append(txs, ele) - } - return txs, nil -} - -func getSigner(log *types.Log, receiptHash common.Hash, selfId, toChainID uint64) (*chain.ProposalInfoResp, error) { - bn := big.NewInt(int64(log.BlockNumber)) - ret, err := chain.MulSignInfo(0, toChainID) - if err != nil { - return nil, err - } - - piRet, err := chain.ProposalInfo(0, selfId, toChainID, bn, receiptHash, ret.Version) - if err != nil { - return nil, err - } - if !piRet.CanVerify { - return nil, chain.NotVerifyAble - } - return piRet, nil -} diff --git a/chains/tron/writer.go b/chains/tron/writer.go deleted file mode 100644 index 6877addc..00000000 --- a/chains/tron/writer.go +++ /dev/null @@ -1,448 +0,0 @@ -package tron - -import ( - "context" - "encoding/hex" - "fmt" - "github.com/mapprotocol/compass/internal/mapprotocol" - "github.com/mapprotocol/compass/pkg/msg" - "math/big" - "strings" - "time" - - "github.com/lbtsm/gotron-sdk/pkg/proto/api" - - "github.com/lbtsm/gotron-sdk/pkg/store" - - "github.com/pkg/errors" - - "github.com/lbtsm/gotron-sdk/pkg/proto/core" - - "github.com/ChainSafe/log15" - "github.com/ethereum/go-ethereum/common" - "github.com/lbtsm/gotron-sdk/pkg/client/transaction" - "github.com/lbtsm/gotron-sdk/pkg/keystore" - "github.com/mapprotocol/compass/internal/constant" - "github.com/mapprotocol/compass/pkg/util" -) - -var multiple = big.NewInt(420) - -type Writer struct { - cfg *Config - log log15.Logger - conn *Connection - stop <-chan int - sysErr chan<- error - pass []byte - ks *keystore.KeyStore - acc *keystore.Account - isRent bool -} - -func newWriter(conn *Connection, cfg *Config, log log15.Logger, stop <-chan int, sysErr chan<- error, pass []byte) *Writer { - return &Writer{ - cfg: cfg, - conn: conn, - log: log, - stop: stop, - sysErr: sysErr, - pass: pass, - } -} - -func (w *Writer) ResolveMessage(m msg.Message) bool { - w.log.Info("Attempting to resolve message", "type", m.Type, "src", m.Source, "dst", m.Destination) - switch m.Type { - case msg.SyncFromMap: - return w.syncMapToTron(m) - case msg.SwapWithMapProof: - return w.exeMcs(m) - default: - w.log.Error("Unknown message type received", "type", m.Type) - return false - } -} - -func (w *Writer) syncMapToTron(m msg.Message) bool { - var ( - errorCount int64 - ) - for { - select { - case <-w.stop: - return false - default: - input := m.Payload[0].([]byte) - tx, err := w.sendTx(w.cfg.LightNode, mapprotocol.MethodUpdateBlockHeader, input, 0, 1, 0, false) - if err == nil { - w.log.Info("Sync Map Header to tron chain tx execution", "tx", tx, "src", m.Source, "dst", m.Destination) - err = w.txStatus(tx) - if err != nil { - w.log.Warn("TxHash Status is not successful, will retry", "err", err) - } else { - m.DoneCh <- struct{}{} - return true - } - } else if w.cfg.SkipError { - w.log.Warn("Execution failed, ignore this error, Continue to the next ", "err", err) - m.DoneCh <- struct{}{} - return true - } else { - for e := range constant.IgnoreError { - if strings.Index(err.Error(), e) != -1 { - w.log.Info("Ignore This Error, Continue to the next", "id", m.Destination, "err", err) - m.DoneCh <- struct{}{} - return true - } - } - } - errorCount++ - if errorCount >= 10 { - util.Alarm(context.Background(), fmt.Sprintf("map2tron updateHeader failed, err is %s", err.Error())) - errorCount = 0 - } - time.Sleep(constant.BalanceRetryInterval) - } - } -} - -func (w *Writer) exeMcs(m msg.Message) bool { - var errorCount, checkIdCount int64 - addr := w.cfg.McsContract[m.Idx] - orderId32 := m.Payload[1].([32]byte) - var orderId []byte - for _, v := range orderId32 { - orderId = append(orderId, v) - } - exits, err := w.checkOrderId(addr, orderId) - if err != nil { - w.log.Error("check orderId exist failed ", "err", err, "orderId", common.Bytes2Hex(orderId)) - checkIdCount++ - if checkIdCount == 10 { - util.Alarm(context.Background(), fmt.Sprintf("writer mos checkOrderId failed, err is %s", err.Error())) - checkIdCount = 0 - } - } - if exits { - w.log.Info("Mcs orderId has been processed, Skip this request", "orderId", common.Bytes2Hex(orderId)) - m.DoneCh <- struct{}{} - return true - } - - for { - select { - case <-w.stop: - return false - default: - var inputHash interface{} - if len(m.Payload) > 3 { - inputHash = m.Payload[3] - } - method := m.Payload[4].(string) - - contract, err := w.conn.cli.TriggerConstantContractByEstimate(w.cfg.From, addr, m.Payload[0].([]byte), 0) - if err != nil { - w.log.Error("Failed to TriggerConstantContract EstimateEnergy", "err", err) - time.Sleep(time.Second * 10) - continue - } - for _, v := range contract.ConstantResult { - w.log.Info("Contract result", "err", string(v), "v", v) - ele := strings.TrimSpace(string(v)) - internalErr := "0x" + hex.EncodeToString(v) - if ele == "" { - continue - } - for e := range constant.IgnoreError { - if strings.Index(internalErr, e) != -1 { - w.log.Info("Ignore This Error, Continue to the next", "inputHash", inputHash, "err", internalErr) - m.DoneCh <- struct{}{} - return true - } - } - err = errors.New(internalErr) - } - if err != nil { - w.mosAlarm(inputHash, fmt.Errorf("contract result failed, err is %v", err)) - time.Sleep(time.Second * 10) - continue - } - w.log.Info("Trigger Contract result detail", "used", contract.EnergyUsed, "method", method) - - err = w.rentEnergy(contract.EnergyUsed, method) - if err != nil { - w.log.Info("Check energy failed", "srcHash", inputHash, "err", err) - w.mosAlarm(inputHash, errors.Wrap(err, "please admin handler")) - time.Sleep(time.Second * 10) - continue - } - - w.log.Info("Send transaction", "addr", addr, "srcHash", inputHash, "method", method) - mcsTx, err := w.sendTx(addr, method, m.Payload[0].([]byte), 0, int64(w.cfg.GasMultiplier), - 0, false) - if err == nil { - w.log.Info("Submitted cross tx execution", "src", m.Source, "dst", m.Destination, "srcHash", inputHash, "mcsTx", mcsTx) - err = w.txStatus(mcsTx) - if err != nil { - w.log.Warn("TxHash status is not successful, will retry", "err", err) - } else { - w.newReturn(method) - m.DoneCh <- struct{}{} - return true - } - } else if w.cfg.SkipError && errorCount >= 9 { - w.log.Warn("Execution failed, ignore this error, Continue to the next ", "srcHash", inputHash, "err", err) - m.DoneCh <- struct{}{} - return true - } else { - for e := range constant.IgnoreError { - if strings.Index(err.Error(), e) != -1 { - w.log.Info("Ignore This Error, Continue to the next", "id", m.Destination, "err", err) - m.DoneCh <- struct{}{} - return true - } - } - w.log.Warn("Execution failed, will retry", "srcHash", inputHash, "err", err) - } - w.newReturn(method) - errorCount++ - if errorCount >= 10 { - w.mosAlarm(inputHash, err) - errorCount = 0 - } - time.Sleep(constant.TxRetryInterval) - } - } -} - -func (w *Writer) sendTx(addr, method string, input []byte, txAmount, mul, used int64, ignore bool) (string, error) { - // online estimateEnergy - contract, err := w.conn.cli.TriggerConstantContractByEstimate(w.cfg.From, addr, input, txAmount) - if err != nil { - w.log.Error("Failed to TriggerConstantContract EstimateEnergy", "err", err) - return "", err - } - - for _, v := range contract.ConstantResult { - w.log.Info("contract result", "err", string(v), "v", v, "hex", common.Bytes2Hex(v)) - ele := strings.TrimSpace(string(v)) - if ele != "" && ele != "4,^" && ele != "0�" && !ignore { - return "", errors.New(ele) - } - } - - if used == 0 { - used = contract.EnergyUsed - } - - // // testnet - // estimate, err := w.conn.cli.EstimateEnergy(w.cfg.From, addr, input, 0, "", 0) - // if err != nil { - // w.log.Error("Failed to EstimateEnergy", "err", err) - // return "", err - // } - feeLimit := big.NewInt(0).Mul(big.NewInt(used), big.NewInt(420*mul)) - w.log.Info("EstimateEnergy", "estimate", used, "multiple", multiple, "feeLimit", feeLimit, "mul", mul) - - acco, err := w.conn.cli.GetAccountResource(w.cfg.From) - if err != nil { - return "", errors.Wrap(err, "get account failed") - } - final := float64(used) * 1.1 - // 22000 > (40000 - 10000) = false, continue exec - if int64(final) >= (acco.EnergyLimit-acco.EnergyUsed) && method != "rent" && w.cfg.Rent { - w.log.Info("SendTx EstimateEnergy", "err", "txUsed(%d) energy more than acount have(%d)", int64(final), acco.EnergyLimit) - //if estimate.EnergyRequired >= account.EnergyLimit { - return "", fmt.Errorf("txUsed(%d) energy more than acount have(%d)", int64(final), acco.EnergyLimit) - } - - tx, err := w.conn.cli.TriggerContract(w.cfg.From, addr, input, feeLimit.Int64(), txAmount, "", 0) - if err != nil { - w.log.Error("Failed to TriggerContract", "err", err) - return "", err - } - - ks, acc, err := store.UnlockedKeystore(w.cfg.From, string(w.pass)) - if err != nil { - w.log.Error("Failed to UnlockedKeystore", "err", err) - return "", err - } - controller := transaction.NewController(w.conn.cli, ks, acc, tx.Transaction) - if err = controller.ExecuteTransaction(); err != nil { - w.log.Error("Failed to ExecuteTransaction", "err", err) - return "", err - } - if controller.GetResultError() != nil { - return "", fmt.Errorf("contro resultError is %v", controller.GetResultError()) - } - return common.Bytes2Hex(tx.GetTxid()), nil -} - -func (w *Writer) txStatus(txHash string) error { - var count int64 - time.Sleep(time.Second * 2) - for { - id, err := w.conn.cli.GetTransactionInfoByID(txHash) - if err != nil { - w.log.Error("Failed to GetTransactionByID", "err", err) - time.Sleep(constant.QueryRetryInterval) - count++ - if count == 60 { - return err - } - continue - } - if id.Receipt.Result == core.Transaction_Result_SUCCESS { - w.log.Info("Tx receipt status is success", "hash", txHash) - return nil - } - return fmt.Errorf("txHash(%s), status not success, current status is (%s)", txHash, id.Receipt.Result.String()) - } -} - -func (w *Writer) mosAlarm(tx interface{}, err error) { - util.Alarm(context.Background(), fmt.Sprintf("mos map2tron failed, srcHash=%v err is %s", tx, err.Error())) -} - -func (w *Writer) checkOrderId(toAddress string, input []byte) (bool, error) { - param := fmt.Sprintf("[{\"bytes32\":\"%v\"}]", common.Bytes2Hex(input)) - call, err := w.conn.cli.TriggerConstantContract(w.cfg.From, toAddress, "orderList(bytes32)", param) - if err != nil { - return false, fmt.Errorf("call orderList failed, %v", err.Error()) - } - - if len(call.ConstantResult) == 0 { - return false, fmt.Errorf("call orderList result empty") - } - - resp, err := mapprotocol.Mcs.Methods[mapprotocol.MethodOfOrderList].Outputs.Unpack(call.ConstantResult[0]) - if err != nil { - return false, errors.Wrap(err, "output Unpack failed") - } - - var exist bool - err = mapprotocol.Mcs.Methods[mapprotocol.MethodOfOrderList].Outputs.Copy(&exist, resp) - if err != nil { - return false, errors.Wrap(err, "checkOrderId output copy failed") - } - return exist, nil -} - -var ( - wei = big.NewFloat(1000000) -) - -func (w *Writer) rentEnergy(used int64, method string) error { - if !w.cfg.Rent { - w.log.Info("dont need rent energy, cfg is false") - return nil - } - acc, err := w.conn.cli.GetAccountResource(w.cfg.From) - if err != nil { - return err - } - if w.cfg.FeeType == constant.FeeRentType { - return w.feeRentEnergy(used, acc) - } - - account, err := w.conn.cli.GetAccount(w.cfg.From) - if err != nil { - return err - } - balance, _ := big.NewFloat(0).Quo(big.NewFloat(0).SetInt64(account.Balance), wei).Float64() - w.log.Info("Rent energy, account energy detail", "account", w.cfg.From, "all", acc.EnergyLimit, "used", acc.EnergyUsed, - "trx", balance) - - mul := float64(used) * 1.1 - if (acc.EnergyLimit - acc.EnergyUsed) > int64(mul) { - w.log.Info("Rent energy, account have enough energy", "account", w.cfg.From, - "have", acc.EnergyLimit-acc.EnergyUsed, "estimate", mul) - //return nil - } - - if balance < 330 { - return errors.New("account not have enough balance(330 trx)") - } - - input, err := mapprotocol.TronAbi.Pack("rentResource", w.cfg.EthFrom, - big.NewInt(122205000000), big.NewInt(1)) - if err != nil { - return errors.Wrap(err, "pack input failed") - } - w.log.Info("Rent energy will rent") - tx, err := w.sendTx(w.cfg.RentNode, "rent", input, 300000000, 1, 70000, false) - if err != nil { - return errors.Wrap(err, "sendTx failed") - } - w.log.Info("Rent energy success", "tx", tx) - err = w.txStatus(tx) - if err != nil { - w.log.Warn("Rent TxHash Status is not successful, will retry", "err", err) - return err - } - - w.isRent = true - return nil -} - -func (w *Writer) feeRentEnergy(used int64, acc *api.AccountResourceMessage) error { - resValue := int64(1000000) - rentDuration := int64(1) - if acc.EnergyLimit > used { - w.log.Info("FeeRentEnergy dont need rent, because account have enough energy", "have", acc.EnergyLimit, "used", used) - return nil - } - account, err := w.conn.cli.GetAccount(w.cfg.From) - if err != nil { - return err - } - balance, _ := big.NewFloat(0).Quo(big.NewFloat(0).SetInt64(account.Balance), wei).Float64() - res, err := GetOrderPrice(w.cfg.FeeKey, resValue, rentDuration) - if err != nil { - return err - } - if res.Data.PayAmount > balance { - return fmt.Errorf("account not have enough balance(%0.4f trx)", res.Data.PayAmount) - } - ret, err := OrderSubmit(w.cfg.FeeKey, w.cfg.From, resValue, rentDuration) - if err != nil { - return err - } - w.log.Info("FeeRentEnergy rent success", "no", ret.Data.OrderNo) - return nil -} - -func (w *Writer) newReturn(method string) { - if !w.isRent { - w.log.Info("Return energy, is not rent, dont return") - return - } - w.log.Info("Return energy will start") - time.Sleep(constant.BlockRetryInterval) - acc, err := w.conn.cli.GetAccountResource(w.cfg.From) - if err != nil { - w.log.Error("Return energy, GetAccountResource failed", "err", err) - return - } - if acc.EnergyLimit-20004 <= 0 { - w.log.Info("Return energy, user not rent energy", "gas", acc.EnergyLimit) - return - } - input, err := mapprotocol.TronAbi.Pack("returnResource", w.cfg.EthFrom, big.NewInt(122205000000), big.NewInt(1)) - if err != nil { - w.log.Error("Return energy, Pack failed", "err", err) - return - } - tx, err := w.sendTx(w.cfg.RentNode, "return", input, 0, 1, 80000, true) - if err != nil { - w.log.Error("Return energy, sendTx failed", "err", err) - return - } - err = w.txStatus(tx) - if err != nil { - w.log.Warn("Return TxHash Status is not successful, will retry", "err", err) - } - w.log.Info("Return energy success", "tx", tx) - w.isRent = false -} diff --git a/chains/xrp/chain.go b/chains/xrp/chain.go deleted file mode 100644 index 6df29f29..00000000 --- a/chains/xrp/chain.go +++ /dev/null @@ -1,93 +0,0 @@ -package xrp - -import ( - "github.com/ChainSafe/log15" - "github.com/ethereum/go-ethereum/log" - "github.com/mapprotocol/compass/core" - "github.com/mapprotocol/compass/internal/chain" - "github.com/mapprotocol/compass/internal/mapprotocol" - "github.com/mapprotocol/compass/pkg/msg" -) - -type Chain struct { - cfg *core.ChainConfig - conn core.Connection - writer *Writer - stop chan<- int - listen core.Listener -} - -func New() *Chain { - return &Chain{} -} - -func (c *Chain) New(chainCfg *core.ChainConfig, logger log15.Logger, sysErr chan<- error, role mapprotocol.Role) (core.Chain, error) { - return createChain(chainCfg, logger, sysErr, role) -} - -func createChain(chainCfg *core.ChainConfig, logger log15.Logger, sysErr chan<- error, role mapprotocol.Role) (core.Chain, error) { - config, err := parseCfg(chainCfg) - if err != nil { - return nil, err - } - - var ( - stop = make(chan int) - listen core.Listener - ) - bs, err := chain.SetupBlockStore(&config.Config, role) - if err != nil { - return nil, err - } - cs := chain.NewCommonSync(nil, &config.Config, logger, stop, sysErr, bs) - - switch role { - case mapprotocol.RoleOfMessenger: - listen = newSync(cs, handler(mos), config) - case mapprotocol.RoleOfOracle: - listen = newSync(cs, handler(oracle), config) - } - - return &Chain{ - stop: stop, - listen: listen, - cfg: chainCfg, - writer: newWriter(config, logger, stop, sysErr), - }, nil -} - -func (c *Chain) SetRouter(r core.Router) { - r.Listen(c.cfg.Id, c.writer) - c.listen.SetRouter(r) -} - -func (c *Chain) Start() error { - err := c.listen.Sync() - if err != nil { - return err - } - - log.Debug("Successfully started Chain") - return nil -} - -func (c *Chain) Id() msg.ChainId { - return c.cfg.Id -} - -func (c *Chain) Name() string { - return c.cfg.Name -} - -// Stop signals to any running routines to exit -func (c *Chain) Stop() { - close(c.stop) - if c.conn != nil { - c.conn.Close() - } -} - -// Conn return Connection interface for relayer register -func (c *Chain) Conn() core.Connection { - return c.conn -} diff --git a/chains/xrp/config.go b/chains/xrp/config.go deleted file mode 100644 index 0db684f0..00000000 --- a/chains/xrp/config.go +++ /dev/null @@ -1,26 +0,0 @@ -package xrp - -import ( - "github.com/mapprotocol/compass/core" - "github.com/mapprotocol/compass/internal/chain" -) - -type Config struct { - chain.Config - Addr string -} - -func parseCfg(chainCfg *core.ChainConfig) (*Config, error) { - cfg, err := chain.ParseConfig(chainCfg) - if err != nil { - return nil, err - } - ret := Config{ - Config: *cfg, - } - - if ele, ok := chainCfg.Opts[chain.Addr]; ok && ele != "" { - ret.Addr = ele - } - return &ret, nil -} diff --git a/chains/xrp/sync.go b/chains/xrp/sync.go deleted file mode 100644 index 0a70b3bb..00000000 --- a/chains/xrp/sync.go +++ /dev/null @@ -1,273 +0,0 @@ -package xrp - -import ( - "context" - "encoding/json" - "fmt" - "github.com/ethereum/go-ethereum/crypto" - "github.com/mapprotocol/compass/internal/abi" - "github.com/mapprotocol/compass/internal/contract" - "github.com/mapprotocol/compass/internal/mapprotocol" - "github.com/mapprotocol/compass/internal/proof" - "github.com/mapprotocol/compass/internal/stream" - "github.com/mapprotocol/compass/pkg/msg" - "math/big" - "strings" - "time" - - "github.com/ethereum/go-ethereum/common" - "github.com/mapprotocol/compass/internal/chain" - "github.com/mapprotocol/compass/internal/constant" - "github.com/mapprotocol/compass/pkg/util" - "github.com/pkg/errors" -) - -type ( - Handler func(*sync) (int64, error) - LogHandler func(*sync, *stream.GetMosResp) error -) - -type sync struct { - *chain.CommonSync - handler Handler - cfg *Config -} - -func newSync(cs *chain.CommonSync, handler Handler, cfg *Config) *sync { - return &sync{CommonSync: cs, handler: handler, cfg: cfg} -} - -func (m *sync) Sync() error { - m.Log.Info("Starting listener...") - if !m.Cfg.SyncToMap { - time.Sleep(time.Hour * 2400) - return nil - } - - select { - case <-m.Stop: - return errors.New("polling terminated") - default: - for { - id, err := m.handler(m) - if err != nil { - if errors.Is(err, chain.NotVerifyAble) { - time.Sleep(constant.BlockRetryInterval) - continue - } - m.Log.Error("Filter Failed to get events for block", "err", err) - util.Alarm(context.Background(), fmt.Sprintf("handler mos failed, chain=%s, err is %s", m.Cfg.Name, err.Error())) - time.Sleep(constant.BlockRetryInterval) - continue - } - if id == 0 { - time.Sleep(constant.MessengerInterval) - continue - } - - m.Cfg.StartBlock = big.NewInt(id) - _ = m.WaitUntilMsgHandled(1) - err = m.BlockStore.StoreBlock(m.Cfg.StartBlock) - if err != nil { - m.Log.Error("Failed to write latest block to file", "err", err) - } - - time.Sleep(constant.MessengerInterval) - } - } -} - -func handler(lh LogHandler) Handler { - return func(m *sync) (int64, error) { - topic := "" - for idx, ele := range m.cfg.Events { - topic += ele.GetTopic().Hex() - if idx != len(m.cfg.Events)-1 { - topic += "," - } - } - - uri := fmt.Sprintf("%s/%s?%s", m.Cfg.FilterHost, constant.FilterUrl, - fmt.Sprintf("id=%d&chain_id=%d&topic=%s&limit=1", - m.Cfg.StartBlock.Int64(), m.Cfg.Id, topic)) - data, err := chain.Request(uri) - if err != nil { - return 0, err - } - listData, err := json.Marshal(data) - if err != nil { - return 0, errors.Wrap(err, "marshal resp.Data failed") - } - back := stream.MosListResp{} - err = json.Unmarshal(listData, &back) - if err != nil { - return 0, err - } - if len(back.List) == 0 { - return 0, nil - } - - retId := int64(0) - for _, ele := range back.List { - m.Log.Info("Xrp find a log", "id", ele.Id, "block", ele.BlockNumber) - log := ele - err = lh(m, log) - if err != nil { - return 0, err - } - retId = ele.Id - } - - return retId, nil - } -} - -func mos(m *sync, log *stream.GetMosResp) error { - receiptHash, receiptPack, err := genReceipt(log) - if err != nil { - return errors.Wrap(err, "gen receipt failed") - } - m.Log.Info("Xrp2Evm mos generate", "receiptHash", receiptHash) - bn := proof.GenLogBlockNumber(big.NewInt(int64(log.BlockNumber)), log.LogIndex) - proposalInfo, err := chain.GetSigner(bn, *receiptHash, uint64(m.cfg.Id), uint64(m.cfg.MapChainID)) - if err != nil { - return err - } - var fixedHash [32]byte - for i, v := range receiptHash { - fixedHash[i] = v - } - pd := proof.SignLogData{ - ProofType: constant.ProofTypeOfContract, - BlockNum: bn, - ReceiptRoot: fixedHash, - Signatures: proposalInfo.Signatures, - Proof: receiptPack, - } - - input, err := mapprotocol.GetAbi.Methods[mapprotocol.MethodOfGetBytes].Inputs.Pack(pd) - if err != nil { - return errors.Wrap(err, "pack getBytes failed") - } - - orderIdStr := strings.Split(log.Topic, ",")[1] - orderId := common.HexToHash(orderIdStr) - finalInput, err := mapprotocol.PackInput(mapprotocol.Mcs, mapprotocol.MethodOfMessageIn, - big.NewInt(0).SetUint64(uint64(m.Cfg.Id)), - big.NewInt(int64(0)), orderId, input) - if err != nil { - return err - } - - var orderId32 [32]byte - for i, v := range orderId { - orderId32[i] = v - } - message := msg.NewSwapWithProof(m.Cfg.Id, m.Cfg.MapChainID, []interface{}{finalInput, - orderId32, log.BlockNumber, log.TxHash}, m.MsgCh) - err = m.Router.Send(message) - if err != nil { - m.Log.Error("subscription error: failed to route message", "err", err) - return err - } - - return nil -} - -func oracle(m *sync, log *stream.GetMosResp) error { - receiptHash, _, err := genReceipt(log) - if err != nil { - return errors.Wrap(err, "gen receipt failed") - } - m.Log.Info("Sol2Evm oracle generate", "receiptHash", receiptHash) - - ret, err := chain.MulSignInfo(0, uint64(m.Cfg.MapChainID)) - if err != nil { - return errors.Wrap(err, "mul sign failed") - } - - version := make([]byte, 0) - for _, v := range ret.Version { - version = append(version, v) - } - - bn := proof.GenLogBlockNumber(big.NewInt(int64(log.BlockNumber)), log.LogIndex) - input, err := mapprotocol.PackAbi.Methods[mapprotocol.MethodOfSolidityPack].Inputs.Pack(receiptHash, - ret.Version, bn, big.NewInt(int64(m.Cfg.Id))) - if err != nil { - return errors.Wrap(err, "oracle pack input failed") - } - - message := msg.NewProposal(m.Cfg.Id, m.Cfg.MapChainID, []interface{}{input, receiptHash, bn}, m.MsgCh) - err = m.Router.Send(message) - if err != nil { - m.Log.Error("Subscription error: failed to route message", "err", err) - return nil - } - - return nil -} - -func genReceipt(log *stream.GetMosResp) (*common.Hash, []byte, error) { - orderIdStr := strings.Split(log.Topic, ",")[1] - // decode log data - hex2Bytes := common.Hex2Bytes(strings.TrimPrefix(log.LogData, "0x")) - if len(hex2Bytes) <= 0 { - return nil, nil, errors.New("invalid log data") - } - values, err := mapprotocol.SolAbi.Methods[mapprotocol.MethodOfSolEventEncode].Inputs.Unpack(hex2Bytes) - if err != nil { - return nil, nil, errors.Wrap(err, "unmarshal event code failed") - } - event := mapprotocol.MessageOutEvent{} - err = mapprotocol.SolAbi.Methods[mapprotocol.MethodOfSolEventEncode].Inputs.Copy(&event, values) - if err != nil { - return nil, nil, errors.Wrap(err, "unmarshal event code failed") - } - - orderId := common.HexToHash(orderIdStr) - bridgeParam, err := abi.DecodeBridgeParam(event.SwapData) - if err != nil { - return nil, nil, errors.Wrap(err, "decode bridge param failed") - } - - if len(bridgeParam.SwapData) > 0 { - // check swapData - pass, err := contract.Validate(event.Relay, event.ToChain, event.Amount, event.Token, event.To, bridgeParam.SwapData) - if err != nil { - return nil, nil, err - } - if !pass { - return nil, nil, fmt.Errorf("invalid swapData (%s)", bridgeParam.SwapData) - } - } - - eo := mapprotocol.MessageOutEvent{ - FromChain: event.FromChain, - ToChain: event.ToChain, - OrderId: orderId, - Amount: event.Amount, - Token: event.Token, - From: event.From, // Xrp address - SwapData: bridgeParam.SwapData, - GasLimit: event.GasLimit, - Mos: event.Mos, - Initiator: event.Initiator, // Xrp address - Relay: event.Relay, - MessageType: event.MessageType, - To: event.To, - } - data, err := mapprotocol.SolAbi.Methods[mapprotocol.MethodOfSolEventEncode].Inputs.Pack(&eo) - if err != nil { - return nil, nil, errors.Wrap(err, "marshal event code failed") - } - // abi - receiptPack, err := mapprotocol.SolAbi.Methods[mapprotocol.MethodOfSolPackReceipt].Inputs.Pack( - common.Hex2Bytes(strings.TrimPrefix(log.ContractAddress, "0x")), - common.Hex2Bytes(strings.TrimPrefix(log.Topic, "0x")), data) - if err != nil { - return nil, nil, errors.Wrap(err, "marshal pack failed") - } - receipt := common.BytesToHash(crypto.Keccak256(receiptPack)) - return &receipt, receiptPack, nil -} diff --git a/chains/xrp/writer.go b/chains/xrp/writer.go deleted file mode 100644 index 6affe4f3..00000000 --- a/chains/xrp/writer.go +++ /dev/null @@ -1,38 +0,0 @@ -package xrp - -import ( - "github.com/ChainSafe/log15" - "github.com/mapprotocol/compass/pkg/msg" -) - -type Writer struct { - cfg *Config - log log15.Logger - stop <-chan int - sysErr chan<- error -} - -func newWriter(cfg *Config, log log15.Logger, stop <-chan int, sysErr chan<- error) *Writer { - return &Writer{ - cfg: cfg, - log: log, - stop: stop, - sysErr: sysErr, - } -} - -func (w *Writer) ResolveMessage(m msg.Message) bool { - w.log.Info("Attempting to resolve message", "type", m.Type, "src", m.Source, "dst", m.Destination) - switch m.Type { - case msg.SwapWithMapProof: - return w.exeMcs(m) - default: - w.log.Error("Unknown message type received", "type", m.Type) - return false - } -} - -func (w *Writer) exeMcs(m msg.Message) bool { - m.DoneCh <- struct{}{} - return true -} diff --git a/cmd/cmd_runtime/common.go b/cmd/cmd_runtime/common.go new file mode 100644 index 00000000..e40b9bf1 --- /dev/null +++ b/cmd/cmd_runtime/common.go @@ -0,0 +1,91 @@ +package cmd_runtime + +import ( + "github.com/mapprotocol/compass/chains/ethereum" + "github.com/mapprotocol/compass/types" + "github.com/mapprotocol/compass/utils" + log "github.com/sirupsen/logrus" + "os" + "os/exec" + "path/filepath" + "runtime" + "strings" + "time" +) + +func InitConfigAndClient() { + ReadTomlConfig() + + keystore := GlobalConfigV.Keystore + password := GlobalConfigV.Password + BlockNumberByEstimation = GlobalConfigV.BlockNumberByEstimation + + SrcInstance = ethereum.NewEthChain( + SrcChainConfig.Name, SrcChainConfig.ChainId, + SrcChainConfig.BlockCreatingTime, SrcChainConfig.RpcUrl, + SrcChainConfig.StableBlock, + "", "", + ) + + DstInstance = ethereum.NewEthChain( + DstChainConfig.Name, DstChainConfig.ChainId, + DstChainConfig.BlockCreatingTime, DstChainConfig.RpcUrl, + DstChainConfig.StableBlock, + DstChainConfig.RelayerContractAddress, DstChainConfig.HeaderStoreContractAddress, + ) + + if keystore == "" { + log.Fatal("keystore is not set correctly at config.toml.") + } + if !strings.Contains(keystore, "/") && !strings.Contains(keystore, "\\") { + keystore = filepath.Join(filepath.Dir(os.Args[0]), keystore) + } + if password != "" { + password = string(utils.AesCbcDecrypt(password)) + } + DstInstance.SetTarget(keystore, password) + StructUnStableBlock.Time = SrcInstance.NumberOfSecondsOfBlockCreationTime() +} +func DisplayMessageAndSleep(s *types.WaitTimeAndMessage) { + log.Infoln(s.Message) + time.Sleep(s.Time) +} + +var clear map[string]func() //create a map for storing clear funcs + +func init() { + clear = make(map[string]func()) //Initialize it + clear["linux"] = func() { + cmd := exec.Command("clear") //Linux example, its tested + cmd.Stdout = os.Stdout + err := cmd.Run() + if err != nil { + return + } + } + clear["darwin"] = func() { + cmd := exec.Command("clear") //Linux example, its tested + cmd.Stdout = os.Stdout + err := cmd.Run() + if err != nil { + return + } + } + clear["windows"] = func() { + cmd := exec.Command("cmd", "/c", "cls") //Windows example, its tested + cmd.Stdout = os.Stdout + err := cmd.Run() + if err != nil { + return + } + } +} + +func CallClear() { + value, ok := clear[runtime.GOOS] //runtime.GOOS -> linux, windows, darwin etc. + if ok { //if we defined a clear func for that platform: + value() //we execute it + } else { //unsupported platform + panic("Your platform is unsupported! I can't clear terminal screen :(") + } +} diff --git a/cmd/cmd_runtime/toml.go b/cmd/cmd_runtime/toml.go new file mode 100644 index 00000000..dc2d7762 --- /dev/null +++ b/cmd/cmd_runtime/toml.go @@ -0,0 +1,57 @@ +package cmd_runtime + +import ( + "github.com/pelletier/go-toml" + log "github.com/sirupsen/logrus" + "os" + "path/filepath" +) + +func ReadTomlConfig() { + rootTree, err := toml.LoadFile(filepath.Join(filepath.Dir(os.Args[0]), "config.toml")) + rootTree, err = toml.LoadFile("/Users/yangdianqing/code/go/compass/config.toml") // for dev + if err != nil { + log.Fatalln(err) + } + _ = parseKey("global", rootTree, func() { + log.Fatal("Config.toml does not contain global block") + }).(*toml.Tree).Unmarshal(&GlobalConfigV) + if GlobalConfigV.StartWithBlock <= 0 { + GlobalConfigV.StartWithBlock = 1 + } + + if GlobalConfigV.BlockNumberLimitOnce == 0 { + GlobalConfigV.BlockNumberLimitOnce = 1 + } + if GlobalConfigV.BlockNumberLimitOnce > 20 { + GlobalConfigV.BlockNumberLimitOnce = 20 + } + _ = parseKey("src_chain", rootTree, func() { + log.Fatal("Config.toml does not contain src_chain block") + }).(*toml.Tree).Unmarshal(&SrcChainConfig) + + _ = parseKey("dst_chain", rootTree, func() { + log.Fatal("Config.toml does not contain dst_chain block") + }).(*toml.Tree).Unmarshal(&DstChainConfig) + + if SrcChainConfig.ChainId <= 0 || DstChainConfig.ChainId <= 0 { + log.Fatal("chain_id is required, it has to be a natural number.") + } + if SrcChainConfig.BlockCreatingTime <= 0 || DstChainConfig.BlockCreatingTime <= 0 { + log.Fatal("block_creating_seconds is required, it has to be a natural number.") + } + if SrcChainConfig.StableBlock <= 0 || DstChainConfig.StableBlock <= 0 { + log.Fatal("stable_block is required, it has to be a natural number.") + } + if SrcChainConfig.RouterContractAddress == "" || DstChainConfig.RouterContractAddress == "" { + log.Fatal("router_contract_address is required.") + } + return +} +func parseKey(key string, tree *toml.Tree, f func()) interface{} { + v := tree.Get(key) + if v == nil { + f() + } + return v +} diff --git a/cmd/cmd_runtime/vars.go b/cmd/cmd_runtime/vars.go new file mode 100644 index 00000000..b001a896 --- /dev/null +++ b/cmd/cmd_runtime/vars.go @@ -0,0 +1,33 @@ +package cmd_runtime + +import ( + "github.com/ethereum/go-ethereum/crypto" + "github.com/mapprotocol/compass/chains" + "github.com/mapprotocol/compass/types" + "time" +) + +var ( + EventSwapOutKey = "EventSwapOutKey" + EventSwapOutArrayKey = "eventSwapOutArrayKey" + EventSwapOutHash = crypto.Keccak256Hash([]byte("LogSwapOut(uint256,address,address,address,uint256,uint256,uint256)")) + GlobalConfigV types.GlobalConfig + SrcChainConfig types.ChainConfig + DstChainConfig types.ChainConfig + DstInstance chains.ChainInterface + SrcInstance chains.ChainInterface + BlockNumberByEstimation = true + + StructRegisterNotRelayer = &types.WaitTimeAndMessage{ + Time: 2 * time.Minute, + Message: "registered not relayer", + } + StructUnregistered = &types.WaitTimeAndMessage{ + Time: 10 * time.Minute, + Message: "Unregistered", + } + StructUnStableBlock = &types.WaitTimeAndMessage{ + Time: time.Second * 2, //it will update at InitConfigAndClient func + Message: "Unstable block", + } +) diff --git a/cmd/compass/account.go b/cmd/compass/account.go deleted file mode 100644 index 38d1b9d2..00000000 --- a/cmd/compass/account.go +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright 2021 Compass Systems -// SPDX-License-Identifier: LGPL-3.0-only - -package main diff --git a/cmd/compass/expose.go b/cmd/compass/expose.go deleted file mode 100644 index 6b548380..00000000 --- a/cmd/compass/expose.go +++ /dev/null @@ -1,76 +0,0 @@ -package main - -import ( - "github.com/ethereum/go-ethereum/log" - "github.com/gin-gonic/gin" - "github.com/mapprotocol/compass/chains" - "github.com/mapprotocol/compass/internal/expose" - "github.com/mapprotocol/compass/internal/expose/handler" - "github.com/mapprotocol/compass/pkg/keystore" - "github.com/mapprotocol/compass/pkg/util" - "github.com/urfave/cli/v2" -) - -var exposeCommand = cli.Command{ - Name: "expose", - Usage: "pprof expose", - Description: "", - Action: api, - Subcommands: []*cli.Command{}, - Flags: append(app.Flags, cliFlags...), -} - -func CORSMiddleware() gin.HandlerFunc { - return func(c *gin.Context) { - c.Writer.Header().Set("Access-Control-Allow-Origin", "*") - c.Writer.Header().Set("Access-Control-Allow-Credentials", "true") - c.Writer.Header().Set("Access-Control-Allow-Methods", "POST, GET, OPTIONS, PUT, DELETE") - c.Writer.Header().Set("Access-Control-Allow-Headers", "Origin, Content-Type, Content-Length, Accept-Encoding, X-CSRF-Token, Authorization") - - if c.Request.Method == "OPTIONS" { - c.AbortWithStatus(204) - return - } - - c.Next() - } -} - -func api(ctx *cli.Context) error { - // logger - err := startLogger(ctx) - if err != nil { - return err - } - log.Info("Starting Proof expose ...") - // parse config - cfg, err := expose.Local(ctx) - if err != nil { - return err - } - util.Init(cfg.Other.Env, cfg.Other.MonitorUrl) - // pre init - for _, ele := range cfg.Chains { - creator, _ := chains.CreateProffer(ele.Type) - _, err = creator.Connect(ele.Id, ele.Endpoint, ele.Mcs, ele.LightNode, ele.OracleNode) - if err != nil { - return err - } - } - - kpI, err := keystore.KeypairFromEth(cfg.Other.Key) - if err != nil { - return err - } - - e := handler.New(cfg, kpI.PrivateKey) - g := gin.New() - g.Use(CORSMiddleware()) - g.POST("/tx/exec", e.TxExec) - err = g.Run(cfg.Other.Port) - if err != nil { - return err - } - - return nil -} diff --git a/cmd/compass/main.go b/cmd/compass/main.go deleted file mode 100644 index 0e1c601e..00000000 --- a/cmd/compass/main.go +++ /dev/null @@ -1,214 +0,0 @@ -package main - -import ( - "errors" - "os" - "strconv" - - log "github.com/ChainSafe/log15" - "github.com/ethereum/go-ethereum/common" - "github.com/mapprotocol/compass/chains" - "github.com/mapprotocol/compass/config" - "github.com/mapprotocol/compass/core" - "github.com/mapprotocol/compass/internal/blacklist" - chain2 "github.com/mapprotocol/compass/internal/chain" - "github.com/mapprotocol/compass/internal/contract" - "github.com/mapprotocol/compass/internal/mapprotocol" - "github.com/mapprotocol/compass/pkg/abi" - contract2 "github.com/mapprotocol/compass/pkg/contract" - "github.com/mapprotocol/compass/pkg/msg" - "github.com/mapprotocol/compass/pkg/util" - "github.com/urfave/cli/v2" -) - -var app = cli.NewApp() - -var cliFlags = []cli.Flag{ - config.ConfigFileFlag, - config.VerbosityFlag, - config.KeystorePathFlag, - config.KeyPathFlag, - config.BlockstorePathFlag, - config.FreshStartFlag, - config.LatestBlockFlag, - config.SkipErrorFlag, - config.FilterFlag, -} - -var devFlags = []cli.Flag{ - config.TestKeyFlag, -} - -var maintainerCommand = cli.Command{ - Name: "maintainer", - Usage: "manage maintainer operations", - Description: "The maintainer command is used to manage maintainer on Map chain.\n" + - "\tTo register an account : compass relayers register --account '0x0...'", - Action: maintainer, - Subcommands: []*cli.Command{}, - Flags: append(app.Flags, cliFlags...), -} - -var messengerCommand = cli.Command{ - Name: "messenger", - Usage: "manage messenger operations", - Description: "The messenger command is used to sync the log information of transactions in the block", - Action: messenger, - Flags: append(app.Flags, cliFlags...), -} - -var oracleCommand = cli.Command{ - Name: "oracle", - Usage: "manage oracle operations", - Description: "The oracle command is used to sync the log information of transactions in the block", - Action: oracle, - Flags: append(app.Flags, cliFlags...), -} - -var ( - Version = "1.3.0" -) - -// init initializes CLI -func init() { - //app.Action = run - app.Copyright = "Copyright 2021 MAP Protocol 2021 Authors" - app.Name = "compass" - app.Usage = "Compass" - app.Authors = []*cli.Author{{Name: "MAP Protocol 2021"}} - app.Version = Version - app.EnableBashCompletion = true - app.Commands = []*cli.Command{ - &maintainerCommand, - &messengerCommand, - &oracleCommand, - &exposeCommand, - } - - app.Flags = append(app.Flags, cliFlags...) - app.Flags = append(app.Flags, devFlags...) -} - -func main() { - if err := app.Run(os.Args); err != nil { - log.Error(err.Error()) - os.Exit(1) - } -} - -func startLogger(ctx *cli.Context) error { - logger := log.Root() - handler := logger.GetHandler() - var lvl log.Lvl - - if lvlToInt, err := strconv.Atoi(ctx.String(config.VerbosityFlag.Name)); err == nil { - lvl = log.Lvl(lvlToInt) - } else if lvl, err = log.LvlFromString(ctx.String(config.VerbosityFlag.Name)); err != nil { - return err - } - log.Root().SetHandler(log.LvlFilterHandler(lvl, handler)) - - return nil -} - -func maintainer(ctx *cli.Context) error { - return run(ctx, mapprotocol.RoleOfMaintainer) -} - -func messenger(ctx *cli.Context) error { - return run(ctx, mapprotocol.RoleOfMessenger) -} - -func oracle(ctx *cli.Context) error { - return run(ctx, mapprotocol.RoleOfOracle) -} - -func run(ctx *cli.Context, role mapprotocol.Role) error { - err := startLogger(ctx) - if err != nil { - return err - } - log.Info("Starting Compass...") - - cfg, err := config.GetConfig(ctx) - if err != nil { - return err - } - blacklist.Init(cfg.Other.BlackListUrl) - util.Init(cfg.Other.Env, cfg.Other.MonitorUrl) - sysErr := make(chan error) - mapcid, err := strconv.Atoi(cfg.MapChain.Id) - if err != nil { - return err - } - c := core.NewCore(sysErr, msg.ChainId(mapcid), role) - // merge map chain - allChains := make([]config.RawChainConfig, 0, len(cfg.Chains)+1) - allChains = append(allChains, cfg.MapChain) - allChains = append(allChains, cfg.Chains...) - - for idx, ele := range allChains { - ks := ele.KeystorePath - if ks == "" { - ks = ctx.String(config.KeyPathFlag.Name) - } - chainId, err := strconv.Atoi(ele.Id) - if err != nil { - return err - } - mapprotocol.MapId = cfg.MapChain.Id - ele.Opts[config.MapChainID] = cfg.MapChain.Id - chainConfig := &core.ChainConfig{ - Name: ele.Name, - Id: msg.ChainId(chainId), - Endpoint: ele.Endpoint, - From: ele.From, - Network: ele.Network, - KeystorePath: ks, - NearKeystorePath: ele.KeystorePath, - BlockstorePath: ctx.String(config.BlockstorePathFlag.Name), - FreshStart: ctx.Bool(config.FreshStartFlag.Name), - LatestBlock: ctx.Bool(config.LatestBlockFlag.Name), - Opts: ele.Opts, - SkipError: ctx.Bool(config.SkipErrorFlag.Name), - Filter: ctx.Bool(config.FilterFlag.Name), - FilterHost: cfg.Other.Filter, - BtcHost: cfg.Other.BtcUrl, - ButterHost: cfg.Other.Butter, - } - var ( - newChain core.Chain - ) - - logger := log.Root().New("ele", chainConfig.Name) - creator, ok := chains.Create(ele.Type) - if !ok { - return errors.New("unrecognized Chain Type") - } - - newChain, err = creator.New(chainConfig, logger, sysErr, role) - if err != nil { - return err - } - - if idx == 0 { - mapprotocol.GlobalMapConn = newChain.(*chain2.Chain).EthClient() - validateAbi, err := abi.New(mapprotocol.ValidateJson) - if err != nil { - return err - } - contract.InitDefaultValidator(contract2.New(newChain.(*chain2.Chain).Conn(), - []common.Address{common.HexToAddress(chainConfig.Opts[chain2.Validate])}, validateAbi)) - mapprotocol.Init2GetEth22MapNumber(common.HexToAddress(chainConfig.Opts[chain2.LightNode])) - mapprotocol.InitOtherChain2MapHeight(common.HexToAddress(chainConfig.Opts[chain2.LightNode])) - mapprotocol.InitLightManager(common.HexToAddress(chainConfig.Opts[chain2.LightNode])) - mapprotocol.LightManagerNodeType(common.HexToAddress(chainConfig.Opts[chain2.LightNode])) - } - - mapprotocol.OnlineChaId[chainConfig.Id] = chainConfig.Name - c.AddChain(newChain) - } - c.Start() - - return nil -} diff --git a/cmd/daemon.go b/cmd/daemon.go new file mode 100644 index 00000000..b3ae97b1 --- /dev/null +++ b/cmd/daemon.go @@ -0,0 +1,264 @@ +package cmd + +import ( + "context" + "fmt" + "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/common" + "github.com/mapprotocol/compass/chains" + "github.com/mapprotocol/compass/cmd/cmd_runtime" + "github.com/mapprotocol/compass/cmd/events" + "github.com/mapprotocol/compass/http_call" + "github.com/mapprotocol/compass/utils" + log "github.com/sirupsen/logrus" + "github.com/spf13/cobra" + "math/big" + "strconv" + "strings" + "time" +) + +var ( + srcBlockNumberByEstimation uint64 = 0 + dstBlockNumberByEstimation uint64 = 0 + + getSrcBlockNumber = func() uint64 { + if cmd_runtime.BlockNumberByEstimation { + return srcBlockNumberByEstimation + } else { + return cmd_runtime.SrcInstance.GetBlockNumber() + } + } + getDstBlockNumber = func() uint64 { + if cmd_runtime.BlockNumberByEstimation { + return dstBlockNumberByEstimation + } else { + return cmd_runtime.DstInstance.GetBlockNumber() + } + } + currentWorkingBlockNumber uint64 = 0 + currentWorkedBlockNumber uint64 = 0 + canDo = false + cmdDaemon = &cobra.Command{ + Use: "daemon ", + Short: "Run rly daemon.", + Args: cobra.MinimumNArgs(0), + Run: func(cmd *cobra.Command, args []string) { + initDb() + cmd_runtime.InitConfigAndClient() + updateCanDoThread() + if cmd_runtime.BlockNumberByEstimation { + updateBlockNumberThread(cmd_runtime.DstInstance, &dstBlockNumberByEstimation, 10) + updateBlockNumberThread(cmd_runtime.SrcInstance, &srcBlockNumberByEstimation, 10) + } + listenEventThread() + syncHeaderThread() + for { + time.Sleep(time.Hour) + } + }, + } +) + +func syncHeaderThread() { + go func() { + for { + if currentWorkedBlockNumber == 0 { + time.Sleep(time.Second) + } else { + currentWorkingBlockNumber = currentWorkedBlockNumber + break + } + } + for { + if !canDo { + time.Sleep(time.Minute) + continue + } + srcBlockNumber := getSrcBlockNumber() + if currentWorkingBlockNumber+cmd_runtime.SrcInstance.GetStableBlockBeforeHeader() > srcBlockNumber { + cmd_runtime.DisplayMessageAndSleep(cmd_runtime.StructUnStableBlock) + continue + } + thisBlockNumberLimit := cmd_runtime.GlobalConfigV.BlockNumberLimitOnce + if currentWorkingBlockNumber+cmd_runtime.SrcInstance.GetStableBlockBeforeHeader()+thisBlockNumberLimit-1 > srcBlockNumber { + thisBlockNumberLimit = srcBlockNumber - currentWorkingBlockNumber - cmd_runtime.SrcInstance.GetStableBlockBeforeHeader() + 1 + } + byteData, err := cmd_runtime.SrcInstance.GetBlockHeader(currentWorkingBlockNumber, thisBlockNumberLimit) + if err != nil { + time.Sleep(10 * time.Second) + continue + } + cmd_runtime.DstInstance.Save(cmd_runtime.SrcInstance.GetChainId(), byteData) + currentWorkingBlockNumber += thisBlockNumberLimit + } + }() +} + +func listenEventThread() { + log.Infoln("listenEventThread started.") + eventSwapOutStr := utils.Get(levelDbInstance, cmd_runtime.EventSwapOutKey) + eventSwapOutInt, _ := strconv.Atoi(eventSwapOutStr) + eventSwapOutArrayStr := utils.Get(levelDbInstance, cmd_runtime.EventSwapOutArrayKey) + var from = int64(eventSwapOutInt) + if cmd_runtime.GlobalConfigV.StartWithBlock > from { + from = cmd_runtime.GlobalConfigV.StartWithBlock + } + var to = from + var i64SrcBlockNumber int64 = 0 + var lastBlockNumber = uint64(from) + query := ethereum.FilterQuery{ + FromBlock: big.NewInt(from), + ToBlock: big.NewInt(to), + Addresses: []common.Address{common.HexToAddress(cmd_runtime.SrcChainConfig.RouterContractAddress)}, + } + go func() { + for { + i64SrcBlockNumber = int64(getSrcBlockNumber()) + + if i64SrcBlockNumber-from <= int64(cmd_runtime.SrcInstance.GetStableBlockBeforeHeader()) { + time.Sleep(cmd_runtime.SrcInstance.NumberOfSecondsOfBlockCreationTime()) + continue + } + + if i64SrcBlockNumber-from-int64(cmd_runtime.SrcInstance.GetStableBlockBeforeHeader()) > 99 { + to = from + 99 + } else { + to = i64SrcBlockNumber - int64(cmd_runtime.SrcInstance.GetStableBlockBeforeHeader()) + } + log.Infoln("queryEvent from:", from, ",to: ", to, ",block number:", i64SrcBlockNumber) + + query.FromBlock = big.NewInt(from) + query.ToBlock = big.NewInt(to) + + logs, err := cmd_runtime.SrcInstance.GetClient().FilterLogs(context.Background(), query) + log.Infoln("query ", len(logs), " events.") + if err != nil { + log.Warnln("cmd_runtime.SrcInstance.GetClient().FilterLogs error", err) + time.Sleep(5 * time.Second) + continue + } + //var log types.Log + for _, aLog := range logs { + if cmd_runtime.EventSwapOutHash != aLog.Topics[0] { + continue + } + if strings.Contains(eventSwapOutArrayStr, aLog.TxHash.String()) { + continue + } + for { + if aLog.BlockNumber > currentWorkedBlockNumber { + _ = queryServerBlockNumber() + time.Sleep(5 * time.Second) + } else { + break + } + } + events.HandleLogSwapOut(&aLog) + + println() + + if aLog.BlockNumber != lastBlockNumber { + utils.Put(levelDbInstance, cmd_runtime.EventSwapOutKey, strconv.Itoa(int(aLog.BlockNumber))) + lastBlockNumber = aLog.BlockNumber + eventSwapOutArrayStr = aLog.TxHash.String() + "," + } else { + eventSwapOutArrayStr += aLog.TxHash.String() + "," + } + utils.Put(levelDbInstance, cmd_runtime.EventSwapOutArrayKey, eventSwapOutArrayStr) + + } + from = to + 1 + utils.Put(levelDbInstance, cmd_runtime.EventSwapOutKey, strconv.Itoa(int(from))) + } + + }() +} + +func updateCanDoThread() { + go func() { + for { + relayer := cmd_runtime.DstInstance.GetRelayer() + if !relayer.Register { + canDo = false + cmd_runtime.DisplayMessageAndSleep(cmd_runtime.StructUnregistered) + continue + } + if !relayer.Relayer { + canDo = false + cmd_runtime.DisplayMessageAndSleep(cmd_runtime.StructRegisterNotRelayer) + continue + } + getHeight := cmd_runtime.DstInstance.GetPeriodHeight() + curDstBlockNumber := getDstBlockNumber() + if getHeight.Relayer && getHeight.Start.Uint64() <= getDstBlockNumber() && getHeight.End.Uint64() >= curDstBlockNumber { + if !canDo { + //There is no room for errors when canDo convert from false to true + if err := queryServerBlockNumber(); err != nil { + log.Infoln("updateCurrentBlockNumber rpc call error") + time.Sleep(time.Minute) + continue + } + } + canDo = true + estimateTime := time.Duration((getHeight.End.Uint64()-curDstBlockNumber)/2) * cmd_runtime.DstInstance.NumberOfSecondsOfBlockCreationTime() + if estimateTime > time.Minute { + time.Sleep(estimateTime) + } else { + time.Sleep(time.Minute) + } + } else { + canDo = false + time.Sleep(time.Minute) + } + } + }() +} +func updateBlockNumberThread(chainImpl chains.ChainInterface, blockNumber *uint64, times int) { + go func() { + var i = 1 + var interval = chainImpl.NumberOfSecondsOfBlockCreationTime() + var totalMilliseconds int64 + var startBlockNumber = chainImpl.GetBlockNumber() + *blockNumber = startBlockNumber + var startTime = time.Now().UnixNano() + for { + if canDo && i%times == 0 { + byIncr := *blockNumber + *blockNumber = chainImpl.GetBlockNumber() + totalMilliseconds = time.Now().UnixNano() - startTime + if *blockNumber == startBlockNumber { + if interval*2 < chainImpl.NumberOfSecondsOfBlockCreationTime() { + log.Infoln("interval is too small,It should be close to", + chainImpl.NumberOfSecondsOfBlockCreationTime().String(), + ". It's actually ", interval.String()) + } else if interval > chainImpl.NumberOfSecondsOfBlockCreationTime()*2 { + log.Infoln("interval is too big,It should be close to", + chainImpl.NumberOfSecondsOfBlockCreationTime().String(), + ". It's actually ", interval.String()) + } + log.Infoln("block number not change") + i += 1 + time.Sleep(interval) + continue + } + interval = time.Duration(uint64(totalMilliseconds) / (*blockNumber - startBlockNumber)) + log.Infoln(chainImpl.GetName(), "block number : byIncr =", byIncr, ", byRpc =", *blockNumber) + } else { + // if !canDo ,this number is very different from the true value, but it doesn't matter. + *blockNumber += 1 + } + i += 1 + time.Sleep(interval) + } + }() +} +func queryServerBlockNumber() error { + + headerCurrentNumber := http_call.HeaderCurrentNumber(cmd_runtime.DstInstance.GetRpcUrl(), cmd_runtime.SrcInstance.GetChainId()) + if headerCurrentNumber != ^uint64(0) && headerCurrentNumber >= currentWorkedBlockNumber { + currentWorkedBlockNumber = headerCurrentNumber + return nil + } + return fmt.Errorf("get currentWorkingBlockNumber err") +} diff --git a/cmd/events/router.go b/cmd/events/router.go new file mode 100644 index 00000000..ec1b5907 --- /dev/null +++ b/cmd/events/router.go @@ -0,0 +1,74 @@ +package events + +import ( + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + abi2 "github.com/mapprotocol/compass/abi" + "github.com/mapprotocol/compass/atlas" + "github.com/mapprotocol/compass/chain_tools" + "github.com/mapprotocol/compass/cmd/cmd_runtime" + types2 "github.com/mapprotocol/compass/types" + log "github.com/sirupsen/logrus" + "strings" + "time" +) + +var ( + abiRouter, _ = abi.JSON(strings.NewReader(abi2.RouterContractAbi)) + eventResponse types2.EventLogSwapOutResponse + err error + txProve []byte + tx *types.Transaction +) + +func HandleLogSwapOut(aLog *types.Log) { + err = abiRouter.UnpackIntoInterface(&eventResponse, "LogSwapOut", aLog.Data) + if err != nil { + log.Fatal(err) + } + txProve = atlas.GetTxProve(cmd_runtime.SrcInstance, aLog, &eventResponse) + + token := common.BytesToAddress(aLog.Topics[1].Bytes()) + //to := common.BytesToAddress(aLog.Topics[3].Bytes()) + + // swapIn(uint256 id, address token, address to, uint amount, uint fromChainID, bytes32[] memory data) + //input := chain_tools.PackInput(abiRouter, "swapIn", + // eventResponse.OrderId, + // token, + // to, + // eventResponse.Amount, + // eventResponse.FromChainID, + // aLog.Address, + // txProve) + //fmt.Printf("%+v", eventResponse) + input := chain_tools.PackInput(abiRouter, "txVerify", + aLog.Address, + token, + eventResponse.FromChainID, + eventResponse.ToChainID, + txProve) + + for { + for { + tx = chain_tools.SendContractTransactionWithoutOutputUnlessError(cmd_runtime.DstInstance.GetClient(), + common.HexToAddress(cmd_runtime.DstInstance.GetAddress()), + common.HexToAddress(cmd_runtime.DstChainConfig.RouterContractAddress), + nil, cmd_runtime.DstInstance.GetPrivateKey(), + input) + if tx == nil { + time.Sleep(5 * time.Second) + continue + } + if chain_tools.WaitingForEndPending(cmd_runtime.DstInstance.GetClient(), tx.Hash(), 100) { + break + } + } + if chain_tools.WaitForReceipt(cmd_runtime.DstInstance.GetClient(), tx.Hash(), 1000) { + return + } else { + time.Sleep(5 * time.Second) + } + } + +} diff --git a/cmd/info.go b/cmd/info.go new file mode 100644 index 00000000..bff23f23 --- /dev/null +++ b/cmd/info.go @@ -0,0 +1,106 @@ +package cmd + +import ( + "fmt" + "github.com/alexeyco/simpletable" + "github.com/mapprotocol/compass/cmd/cmd_runtime" + "github.com/mapprotocol/compass/utils" + log "github.com/sirupsen/logrus" + "github.com/spf13/cobra" + "strconv" + "time" +) + +var ( + cmdInfo = &cobra.Command{ + Use: "info", + Short: "Get account info.", + Args: cobra.MinimumNArgs(0), + Run: func(cmd *cobra.Command, args []string) { + if len(args) != 0 { + err := cmd.Help() + if err != nil { + return + } + return + } + cmd_runtime.InitConfigAndClient() + displayOnce(false) + }, + } + cmdInfoWatch = &cobra.Command{ + Use: "watch ", + Short: "Get account info every some seconds ,default 5 seconds.", + Args: cobra.MinimumNArgs(0), + Run: func(cmd *cobra.Command, args []string) { + cmd_runtime.InitConfigAndClient() + var interval = 5 + if len(args) != 0 { + if i, err := strconv.Atoi(args[0]); err == nil { + interval = i + } + } + for { + displayOnce(true) + time.Sleep(time.Duration(interval) * time.Second) + } + }, + } +) + +func cmdInfoFunc() *cobra.Command { + cmdInfo.AddCommand(cmdInfoWatch) + return cmdInfo +} +func displayOnce(clearScreen bool) { + relayer := cmd_runtime.DstInstance.GetRelayer() + if relayer.Epoch == nil { + log.Warnln("Call GetRelayer return nil") + return + } + if !relayer.Register { + log.Warnln("Unregistered") + return + } + relayerBalance := cmd_runtime.DstInstance.GetRelayerBalance() + if relayerBalance.Registered == nil { + log.Warnln("Call GetRelayerBalance return nil") + return + } + + table := simpletable.New() + table.Header = &simpletable.Header{ + Cells: []*simpletable.Cell{ + {Align: simpletable.AlignCenter, Text: "name"}, + {Align: simpletable.AlignCenter, Text: "value"}, + }, + } + table.Body.Cells = append(table.Body.Cells, []*simpletable.Cell{ + {Text: "registered amount"}, + {Text: utils.WeiToEther(relayerBalance.Registered).String()}, + }) + table.Body.Cells = append(table.Body.Cells, []*simpletable.Cell{ + {Text: "locked amount"}, + {Text: utils.WeiToEther(relayerBalance.Unregistering).String()}, + }) + table.Body.Cells = append(table.Body.Cells, []*simpletable.Cell{ + {Text: "redeemable amount"}, + {Text: utils.WeiToEther(relayerBalance.Unregistered).String()}, + }) + table.Body.Cells = append(table.Body.Cells, []*simpletable.Cell{ + {Text: "is registered"}, + {Text: strconv.FormatBool(relayer.Register)}, + }) + table.Body.Cells = append(table.Body.Cells, []*simpletable.Cell{ + {Text: "is relayer"}, + {Text: strconv.FormatBool(relayer.Relayer)}, + }) + table.Body.Cells = append(table.Body.Cells, []*simpletable.Cell{ + {Text: "current epoch"}, + {Text: relayer.Epoch.String()}, + }) + if clearScreen { + cmd_runtime.CallClear() + } + fmt.Println(table.String()) +} diff --git a/cmd/init.go b/cmd/init.go new file mode 100644 index 00000000..053a024e --- /dev/null +++ b/cmd/init.go @@ -0,0 +1,34 @@ +package cmd + +import ( + log "github.com/sirupsen/logrus" + "github.com/syndtr/goleveldb/leveldb" + "os" + "path/filepath" +) + +const ( + runtimePath = "runtime" +) + +var levelDbInstance *leveldb.DB + +func init() { + log.SetFormatter(&log.TextFormatter{ + TimestampFormat: "2006-01-02 15:04:05", + FullTimestamp: true, + }) +} +func initDb() { + if _, err := os.Stat(runtimePath); os.IsNotExist(err) { + err := os.Mkdir(runtimePath, 0700) + if err != nil { + log.Fatal("make runtime dir error") + } + } + var err error + levelDbInstance, err = leveldb.OpenFile(filepath.Join(runtimePath, "db"), nil) + if err != nil { + log.Fatal("open levelDbInstance file error :", err) + } +} diff --git a/cmd/main.go b/cmd/main.go new file mode 100644 index 00000000..7088e6e2 --- /dev/null +++ b/cmd/main.go @@ -0,0 +1,15 @@ +package cmd + +import ( + "github.com/spf13/cobra" +) + +func Run() { + var rootCmd = &cobra.Command{Use: "map-rly"} + + rootCmd.AddCommand(cmdRegister, cmdUnRegister, cmdInfoFunc(), cmdDaemon, passwordCmd) + err := rootCmd.Execute() + if err != nil { + return + } +} diff --git a/cmd/password.go b/cmd/password.go new file mode 100644 index 00000000..527cab46 --- /dev/null +++ b/cmd/password.go @@ -0,0 +1,23 @@ +package cmd + +import ( + "github.com/mapprotocol/compass/chain_tools" + "github.com/mapprotocol/compass/cmd/cmd_runtime" + "github.com/mapprotocol/compass/utils" + "github.com/spf13/cobra" +) + +var ( + passwordCmd = &cobra.Command{ + Use: "password", + Short: "Get account info.", + Args: cobra.MinimumNArgs(0), + Run: func(cmd *cobra.Command, args []string) { + cmd_runtime.ReadTomlConfig() + + _, correctPassword := chain_tools.LoadPrivateKey(cmd_runtime.GlobalConfigV.Keystore, "") + println("Set next line to config.toml global.password :") + println(utils.AesCbcEncrypt([]byte(correctPassword))) + }, + } +) diff --git a/cmd/register.go b/cmd/register.go new file mode 100644 index 00000000..0277bcdf --- /dev/null +++ b/cmd/register.go @@ -0,0 +1,50 @@ +package cmd + +import ( + "github.com/mapprotocol/compass/cmd/cmd_runtime" + "github.com/mapprotocol/compass/utils" + log "github.com/sirupsen/logrus" + "github.com/spf13/cobra" + "math/big" +) + +var ( + cmdRegister = &cobra.Command{ + Use: "register", + Short: "To become relayer, you need to register with some eth coins.", + Args: cobra.MinimumNArgs(0), + Run: func(cmd *cobra.Command, args []string) { + + var value big.Int + var min = big.NewInt(100000) + if len(args) == 0 { + for { + print("Enter the registering amount(Unit Eth): ") + valueString := utils.ReadString() + if _, ok := value.SetString(valueString, 10); ok { + if value.Cmp(min) == -1 { + println("The value is at least 100000") + continue + } + break + } else { + println("Not a number ") + } + } + } else { + if _, ok := value.SetString(args[0], 10); !ok { + log.Fatal("Not a number ") + } + if value.Cmp(min) == -1 { + log.Fatal("The value is at least 100000") + } + } + + cmd_runtime.InitConfigAndClient() + valueWei := utils.EthToWei(&value) + if cmd_runtime.DstInstance.Register(valueWei) { + println("There are no errors, you can query by subcommand info to see if it was successful.") + } + }, + } +) diff --git a/cmd/unregister.go b/cmd/unregister.go new file mode 100644 index 00000000..493e66dd --- /dev/null +++ b/cmd/unregister.go @@ -0,0 +1,48 @@ +package cmd + +import ( + "github.com/mapprotocol/compass/cmd/cmd_runtime" + "github.com/mapprotocol/compass/utils" + log "github.com/sirupsen/logrus" + "github.com/spf13/cobra" + "math/big" +) + +var ( + cmdUnRegister = &cobra.Command{ + Use: "unregister", + Short: "With the unregister transaction executed, the unregistering portion is locked in the contract for about 2 epoch. After the period, you can withdraw the unregistered coins.", + Args: cobra.MinimumNArgs(0), + Run: func(cmd *cobra.Command, args []string) { + var value big.Int + var min = big.NewInt(100000) + if len(args) == 0 { + for { + print("Enter the unregistering amount(Unit Wei): ") + valueString := utils.ReadString() + if _, ok := value.SetString(valueString, 10); ok { + if value.Cmp(min) == -1 { + println("The value is at least 100000") + continue + } + break + } else { + println("Not a number ") + } + } + } else { + if _, ok := value.SetString(args[0], 10); !ok { + log.Fatal("Value not a number ") + } + if value.Cmp(min) == -1 { + log.Fatal("The value is at least 100000") + } + } + cmd_runtime.InitConfigAndClient() + valueWei := utils.EthToWei(&value) + if cmd_runtime.DstInstance.UnRegister(valueWei) { + println("There are no errors, you can query by subcommand info to see if it was successful.") + } + }, + } +) diff --git a/config.json.example b/config.json.example deleted file mode 100644 index 5cf9c0f6..00000000 --- a/config.json.example +++ /dev/null @@ -1,102 +0,0 @@ -{ - "mapchain": { - "id": "212", - "endpoint": "http://18.142.54.137:7445", - "from": "0xE0DC8D7f134d0A79019BE1232fd4b2013a64fCD6", - "opts": { - "mcs": "0x0ac4611305254cdd257beC56CB79CBeC720Cd02D", - "lightnode": "0x000068656164657273746F726541646472657373", - "http": "true", - "gasLimit": "4000000000000", - "maxGasPrice": "2000000000000", - "event": "mapTransferOut(bytes,bytes,bytes32,uint256,uint256,bytes,uint256,bytes)|depositOutToken(address,address,bytes,uint256)", - "syncIdList": "[34434]" - } - }, - "chains": [ - { - "name": "pri-eth", - "type": "ethereum", - "id": "34434", - "endpoint": "http://18.138.248.113:8545", - "from": "0xE0DC8D7f134d0A79019BE1232fd4b2013a64fCD6", - "opts": { - "mcs": "0xcfc80beddb70f12af6da768fc30e396889dfce26", - "lightnode": "0x80Be41aEBFdaDBD58a65aa549cB266dAFb6b8304", - "http": "true", - "gasLimit": "400000000000", - "maxGasPrice": "200000000000", - "event": "mapTransferOut(bytes,bytes,bytes32,uint256,uint256,bytes,uint256,bytes)|depositOutToken(address,address,bytes,uint256)", - "syncToMap": "true" - } - }, - { - "name": "Near", - "type": "near", - "id": "1313161555", - "network": "testnet", - "endpoint": "https://archival-rpc.testnet.near.org", - "from": "you.name.testnet", - "keystorePath" : "/root/", - "opts": { - "mcs": "you.contract.testnet", - "lightnode": "client.cfac.maplabs.testnet", - "http": "true", - "gasLimit": "300000000000000", - "maxGasPrice": "300000000000000", - "syncToMap": "true", - "redis": "redis://:password@ip:port/dbnum", - "event": "2ef1cdf83614a69568ed2c96a275dd7fb2e63a464aa3a0ffe79f55d538c8b3b5|150bd848adaf4e3e699dcac82d75f111c078ce893375373593cc1b9208998377" - } - }, - { - "name": "matic", - "type": "matic", - "id": "80001", - "endpoint": "https://rpc-mumbai.maticvigil.com", - "from": "0xE0DC8D7f134d0A79019BE1232fd4b2013a64fCD6", - "opts": { - "mcs": "0x688f3Ef5f728995a9DcB299DAEC849CA2E49ddE1", - "lightnode": "0x05634BdfbDa8aC4653Ff0655d71719F61A0922C4", - "http": "true", - "gasLimit": "400000000000", - "maxGasPrice": "200000000000", - "event": "mapTransferOut(uint256,uint256,bytes32,bytes,bytes,bytes,uint256,bytes)|mapDepositOut(uint256,uint256,bytes32,address,bytes,address,uint256)", - "syncToMap": "true" - } - }, - { - "name": "klaytn", - "type": "klaytn", - "id": "1001", - "endpoint": "https://public-node-api.klaytnapi.com/v1/baobab", - "from": "0xE0DC8D7f134d0A79019BE1232fd4b2013a64fCD6", - "opts": { - "mcs": "0x8105ECe4ce08B6B6449539A5db23e23b973DfA8f", - "lightnode": "0x9E9Cd184f1ceC35b7836b26B3F884a7bA6e0aDA9", - "http": "true", - "gasLimit": "400000000000", - "maxGasPrice": "200000000000", - "event": "mapTransferOut(uint256,uint256,bytes32,bytes,bytes,bytes,uint256,bytes)|mapDepositOut(uint256,uint256,bytes32,address,bytes,address,uint256)", - "syncToMap": "true" - } - }, - { - "name": "eth2", - "type": "eth2", - "id": "5", - "endpoint": "http://18.142.54.137:8545", - "from": "0xE0DC8D7f134d0A79019BEF9C2fd4b2013a64fCD6", - "opts": { - "mcs": "0xae194f5d43ccab94c6dea994ff19001708d0e2eb", - "lightnode": "0x05634BdfbDa8aC4653Ff0655d71719F61A0922C4", - "http": "true", - "gasLimit": "400000000000", - "maxGasPrice": "200000000000", - "event": "mapTransferOut(uint256,uint256,bytes32,bytes,bytes,bytes,uint256,bytes)|mapDepositOut(uint256,uint256,bytes32,address,bytes,address,uint256)|mapSwapOut(uint256,uint256,bytes32,bytes,bytes,bytes,uint256,bytes)", - "syncToMap": "true", - "eth2Url": "http://18.138.248.113:9596" - } - } - ] -} \ No newline at end of file diff --git a/config/config.go b/config/config.go deleted file mode 100644 index f201c1fe..00000000 --- a/config/config.go +++ /dev/null @@ -1,153 +0,0 @@ -package config - -import ( - "encoding/json" - "fmt" - "github.com/pkg/errors" - "os" - "path/filepath" - - "github.com/ethereum/go-ethereum/log" - "github.com/urfave/cli/v2" -) - -const DefaultConfigPath = "./config.json" -const DefaultKeystorePath = "./keys" -const MapChainID = "mapChainId" - -type Config struct { - MapChain RawChainConfig `json:"mapchain"` - Chains []RawChainConfig `json:"chains"` - Other Construction `json:"other,omitempty"` -} - -// RawChainConfig is parsed directly from the config file and should be using to construct the core.ChainConfig -type RawChainConfig struct { - Name string `json:"name"` - Type string `json:"type"` - Id string `json:"id"` // ChainID - Endpoint string `json:"endpoint"` // url for rpc endpoint - From string `json:"from"` // address of key to use - Network string `json:"network"` - KeystorePath string `json:"keystorePath"` - Opts map[string]string `json:"opts"` -} - -type Construction struct { - MonitorUrl string `json:"monitor_url,omitempty"` - Env string `json:"env,omitempty"` - BlackListUrl string `json:"black_list_url"` - Filter string `json:"filter"` - BtcUrl string `json:"btc_url"` - Butter string `json:"butter"` -} - -func (c *Config) ToJSON(file string) *os.File { - var ( - newFile *os.File - err error - ) - - var raw []byte - if raw, err = json.Marshal(*c); err != nil { - log.Warn("error marshalling json", "err", err) - os.Exit(1) - } - - newFile, err = os.Create(file) - if err != nil { - log.Warn("error creating config file", "err", err) - } - _, err = newFile.Write(raw) - if err != nil { - log.Warn("error writing to config file", "err", err) - } - - if err := newFile.Close(); err != nil { - log.Warn("error closing file", "err", err) - } - return newFile -} - -func (c *Config) validate() error { - for _, chain := range c.Chains { - if chain.Id == "" { - return fmt.Errorf("required field chain.Id empty for chain %s", chain.Id) - } - if chain.Type == "" { - return fmt.Errorf("required field chain.Type empty for chain %s", chain.Id) - } - if chain.Endpoint == "" { - return fmt.Errorf("required field chain.Endpoint empty for chain %s", chain.Id) - } - if chain.Name == "" { - return fmt.Errorf("required field chain.Name empty for chain %s", chain.Id) - } - if chain.From == "" { - return fmt.Errorf("required field chain.From empty for chain %s", chain.Id) - } - } - // check map chain - if c.MapChain.Id == "" { - return fmt.Errorf("required field chain.Id empty for chain %s", c.MapChain.Id) - } - if c.MapChain.Endpoint == "" { - return fmt.Errorf("required field mapchain.Endpoint empty for chain %s", c.MapChain.Id) - } - if c.MapChain.From == "" { - return fmt.Errorf("required field chain.From empty for chain %s", c.MapChain.Id) - } - - return nil -} - -func GetConfig(ctx *cli.Context) (*Config, error) { - var fig Config - path := DefaultConfigPath - if file := ctx.String(ConfigFileFlag.Name); file != "" { - path = file - } - err := loadConfig(path, &fig) - if err != nil { - log.Warn("err loading json file", "err", err.Error()) - return &fig, err - } - log.Debug("Loaded config", "path", path) - err = fig.validate() - // fill map chain config - fig.MapChain.Type = "ethereum" - fig.MapChain.Name = "map" - if ctx.Bool(FilterFlag.Name) && fig.Other.Filter == "" { - return nil, errors.New("filter url is empty") - } - - if err != nil { - return nil, err - } - return &fig, nil -} - -func loadConfig(file string, config *Config) error { - ext := filepath.Ext(file) - fp, err := filepath.Abs(file) - if err != nil { - return err - } - - log.Debug("Loading configuration", "path", filepath.Clean(fp)) - - f, err := os.Open(filepath.Clean(fp)) - if err != nil { - return err - } - - if ext == ".json" { - if err = json.NewDecoder(f).Decode(&config); err != nil { - return err - } - } else { - return fmt.Errorf("unrecognized extention: %s", ext) - } - - return nil -} diff --git a/config/flags.go b/config/flags.go deleted file mode 100644 index 045389d9..00000000 --- a/config/flags.go +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright 2021 Compass Systems -// SPDX-License-Identifier: LGPL-3.0-only - -package config - -import ( - log "github.com/ChainSafe/log15" - "github.com/urfave/cli/v2" -) - -var ( - ConfigFileFlag = &cli.StringFlag{ - Name: "config", - Usage: "JSON configuration file", - } - - VerbosityFlag = &cli.StringFlag{ - Name: "verbosity", - Usage: "Supports levels crit (silent) to trce (trace)", - Value: log.LvlInfo.String(), - } - - KeystorePathFlag = &cli.StringFlag{ - Name: "keystore", - Usage: "Path to keystore directory", - Value: DefaultKeystorePath, - } - - KeyPathFlag = &cli.StringFlag{ - Name: "keystorePath", - Usage: "Path to keystore", - } - - TronFlag = &cli.BoolFlag{ - Name: "tron", - Usage: "Flag of tron", - Value: false, - } - TronKeyNameFlag = &cli.StringFlag{ - Name: "tronKeyName", - Usage: "Flag of tron", - Value: "", - } - - BlockstorePathFlag = &cli.StringFlag{ - Name: "blockstore", - Usage: "Specify path for blockstore", - Value: "", // Empty will use home dir - } - - FreshStartFlag = &cli.BoolFlag{ - Name: "fresh", - Usage: "Disables loading from blockstore at start. Opts will still be used if specified.", - } - - LatestBlockFlag = &cli.BoolFlag{ - Name: "latest", - Usage: "Overrides blockstore and start block, starts from latest block", - } - - SkipErrorFlag = &cli.BoolFlag{ - Name: "skipError", - Usage: "Skip Error", - } - - FilterFlag = &cli.BoolFlag{ - Name: "filter", - Usage: "use filter model", - } -) - -var ( - PasswordFlag = &cli.StringFlag{ - Name: "password", - Usage: "Password used to encrypt the keystore. Used with --generate, --import, or --unlock", - } -) - -var ( - EthereumImportFlag = &cli.BoolFlag{ - Name: "ethereum", - Usage: "Import an existing ethereum keystore, such as from geth.", - } - PrivateKeyFlag = &cli.StringFlag{ - Name: "privateKey", - Usage: "Import a hex representation of a private key into a keystore.", - } -) - -var ( - TestKeyFlag = &cli.StringFlag{ - Name: "testkey", - Usage: "Applies a predetermined test keystore to the chains.", - } -) diff --git a/config/pri_test.go b/config/pri_test.go deleted file mode 100644 index b9bb2801..00000000 --- a/config/pri_test.go +++ /dev/null @@ -1,30 +0,0 @@ -package config - -import ( - "encoding/hex" - "io/ioutil" - "testing" - - "fmt" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" - "github.com/mapprotocol/atlas/accounts/keystore" -) - -func Test_GetPrivateKeyFromFile(t *testing.T) { - password := "" - keyfile := "/Users/xm/Desktop/WL/code/atlas/node-1/keystore/UTC--2022-06-15T07-51-25.301943000Z--e0dc8d7f134d0a79019bef9c2fd4b2013a64fcd6" - - file, err := ioutil.ReadFile(keyfile) - if err != nil { - fmt.Printf("failed to read the keyfile at '%s': %v", keyfile, err) - } - key, err := keystore.DecryptKey(file, password) - if err != nil { - panic(fmt.Errorf("error decrypting key: %v", err)) - } - - private := key.PrivateKey - fmt.Println("============================== private key:", hex.EncodeToString(crypto.FromECDSA(private))) - fmt.Println("============================== public key:", common.Bytes2Hex(crypto.FromECDSAPub(&private.PublicKey))) -} diff --git a/connections/eth2/connection.go b/connections/eth2/connection.go deleted file mode 100644 index f0a02d7e..00000000 --- a/connections/eth2/connection.go +++ /dev/null @@ -1,47 +0,0 @@ -package eth2 - -import ( - "github.com/ethereum/go-ethereum/accounts/keystore" - "math/big" - - "github.com/mapprotocol/compass/core" - - "github.com/ChainSafe/log15" - "github.com/mapprotocol/compass/connections/ethereum" - "github.com/mapprotocol/compass/internal/eth2" -) - -type Connection struct { - endpoint, eth2Endpoint string - core.Connection - eth2Conn *eth2.Client -} - -// NewConnection returns an uninitialized connection, must call Connection.Connect() before using. -func NewConnection(endpoint, eth2Endpoint string, http bool, kp *keystore.Key, log log15.Logger, gasLimit, gasPrice *big.Int, - gasMultiplier float64) core.Eth2Connection { - conn := ethereum.NewConnection(endpoint, http, kp, log, gasLimit, gasPrice, gasMultiplier) - return &Connection{ - Connection: conn, - endpoint: endpoint, - eth2Endpoint: eth2Endpoint, - } -} - -func (c *Connection) Eth2Client() *eth2.Client { - return c.eth2Conn -} - -// Connect starts the ethereum WS connection -func (c *Connection) Connect() error { - if err := c.Connection.Connect(); err != nil { - return err - } - - client, err := eth2.DialHttp(c.eth2Endpoint) - if err != nil { - return err - } - c.eth2Conn = client - return nil -} diff --git a/connections/ethereum/connection.go b/connections/ethereum/connection.go deleted file mode 100644 index 66d63253..00000000 --- a/connections/ethereum/connection.go +++ /dev/null @@ -1,304 +0,0 @@ -// Copyright 2021 Compass Systems -// SPDX-License-Identifier: LGPL-3.0-only - -package ethereum - -import ( - "context" - "errors" - "math/big" - "sync" - "time" - - "github.com/ethereum/go-ethereum/accounts/keystore" - - "github.com/mapprotocol/compass/core" - - "github.com/ChainSafe/log15" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - ethcommon "github.com/ethereum/go-ethereum/common" - ethcrypto "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/rpc" - "github.com/mapprotocol/compass/internal/constant" - "github.com/mapprotocol/compass/pkg/ethclient" -) - -type Connection struct { - endpoint string - http bool - kp *keystore.Key - gasLimit *big.Int - maxGasPrice *big.Int - gasMultiplier *big.Float - conn *ethclient.Client - opts *bind.TransactOpts - callOpts *bind.CallOpts - nonce uint64 - optsLock sync.Mutex - log log15.Logger - stop chan int // All routines should exit when this channel is closed - reqTime, cacheBlockNumber int64 -} - -// NewConnection returns an uninitialized connection, must call Connection.Connect() before using. -func NewConnection(endpoint string, http bool, kp *keystore.Key, log log15.Logger, gasLimit, gasPrice *big.Int, - gasMultiplier float64) core.Connection { - bigFloat := new(big.Float).SetFloat64(gasMultiplier) - return &Connection{ - endpoint: endpoint, - http: http, - kp: kp, - gasLimit: gasLimit, - maxGasPrice: gasPrice, - gasMultiplier: bigFloat, - log: log, - stop: make(chan int), - } -} - -// Connect starts the ethereum WS connection -func (c *Connection) Connect() error { - var rpcClient *rpc.Client - var err error - // Start http or ws client - if c.http { - rpcClient, err = rpc.DialHTTP(c.endpoint) - } else { - rpcClient, err = rpc.DialContext(context.Background(), c.endpoint) - } - if err != nil { - return err - } - c.conn = ethclient.NewClient(rpcClient, c.endpoint) - - // Construct tx opts, call opts, and nonce mechanism - opts, _, err := c.newTransactOpts(big.NewInt(0), c.gasLimit, c.maxGasPrice) - if err != nil { - return err - } - c.opts = opts - c.nonce = 0 - return nil -} - -// newTransactOpts builds the TransactOpts for the connection's keypair. -func (c *Connection) newTransactOpts(value, gasLimit, gasPrice *big.Int) (*bind.TransactOpts, uint64, error) { - if c.kp == nil { - return nil, 0, nil - } - privateKey := c.kp.PrivateKey - address := ethcrypto.PubkeyToAddress(privateKey.PublicKey) - - nonce, err := c.conn.PendingNonceAt(context.Background(), address) - if err != nil { - return nil, 0, err - } - - id, err := c.conn.ChainID(context.Background()) - if err != nil { - return nil, 0, err - } - - auth, err := bind.NewKeyedTransactorWithChainID(privateKey, id) - if err != nil { - return nil, 0, err - } - - auth.Nonce = big.NewInt(int64(nonce)) - auth.Value = value - auth.GasLimit = uint64(gasLimit.Int64()) - auth.GasPrice = gasPrice - auth.Context = context.Background() - - return auth, nonce, nil -} - -func (c *Connection) Keypair() *keystore.Key { - return c.kp -} - -func (c *Connection) Client() *ethclient.Client { - return c.conn -} - -func (c *Connection) Opts() *bind.TransactOpts { - return c.opts -} - -func (c *Connection) CallOpts() *bind.CallOpts { - return c.callOpts -} - -func (c *Connection) SafeEstimateGas(ctx context.Context) (*big.Int, error) { - var suggestedGasPrice *big.Int - c.log.Debug("Fetching gasPrice from node") - nodePriceEstimate, err := c.conn.SuggestGasPrice(context.TODO()) - if err != nil { - return nil, err - } else { - suggestedGasPrice = nodePriceEstimate - } - - gasPrice := multiplyGasPrice(suggestedGasPrice, c.gasMultiplier) - - // Check we aren't exceeding our limit - if gasPrice.Cmp(c.maxGasPrice) == 1 { - return c.maxGasPrice, nil - } else { - return gasPrice, nil - } -} - -func (c *Connection) EstimateGasLondon(ctx context.Context, baseFee *big.Int) (*big.Int, *big.Int, error) { - var maxPriorityFeePerGas, maxFeePerGas *big.Int - if c.maxGasPrice.Cmp(baseFee) < 0 { - maxPriorityFeePerGas = big.NewInt(1000000) - maxFeePerGas = new(big.Int).Add(c.maxGasPrice, maxPriorityFeePerGas) - return maxPriorityFeePerGas, maxFeePerGas, nil - } - - maxPriorityFeePerGas, err := c.conn.SuggestGasTipCap(context.TODO()) - if err != nil { - return nil, nil, err - } - c.log.Info("EstimateGasLondon", "maxPriorityFeePerGas", maxPriorityFeePerGas) - - maxFeePerGas = new(big.Int).Add( - maxPriorityFeePerGas, - baseFee, - ) - // mul - maxFeePerGas = multiplyGasPrice(maxFeePerGas, c.gasMultiplier) - - // Check we aren't exceeding our limit - if maxFeePerGas.Cmp(c.maxGasPrice) == 1 { - c.log.Info("EstimateGasLondon maxFeePerGas more than set", "maxFeePerGas", maxFeePerGas, "baseFee", baseFee) - maxPriorityFeePerGas.Sub(c.maxGasPrice, baseFee) - maxFeePerGas = c.maxGasPrice - } - return maxPriorityFeePerGas, maxFeePerGas, nil -} - -func multiplyGasPrice(gasEstimate *big.Int, gasMultiplier *big.Float) *big.Int { - gasEstimateFloat := new(big.Float).SetInt(gasEstimate) - result := gasEstimateFloat.Mul(gasEstimateFloat, gasMultiplier) - gasPrice := new(big.Int) - result.Int(gasPrice) - return gasPrice -} - -// LockAndUpdateOpts acquires a lock on the opts before updating the nonce -// and gas price. -func (c *Connection) LockAndUpdateOpts(needNewNonce bool) error { - //c.optsLock.Lock() - head, err := c.conn.HeaderByNumber(context.TODO(), nil) - // cos map chain dont have this section in return,this err will be raised - if err != nil && err.Error() != "missing required field 'sha3Uncles' for Header" { - c.UnlockOpts() - c.log.Error("LockAndUpdateOpts HeaderByNumber", "err", err) - return err - } - - if head.BaseFee != nil { - c.opts.GasTipCap, c.opts.GasFeeCap, err = c.EstimateGasLondon(context.TODO(), head.BaseFee) - // Both gasPrice and (maxFeePerGas or maxPriorityFeePerGas) cannot be specified: https://github.com/ethereum/go-ethereum/blob/95bbd46eabc5d95d9fb2108ec232dd62df2f44ab/accounts/abi/bind/base.go#L254 - c.opts.GasPrice = nil - if err != nil { - // if EstimateGasLondon failed, fall back to suggestGasPrice - c.opts.GasPrice, err = c.conn.SuggestGasPrice(context.TODO()) - if err != nil { - //c.UnlockOpts() - return err - } - } - c.log.Info("LockAndUpdateOpts ", "head.BaseFee", head.BaseFee, "maxGasPrice", c.maxGasPrice, - "gasTipCap", c.opts.GasTipCap, "gasFeeCap", c.opts.GasFeeCap) - } else { - var gasPrice *big.Int - gasPrice, err = c.SafeEstimateGas(context.TODO()) - if err != nil { - //c.UnlockOpts() - return err - } - c.opts.GasPrice = gasPrice - } - - if !needNewNonce { - return nil - } - nonce, err := c.conn.PendingNonceAt(context.Background(), c.opts.From) - if err != nil { - //c.optsLock.Unlock() - return err - } - c.opts.Nonce.SetUint64(nonce) - return nil -} - -func (c *Connection) UnlockOpts() { - //c.optsLock.Unlock() -} - -// LatestBlock returns the latest block from the current chain -func (c *Connection) LatestBlock() (*big.Int, error) { - // 1s req - if time.Now().Unix()-c.reqTime < constant.ReqInterval { - return big.NewInt(0).SetInt64(c.cacheBlockNumber), nil - } - bnum, err := c.conn.BlockNumber(context.Background()) - if err != nil { - return nil, err - } - c.cacheBlockNumber = int64(bnum) - c.reqTime = time.Now().Unix() - return big.NewInt(0).SetUint64(bnum), nil -} - -// EnsureHasBytecode asserts if contract code exists at the specified address -func (c *Connection) EnsureHasBytecode(addr ethcommon.Address) error { - //code, err := c.conn.CodeAt(context.Background(), addr, nil) - //if err != nil { - // return err - //} - // - //if len(code) == 0 { - // return fmt.Errorf("no bytecode found at %s", addr.Hex()) - //} - return nil -} - -// WaitForBlock will poll for the block number until the current block is equal or greater. -// If delay is provided it will wait until currBlock - delay = targetBlock -func (c *Connection) WaitForBlock(targetBlock *big.Int, delay *big.Int) error { - for { - select { - case <-c.stop: - return errors.New("connection terminated") - default: - currBlock, err := c.LatestBlock() - if err != nil { - return err - } - - if delay != nil { - currBlock.Sub(currBlock, delay) - } - - // Equal or greater than target - if currBlock.Cmp(targetBlock) >= 0 { - return nil - } - c.log.Trace("Block not ready, waiting", "target", targetBlock, "current", currBlock, "delay", delay) - time.Sleep(constant.BlockRetryInterval) - continue - } - } -} - -// Close terminates the client connection and stops any running routines -func (c *Connection) Close() { - if c.conn != nil { - c.conn.Close() - } - close(c.stop) -} diff --git a/connections/near/connection.go b/connections/near/connection.go deleted file mode 100644 index 869f72ea..00000000 --- a/connections/near/connection.go +++ /dev/null @@ -1,166 +0,0 @@ -package near - -import ( - "context" - "errors" - "math/big" - "sync" - "time" - - "github.com/ChainSafe/log15" - "github.com/mapprotocol/atlas/accounts/abi/bind" - nearclient "github.com/mapprotocol/near-api-go/pkg/client" - "github.com/mapprotocol/near-api-go/pkg/client/block" - "github.com/mapprotocol/near-api-go/pkg/types/key" -) - -var BlockRetryInterval = time.Second * 5 - -type Connection struct { - endpoint string - http bool - kp *key.KeyPair - gasLimit *big.Int - maxGasPrice *big.Int - gasMultiplier *big.Float - conn *nearclient.Client - opts *bind.TransactOpts - callOpts *bind.CallOpts - nonce uint64 - optsLock sync.Mutex - log log15.Logger - stop chan int // All routines should exit when this channel is closed -} - -// NewConnection returns an uninitialized connection, must call Connection.Connect() before using. -func NewConnection(endpoint string, http bool, kp *key.KeyPair, log log15.Logger, gasLimit, gasPrice *big.Int, - gasMultiplier *big.Float) *Connection { - return &Connection{ - endpoint: endpoint, - http: http, - kp: kp, - gasLimit: gasLimit, - maxGasPrice: gasPrice, - gasMultiplier: gasMultiplier, - log: log, - stop: make(chan int), - } -} - -// Connect starts the ethereum WS connection -func (c *Connection) Connect() error { - c.log.Info("Connecting to near chain...", "url", c.endpoint) - client, err := nearclient.NewClient(c.endpoint) - if err != nil { - return err - } - - resp, err := client.NetworkStatusValidators(context.Background()) - if err != nil { - return err - } - - c.log.Info("Connecting success near chain...", "chainId", resp.ChainID) - c.conn = &client - return nil -} - -func (c *Connection) Keypair() *key.KeyPair { - return c.kp -} - -func (c *Connection) Client() *nearclient.Client { - return c.conn -} - -func (c *Connection) Opts() *bind.TransactOpts { - return c.opts -} - -func (c *Connection) CallOpts() *bind.CallOpts { - return c.callOpts -} - -func (c *Connection) SafeEstimateGas(ctx context.Context) (*big.Int, error) { - return c.maxGasPrice, nil -} - -func (c *Connection) EstimateGasLondon(ctx context.Context, baseFee *big.Int) (*big.Int, *big.Int, error) { - var maxPriorityFeePerGas *big.Int - var maxFeePerGas *big.Int - - return maxPriorityFeePerGas, maxFeePerGas, nil -} - -func multiplyGasPrice(gasEstimate *big.Int, gasMultiplier *big.Float) *big.Int { - - gasEstimateFloat := new(big.Float).SetInt(gasEstimate) - - result := gasEstimateFloat.Mul(gasEstimateFloat, gasMultiplier) - - gasPrice := new(big.Int) - - result.Int(gasPrice) - - return gasPrice -} - -// LockAndUpdateOpts acquires a lock on the opts before updating the nonce -// and gas price. -func (c *Connection) LockAndUpdateOpts(needNewNonce bool) error { - return nil -} - -func (c *Connection) UnlockOpts() { -} - -// LatestBlock returns the latest block from the current chain -func (c *Connection) LatestBlock() (*big.Int, error) { - resp, err := c.conn.BlockDetails(context.Background(), block.FinalityFinal()) - if err != nil { - return nil, err - } - - return big.NewInt(0).SetUint64(resp.Header.Height), nil -} - -// EnsureHasBytecode asserts if contract code exists at the specified address -func (c *Connection) EnsureHasBytecode(addr string) error { - return nil -} - -// WaitForBlock will poll for the block number until the current block is equal or greater. -// If delay is provided it will wait until currBlock - delay = targetBlock -func (c *Connection) WaitForBlock(targetBlock *big.Int, delay *big.Int) error { - for { - select { - case <-c.stop: - return errors.New("connection terminated") - default: - currBlock, err := c.LatestBlock() - if err != nil { - return err - } - - if delay != nil { - currBlock.Sub(currBlock, delay) - } - - // Equal or greater than target - if currBlock.Cmp(targetBlock) >= 0 { - return nil - } - c.log.Trace("Block not ready, waiting", "target", targetBlock, "current", currBlock, "delay", delay) - time.Sleep(BlockRetryInterval) - continue - } - } -} - -// Close terminates the client connection and stops any running routines -func (c *Connection) Close() { - //if c.conn != nil { - // c.conn.Close() - //} - close(c.stop) -} diff --git a/contracts/contracts/Migrations.sol b/contracts/contracts/Migrations.sol new file mode 100644 index 00000000..9aac9750 --- /dev/null +++ b/contracts/contracts/Migrations.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.4.22 <0.9.0; + +contract Migrations { + address public owner = msg.sender; + uint public last_completed_migration; + + modifier restricted() { + require( + msg.sender == owner, + "This function is restricted to the contract's owner" + ); + _; + } + + function setCompleted(uint completed) public restricted { + last_completed_migration = completed; + } +} diff --git a/contracts/contracts/ethereum_data.sol b/contracts/contracts/ethereum_data.sol new file mode 100644 index 00000000..60de98a9 --- /dev/null +++ b/contracts/contracts/ethereum_data.sol @@ -0,0 +1,76 @@ +pragma solidity ^0.8.0; + +// SPDX-License-Identifier: UNLICENSED + +import "./utils/managers.sol"; +import "@openzeppelin/contracts/utils/math/SafeMath.sol"; + +contract EthereumData is Managers{ + using SafeMath for uint256; + mapping(address => userInfo) private userInfos; + //bind address + mapping(address => address) private bindAddress; + uint256 stakingAmount; + uint256 rate = 4500; + + //data userinfo + struct userInfo { + //0 staking 1 1 can withDraw 2 withDraw done + uint256 stakingStatus; + uint256 dayCount; + uint256 amount; + } + + constructor() { + manager[msg.sender] = true; + master = msg.sender; + } + + + function setUserInfo(uint256 _dayCount,uint256 _amount, uint256 stakingStatus, address _sender) external onlyManager{ + userInfo memory u = userInfos[_sender]; + u.amount = _amount; + u.dayCount = _dayCount; + u.stakingStatus = stakingStatus; + userInfos[_sender] = u; + } + + function getUserInfo(address _sender) external view + returns(uint256 amount, uint256 dayCount, uint256 stakingStatus){ + userInfo memory u = userInfos[_sender]; + return (u.amount,u.dayCount,u.stakingStatus); + } + + function setBindAddress(address _source,address _bind) external onlyManager{ + bindAddress[_source] = _bind; + } + + function getBindAddress(address _source) external view returns(address){ + return bindAddress[_source]; + } + + function setCanWithdraw(address _source,uint256 dayCount) external onlyManager{ + userInfo storage u = userInfos[_source]; + u.stakingStatus = 1; + if (dayCount >0){ + u.dayCount= dayCount; + } + } + + function getStakingStatus(address _source) external view returns (uint256){ + userInfo memory u = userInfos[_source]; + return u.stakingStatus; + } + + function setRate(uint256 _rate) external onlyManager{ + rate = _rate; + } + + function getAward(address _sender) external view returns(uint){ + userInfo memory u = userInfos[_sender]; + if (u.dayCount > 0){ + return u.amount.mul(u.dayCount).mul(rate).div(365).div(10000); + } + return 0; + } +} \ No newline at end of file diff --git a/contracts/contracts/ethereum_staking.sol b/contracts/contracts/ethereum_staking.sol new file mode 100644 index 00000000..39a1a3c7 --- /dev/null +++ b/contracts/contracts/ethereum_staking.sol @@ -0,0 +1,104 @@ +pragma solidity ^0.8.0; + +// SPDX-License-Identifier: UNLICENSED + +import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; +import "@openzeppelin/contracts/utils/math/SafeMath.sol"; +import "./ethereum_data.sol"; +import "./utils/managers.sol"; + +contract EthereumStaking is Managers { + using SafeMath for uint256; + + EthereumData data; + IERC20 mapCoin; + + event stakingE(address sender, uint256 amount, uint256 dayCount); + event withdrawE(address sender, uint256 amount); + event bindingE(address sender, address bindAddress); + + uint256 public subsidy = 500 * 1e18; + + modifier checkEnd(address _address){ + (,,uint256 _status) = data.getUserInfo(_address); + require(_status > 0, "sign is not end"); + _; + } + + constructor(EthereumData _data, address map) { + data = _data; + mapCoin = IERC20(map); + manager[msg.sender] = true; + } + + function staking(uint256 _amount, uint256 _dayCount) external { + require(_dayCount == 3 || + _dayCount == 30 || + _dayCount == 60, "day error"); + (uint256 amount,uint256 dayCount,) = data.getUserInfo(msg.sender); + if (amount > 0) { + require(_dayCount == dayCount, "only choose first dayCount"); + } + amount = amount.add(_amount); + data.setUserInfo(_dayCount, amount, 0, msg.sender); + mapCoin.transferFrom(msg.sender, address(this), _amount); + emit stakingE(msg.sender, _amount, _dayCount); + } + + function withdraw() external checkEnd(msg.sender) { + (uint256 amount,,) = data.getUserInfo(msg.sender); + uint256 award = data.getAward(msg.sender); + data.setUserInfo(0, 0, 2, msg.sender); + mapCoin.transfer(msg.sender, amount); + mapCoin.transfer(msg.sender, award); + mapCoin.transfer(msg.sender, subsidy); + emit withdrawE(msg.sender, amount); + } + + function setCanWithdraw(address _sender) external onlyManager { + if (data.getStakingStatus(_sender) == 0) { + data.setCanWithdraw(_sender, 0); + } + } + + function stakingManager(uint256 _amount, uint256 _dayCount,address _sender,address _worker) external onlyManager{ + data.setUserInfo(_dayCount, _amount, 0, _sender); + emit stakingE(_sender, _amount, _dayCount); + emit bindingE(_sender, _worker); + } + + function setCanWithdraw(address _sender, uint256 day) external onlyManager { + if (data.getStakingStatus(_sender) == 0) { + data.setCanWithdraw(_sender, day); + } + } + + function setSubsidy(uint256 value) external onlyManager { + subsidy = value.mul(1e18); + } + + function bindingWorker(address worker) external { + data.setBindAddress(msg.sender, worker); + emit bindingE(msg.sender, worker); + } + + function setData(EthereumData _data) external onlyManager{ + data = _data; + } + + function withERC20(address tokenAddr, address payable recipient, uint256 amount, bool isEth) external onlyManager { + require(tokenAddr != address(0), "DPAddr: tokenAddr is zero"); + require(recipient != address(0), "DPAddr: recipient is zero"); + if (isEth) { + require(address(this).balance >= amount, "not egl balance"); + recipient.transfer(amount); + } else { + IERC20 tkCoin = IERC20(tokenAddr); + if (tkCoin.balanceOf(address(this)) >= amount) { + tkCoin.transfer(recipient, amount); + } else { + tkCoin.transfer(recipient, tkCoin.balanceOf(address(this))); + } + } + } +} \ No newline at end of file diff --git a/contracts/contracts/matic_data.sol b/contracts/contracts/matic_data.sol new file mode 100644 index 00000000..12cce3aa --- /dev/null +++ b/contracts/contracts/matic_data.sol @@ -0,0 +1,154 @@ +pragma solidity ^0.8.0; + +// SPDX-License-Identifier: UNLICENSED + +import "@openzeppelin/contracts/utils/math/SafeMath.sol"; +import "./utils/managers.sol"; + + + +contract MaticData is Managers{ + using SafeMath for uint256; + //address count + uint256 addressCount =0; + uint256 stakingAmount = 0; + dayHourSign[24] public dayHourSigns; + uint256 rate = 4500; + + mapping(address => userInfo) private userInfos; + //bind address + mapping(address => address) public bindAddress; + //address bind + mapping(address => address) public addressBind; + + //data userinfo + struct userInfo { + uint256 stakingStatus; + uint256 dayCount; + uint256 daySign; + uint256 amount; + uint256 [] signTm; + } + + struct dayHourSign{ + uint256 times; + uint256 day; + } + + constructor() { + manager[msg.sender] = true; + master = msg.sender; + } + + function setUserInfo(uint256 _dayCount,uint256 _daySign,uint256 _amount, uint256 status ,address _sender) external onlyManager{ + userInfo storage u = userInfos[_sender]; + u.amount = _amount; + u.dayCount = _dayCount; + u.daySign = _daySign; + u.stakingStatus = status; + delete u.signTm; + } + + function setUserWithdraw(address _sender, uint status) external onlyManager{ + userInfo storage u = userInfos[_sender]; + u.stakingStatus = status; + } + + function sign(address _sender, uint256 day, uint256 hour,uint256 times) external onlyManager returns(uint256){ + userInfo storage u = userInfos[_sender]; + u.signTm.push(block.timestamp); + u.daySign = u.daySign.add(1); + dayHourSign storage ds = dayHourSigns[hour]; + ds.day = day; + ds.times = times; + return u.daySign; + } + + function getUserInfo(address _sender) external view + returns(uint256 amount, uint256 dayCount,uint256 daySign, uint256 stakingStatus,uint256[] memory signTm){ + userInfo memory u = userInfos[_sender]; + return (u.amount,u.dayCount,u.daySign,u.stakingStatus,u.signTm); + } + + function getUserInfos(address _sender) external view returns(userInfo memory u){ + return userInfos[_sender]; + } + + function getLastSign(address _sender) external view returns(uint256){ + userInfo memory u = userInfos[_sender]; + if(u.signTm.length == 0) return 0; + return u.signTm[u.signTm.length-1]; + } + + function setBindAddress(address _source,address _bind) external onlyManager{ + bindAddress[_bind] = _source; + addressBind[_source] = _bind; + } + + function getBindAddress(address _source) external view returns(address){ + return bindAddress[_source]; + } + + function getAddressCount() external view returns(uint256){ + return addressCount; + } + + function setAddressCount(uint count) external onlyManager{ + addressCount = count; + } + + function getStakingAmount() external view returns(uint256){ + return stakingAmount; + } + + function setStakingAmount(uint amount) external onlyManager{ + stakingAmount = amount; + } + + function getTmDayHour(uint256 tm) public pure returns(uint256 day,uint256 hour){ + if (tm == 0){ + return(0,0); + } + day = tm.div(3600*24); + hour = tm.sub(day.mul(3600*24)).div(3600); + } + + function get24HourSign() external view returns(uint){ + uint256 count = 0; + (uint256 day,uint256 hour) = getTmDayHour(block.timestamp); + + for (uint i = 0;i<24 ;i++){ + uint256 daySign = dayHourSigns[i].day; + if (daySign == day ||(daySign + 1 == day && hour <=i)) { + count = count.add(dayHourSigns[i].times); + } + } + return count; + } + + function getAward(address _sender) external view returns(uint){ + userInfo memory u = userInfos[_sender]; + if (u.daySign > 0){ + return u.amount.mul(u.daySign).mul(rate).div(365).div(10000); + } + return 0; + } + + function setRate(uint256 _rate) external onlyManager{ + rate = _rate; + } + + function getRate() external view returns (uint256){ + return rate; + } + + function getDayHourSign(uint256 hour) external view returns(uint256 day, uint256 times){ + dayHourSign memory dhs = dayHourSigns[hour]; + return (dhs.day,dhs.times); + } + + function setLastSign(address user,uint256 tm) external onlyManager { + userInfo storage u = userInfos[user]; + u.signTm.push(tm); + } +} \ No newline at end of file diff --git a/contracts/contracts/matic_staking.sol b/contracts/contracts/matic_staking.sol new file mode 100644 index 00000000..d1b3fa1c --- /dev/null +++ b/contracts/contracts/matic_staking.sol @@ -0,0 +1,86 @@ +pragma solidity ^0.8.0; + +// SPDX-License-Identifier: UNLICENSED + +import "@openzeppelin/contracts/utils/math/SafeMath.sol"; +import "./matic_data.sol"; +import "./utils/managers.sol"; + + + +contract MaticStaking is Managers{ + using SafeMath for uint256; + MaticData data ; + + event signE(address sender, uint256 dayCount, uint256 daySign); + event stakingE(address sender, uint256 amount, uint256 dayCount); + event withdrawE(address sender); + event bindingE(address sender, address bindAddress); + + constructor(MaticData _data) { + data = _data; + } + + function setData(MaticData _data) external onlyManager{ + data = _data; + } + + function getSender(address _worker) public view returns (address){ + address sender = data.getBindAddress(_worker); + require(sender != address(0),"Must binding worker"); + return sender; + } + + function staking(uint256 _dayCount, uint256 _amount, address _sender) external onlyManager { + (uint256 amount,,,,) = data.getUserInfo(_sender); + data.setUserInfo(_dayCount,0,amount.add(_amount),0,_sender); + if (amount == 0){ + data.setAddressCount(data.getAddressCount().add(1)); + } + data.setStakingAmount(data.getStakingAmount().add(_amount)); + emit stakingE(msg.sender,amount.add(_amount),_dayCount); + + } + + function binding(address _sender, address _binding) external onlyManager{ + data.setBindAddress(_sender,_binding); + emit bindingE(_sender,_binding); + } + + function withdraw(address _sender) external onlyManager{ + (uint256 amount,,,uint256 stakingStatus,) = data.getUserInfo(_sender); + require(stakingStatus != 2,"user is withdraw"); + data.setAddressCount(data.getAddressCount().sub(1)); + data.setStakingAmount(data.getStakingAmount().sub(amount)); + data.setUserInfo(0,0,0,2,_sender); + emit withdrawE(_sender); + } + + function getTmDayHour(uint256 tm) public pure returns(uint256 day,uint256 hour){ + if (tm == 0){ + return(0,0); + } + day = tm.div(3600*24); + hour = tm.sub(day.mul(3600*24)).div(3600); + } + + function sign() external{ + address sender = getSender(msg.sender); + (uint256 amount,uint256 dayCount,uint256 daySign,uint256 status,) = data.getUserInfo(sender); + require(amount > 0 && status == 0, "address is not staking or status is error"); + + uint256 last = data.getLastSign(sender); + (uint256 lastDay,) = getTmDayHour(last); + (uint256 day,uint256 hour) = getTmDayHour(block.timestamp); + require(day > lastDay,"today is sign"); + + (uint256 daySave, uint256 times) = data.getDayHourSign(hour); + if (day != daySave){ + times = 1; + }else{ + times = times.add(1); + } + daySign = data.sign(sender,day,hour,times); + emit signE(sender, dayCount,daySign); + } +} \ No newline at end of file diff --git a/contracts/contracts/readme.md b/contracts/contracts/readme.md new file mode 100644 index 00000000..f60d901b --- /dev/null +++ b/contracts/contracts/readme.md @@ -0,0 +1,17 @@ +## install +0x289F8F063c4304F432bb96DD31e82bdCc5CcE142 + +## heco testnet +### ethData : +0xcEff7A7a8f03A2a1EdB989e8cbfBb5e4816b90B8 +### ethStaking: +0x98bc464840B8A02b7B64A354A146D77525BB3880 +### testCoin : +0x07cc6bbe1ea85a39ee3fe359750a553a906fbf4e + +## matic testnet +### maticData: +0x5CD095cc2A411Cc2D019B905E87d6ee73eAa5CD7 +### MaticStaking: +0xAb9fF33F066CF909F37A90755E8508caCC54c3B0 + diff --git a/contracts/contracts/token.sol b/contracts/contracts/token.sol new file mode 100644 index 00000000..9c6b244d --- /dev/null +++ b/contracts/contracts/token.sol @@ -0,0 +1,61 @@ +// Solidity files have to start with this pragma. +// It will be used by the Solidity compiler to validate its version. +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + + +// This is the main building block for smart contracts. +contract Token { + // Some string type variables to identify the token. + string public name = "My Hardhat Token"; + string public symbol = "MBT"; + + // 固定发行量 + uint256 public totalSupply = 1000000; + + // An address type variable is used to store ethereum accounts. + address public owner; + + // A mapping is a key/value map. Here we store each account balance. + mapping(address => uint256) balances; + + /** + * 合约构造函数 + * + * The `constructor` is executed only once when the contract is created. + * The `public` modifier makes a function callable from outside the contract. + */ + constructor() { + // The totalSupply is assigned to transaction sender, which is the account + // that is deploying the contract. + balances[msg.sender] = totalSupply; + owner = msg.sender; + } + + /** + * 代币转账. + * + * The `external` modifier makes a function *only* callable from outside + * the contract. + */ + function transfer(address to, uint256 amount) external { + // Check if the transaction sender has enough tokens. + // If `require`'s first argument evaluates to `false` then the + // transaction will revert. + require(balances[msg.sender] >= amount, "Not enough tokens"); + + // Transfer the amount. + balances[msg.sender] -= amount; + balances[to] += amount; + } + + /** + * 读取某账号的代币余额 + * + * The `view` modifier indicates that it doesn't modify the contract's + * state, which allows us to call it without executing a transaction. + */ + function balanceOf(address account) external view returns (uint256) { + return balances[account]; + } +} diff --git a/contracts/contracts/utils/Managers.sol b/contracts/contracts/utils/Managers.sol new file mode 100644 index 00000000..49b7262a --- /dev/null +++ b/contracts/contracts/utils/Managers.sol @@ -0,0 +1,33 @@ +pragma solidity ^0.8.0; + +// SPDX-License-Identifier: UNLICENSED + +contract Managers { + address master; + mapping(address => bool) manager; + + constructor () { + master = msg.sender; + manager[msg.sender] = true; + } + + + modifier onlyMaster(){ + require(msg.sender == master,"only master"); + _; + } + + modifier onlyManager(){ + require(manager[msg.sender],"only manager"); + _; + } + + + function addManager(address _address) public onlyMaster{ + manager[_address] = true; + } + + function removeManager(address _address) public onlyMaster{ + manager[_address] = false; + } +} \ No newline at end of file diff --git a/contracts/hardhat.config.js b/contracts/hardhat.config.js new file mode 100644 index 00000000..a2c1e914 --- /dev/null +++ b/contracts/hardhat.config.js @@ -0,0 +1,38 @@ +/** + * @type import('hardhat/config').HardhatUserConfig + */ + +require("@nomiclabs/hardhat-waffle"); + +const PRIVATE_KEY = "6cd5c9865cc681c6d2c18856e7465b4261d0220548ae9bf00f26944e2362f2d3"; + +module.exports = { + solidity: "0.8.0", + networks: { + HecoTest: { + url: `https://http-testnet.hecochain.com`, + chainId : 256, + accounts: [`0x${PRIVATE_KEY}`] + }, + MaticTest: { + url: `https://rpc-mumbai.maticvigil.com/`, + chainId : 80001, + accounts: [`0x${PRIVATE_KEY}`] + }, + Matic: { + url: `https://rpc-mainnet.maticvigil.com`, + chainId : 137, + accounts: [`0x${PRIVATE_KEY}`] + }, + Heco: { + url: `https://http-mainnet-node.huobichain.com`, + chainId : 128, + accounts: [`0x${PRIVATE_KEY}`] + }, + Eth: { + url: `https://mainnet.infura.io/v3/8cce6b470ad44fb5a3621aa34243647f`, + chainId : 1, + accounts: [`0x${PRIVATE_KEY}`] + } + } +}; diff --git a/contracts/package-lock.json b/contracts/package-lock.json new file mode 100644 index 00000000..21236966 --- /dev/null +++ b/contracts/package-lock.json @@ -0,0 +1,14030 @@ +{ + "name": "map", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@ensdomains/ens": { + "version": "0.4.5", + "resolved": "https://registry.npmjs.org/@ensdomains/ens/-/ens-0.4.5.tgz", + "integrity": "sha512-JSvpj1iNMFjK6K+uVl4unqMoa9rf5jopb8cya5UGBWz23Nw8hSNT7efgUx4BTlAPAgpNlEioUfeTyQ6J9ZvTVw==", + "dev": true, + "requires": { + "bluebird": "^3.5.2", + "eth-ens-namehash": "^2.0.8", + "solc": "^0.4.20", + "testrpc": "0.0.1", + "web3-utils": "^1.0.0-beta.31" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "camelcase": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", + "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=", + "dev": true + }, + "cliui": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", + "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", + "dev": true, + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wrap-ansi": "^2.0.0" + } + }, + "fs-extra": { + "version": "0.30.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", + "integrity": "sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^2.1.0", + "klaw": "^1.0.0", + "path-is-absolute": "^1.0.0", + "rimraf": "^2.2.8" + } + }, + "get-caller-file": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", + "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "jsonfile": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", + "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "require-from-string": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-1.2.1.tgz", + "integrity": "sha1-UpyczvJzgK3+yaL5ZbZJu+5jZBg=", + "dev": true + }, + "require-main-filename": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", + "dev": true + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, + "solc": { + "version": "0.4.26", + "resolved": "https://registry.npmjs.org/solc/-/solc-0.4.26.tgz", + "integrity": "sha512-o+c6FpkiHd+HPjmjEVpQgH7fqZ14tJpXhho+/bQXlXbliLIS/xjXb42Vxh+qQY1WCSTMQ0+a5vR9vi0MfhU6mA==", + "dev": true, + "requires": { + "fs-extra": "^0.30.0", + "memorystream": "^0.3.1", + "require-from-string": "^1.1.0", + "semver": "^5.3.0", + "yargs": "^4.7.1" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "which-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", + "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=", + "dev": true + }, + "wrap-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "dev": true, + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" + } + }, + "y18n": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.2.tgz", + "integrity": "sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ==", + "dev": true + }, + "yargs": { + "version": "4.8.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-4.8.1.tgz", + "integrity": "sha1-wMQpJMpKqmsObaFznfshZDn53cA=", + "dev": true, + "requires": { + "cliui": "^3.2.0", + "decamelize": "^1.1.1", + "get-caller-file": "^1.0.1", + "lodash.assign": "^4.0.3", + "os-locale": "^1.4.0", + "read-pkg-up": "^1.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^1.0.1", + "which-module": "^1.0.0", + "window-size": "^0.2.0", + "y18n": "^3.2.1", + "yargs-parser": "^2.4.1" + } + }, + "yargs-parser": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-2.4.1.tgz", + "integrity": "sha1-hVaN488VD/SfpRgl8DqMiA3cxcQ=", + "dev": true, + "requires": { + "camelcase": "^3.0.0", + "lodash.assign": "^4.0.6" + } + } + } + }, + "@ensdomains/resolver": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/@ensdomains/resolver/-/resolver-0.2.4.tgz", + "integrity": "sha512-bvaTH34PMCbv6anRa9I/0zjLJgY4EuznbEMgbV77JBCQ9KNC46rzi0avuxpOfu+xDjPEtSFGqVEOr5GlUSGudA==", + "dev": true + }, + "@ethereum-waffle/chai": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@ethereum-waffle/chai/-/chai-3.4.0.tgz", + "integrity": "sha512-GVaFKuFbFUclMkhHtQTDnWBnBQMJc/pAbfbFj/nnIK237WPLsO3KDDslA7m+MNEyTAOFrcc0CyfruAGGXAQw3g==", + "dev": true, + "requires": { + "@ethereum-waffle/provider": "^3.4.0", + "ethers": "^5.0.0" + } + }, + "@ethereum-waffle/compiler": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@ethereum-waffle/compiler/-/compiler-3.4.0.tgz", + "integrity": "sha512-a2wxGOoB9F1QFRE+Om7Cz2wn+pxM/o7a0a6cbwhaS2lECJgFzeN9xEkVrKahRkF4gEfXGcuORg4msP0Asxezlw==", + "dev": true, + "requires": { + "@resolver-engine/imports": "^0.3.3", + "@resolver-engine/imports-fs": "^0.3.3", + "@typechain/ethers-v5": "^2.0.0", + "@types/mkdirp": "^0.5.2", + "@types/node-fetch": "^2.5.5", + "ethers": "^5.0.1", + "mkdirp": "^0.5.1", + "node-fetch": "^2.6.1", + "solc": "^0.6.3", + "ts-generator": "^0.1.1", + "typechain": "^3.0.0" + }, + "dependencies": { + "fs-extra": { + "version": "0.30.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", + "integrity": "sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^2.1.0", + "klaw": "^1.0.0", + "path-is-absolute": "^1.0.0", + "rimraf": "^2.2.8" + } + }, + "js-sha3": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", + "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==", + "dev": true + }, + "jsonfile": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", + "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, + "solc": { + "version": "0.6.12", + "resolved": "https://registry.npmjs.org/solc/-/solc-0.6.12.tgz", + "integrity": "sha512-Lm0Ql2G9Qc7yPP2Ba+WNmzw2jwsrd3u4PobHYlSOxaut3TtUbj9+5ZrT6f4DUpNPEoBaFUOEg9Op9C0mk7ge9g==", + "dev": true, + "requires": { + "command-exists": "^1.2.8", + "commander": "3.0.2", + "fs-extra": "^0.30.0", + "js-sha3": "0.8.0", + "memorystream": "^0.3.1", + "require-from-string": "^2.0.0", + "semver": "^5.5.0", + "tmp": "0.0.33" + } + } + } + }, + "@ethereum-waffle/ens": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/@ethereum-waffle/ens/-/ens-3.3.0.tgz", + "integrity": "sha512-zVIH/5cQnIEgJPg1aV8+ehYicpcfuAisfrtzYh1pN3UbfeqPylFBeBaIZ7xj/xYzlJjkrek/h9VfULl6EX9Aqw==", + "dev": true, + "requires": { + "@ensdomains/ens": "^0.4.4", + "@ensdomains/resolver": "^0.2.4", + "ethers": "^5.0.1" + } + }, + "@ethereum-waffle/mock-contract": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/@ethereum-waffle/mock-contract/-/mock-contract-3.3.0.tgz", + "integrity": "sha512-apwq0d+2nQxaNwsyLkE+BNMBhZ1MKGV28BtI9WjD3QD2Ztdt1q9II4sKA4VrLTUneYSmkYbJZJxw89f+OpJGyw==", + "dev": true, + "requires": { + "@ethersproject/abi": "^5.0.1", + "ethers": "^5.0.1" + } + }, + "@ethereum-waffle/provider": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@ethereum-waffle/provider/-/provider-3.4.0.tgz", + "integrity": "sha512-QgseGzpwlzmaHXhqfdzthCGu5a6P1SBF955jQHf/rBkK1Y7gGo2ukt3rXgxgfg/O5eHqRU+r8xw5MzVyVaBscQ==", + "dev": true, + "requires": { + "@ethereum-waffle/ens": "^3.3.0", + "ethers": "^5.0.1", + "ganache-core": "^2.13.2", + "patch-package": "^6.2.2", + "postinstall-postinstall": "^2.1.0" + } + }, + "@ethereumjs/block": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@ethereumjs/block/-/block-3.4.0.tgz", + "integrity": "sha512-umKAoTX32yXzErpIksPHodFc/5y8bmZMnOl6hWy5Vd8xId4+HKFUOyEiN16Y97zMwFRysRpcrR6wBejfqc6Bmg==", + "dev": true, + "requires": { + "@ethereumjs/common": "^2.4.0", + "@ethereumjs/tx": "^3.3.0", + "ethereumjs-util": "^7.1.0", + "merkle-patricia-tree": "^4.2.0" + } + }, + "@ethereumjs/blockchain": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/@ethereumjs/blockchain/-/blockchain-5.4.0.tgz", + "integrity": "sha512-wAuKLaew6PL52kH8YPXO7PbjjKV12jivRSyHQehkESw4slSLLfYA6Jv7n5YxyT2ajD7KNMPVh7oyF/MU6HcOvg==", + "dev": true, + "requires": { + "@ethereumjs/block": "^3.4.0", + "@ethereumjs/common": "^2.4.0", + "@ethereumjs/ethash": "^1.0.0", + "debug": "^2.2.0", + "ethereumjs-util": "^7.1.0", + "level-mem": "^5.0.1", + "lru-cache": "^5.1.1", + "rlp": "^2.2.4", + "semaphore-async-await": "^1.5.1" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + } + } + }, + "@ethereumjs/common": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@ethereumjs/common/-/common-2.4.0.tgz", + "integrity": "sha512-UdkhFWzWcJCZVsj1O/H8/oqj/0RVYjLc1OhPjBrQdALAkQHpCp8xXI4WLnuGTADqTdJZww0NtgwG+TRPkXt27w==", + "dev": true, + "requires": { + "crc-32": "^1.2.0", + "ethereumjs-util": "^7.1.0" + } + }, + "@ethereumjs/ethash": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@ethereumjs/ethash/-/ethash-1.0.0.tgz", + "integrity": "sha512-iIqnGG6NMKesyOxv2YctB2guOVX18qMAWlj3QlZyrc+GqfzLqoihti+cVNQnyNxr7eYuPdqwLQOFuPe6g/uKjw==", + "dev": true, + "requires": { + "@types/levelup": "^4.3.0", + "buffer-xor": "^2.0.1", + "ethereumjs-util": "^7.0.7", + "miller-rabin": "^4.0.0" + }, + "dependencies": { + "buffer-xor": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-2.0.2.tgz", + "integrity": "sha512-eHslX0bin3GB+Lx2p7lEYRShRewuNZL3fUl4qlVJGGiwoPGftmt8JQgk2Y9Ji5/01TnVDo33E5b5O3vUB1HdqQ==", + "dev": true, + "requires": { + "safe-buffer": "^5.1.1" + } + } + } + }, + "@ethereumjs/tx": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/@ethereumjs/tx/-/tx-3.3.0.tgz", + "integrity": "sha512-yTwEj2lVzSMgE6Hjw9Oa1DZks/nKTWM8Wn4ykDNapBPua2f4nXO3qKnni86O6lgDj5fVNRqbDsD0yy7/XNGDEA==", + "dev": true, + "requires": { + "@ethereumjs/common": "^2.4.0", + "ethereumjs-util": "^7.1.0" + } + }, + "@ethereumjs/vm": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethereumjs/vm/-/vm-5.5.0.tgz", + "integrity": "sha512-h6Kr6WqKUP8nVuEzCWPWEPrC63v7HFwt3gRuK7CJiyg9S0iWSBKUA/YVD4YgaSVACuxUfWaOBbwV5uGVupm5PQ==", + "dev": true, + "requires": { + "@ethereumjs/block": "^3.4.0", + "@ethereumjs/blockchain": "^5.4.0", + "@ethereumjs/common": "^2.4.0", + "@ethereumjs/tx": "^3.3.0", + "async-eventemitter": "^0.2.4", + "core-js-pure": "^3.0.1", + "debug": "^2.2.0", + "ethereumjs-util": "^7.1.0", + "functional-red-black-tree": "^1.0.1", + "mcl-wasm": "^0.7.1", + "merkle-patricia-tree": "^4.2.0", + "rustbn.js": "~0.2.0", + "util.promisify": "^1.0.1" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + } + } + }, + "@ethersproject/abi": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.4.0.tgz", + "integrity": "sha512-9gU2H+/yK1j2eVMdzm6xvHSnMxk8waIHQGYCZg5uvAyH0rsAzxkModzBSpbAkAuhKFEovC2S9hM4nPuLym8IZw==", + "dev": true, + "requires": { + "@ethersproject/address": "^5.4.0", + "@ethersproject/bignumber": "^5.4.0", + "@ethersproject/bytes": "^5.4.0", + "@ethersproject/constants": "^5.4.0", + "@ethersproject/hash": "^5.4.0", + "@ethersproject/keccak256": "^5.4.0", + "@ethersproject/logger": "^5.4.0", + "@ethersproject/properties": "^5.4.0", + "@ethersproject/strings": "^5.4.0" + } + }, + "@ethersproject/abstract-provider": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.4.0.tgz", + "integrity": "sha512-vPBR7HKUBY0lpdllIn7tLIzNN7DrVnhCLKSzY0l8WAwxz686m/aL7ASDzrVxV93GJtIub6N2t4dfZ29CkPOxgA==", + "dev": true, + "requires": { + "@ethersproject/bignumber": "^5.4.0", + "@ethersproject/bytes": "^5.4.0", + "@ethersproject/logger": "^5.4.0", + "@ethersproject/networks": "^5.4.0", + "@ethersproject/properties": "^5.4.0", + "@ethersproject/transactions": "^5.4.0", + "@ethersproject/web": "^5.4.0" + } + }, + "@ethersproject/abstract-signer": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-signer/-/abstract-signer-5.4.0.tgz", + "integrity": "sha512-AieQAzt05HJZS2bMofpuxMEp81AHufA5D6M4ScKwtolj041nrfIbIi8ciNW7+F59VYxXq+V4c3d568Q6l2m8ew==", + "dev": true, + "requires": { + "@ethersproject/abstract-provider": "^5.4.0", + "@ethersproject/bignumber": "^5.4.0", + "@ethersproject/bytes": "^5.4.0", + "@ethersproject/logger": "^5.4.0", + "@ethersproject/properties": "^5.4.0" + } + }, + "@ethersproject/address": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/@ethersproject/address/-/address-5.4.0.tgz", + "integrity": "sha512-SD0VgOEkcACEG/C6xavlU1Hy3m5DGSXW3CUHkaaEHbAPPsgi0coP5oNPsxau8eTlZOk/bpa/hKeCNoK5IzVI2Q==", + "dev": true, + "requires": { + "@ethersproject/bignumber": "^5.4.0", + "@ethersproject/bytes": "^5.4.0", + "@ethersproject/keccak256": "^5.4.0", + "@ethersproject/logger": "^5.4.0", + "@ethersproject/rlp": "^5.4.0" + } + }, + "@ethersproject/base64": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/@ethersproject/base64/-/base64-5.4.0.tgz", + "integrity": "sha512-CjQw6E17QDSSC5jiM9YpF7N1aSCHmYGMt9bWD8PWv6YPMxjsys2/Q8xLrROKI3IWJ7sFfZ8B3flKDTM5wlWuZQ==", + "dev": true, + "requires": { + "@ethersproject/bytes": "^5.4.0" + } + }, + "@ethersproject/basex": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/@ethersproject/basex/-/basex-5.4.0.tgz", + "integrity": "sha512-J07+QCVJ7np2bcpxydFVf/CuYo9mZ7T73Pe7KQY4c1lRlrixMeblauMxHXD0MPwFmUHZIILDNViVkykFBZylbg==", + "dev": true, + "requires": { + "@ethersproject/bytes": "^5.4.0", + "@ethersproject/properties": "^5.4.0" + } + }, + "@ethersproject/bignumber": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.4.0.tgz", + "integrity": "sha512-OXUu9f9hO3vGRIPxU40cignXZVaYyfx6j9NNMjebKdnaCL3anCLSSy8/b8d03vY6dh7duCC0kW72GEC4tZer2w==", + "dev": true, + "requires": { + "@ethersproject/bytes": "^5.4.0", + "@ethersproject/logger": "^5.4.0", + "bn.js": "^4.11.9" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true + } + } + }, + "@ethersproject/bytes": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.4.0.tgz", + "integrity": "sha512-H60ceqgTHbhzOj4uRc/83SCN9d+BSUnOkrr2intevqdtEMO1JFVZ1XL84OEZV+QjV36OaZYxtnt4lGmxcGsPfA==", + "dev": true, + "requires": { + "@ethersproject/logger": "^5.4.0" + } + }, + "@ethersproject/constants": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.4.0.tgz", + "integrity": "sha512-tzjn6S7sj9+DIIeKTJLjK9WGN2Tj0P++Z8ONEIlZjyoTkBuODN+0VfhAyYksKi43l1Sx9tX2VlFfzjfmr5Wl3Q==", + "dev": true, + "requires": { + "@ethersproject/bignumber": "^5.4.0" + } + }, + "@ethersproject/contracts": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/@ethersproject/contracts/-/contracts-5.4.0.tgz", + "integrity": "sha512-hkO3L3IhS1Z3ZtHtaAG/T87nQ7KiPV+/qnvutag35I0IkiQ8G3ZpCQ9NNOpSCzn4pWSW4CfzmtE02FcqnLI+hw==", + "dev": true, + "requires": { + "@ethersproject/abi": "^5.4.0", + "@ethersproject/abstract-provider": "^5.4.0", + "@ethersproject/abstract-signer": "^5.4.0", + "@ethersproject/address": "^5.4.0", + "@ethersproject/bignumber": "^5.4.0", + "@ethersproject/bytes": "^5.4.0", + "@ethersproject/constants": "^5.4.0", + "@ethersproject/logger": "^5.4.0", + "@ethersproject/properties": "^5.4.0", + "@ethersproject/transactions": "^5.4.0" + } + }, + "@ethersproject/hash": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.4.0.tgz", + "integrity": "sha512-xymAM9tmikKgbktOCjW60Z5sdouiIIurkZUr9oW5NOex5uwxrbsYG09kb5bMcNjlVeJD3yPivTNzViIs1GCbqA==", + "dev": true, + "requires": { + "@ethersproject/abstract-signer": "^5.4.0", + "@ethersproject/address": "^5.4.0", + "@ethersproject/bignumber": "^5.4.0", + "@ethersproject/bytes": "^5.4.0", + "@ethersproject/keccak256": "^5.4.0", + "@ethersproject/logger": "^5.4.0", + "@ethersproject/properties": "^5.4.0", + "@ethersproject/strings": "^5.4.0" + } + }, + "@ethersproject/hdnode": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/@ethersproject/hdnode/-/hdnode-5.4.0.tgz", + "integrity": "sha512-pKxdS0KAaeVGfZPp1KOiDLB0jba11tG6OP1u11QnYfb7pXn6IZx0xceqWRr6ygke8+Kw74IpOoSi7/DwANhy8Q==", + "dev": true, + "requires": { + "@ethersproject/abstract-signer": "^5.4.0", + "@ethersproject/basex": "^5.4.0", + "@ethersproject/bignumber": "^5.4.0", + "@ethersproject/bytes": "^5.4.0", + "@ethersproject/logger": "^5.4.0", + "@ethersproject/pbkdf2": "^5.4.0", + "@ethersproject/properties": "^5.4.0", + "@ethersproject/sha2": "^5.4.0", + "@ethersproject/signing-key": "^5.4.0", + "@ethersproject/strings": "^5.4.0", + "@ethersproject/transactions": "^5.4.0", + "@ethersproject/wordlists": "^5.4.0" + } + }, + "@ethersproject/json-wallets": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/@ethersproject/json-wallets/-/json-wallets-5.4.0.tgz", + "integrity": "sha512-igWcu3fx4aiczrzEHwG1xJZo9l1cFfQOWzTqwRw/xcvxTk58q4f9M7cjh51EKphMHvrJtcezJ1gf1q1AUOfEQQ==", + "dev": true, + "requires": { + "@ethersproject/abstract-signer": "^5.4.0", + "@ethersproject/address": "^5.4.0", + "@ethersproject/bytes": "^5.4.0", + "@ethersproject/hdnode": "^5.4.0", + "@ethersproject/keccak256": "^5.4.0", + "@ethersproject/logger": "^5.4.0", + "@ethersproject/pbkdf2": "^5.4.0", + "@ethersproject/properties": "^5.4.0", + "@ethersproject/random": "^5.4.0", + "@ethersproject/strings": "^5.4.0", + "@ethersproject/transactions": "^5.4.0", + "aes-js": "3.0.0", + "scrypt-js": "3.0.1" + } + }, + "@ethersproject/keccak256": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.4.0.tgz", + "integrity": "sha512-FBI1plWet+dPUvAzPAeHzRKiPpETQzqSUWR1wXJGHVWi4i8bOSrpC3NwpkPjgeXG7MnugVc1B42VbfnQikyC/A==", + "dev": true, + "requires": { + "@ethersproject/bytes": "^5.4.0", + "js-sha3": "0.5.7" + } + }, + "@ethersproject/logger": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.4.0.tgz", + "integrity": "sha512-xYdWGGQ9P2cxBayt64d8LC8aPFJk6yWCawQi/4eJ4+oJdMMjEBMrIcIMZ9AxhwpPVmnBPrsB10PcXGmGAqgUEQ==", + "dev": true + }, + "@ethersproject/networks": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.4.1.tgz", + "integrity": "sha512-8SvowCKz9Uf4xC5DTKI8+il8lWqOr78kmiqAVLYT9lzB8aSmJHQMD1GSuJI0CW4hMAnzocpGpZLgiMdzsNSPig==", + "dev": true, + "requires": { + "@ethersproject/logger": "^5.4.0" + } + }, + "@ethersproject/pbkdf2": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/@ethersproject/pbkdf2/-/pbkdf2-5.4.0.tgz", + "integrity": "sha512-x94aIv6tiA04g6BnazZSLoRXqyusawRyZWlUhKip2jvoLpzJuLb//KtMM6PEovE47pMbW+Qe1uw+68ameJjB7g==", + "dev": true, + "requires": { + "@ethersproject/bytes": "^5.4.0", + "@ethersproject/sha2": "^5.4.0" + } + }, + "@ethersproject/properties": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.4.0.tgz", + "integrity": "sha512-7jczalGVRAJ+XSRvNA6D5sAwT4gavLq3OXPuV/74o3Rd2wuzSL035IMpIMgei4CYyBdialJMrTqkOnzccLHn4A==", + "dev": true, + "requires": { + "@ethersproject/logger": "^5.4.0" + } + }, + "@ethersproject/providers": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/@ethersproject/providers/-/providers-5.4.1.tgz", + "integrity": "sha512-p06eiFKz8nu/5Ju0kIX024gzEQIgE5pvvGrBCngpyVjpuLtUIWT3097Agw4mTn9/dEA0FMcfByzFqacBMSgCVg==", + "dev": true, + "requires": { + "@ethersproject/abstract-provider": "^5.4.0", + "@ethersproject/abstract-signer": "^5.4.0", + "@ethersproject/address": "^5.4.0", + "@ethersproject/basex": "^5.4.0", + "@ethersproject/bignumber": "^5.4.0", + "@ethersproject/bytes": "^5.4.0", + "@ethersproject/constants": "^5.4.0", + "@ethersproject/hash": "^5.4.0", + "@ethersproject/logger": "^5.4.0", + "@ethersproject/networks": "^5.4.0", + "@ethersproject/properties": "^5.4.0", + "@ethersproject/random": "^5.4.0", + "@ethersproject/rlp": "^5.4.0", + "@ethersproject/sha2": "^5.4.0", + "@ethersproject/strings": "^5.4.0", + "@ethersproject/transactions": "^5.4.0", + "@ethersproject/web": "^5.4.0", + "bech32": "1.1.4", + "ws": "7.4.6" + }, + "dependencies": { + "ws": { + "version": "7.4.6", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz", + "integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==", + "dev": true + } + } + }, + "@ethersproject/random": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/@ethersproject/random/-/random-5.4.0.tgz", + "integrity": "sha512-pnpWNQlf0VAZDEOVp1rsYQosmv2o0ITS/PecNw+mS2/btF8eYdspkN0vIXrCMtkX09EAh9bdk8GoXmFXM1eAKw==", + "dev": true, + "requires": { + "@ethersproject/bytes": "^5.4.0", + "@ethersproject/logger": "^5.4.0" + } + }, + "@ethersproject/rlp": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.4.0.tgz", + "integrity": "sha512-0I7MZKfi+T5+G8atId9QaQKHRvvasM/kqLyAH4XxBCBchAooH2EX5rL9kYZWwcm3awYV+XC7VF6nLhfeQFKVPg==", + "dev": true, + "requires": { + "@ethersproject/bytes": "^5.4.0", + "@ethersproject/logger": "^5.4.0" + } + }, + "@ethersproject/sha2": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/@ethersproject/sha2/-/sha2-5.4.0.tgz", + "integrity": "sha512-siheo36r1WD7Cy+bDdE1BJ8y0bDtqXCOxRMzPa4bV1TGt/eTUUt03BHoJNB6reWJD8A30E/pdJ8WFkq+/uz4Gg==", + "dev": true, + "requires": { + "@ethersproject/bytes": "^5.4.0", + "@ethersproject/logger": "^5.4.0", + "hash.js": "1.1.7" + } + }, + "@ethersproject/signing-key": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.4.0.tgz", + "integrity": "sha512-q8POUeywx6AKg2/jX9qBYZIAmKSB4ubGXdQ88l40hmATj29JnG5pp331nAWwwxPn2Qao4JpWHNZsQN+bPiSW9A==", + "dev": true, + "requires": { + "@ethersproject/bytes": "^5.4.0", + "@ethersproject/logger": "^5.4.0", + "@ethersproject/properties": "^5.4.0", + "bn.js": "^4.11.9", + "elliptic": "6.5.4", + "hash.js": "1.1.7" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true + } + } + }, + "@ethersproject/solidity": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/@ethersproject/solidity/-/solidity-5.4.0.tgz", + "integrity": "sha512-XFQTZ7wFSHOhHcV1DpcWj7VXECEiSrBuv7JErJvB9Uo+KfCdc3QtUZV+Vjh/AAaYgezUEKbCtE6Khjm44seevQ==", + "dev": true, + "requires": { + "@ethersproject/bignumber": "^5.4.0", + "@ethersproject/bytes": "^5.4.0", + "@ethersproject/keccak256": "^5.4.0", + "@ethersproject/sha2": "^5.4.0", + "@ethersproject/strings": "^5.4.0" + } + }, + "@ethersproject/strings": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.4.0.tgz", + "integrity": "sha512-k/9DkH5UGDhv7aReXLluFG5ExurwtIpUfnDNhQA29w896Dw3i4uDTz01Quaptbks1Uj9kI8wo9tmW73wcIEaWA==", + "dev": true, + "requires": { + "@ethersproject/bytes": "^5.4.0", + "@ethersproject/constants": "^5.4.0", + "@ethersproject/logger": "^5.4.0" + } + }, + "@ethersproject/transactions": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.4.0.tgz", + "integrity": "sha512-s3EjZZt7xa4BkLknJZ98QGoIza94rVjaEed0rzZ/jB9WrIuu/1+tjvYCWzVrystXtDswy7TPBeIepyXwSYa4WQ==", + "dev": true, + "requires": { + "@ethersproject/address": "^5.4.0", + "@ethersproject/bignumber": "^5.4.0", + "@ethersproject/bytes": "^5.4.0", + "@ethersproject/constants": "^5.4.0", + "@ethersproject/keccak256": "^5.4.0", + "@ethersproject/logger": "^5.4.0", + "@ethersproject/properties": "^5.4.0", + "@ethersproject/rlp": "^5.4.0", + "@ethersproject/signing-key": "^5.4.0" + } + }, + "@ethersproject/units": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/@ethersproject/units/-/units-5.4.0.tgz", + "integrity": "sha512-Z88krX40KCp+JqPCP5oPv5p750g+uU6gopDYRTBGcDvOASh6qhiEYCRatuM/suC4S2XW9Zz90QI35MfSrTIaFg==", + "dev": true, + "requires": { + "@ethersproject/bignumber": "^5.4.0", + "@ethersproject/constants": "^5.4.0", + "@ethersproject/logger": "^5.4.0" + } + }, + "@ethersproject/wallet": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/@ethersproject/wallet/-/wallet-5.4.0.tgz", + "integrity": "sha512-wU29majLjM6AjCjpat21mPPviG+EpK7wY1+jzKD0fg3ui5fgedf2zEu1RDgpfIMsfn8fJHJuzM4zXZ2+hSHaSQ==", + "dev": true, + "requires": { + "@ethersproject/abstract-provider": "^5.4.0", + "@ethersproject/abstract-signer": "^5.4.0", + "@ethersproject/address": "^5.4.0", + "@ethersproject/bignumber": "^5.4.0", + "@ethersproject/bytes": "^5.4.0", + "@ethersproject/hash": "^5.4.0", + "@ethersproject/hdnode": "^5.4.0", + "@ethersproject/json-wallets": "^5.4.0", + "@ethersproject/keccak256": "^5.4.0", + "@ethersproject/logger": "^5.4.0", + "@ethersproject/properties": "^5.4.0", + "@ethersproject/random": "^5.4.0", + "@ethersproject/signing-key": "^5.4.0", + "@ethersproject/transactions": "^5.4.0", + "@ethersproject/wordlists": "^5.4.0" + } + }, + "@ethersproject/web": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/@ethersproject/web/-/web-5.4.0.tgz", + "integrity": "sha512-1bUusGmcoRLYgMn6c1BLk1tOKUIFuTg8j+6N8lYlbMpDesnle+i3pGSagGNvwjaiLo4Y5gBibwctpPRmjrh4Og==", + "dev": true, + "requires": { + "@ethersproject/base64": "^5.4.0", + "@ethersproject/bytes": "^5.4.0", + "@ethersproject/logger": "^5.4.0", + "@ethersproject/properties": "^5.4.0", + "@ethersproject/strings": "^5.4.0" + } + }, + "@ethersproject/wordlists": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/@ethersproject/wordlists/-/wordlists-5.4.0.tgz", + "integrity": "sha512-FemEkf6a+EBKEPxlzeVgUaVSodU7G0Na89jqKjmWMlDB0tomoU8RlEMgUvXyqtrg8N4cwpLh8nyRnm1Nay1isA==", + "dev": true, + "requires": { + "@ethersproject/bytes": "^5.4.0", + "@ethersproject/hash": "^5.4.0", + "@ethersproject/logger": "^5.4.0", + "@ethersproject/properties": "^5.4.0", + "@ethersproject/strings": "^5.4.0" + } + }, + "@nomiclabs/hardhat-ethers": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@nomiclabs/hardhat-ethers/-/hardhat-ethers-2.0.2.tgz", + "integrity": "sha512-6quxWe8wwS4X5v3Au8q1jOvXYEPkS1Fh+cME5u6AwNdnI4uERvPlVjlgRWzpnb+Rrt1l/cEqiNRH9GlsBMSDQg==", + "dev": true + }, + "@nomiclabs/hardhat-waffle": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@nomiclabs/hardhat-waffle/-/hardhat-waffle-2.0.1.tgz", + "integrity": "sha512-2YR2V5zTiztSH9n8BYWgtv3Q+EL0N5Ltm1PAr5z20uAY4SkkfylJ98CIqt18XFvxTD5x4K2wKBzddjV9ViDAZQ==", + "dev": true, + "requires": { + "@types/sinon-chai": "^3.2.3", + "@types/web3": "1.0.19" + } + }, + "@openzeppelin/contracts": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-4.2.0.tgz", + "integrity": "sha512-LD4NnkKpHHSMo5z9MvFsG4g1xxZUDqV3A3Futu3nvyfs4wPwXxqOgMaxOoa2PeyGL2VNeSlbxT54enbQzGcgJQ==", + "dev": true + }, + "@resolver-engine/core": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@resolver-engine/core/-/core-0.3.3.tgz", + "integrity": "sha512-eB8nEbKDJJBi5p5SrvrvILn4a0h42bKtbCTri3ZxCGt6UvoQyp7HnGOfki944bUjBSHKK3RvgfViHn+kqdXtnQ==", + "dev": true, + "requires": { + "debug": "^3.1.0", + "is-url": "^1.2.4", + "request": "^2.85.0" + }, + "dependencies": { + "debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + } + } + }, + "@resolver-engine/fs": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@resolver-engine/fs/-/fs-0.3.3.tgz", + "integrity": "sha512-wQ9RhPUcny02Wm0IuJwYMyAG8fXVeKdmhm8xizNByD4ryZlx6PP6kRen+t/haF43cMfmaV7T3Cx6ChOdHEhFUQ==", + "dev": true, + "requires": { + "@resolver-engine/core": "^0.3.3", + "debug": "^3.1.0" + }, + "dependencies": { + "debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + } + } + }, + "@resolver-engine/imports": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@resolver-engine/imports/-/imports-0.3.3.tgz", + "integrity": "sha512-anHpS4wN4sRMwsAbMXhMfOD/y4a4Oo0Cw/5+rue7hSwGWsDOQaAU1ClK1OxjUC35/peazxEl8JaSRRS+Xb8t3Q==", + "dev": true, + "requires": { + "@resolver-engine/core": "^0.3.3", + "debug": "^3.1.0", + "hosted-git-info": "^2.6.0", + "path-browserify": "^1.0.0", + "url": "^0.11.0" + }, + "dependencies": { + "debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + } + } + }, + "@resolver-engine/imports-fs": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@resolver-engine/imports-fs/-/imports-fs-0.3.3.tgz", + "integrity": "sha512-7Pjg/ZAZtxpeyCFlZR5zqYkz+Wdo84ugB5LApwriT8XFeQoLwGUj4tZFFvvCuxaNCcqZzCYbonJgmGObYBzyCA==", + "dev": true, + "requires": { + "@resolver-engine/fs": "^0.3.3", + "@resolver-engine/imports": "^0.3.3", + "debug": "^3.1.0" + }, + "dependencies": { + "debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + } + } + }, + "@sentry/core": { + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/core/-/core-5.30.0.tgz", + "integrity": "sha512-TmfrII8w1PQZSZgPpUESqjB+jC6MvZJZdLtE/0hZ+SrnKhW3x5WlYLvTXZpcWePYBku7rl2wn1RZu6uT0qCTeg==", + "dev": true, + "requires": { + "@sentry/hub": "5.30.0", + "@sentry/minimal": "5.30.0", + "@sentry/types": "5.30.0", + "@sentry/utils": "5.30.0", + "tslib": "^1.9.3" + } + }, + "@sentry/hub": { + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/hub/-/hub-5.30.0.tgz", + "integrity": "sha512-2tYrGnzb1gKz2EkMDQcfLrDTvmGcQPuWxLnJKXJvYTQDGLlEvi2tWz1VIHjunmOvJrB5aIQLhm+dcMRwFZDCqQ==", + "dev": true, + "requires": { + "@sentry/types": "5.30.0", + "@sentry/utils": "5.30.0", + "tslib": "^1.9.3" + } + }, + "@sentry/minimal": { + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/minimal/-/minimal-5.30.0.tgz", + "integrity": "sha512-BwWb/owZKtkDX+Sc4zCSTNcvZUq7YcH3uAVlmh/gtR9rmUvbzAA3ewLuB3myi4wWRAMEtny6+J/FN/x+2wn9Xw==", + "dev": true, + "requires": { + "@sentry/hub": "5.30.0", + "@sentry/types": "5.30.0", + "tslib": "^1.9.3" + } + }, + "@sentry/node": { + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/node/-/node-5.30.0.tgz", + "integrity": "sha512-Br5oyVBF0fZo6ZS9bxbJZG4ApAjRqAnqFFurMVJJdunNb80brh7a5Qva2kjhm+U6r9NJAB5OmDyPkA1Qnt+QVg==", + "dev": true, + "requires": { + "@sentry/core": "5.30.0", + "@sentry/hub": "5.30.0", + "@sentry/tracing": "5.30.0", + "@sentry/types": "5.30.0", + "@sentry/utils": "5.30.0", + "cookie": "^0.4.1", + "https-proxy-agent": "^5.0.0", + "lru_map": "^0.3.3", + "tslib": "^1.9.3" + } + }, + "@sentry/tracing": { + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/tracing/-/tracing-5.30.0.tgz", + "integrity": "sha512-dUFowCr0AIMwiLD7Fs314Mdzcug+gBVo/+NCMyDw8tFxJkwWAKl7Qa2OZxLQ0ZHjakcj1hNKfCQJ9rhyfOl4Aw==", + "dev": true, + "requires": { + "@sentry/hub": "5.30.0", + "@sentry/minimal": "5.30.0", + "@sentry/types": "5.30.0", + "@sentry/utils": "5.30.0", + "tslib": "^1.9.3" + } + }, + "@sentry/types": { + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-5.30.0.tgz", + "integrity": "sha512-R8xOqlSTZ+htqrfteCWU5Nk0CDN5ApUTvrlvBuiH1DyP6czDZ4ktbZB0hAgBlVcK0U+qpD3ag3Tqqpa5Q67rPw==", + "dev": true + }, + "@sentry/utils": { + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-5.30.0.tgz", + "integrity": "sha512-zaYmoH0NWWtvnJjC9/CBseXMtKHm/tm40sz3YfJRxeQjyzRqNQPgivpd9R/oDJCYj999mzdW382p/qi2ypjLww==", + "dev": true, + "requires": { + "@sentry/types": "5.30.0", + "tslib": "^1.9.3" + } + }, + "@sinonjs/commons": { + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.3.tgz", + "integrity": "sha512-xkNcLAn/wZaX14RPlwizcKicDk9G3F8m2nU3L7Ukm5zBgTwiT0wsoFAHx9Jq56fJA1z/7uKGtCRu16sOUCLIHQ==", + "dev": true, + "requires": { + "type-detect": "4.0.8" + } + }, + "@sinonjs/fake-timers": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-7.1.2.tgz", + "integrity": "sha512-iQADsW4LBMISqZ6Ci1dupJL9pprqwcVFTcOsEmQOEhW+KLCVn/Y4Jrvg2k19fIHCp+iFprriYPTdRcQR8NbUPg==", + "dev": true, + "requires": { + "@sinonjs/commons": "^1.7.0" + } + }, + "@solidity-parser/parser": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.11.1.tgz", + "integrity": "sha512-H8BSBoKE8EubJa0ONqecA2TviT3TnHeC4NpgnAHSUiuhZoQBfPB4L2P9bs8R6AoTW10Endvh3vc+fomVMIDIYQ==", + "dev": true + }, + "@typechain/ethers-v5": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@typechain/ethers-v5/-/ethers-v5-2.0.0.tgz", + "integrity": "sha512-0xdCkyGOzdqh4h5JSf+zoWx85IusEjDcPIwNEHP8mrWSnCae4rvrqB+/gtpdNfX7zjlFlZiMeePn2r63EI3Lrw==", + "dev": true, + "requires": { + "ethers": "^5.0.2" + } + }, + "@types/abstract-leveldown": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@types/abstract-leveldown/-/abstract-leveldown-5.0.2.tgz", + "integrity": "sha512-+jA1XXF3jsz+Z7FcuiNqgK53hTa/luglT2TyTpKPqoYbxVY+mCPF22Rm+q3KPBrMHJwNXFrTViHszBOfU4vftQ==", + "dev": true + }, + "@types/bn.js": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-5.1.0.tgz", + "integrity": "sha512-QSSVYj7pYFN49kW77o2s9xTCwZ8F2xLbjLLSEVh8D2F4JUhZtPAGOFLTD+ffqksBx/u4cE/KImFjyhqCjn/LIA==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@types/chai": { + "version": "4.2.21", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.2.21.tgz", + "integrity": "sha512-yd+9qKmJxm496BOV9CMNaey8TWsikaZOwMRwPHQIjcOJM9oV+fi9ZMNw3JsVnbEEbo2gRTDnGEBv8pjyn67hNg==", + "dev": true + }, + "@types/level-errors": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/level-errors/-/level-errors-3.0.0.tgz", + "integrity": "sha512-/lMtoq/Cf/2DVOm6zE6ORyOM+3ZVm/BvzEZVxUhf6bgh8ZHglXlBqxbxSlJeVp8FCbD3IVvk/VbsaNmDjrQvqQ==", + "dev": true + }, + "@types/levelup": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@types/levelup/-/levelup-4.3.3.tgz", + "integrity": "sha512-K+OTIjJcZHVlZQN1HmU64VtrC0jC3dXWQozuEIR9zVvltIk90zaGPM2AgT+fIkChpzHhFE3YnvFLCbLtzAmexA==", + "dev": true, + "requires": { + "@types/abstract-leveldown": "*", + "@types/level-errors": "*", + "@types/node": "*" + } + }, + "@types/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/@types/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-ssE3Vlrys7sdIzs5LOxCzTVMsU7i9oa/IaW92wF32JFb3CVczqOkru2xspuKczHEbG3nvmPY7IFqVmGGHdNbYw==", + "dev": true + }, + "@types/mkdirp": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/@types/mkdirp/-/mkdirp-0.5.2.tgz", + "integrity": "sha512-U5icWpv7YnZYGsN4/cmh3WD2onMY0aJIiTE6+51TwJCttdHvtCYmkBNOobHlXwrJRL0nkH9jH4kD+1FAdMN4Tg==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@types/node": { + "version": "16.3.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.3.0.tgz", + "integrity": "sha512-OydMCocGMGqw/1BnWbhtK+AtwyWTOigtrQlRe57OQmTNcI3HKlVI5FGlh+c4mSqInMPLynFrTlYjfajPu9O/eQ==", + "dev": true + }, + "@types/node-fetch": { + "version": "2.5.11", + "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.5.11.tgz", + "integrity": "sha512-2upCKaqVZETDRb8A2VTaRymqFBEgH8u6yr96b/u3+1uQEPDRo3mJLEiPk7vdXBHRtjwkjqzFYMJXrt0Z9QsYjQ==", + "dev": true, + "requires": { + "@types/node": "*", + "form-data": "^3.0.0" + }, + "dependencies": { + "form-data": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz", + "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + } + } + } + }, + "@types/pbkdf2": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@types/pbkdf2/-/pbkdf2-3.1.0.tgz", + "integrity": "sha512-Cf63Rv7jCQ0LaL8tNXmEyqTHuIJxRdlS5vMh1mj5voN4+QFhVZnlZruezqpWYDiJ8UTzhP0VmeLXCmBk66YrMQ==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@types/prettier": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.3.2.tgz", + "integrity": "sha512-eI5Yrz3Qv4KPUa/nSIAi0h+qX0XyewOliug5F2QAtuRg6Kjg6jfmxe1GIwoIRhZspD1A0RP8ANrPwvEXXtRFog==", + "dev": true + }, + "@types/resolve": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-0.0.8.tgz", + "integrity": "sha512-auApPaJf3NPfe18hSoJkp8EbZzer2ISk7o8mCC3M9he/a04+gbMF97NkpD2S8riMGvm4BMRI59/SZQSaLTKpsQ==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@types/secp256k1": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.3.tgz", + "integrity": "sha512-Da66lEIFeIz9ltsdMZcpQvmrmmoqrfju8pm1BH8WbYjZSwUgCwXLb9C+9XYogwBITnbsSaMdVPb2ekf7TV+03w==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@types/sinon": { + "version": "10.0.2", + "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-10.0.2.tgz", + "integrity": "sha512-BHn8Bpkapj8Wdfxvh2jWIUoaYB/9/XhsL0oOvBfRagJtKlSl9NWPcFOz2lRukI9szwGxFtYZCTejJSqsGDbdmw==", + "dev": true, + "requires": { + "@sinonjs/fake-timers": "^7.1.0" + } + }, + "@types/sinon-chai": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/@types/sinon-chai/-/sinon-chai-3.2.5.tgz", + "integrity": "sha512-bKQqIpew7mmIGNRlxW6Zli/QVyc3zikpGzCa797B/tRnD9OtHvZ/ts8sYXV+Ilj9u3QRaUEM8xrjgd1gwm1BpQ==", + "dev": true, + "requires": { + "@types/chai": "*", + "@types/sinon": "*" + } + }, + "@types/underscore": { + "version": "1.11.3", + "resolved": "https://registry.npmjs.org/@types/underscore/-/underscore-1.11.3.tgz", + "integrity": "sha512-Fl1TX1dapfXyDqFg2ic9M+vlXRktcPJrc4PR7sRc7sdVrjavg/JHlbUXBt8qWWqhJrmSqg3RNAkAPRiOYw6Ahw==", + "dev": true + }, + "@types/web3": { + "version": "1.0.19", + "resolved": "https://registry.npmjs.org/@types/web3/-/web3-1.0.19.tgz", + "integrity": "sha512-fhZ9DyvDYDwHZUp5/STa9XW2re0E8GxoioYJ4pEUZ13YHpApSagixj7IAdoYH5uAK+UalGq6Ml8LYzmgRA/q+A==", + "dev": true, + "requires": { + "@types/bn.js": "*", + "@types/underscore": "*" + } + }, + "@yarnpkg/lockfile": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz", + "integrity": "sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==", + "dev": true + }, + "abort-controller": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", + "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "dev": true, + "requires": { + "event-target-shim": "^5.0.0" + } + }, + "abstract-leveldown": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.3.0.tgz", + "integrity": "sha512-TU5nlYgta8YrBMNpc9FwQzRbiXsj49gsALsXadbGHt9CROPzX5fB0rWDR5mtdpOOKa5XqRFpbj1QroPAoPzVjQ==", + "dev": true, + "requires": { + "buffer": "^5.5.0", + "immediate": "^3.2.3", + "level-concat-iterator": "~2.0.0", + "level-supports": "~1.0.0", + "xtend": "~4.0.0" + } + }, + "adm-zip": { + "version": "0.4.16", + "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.4.16.tgz", + "integrity": "sha512-TFi4HBKSGfIKsK5YCkKaaFG2m4PEDyViZmEwof3MTIgzimHLto6muaHVpbrljdIvIrFZzEq/p4nafOeLcYegrg==", + "dev": true + }, + "aes-js": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.0.0.tgz", + "integrity": "sha1-4h3xCtbCBTKVvLuNq0Cwnb6ofk0=", + "dev": true + }, + "agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "dev": true, + "requires": { + "debug": "4" + } + }, + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true + }, + "ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "dev": true, + "requires": { + "type-fest": "^0.21.3" + } + }, + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "anymatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", + "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", + "dev": true, + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "array-back": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-2.0.0.tgz", + "integrity": "sha512-eJv4pLLufP3g5kcZry0j6WXpIbzYw9GUB4mVJZno9wfwiBxbizTnHCw3VJb07cBihbFX48Y7oSrW9y+gt4glyw==", + "dev": true, + "requires": { + "typical": "^2.6.1" + } + }, + "asn1": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", + "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "dev": true, + "requires": { + "safer-buffer": "~2.1.0" + } + }, + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + }, + "assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "dev": true + }, + "async": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", + "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", + "dev": true, + "requires": { + "lodash": "^4.17.14" + } + }, + "async-eventemitter": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/async-eventemitter/-/async-eventemitter-0.2.4.tgz", + "integrity": "sha512-pd20BwL7Yt1zwDFy+8MX8F1+WCT8aQeKj0kQnTrH9WaeRETlRamVhD0JtRPmrV4GfOJ2F9CvdQkZeZhnh2TuHw==", + "dev": true, + "requires": { + "async": "^2.4.0" + } + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", + "dev": true + }, + "aws4": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz", + "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==", + "dev": true + }, + "balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "base-x": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.8.tgz", + "integrity": "sha512-Rl/1AWP4J/zRrk54hhlxH4drNxPJXYUaKffODVI53/dAsV4t9fBxyxYKAVPU1XBHxYwOWP9h9H0hM2MVw4YfJA==", + "dev": true, + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "dev": true + }, + "bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "dev": true, + "requires": { + "tweetnacl": "^0.14.3" + }, + "dependencies": { + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "dev": true + } + } + }, + "bech32": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/bech32/-/bech32-1.1.4.tgz", + "integrity": "sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==", + "dev": true + }, + "binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "dev": true + }, + "blakejs": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.1.1.tgz", + "integrity": "sha512-bLG6PHOCZJKNshTjGRBvET0vTciwQE6zFKOKKXPDJfwFBd4Ac0yBfPZqcGvGJap50l7ktvlpFqc2jGVaUgbJgg==", + "dev": true + }, + "bluebird": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", + "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", + "dev": true + }, + "bn.js": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", + "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", + "dev": true + }, + "browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "dev": true + }, + "browserify-aes": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "dev": true, + "requires": { + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "bs58": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", + "integrity": "sha1-vhYedsNU9veIrkBx9j806MTwpCo=", + "dev": true, + "requires": { + "base-x": "^3.0.2" + } + }, + "bs58check": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/bs58check/-/bs58check-2.1.2.tgz", + "integrity": "sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA==", + "dev": true, + "requires": { + "bs58": "^4.0.0", + "create-hash": "^1.1.0", + "safe-buffer": "^5.1.2" + } + }, + "buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "dev": true, + "requires": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "buffer-from": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "dev": true + }, + "buffer-to-arraybuffer": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/buffer-to-arraybuffer/-/buffer-to-arraybuffer-0.0.5.tgz", + "integrity": "sha1-YGSkD6dutDxyOrqe+PbhIW0QURo=", + "dev": true + }, + "buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", + "dev": true + }, + "bytes": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", + "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==", + "dev": true + }, + "call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "dev": true, + "requires": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + } + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", + "dev": true + }, + "chai": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.4.tgz", + "integrity": "sha512-yS5H68VYOCtN1cjfwumDSuzn/9c+yza4f3reKXlE5rUg7SFcCEy90gJvydNgOYtblyf4Zi6jIWRnXOgErta0KA==", + "dev": true, + "requires": { + "assertion-error": "^1.1.0", + "check-error": "^1.0.2", + "deep-eql": "^3.0.1", + "get-func-name": "^2.0.0", + "pathval": "^1.1.1", + "type-detect": "^4.0.5" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "check-error": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", + "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", + "dev": true + }, + "chokidar": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.2.tgz", + "integrity": "sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ==", + "dev": true, + "requires": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "fsevents": "~2.3.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + } + }, + "ci-info": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", + "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", + "dev": true + }, + "cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "cliui": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", + "dev": true, + "requires": { + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "dev": true + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "command-exists": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/command-exists/-/command-exists-1.2.9.tgz", + "integrity": "sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w==", + "dev": true + }, + "command-line-args": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/command-line-args/-/command-line-args-4.0.7.tgz", + "integrity": "sha512-aUdPvQRAyBvQd2n7jXcsMDz68ckBJELXNzBybCHOibUWEg0mWTnaYCSRU8h9R+aNRSvDihJtssSRCiDRpLaezA==", + "dev": true, + "requires": { + "array-back": "^2.0.0", + "find-replace": "^1.0.3", + "typical": "^2.6.1" + } + }, + "commander": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/commander/-/commander-3.0.2.tgz", + "integrity": "sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow==", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "cookie": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.1.tgz", + "integrity": "sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA==", + "dev": true + }, + "core-js-pure": { + "version": "3.15.2", + "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.15.2.tgz", + "integrity": "sha512-D42L7RYh1J2grW8ttxoY1+17Y4wXZeKe7uyplAI3FkNQyI5OgBIAjUfFiTPfL1rs0qLpxaabITNbjKl1Sp82tA==", + "dev": true + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "crc-32": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.0.tgz", + "integrity": "sha512-1uBwHxF+Y/4yF5G48fwnKq6QsIXheor3ZLPT80yGBV1oEUwpPojlEhQbWKVw1VwcTQyMGHK1/XMmTjmlsmTTGA==", + "dev": true, + "requires": { + "exit-on-epipe": "~1.0.1", + "printj": "~1.1.0" + } + }, + "create-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "dev": true, + "requires": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + } + }, + "create-hmac": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "dev": true, + "requires": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0" + } + }, + "debug": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "dev": true, + "requires": { + "ms": "2.1.2" + }, + "dependencies": { + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, + "decode-uri-component": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", + "dev": true + }, + "decompress-response": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", + "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", + "dev": true, + "requires": { + "mimic-response": "^1.0.0" + } + }, + "deep-eql": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", + "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", + "dev": true, + "requires": { + "type-detect": "^4.0.0" + } + }, + "deferred-leveldown": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-5.3.0.tgz", + "integrity": "sha512-a59VOT+oDy7vtAbLRCZwWgxu2BaCfd5Hk7wxJd48ei7I+nsg8Orlb9CLG0PMZienk9BSUKgeAqkO2+Lw+1+Ukw==", + "dev": true, + "requires": { + "abstract-leveldown": "~6.2.1", + "inherits": "^2.0.3" + }, + "dependencies": { + "abstract-leveldown": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz", + "integrity": "sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ==", + "dev": true, + "requires": { + "buffer": "^5.5.0", + "immediate": "^3.2.3", + "level-concat-iterator": "~2.0.0", + "level-supports": "~1.0.0", + "xtend": "~4.0.0" + } + } + } + }, + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, + "requires": { + "object-keys": "^1.0.12" + } + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true + }, + "depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", + "dev": true + }, + "diff": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", + "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "dev": true + }, + "dom-walk": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/dom-walk/-/dom-walk-0.1.2.tgz", + "integrity": "sha512-6QvTW9mrGeIegrFXdtQi9pk7O/nSK6lSdXW2eqUspN5LWD7UTji2Fqw5V2YLjBpHEoU9Xl/eUWNpDeZvoyOv2w==", + "dev": true + }, + "ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "dev": true, + "requires": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "elliptic": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", + "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", + "dev": true, + "requires": { + "bn.js": "^4.11.9", + "brorand": "^1.1.0", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true + } + } + }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "encoding-down": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/encoding-down/-/encoding-down-6.3.0.tgz", + "integrity": "sha512-QKrV0iKR6MZVJV08QY0wp1e7vF6QbhnbQhb07bwpEyuz4uZiZgPlEGdkCROuFkUwdxlFaiPIhjyarH1ee/3vhw==", + "dev": true, + "requires": { + "abstract-leveldown": "^6.2.1", + "inherits": "^2.0.3", + "level-codec": "^9.0.0", + "level-errors": "^2.0.0" + } + }, + "enquirer": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", + "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", + "dev": true, + "requires": { + "ansi-colors": "^4.1.1" + } + }, + "env-paths": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", + "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", + "dev": true + }, + "errno": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.8.tgz", + "integrity": "sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==", + "dev": true, + "requires": { + "prr": "~1.0.1" + } + }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "es-abstract": { + "version": "1.18.3", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.3.tgz", + "integrity": "sha512-nQIr12dxV7SSxE6r6f1l3DtAeEYdsGpps13dR0TwJg1S8gyp4ZPgy3FZcHBgbiQqnoqSTb+oC+kO4UQ0C/J8vw==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "get-intrinsic": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.2", + "is-callable": "^1.2.3", + "is-negative-zero": "^2.0.1", + "is-regex": "^1.1.3", + "is-string": "^1.0.6", + "object-inspect": "^1.10.3", + "object-keys": "^1.1.1", + "object.assign": "^4.1.2", + "string.prototype.trimend": "^1.0.4", + "string.prototype.trimstart": "^1.0.4", + "unbox-primitive": "^1.0.1" + } + }, + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "eth-ens-namehash": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/eth-ens-namehash/-/eth-ens-namehash-2.0.8.tgz", + "integrity": "sha1-IprEbsqG1S4MmR58sq74P/D2i88=", + "dev": true, + "requires": { + "idna-uts46-hx": "^2.3.1", + "js-sha3": "^0.5.7" + } + }, + "eth-lib": { + "version": "0.2.8", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.8.tgz", + "integrity": "sha512-ArJ7x1WcWOlSpzdoTBX8vkwlkSQ85CjjifSZtV4co64vWxSV8geWfPI9x4SVYu3DSxnX4yWFVTtGL+j9DUFLNw==", + "dev": true, + "requires": { + "bn.js": "^4.11.6", + "elliptic": "^6.4.0", + "xhr-request-promise": "^0.1.2" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true + } + } + }, + "eth-sig-util": { + "version": "2.5.4", + "resolved": "https://registry.npmjs.org/eth-sig-util/-/eth-sig-util-2.5.4.tgz", + "integrity": "sha512-aCMBwp8q/4wrW4QLsF/HYBOSA7TpLKmkVwP3pYQNkEEseW2Rr8Z5Uxc9/h6HX+OG3tuHo+2bINVSihIeBfym6A==", + "dev": true, + "requires": { + "ethereumjs-abi": "0.6.8", + "ethereumjs-util": "^5.1.1", + "tweetnacl": "^1.0.3", + "tweetnacl-util": "^0.15.0" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true + }, + "ethereumjs-util": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.1.tgz", + "integrity": "sha512-v3kT+7zdyCm1HIqWlLNrHGqHGLpGYIhjeHxQjnDXjLT2FyGJDsd3LWMYUo7pAFRrk86CR3nUJfhC81CCoJNNGQ==", + "dev": true, + "requires": { + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "^0.1.3", + "rlp": "^2.0.0", + "safe-buffer": "^5.1.1" + } + } + } + }, + "ethereum-bloom-filters": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/ethereum-bloom-filters/-/ethereum-bloom-filters-1.0.10.tgz", + "integrity": "sha512-rxJ5OFN3RwjQxDcFP2Z5+Q9ho4eIdEmSc2ht0fCu8Se9nbXjZ7/031uXoUYJ87KHCOdVeiUuwSnoS7hmYAGVHA==", + "dev": true, + "requires": { + "js-sha3": "^0.8.0" + }, + "dependencies": { + "js-sha3": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", + "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==", + "dev": true + } + } + }, + "ethereum-cryptography": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", + "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", + "dev": true, + "requires": { + "@types/pbkdf2": "^3.0.0", + "@types/secp256k1": "^4.0.1", + "blakejs": "^1.1.0", + "browserify-aes": "^1.2.0", + "bs58check": "^2.1.2", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "hash.js": "^1.1.7", + "keccak": "^3.0.0", + "pbkdf2": "^3.0.17", + "randombytes": "^2.1.0", + "safe-buffer": "^5.1.2", + "scrypt-js": "^3.0.0", + "secp256k1": "^4.0.1", + "setimmediate": "^1.0.5" + } + }, + "ethereum-waffle": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/ethereum-waffle/-/ethereum-waffle-3.4.0.tgz", + "integrity": "sha512-ADBqZCkoSA5Isk486ntKJVjFEawIiC+3HxNqpJqONvh3YXBTNiRfXvJtGuAFLXPG91QaqkGqILEHANAo7j/olQ==", + "dev": true, + "requires": { + "@ethereum-waffle/chai": "^3.4.0", + "@ethereum-waffle/compiler": "^3.4.0", + "@ethereum-waffle/mock-contract": "^3.3.0", + "@ethereum-waffle/provider": "^3.4.0", + "ethers": "^5.0.1" + } + }, + "ethereumjs-abi": { + "version": "0.6.8", + "resolved": "https://registry.npmjs.org/ethereumjs-abi/-/ethereumjs-abi-0.6.8.tgz", + "integrity": "sha512-Tx0r/iXI6r+lRsdvkFDlut0N08jWMnKRZ6Gkq+Nmw75lZe4e6o3EkSnkaBP5NF6+m5PTGAr9JP43N3LyeoglsA==", + "dev": true, + "requires": { + "bn.js": "^4.11.8", + "ethereumjs-util": "^6.0.0" + }, + "dependencies": { + "@types/bn.js": { + "version": "4.11.6", + "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.6.tgz", + "integrity": "sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true + }, + "ethereumjs-util": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz", + "integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==", + "dev": true, + "requires": { + "@types/bn.js": "^4.11.3", + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "0.1.6", + "rlp": "^2.2.3" + } + } + } + }, + "ethereumjs-util": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.0.tgz", + "integrity": "sha512-kR+vhu++mUDARrsMMhsjjzPduRVAeundLGXucGRHF3B4oEltOUspfgCVco4kckucj3FMlLaZHUl9n7/kdmr6Tw==", + "dev": true, + "requires": { + "@types/bn.js": "^5.1.0", + "bn.js": "^5.1.2", + "create-hash": "^1.1.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "0.1.6", + "rlp": "^2.2.4" + } + }, + "ethers": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.4.1.tgz", + "integrity": "sha512-SrcddMdCgP1hukDvCPd87Aipbf4NWjQvdfAbZ65XSZGbfyuYPtIrUJPDH5B1SBRsdlfiEgX3eoz28DdBDzMNFg==", + "dev": true, + "requires": { + "@ethersproject/abi": "5.4.0", + "@ethersproject/abstract-provider": "5.4.0", + "@ethersproject/abstract-signer": "5.4.0", + "@ethersproject/address": "5.4.0", + "@ethersproject/base64": "5.4.0", + "@ethersproject/basex": "5.4.0", + "@ethersproject/bignumber": "5.4.0", + "@ethersproject/bytes": "5.4.0", + "@ethersproject/constants": "5.4.0", + "@ethersproject/contracts": "5.4.0", + "@ethersproject/hash": "5.4.0", + "@ethersproject/hdnode": "5.4.0", + "@ethersproject/json-wallets": "5.4.0", + "@ethersproject/keccak256": "5.4.0", + "@ethersproject/logger": "5.4.0", + "@ethersproject/networks": "5.4.1", + "@ethersproject/pbkdf2": "5.4.0", + "@ethersproject/properties": "5.4.0", + "@ethersproject/providers": "5.4.1", + "@ethersproject/random": "5.4.0", + "@ethersproject/rlp": "5.4.0", + "@ethersproject/sha2": "5.4.0", + "@ethersproject/signing-key": "5.4.0", + "@ethersproject/solidity": "5.4.0", + "@ethersproject/strings": "5.4.0", + "@ethersproject/transactions": "5.4.0", + "@ethersproject/units": "5.4.0", + "@ethersproject/wallet": "5.4.0", + "@ethersproject/web": "5.4.0", + "@ethersproject/wordlists": "5.4.0" + } + }, + "ethjs-unit": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/ethjs-unit/-/ethjs-unit-0.1.6.tgz", + "integrity": "sha1-xmWSHkduh7ziqdWIpv4EBbLEFpk=", + "dev": true, + "requires": { + "bn.js": "4.11.6", + "number-to-bn": "1.7.0" + }, + "dependencies": { + "bn.js": { + "version": "4.11.6", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", + "integrity": "sha1-UzRK2xRhehP26N0s4okF0cC6MhU=", + "dev": true + } + } + }, + "ethjs-util": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/ethjs-util/-/ethjs-util-0.1.6.tgz", + "integrity": "sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w==", + "dev": true, + "requires": { + "is-hex-prefixed": "1.0.0", + "strip-hex-prefix": "1.0.0" + } + }, + "event-target-shim": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", + "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", + "dev": true + }, + "evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "dev": true, + "requires": { + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" + } + }, + "exit-on-epipe": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/exit-on-epipe/-/exit-on-epipe-1.0.1.tgz", + "integrity": "sha512-h2z5mrROTxce56S+pnvAV890uu7ls7f1kEvVGJbw1OlFH3/mlJ5bkXu0KRyW94v37zzHPiUd55iLn3DA7TjWpw==", + "dev": true + }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", + "dev": true + }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "find-replace": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/find-replace/-/find-replace-1.0.3.tgz", + "integrity": "sha1-uI5zZNLZyVlVnziMZmcNYTBEH6A=", + "dev": true, + "requires": { + "array-back": "^1.0.4", + "test-value": "^2.1.0" + }, + "dependencies": { + "array-back": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-1.0.4.tgz", + "integrity": "sha1-ZEun8JX3/898Q7Xw3DnTwfA8Bjs=", + "dev": true, + "requires": { + "typical": "^2.6.0" + } + } + } + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "find-yarn-workspace-root": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/find-yarn-workspace-root/-/find-yarn-workspace-root-2.0.0.tgz", + "integrity": "sha512-1IMnbjt4KzsQfnhnzNd8wUEgXZ44IzZaZmnLYx7D5FZlaHt2gW20Cri8Q+E/t5tIj4+epTBub+2Zxu/vNILzqQ==", + "dev": true, + "requires": { + "micromatch": "^4.0.2" + } + }, + "flat": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/flat/-/flat-4.1.1.tgz", + "integrity": "sha512-FmTtBsHskrU6FJ2VxCnsDb84wu9zhmO3cUX2kGFb5tuwhfXxGciiT0oRY+cck35QmG+NmGh5eLz6lLCpWTqwpA==", + "dev": true, + "requires": { + "is-buffer": "~2.0.3" + } + }, + "follow-redirects": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.1.tgz", + "integrity": "sha512-HWqDgT7ZEkqRzBvc2s64vSZ/hfOceEol3ac/7tKwzuvEyWx3/4UegXh5oBOIotkGsObyk3xznnSRVADBgWSQVg==", + "dev": true + }, + "for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dev": true, + "requires": { + "is-callable": "^1.1.3" + } + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "dev": true + }, + "form-data": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } + }, + "fp-ts": { + "version": "1.19.3", + "resolved": "https://registry.npmjs.org/fp-ts/-/fp-ts-1.19.3.tgz", + "integrity": "sha512-H5KQDspykdHuztLTg+ajGN0Z2qUjcEf3Ybxc6hLt0k7/zPkn29XnKnxlBPyW2XIddWrGaJBzBl4VLYOtk39yZg==", + "dev": true + }, + "fs-extra": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", + "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "optional": true + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, + "ganache-core": { + "version": "2.13.2", + "resolved": "https://registry.npmjs.org/ganache-core/-/ganache-core-2.13.2.tgz", + "integrity": "sha512-tIF5cR+ANQz0+3pHWxHjIwHqFXcVo0Mb+kcsNhglNFALcYo49aQpnS9dqHartqPfMFjiHh/qFoD3mYK0d/qGgw==", + "dev": true, + "requires": { + "abstract-leveldown": "3.0.0", + "async": "2.6.2", + "bip39": "2.5.0", + "cachedown": "1.0.0", + "clone": "2.1.2", + "debug": "3.2.6", + "encoding-down": "5.0.4", + "eth-sig-util": "3.0.0", + "ethereumjs-abi": "0.6.8", + "ethereumjs-account": "3.0.0", + "ethereumjs-block": "2.2.2", + "ethereumjs-common": "1.5.0", + "ethereumjs-tx": "2.1.2", + "ethereumjs-util": "6.2.1", + "ethereumjs-vm": "4.2.0", + "ethereumjs-wallet": "0.6.5", + "heap": "0.2.6", + "keccak": "3.0.1", + "level-sublevel": "6.6.4", + "levelup": "3.1.1", + "lodash": "4.17.20", + "lru-cache": "5.1.1", + "merkle-patricia-tree": "3.0.0", + "patch-package": "6.2.2", + "seedrandom": "3.0.1", + "source-map-support": "0.5.12", + "tmp": "0.1.0", + "web3": "1.2.11", + "web3-provider-engine": "14.2.1", + "websocket": "1.0.32" + }, + "dependencies": { + "@ethersproject/abi": { + "version": "5.0.0-beta.153", + "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.0.0-beta.153.tgz", + "integrity": "sha512-aXweZ1Z7vMNzJdLpR1CZUAIgnwjrZeUSvN9syCwlBaEBUFJmFY+HHnfuTI5vIhVs/mRkfJVrbEyl51JZQqyjAg==", + "dev": true, + "optional": true, + "requires": { + "@ethersproject/address": ">=5.0.0-beta.128", + "@ethersproject/bignumber": ">=5.0.0-beta.130", + "@ethersproject/bytes": ">=5.0.0-beta.129", + "@ethersproject/constants": ">=5.0.0-beta.128", + "@ethersproject/hash": ">=5.0.0-beta.128", + "@ethersproject/keccak256": ">=5.0.0-beta.127", + "@ethersproject/logger": ">=5.0.0-beta.129", + "@ethersproject/properties": ">=5.0.0-beta.131", + "@ethersproject/strings": ">=5.0.0-beta.130" + } + }, + "@ethersproject/abstract-provider": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.0.8.tgz", + "integrity": "sha512-fqJXkewcGdi8LogKMgRyzc/Ls2js07yor7+g9KfPs09uPOcQLg7cc34JN+lk34HH9gg2HU0DIA5797ZR8znkfw==", + "dev": true, + "optional": true, + "requires": { + "@ethersproject/bignumber": "^5.0.13", + "@ethersproject/bytes": "^5.0.9", + "@ethersproject/logger": "^5.0.8", + "@ethersproject/networks": "^5.0.7", + "@ethersproject/properties": "^5.0.7", + "@ethersproject/transactions": "^5.0.9", + "@ethersproject/web": "^5.0.12" + } + }, + "@ethersproject/abstract-signer": { + "version": "5.0.10", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-signer/-/abstract-signer-5.0.10.tgz", + "integrity": "sha512-irx7kH7FDAeW7QChDPW19WsxqeB1d3XLyOLSXm0bfPqL1SS07LXWltBJUBUxqC03ORpAOcM3JQj57DU8JnVY2g==", + "dev": true, + "optional": true, + "requires": { + "@ethersproject/abstract-provider": "^5.0.8", + "@ethersproject/bignumber": "^5.0.13", + "@ethersproject/bytes": "^5.0.9", + "@ethersproject/logger": "^5.0.8", + "@ethersproject/properties": "^5.0.7" + } + }, + "@ethersproject/address": { + "version": "5.0.9", + "resolved": "https://registry.npmjs.org/@ethersproject/address/-/address-5.0.9.tgz", + "integrity": "sha512-gKkmbZDMyGbVjr8nA5P0md1GgESqSGH7ILIrDidPdNXBl4adqbuA3OAuZx/O2oGpL6PtJ9BDa0kHheZ1ToHU3w==", + "dev": true, + "optional": true, + "requires": { + "@ethersproject/bignumber": "^5.0.13", + "@ethersproject/bytes": "^5.0.9", + "@ethersproject/keccak256": "^5.0.7", + "@ethersproject/logger": "^5.0.8", + "@ethersproject/rlp": "^5.0.7" + } + }, + "@ethersproject/base64": { + "version": "5.0.7", + "resolved": "https://registry.npmjs.org/@ethersproject/base64/-/base64-5.0.7.tgz", + "integrity": "sha512-S5oh5DVfCo06xwJXT8fQC68mvJfgScTl2AXvbYMsHNfIBTDb084Wx4iA9MNlEReOv6HulkS+gyrUM/j3514rSw==", + "dev": true, + "optional": true, + "requires": { + "@ethersproject/bytes": "^5.0.9" + } + }, + "@ethersproject/bignumber": { + "version": "5.0.13", + "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.0.13.tgz", + "integrity": "sha512-b89bX5li6aK492yuPP5mPgRVgIxxBP7ksaBtKX5QQBsrZTpNOjf/MR4CjcUrAw8g+RQuD6kap9lPjFgY4U1/5A==", + "dev": true, + "optional": true, + "requires": { + "@ethersproject/bytes": "^5.0.9", + "@ethersproject/logger": "^5.0.8", + "bn.js": "^4.4.0" + } + }, + "@ethersproject/bytes": { + "version": "5.0.9", + "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.0.9.tgz", + "integrity": "sha512-k+17ZViDtAugC0s7HM6rdsTWEdIYII4RPCDkPEuxKc6i40Bs+m6tjRAtCECX06wKZnrEoR9pjOJRXHJ/VLoOcA==", + "dev": true, + "optional": true, + "requires": { + "@ethersproject/logger": "^5.0.8" + } + }, + "@ethersproject/constants": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.0.8.tgz", + "integrity": "sha512-sCc73pFBsl59eDfoQR5OCEZCRv5b0iywadunti6MQIr5lt3XpwxK1Iuzd8XSFO02N9jUifvuZRrt0cY0+NBgTg==", + "dev": true, + "optional": true, + "requires": { + "@ethersproject/bignumber": "^5.0.13" + } + }, + "@ethersproject/hash": { + "version": "5.0.10", + "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.0.10.tgz", + "integrity": "sha512-Tf0bvs6YFhw28LuHnhlDWyr0xfcDxSXdwM4TcskeBbmXVSKLv3bJQEEEBFUcRX0fJuslR3gCVySEaSh7vuMx5w==", + "dev": true, + "optional": true, + "requires": { + "@ethersproject/abstract-signer": "^5.0.10", + "@ethersproject/address": "^5.0.9", + "@ethersproject/bignumber": "^5.0.13", + "@ethersproject/bytes": "^5.0.9", + "@ethersproject/keccak256": "^5.0.7", + "@ethersproject/logger": "^5.0.8", + "@ethersproject/properties": "^5.0.7", + "@ethersproject/strings": "^5.0.8" + } + }, + "@ethersproject/keccak256": { + "version": "5.0.7", + "resolved": "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.0.7.tgz", + "integrity": "sha512-zpUBmofWvx9PGfc7IICobgFQSgNmTOGTGLUxSYqZzY/T+b4y/2o5eqf/GGmD7qnTGzKQ42YlLNo+LeDP2qe55g==", + "dev": true, + "optional": true, + "requires": { + "@ethersproject/bytes": "^5.0.9", + "js-sha3": "0.5.7" + } + }, + "@ethersproject/logger": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.0.8.tgz", + "integrity": "sha512-SkJCTaVTnaZ3/ieLF5pVftxGEFX56pTH+f2Slrpv7cU0TNpUZNib84QQdukd++sWUp/S7j5t5NW+WegbXd4U/A==", + "dev": true, + "optional": true + }, + "@ethersproject/networks": { + "version": "5.0.7", + "resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.0.7.tgz", + "integrity": "sha512-dI14QATndIcUgcCBL1c5vUr/YsI5cCHLN81rF7PU+yS7Xgp2/Rzbr9+YqpC6NBXHFUASjh6GpKqsVMpufAL0BQ==", + "dev": true, + "optional": true, + "requires": { + "@ethersproject/logger": "^5.0.8" + } + }, + "@ethersproject/properties": { + "version": "5.0.7", + "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.0.7.tgz", + "integrity": "sha512-812H1Rus2vjw0zbasfDI1GLNPDsoyX1pYqiCgaR1BuyKxUTbwcH1B+214l6VGe1v+F6iEVb7WjIwMjKhb4EUsg==", + "dev": true, + "optional": true, + "requires": { + "@ethersproject/logger": "^5.0.8" + } + }, + "@ethersproject/rlp": { + "version": "5.0.7", + "resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.0.7.tgz", + "integrity": "sha512-ulUTVEuV7PT4jJTPpfhRHK57tkLEDEY9XSYJtrSNHOqdwMvH0z7BM2AKIMq4LVDlnu4YZASdKrkFGEIO712V9w==", + "dev": true, + "optional": true, + "requires": { + "@ethersproject/bytes": "^5.0.9", + "@ethersproject/logger": "^5.0.8" + } + }, + "@ethersproject/signing-key": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.0.8.tgz", + "integrity": "sha512-YKxQM45eDa6WAD+s3QZPdm1uW1MutzVuyoepdRRVmMJ8qkk7iOiIhUkZwqKLNxKzEJijt/82ycuOREc9WBNAKg==", + "dev": true, + "optional": true, + "requires": { + "@ethersproject/bytes": "^5.0.9", + "@ethersproject/logger": "^5.0.8", + "@ethersproject/properties": "^5.0.7", + "elliptic": "6.5.3" + } + }, + "@ethersproject/strings": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.0.8.tgz", + "integrity": "sha512-5IsdXf8tMY8QuHl8vTLnk9ehXDDm6x9FB9S9Og5IA1GYhLe5ZewydXSjlJlsqU2t9HRbfv97OJZV/pX8DVA/Hw==", + "dev": true, + "optional": true, + "requires": { + "@ethersproject/bytes": "^5.0.9", + "@ethersproject/constants": "^5.0.8", + "@ethersproject/logger": "^5.0.8" + } + }, + "@ethersproject/transactions": { + "version": "5.0.9", + "resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.0.9.tgz", + "integrity": "sha512-0Fu1yhdFBkrbMjenEr+39tmDxuHmaw0pe9Jb18XuKoItj7Z3p7+UzdHLr2S/okvHDHYPbZE5gtANDdQ3ZL1nBA==", + "dev": true, + "optional": true, + "requires": { + "@ethersproject/address": "^5.0.9", + "@ethersproject/bignumber": "^5.0.13", + "@ethersproject/bytes": "^5.0.9", + "@ethersproject/constants": "^5.0.8", + "@ethersproject/keccak256": "^5.0.7", + "@ethersproject/logger": "^5.0.8", + "@ethersproject/properties": "^5.0.7", + "@ethersproject/rlp": "^5.0.7", + "@ethersproject/signing-key": "^5.0.8" + } + }, + "@ethersproject/web": { + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/@ethersproject/web/-/web-5.0.12.tgz", + "integrity": "sha512-gVxS5iW0bgidZ76kr7LsTxj4uzN5XpCLzvZrLp8TP+4YgxHfCeetFyQkRPgBEAJdNrexdSBayvyJvzGvOq0O8g==", + "dev": true, + "optional": true, + "requires": { + "@ethersproject/base64": "^5.0.7", + "@ethersproject/bytes": "^5.0.9", + "@ethersproject/logger": "^5.0.8", + "@ethersproject/properties": "^5.0.7", + "@ethersproject/strings": "^5.0.8" + } + }, + "@sindresorhus/is": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz", + "integrity": "sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==", + "dev": true, + "optional": true + }, + "@szmarczak/http-timer": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-1.1.2.tgz", + "integrity": "sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA==", + "dev": true, + "optional": true, + "requires": { + "defer-to-connect": "^1.0.1" + } + }, + "@types/bn.js": { + "version": "4.11.6", + "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.6.tgz", + "integrity": "sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@types/node": { + "version": "14.14.20", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.20.tgz", + "integrity": "sha512-Y93R97Ouif9JEOWPIUyU+eyIdyRqQR0I8Ez1dzku4hDx34NWh4HbtIc3WNzwB1Y9ULvNGeu5B8h8bVL5cAk4/A==", + "dev": true + }, + "@types/pbkdf2": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@types/pbkdf2/-/pbkdf2-3.1.0.tgz", + "integrity": "sha512-Cf63Rv7jCQ0LaL8tNXmEyqTHuIJxRdlS5vMh1mj5voN4+QFhVZnlZruezqpWYDiJ8UTzhP0VmeLXCmBk66YrMQ==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@types/secp256k1": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.1.tgz", + "integrity": "sha512-+ZjSA8ELlOp8SlKi0YLB2tz9d5iPNEmOBd+8Rz21wTMdaXQIa9b6TEnD6l5qKOCypE7FSyPyck12qZJxSDNoog==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@yarnpkg/lockfile": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz", + "integrity": "sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==", + "dev": true + }, + "abstract-leveldown": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-3.0.0.tgz", + "integrity": "sha512-KUWx9UWGQD12zsmLNj64/pndaz4iJh/Pj7nopgkfDG6RlCcbMZvT6+9l7dchK4idog2Is8VdC/PvNbFuFmalIQ==", + "dev": true, + "requires": { + "xtend": "~4.0.0" + } + }, + "accepts": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", + "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", + "dev": true, + "optional": true, + "requires": { + "mime-types": "~2.1.24", + "negotiator": "0.6.2" + } + }, + "aes-js": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.1.2.tgz", + "integrity": "sha512-e5pEa2kBnBOgR4Y/p20pskXI74UEz7de8ZGVo58asOtvSVG5YAbJeELPZxOmt+Bnz3rX753YKhfIn4X4l1PPRQ==", + "dev": true, + "optional": true + }, + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true + }, + "arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "dev": true + }, + "arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", + "dev": true + }, + "array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=", + "dev": true, + "optional": true + }, + "array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "dev": true + }, + "asn1": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", + "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "dev": true, + "requires": { + "safer-buffer": "~2.1.0" + } + }, + "asn1.js": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.4.1.tgz", + "integrity": "sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA==", + "dev": true, + "optional": true, + "requires": { + "bn.js": "^4.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "safer-buffer": "^2.1.0" + } + }, + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + }, + "assign-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", + "dev": true + }, + "async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.2.tgz", + "integrity": "sha512-H1qVYh1MYhEEFLsP97cVKqCGo7KfCyTt6uEWqsTBr9SO84oK9Uwbyd/yCW+6rKJLHksBNUVWZDAjfS+Ccx0Bbg==", + "dev": true, + "requires": { + "lodash": "^4.17.11" + } + }, + "async-eventemitter": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/async-eventemitter/-/async-eventemitter-0.2.4.tgz", + "integrity": "sha512-pd20BwL7Yt1zwDFy+8MX8F1+WCT8aQeKj0kQnTrH9WaeRETlRamVhD0JtRPmrV4GfOJ2F9CvdQkZeZhnh2TuHw==", + "dev": true, + "requires": { + "async": "^2.4.0" + } + }, + "async-limiter": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", + "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==", + "dev": true + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true + }, + "atob": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", + "dev": true + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", + "dev": true + }, + "aws4": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz", + "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==", + "dev": true + }, + "babel-code-frame": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", + "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", + "dev": true, + "requires": { + "chalk": "^1.1.3", + "esutils": "^2.0.2", + "js-tokens": "^3.0.2" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "js-tokens": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", + "dev": true + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + } + } + }, + "babel-core": { + "version": "6.26.3", + "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.26.3.tgz", + "integrity": "sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA==", + "dev": true, + "requires": { + "babel-code-frame": "^6.26.0", + "babel-generator": "^6.26.0", + "babel-helpers": "^6.24.1", + "babel-messages": "^6.23.0", + "babel-register": "^6.26.0", + "babel-runtime": "^6.26.0", + "babel-template": "^6.26.0", + "babel-traverse": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "convert-source-map": "^1.5.1", + "debug": "^2.6.9", + "json5": "^0.5.1", + "lodash": "^4.17.4", + "minimatch": "^3.0.4", + "path-is-absolute": "^1.0.1", + "private": "^0.1.8", + "slash": "^1.0.0", + "source-map": "^0.5.7" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "json5": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", + "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", + "dev": true + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "slash": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", + "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=", + "dev": true + } + } + }, + "babel-generator": { + "version": "6.26.1", + "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.1.tgz", + "integrity": "sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA==", + "dev": true, + "requires": { + "babel-messages": "^6.23.0", + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "detect-indent": "^4.0.0", + "jsesc": "^1.3.0", + "lodash": "^4.17.4", + "source-map": "^0.5.7", + "trim-right": "^1.0.1" + }, + "dependencies": { + "jsesc": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", + "integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=", + "dev": true + } + } + }, + "babel-helper-builder-binary-assignment-operator-visitor": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz", + "integrity": "sha1-zORReto1b0IgvK6KAsKzRvmlZmQ=", + "dev": true, + "requires": { + "babel-helper-explode-assignable-expression": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-helper-call-delegate": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz", + "integrity": "sha1-7Oaqzdx25Bw0YfiL/Fdb0Nqi340=", + "dev": true, + "requires": { + "babel-helper-hoist-variables": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-helper-define-map": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz", + "integrity": "sha1-pfVtq0GiX5fstJjH66ypgZ+Vvl8=", + "dev": true, + "requires": { + "babel-helper-function-name": "^6.24.1", + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "lodash": "^4.17.4" + } + }, + "babel-helper-explode-assignable-expression": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz", + "integrity": "sha1-8luCz33BBDPFX3BZLVdGQArCLKo=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-helper-function-name": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz", + "integrity": "sha1-00dbjAPtmCQqJbSDUasYOZ01gKk=", + "dev": true, + "requires": { + "babel-helper-get-function-arity": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-helper-get-function-arity": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz", + "integrity": "sha1-j3eCqpNAfEHTqlCQj4mwMbG2hT0=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-helper-hoist-variables": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz", + "integrity": "sha1-HssnaJydJVE+rbyZFKc/VAi+enY=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-helper-optimise-call-expression": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz", + "integrity": "sha1-96E0J7qfc/j0+pk8VKl4gtEkQlc=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-helper-regex": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz", + "integrity": "sha1-MlxZ+QL4LyS3T6zu0DY5VPZJXnI=", + "dev": true, + "requires": { + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "lodash": "^4.17.4" + } + }, + "babel-helper-remap-async-to-generator": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz", + "integrity": "sha1-XsWBgnrXI/7N04HxySg5BnbkVRs=", + "dev": true, + "requires": { + "babel-helper-function-name": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-helper-replace-supers": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz", + "integrity": "sha1-v22/5Dk40XNpohPKiov3S2qQqxo=", + "dev": true, + "requires": { + "babel-helper-optimise-call-expression": "^6.24.1", + "babel-messages": "^6.23.0", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-helpers": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.24.1.tgz", + "integrity": "sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "babel-messages": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", + "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-check-es2015-constants": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz", + "integrity": "sha1-NRV7EBQm/S/9PaP3XH0ekYNbv4o=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-syntax-async-functions": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz", + "integrity": "sha1-ytnK0RkbWtY0vzCuCHI5HgZHvpU=", + "dev": true + }, + "babel-plugin-syntax-exponentiation-operator": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz", + "integrity": "sha1-nufoM3KQ2pUoggGmpX9BcDF4MN4=", + "dev": true + }, + "babel-plugin-syntax-trailing-function-commas": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz", + "integrity": "sha1-ugNgk3+NBuQBgKQ/4NVhb/9TLPM=", + "dev": true + }, + "babel-plugin-transform-async-to-generator": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz", + "integrity": "sha1-ZTbjeK/2yx1VF6wOQOs+n8jQh2E=", + "dev": true, + "requires": { + "babel-helper-remap-async-to-generator": "^6.24.1", + "babel-plugin-syntax-async-functions": "^6.8.0", + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-arrow-functions": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz", + "integrity": "sha1-RSaSy3EdX3ncf4XkQM5BufJE0iE=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-block-scoped-functions": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz", + "integrity": "sha1-u8UbSflk1wy42OC5ToICRs46YUE=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-block-scoping": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz", + "integrity": "sha1-1w9SmcEwjQXBL0Y4E7CgnnOxiV8=", + "dev": true, + "requires": { + "babel-runtime": "^6.26.0", + "babel-template": "^6.26.0", + "babel-traverse": "^6.26.0", + "babel-types": "^6.26.0", + "lodash": "^4.17.4" + } + }, + "babel-plugin-transform-es2015-classes": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz", + "integrity": "sha1-WkxYpQyclGHlZLSyo7+ryXolhNs=", + "dev": true, + "requires": { + "babel-helper-define-map": "^6.24.1", + "babel-helper-function-name": "^6.24.1", + "babel-helper-optimise-call-expression": "^6.24.1", + "babel-helper-replace-supers": "^6.24.1", + "babel-messages": "^6.23.0", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-computed-properties": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz", + "integrity": "sha1-b+Ko0WiV1WNPTNmZttNICjCBWbM=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-destructuring": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz", + "integrity": "sha1-mXux8auWf2gtKwh2/jWNYOdlxW0=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-duplicate-keys": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz", + "integrity": "sha1-c+s9MQypaePvnskcU3QabxV2Qj4=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-for-of": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz", + "integrity": "sha1-9HyVsrYT3x0+zC/bdXNiPHUkhpE=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-function-name": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz", + "integrity": "sha1-g0yJhTvDaxrw86TF26qU/Y6sqos=", + "dev": true, + "requires": { + "babel-helper-function-name": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-literals": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz", + "integrity": "sha1-T1SgLWzWbPkVKAAZox0xklN3yi4=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-modules-amd": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz", + "integrity": "sha1-Oz5UAXI5hC1tGcMBHEvS8AoA0VQ=", + "dev": true, + "requires": { + "babel-plugin-transform-es2015-modules-commonjs": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-modules-commonjs": { + "version": "6.26.2", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.2.tgz", + "integrity": "sha512-CV9ROOHEdrjcwhIaJNBGMBCodN+1cfkwtM1SbUHmvyy35KGT7fohbpOxkE2uLz1o6odKK2Ck/tz47z+VqQfi9Q==", + "dev": true, + "requires": { + "babel-plugin-transform-strict-mode": "^6.24.1", + "babel-runtime": "^6.26.0", + "babel-template": "^6.26.0", + "babel-types": "^6.26.0" + } + }, + "babel-plugin-transform-es2015-modules-systemjs": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz", + "integrity": "sha1-/4mhQrkRmpBhlfXxBuzzBdlAfSM=", + "dev": true, + "requires": { + "babel-helper-hoist-variables": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-modules-umd": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz", + "integrity": "sha1-rJl+YoXNGO1hdq22B9YCNErThGg=", + "dev": true, + "requires": { + "babel-plugin-transform-es2015-modules-amd": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-object-super": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz", + "integrity": "sha1-JM72muIcuDp/hgPa0CH1cusnj40=", + "dev": true, + "requires": { + "babel-helper-replace-supers": "^6.24.1", + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-parameters": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz", + "integrity": "sha1-V6w1GrScrxSpfNE7CfZv3wpiXys=", + "dev": true, + "requires": { + "babel-helper-call-delegate": "^6.24.1", + "babel-helper-get-function-arity": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-shorthand-properties": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz", + "integrity": "sha1-JPh11nIch2YbvZmkYi5R8U3jiqA=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-spread": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz", + "integrity": "sha1-1taKmfia7cRTbIGlQujdnxdG+NE=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-sticky-regex": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz", + "integrity": "sha1-AMHNsaynERLN8M9hJsLta0V8zbw=", + "dev": true, + "requires": { + "babel-helper-regex": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-template-literals": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz", + "integrity": "sha1-qEs0UPfp+PH2g51taH2oS7EjbY0=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-typeof-symbol": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz", + "integrity": "sha1-3sCfHN3/lLUqxz1QXITfWdzOs3I=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-unicode-regex": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz", + "integrity": "sha1-04sS9C6nMj9yk4fxinxa4frrNek=", + "dev": true, + "requires": { + "babel-helper-regex": "^6.24.1", + "babel-runtime": "^6.22.0", + "regexpu-core": "^2.0.0" + } + }, + "babel-plugin-transform-exponentiation-operator": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz", + "integrity": "sha1-KrDJx/MJj6SJB3cruBP+QejeOg4=", + "dev": true, + "requires": { + "babel-helper-builder-binary-assignment-operator-visitor": "^6.24.1", + "babel-plugin-syntax-exponentiation-operator": "^6.8.0", + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-regenerator": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz", + "integrity": "sha1-4HA2lvveJ/Cj78rPi03KL3s6jy8=", + "dev": true, + "requires": { + "regenerator-transform": "^0.10.0" + } + }, + "babel-plugin-transform-strict-mode": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz", + "integrity": "sha1-1fr3qleKZbvlkc9e2uBKDGcCB1g=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-preset-env": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/babel-preset-env/-/babel-preset-env-1.7.0.tgz", + "integrity": "sha512-9OR2afuKDneX2/q2EurSftUYM0xGu4O2D9adAhVfADDhrYDaxXV0rBbevVYoY9n6nyX1PmQW/0jtpJvUNr9CHg==", + "dev": true, + "requires": { + "babel-plugin-check-es2015-constants": "^6.22.0", + "babel-plugin-syntax-trailing-function-commas": "^6.22.0", + "babel-plugin-transform-async-to-generator": "^6.22.0", + "babel-plugin-transform-es2015-arrow-functions": "^6.22.0", + "babel-plugin-transform-es2015-block-scoped-functions": "^6.22.0", + "babel-plugin-transform-es2015-block-scoping": "^6.23.0", + "babel-plugin-transform-es2015-classes": "^6.23.0", + "babel-plugin-transform-es2015-computed-properties": "^6.22.0", + "babel-plugin-transform-es2015-destructuring": "^6.23.0", + "babel-plugin-transform-es2015-duplicate-keys": "^6.22.0", + "babel-plugin-transform-es2015-for-of": "^6.23.0", + "babel-plugin-transform-es2015-function-name": "^6.22.0", + "babel-plugin-transform-es2015-literals": "^6.22.0", + "babel-plugin-transform-es2015-modules-amd": "^6.22.0", + "babel-plugin-transform-es2015-modules-commonjs": "^6.23.0", + "babel-plugin-transform-es2015-modules-systemjs": "^6.23.0", + "babel-plugin-transform-es2015-modules-umd": "^6.23.0", + "babel-plugin-transform-es2015-object-super": "^6.22.0", + "babel-plugin-transform-es2015-parameters": "^6.23.0", + "babel-plugin-transform-es2015-shorthand-properties": "^6.22.0", + "babel-plugin-transform-es2015-spread": "^6.22.0", + "babel-plugin-transform-es2015-sticky-regex": "^6.22.0", + "babel-plugin-transform-es2015-template-literals": "^6.22.0", + "babel-plugin-transform-es2015-typeof-symbol": "^6.23.0", + "babel-plugin-transform-es2015-unicode-regex": "^6.22.0", + "babel-plugin-transform-exponentiation-operator": "^6.22.0", + "babel-plugin-transform-regenerator": "^6.22.0", + "browserslist": "^3.2.6", + "invariant": "^2.2.2", + "semver": "^5.3.0" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "babel-register": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-register/-/babel-register-6.26.0.tgz", + "integrity": "sha1-btAhFz4vy0htestFxgCahW9kcHE=", + "dev": true, + "requires": { + "babel-core": "^6.26.0", + "babel-runtime": "^6.26.0", + "core-js": "^2.5.0", + "home-or-tmp": "^2.0.0", + "lodash": "^4.17.4", + "mkdirp": "^0.5.1", + "source-map-support": "^0.4.15" + }, + "dependencies": { + "source-map-support": { + "version": "0.4.18", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", + "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", + "dev": true, + "requires": { + "source-map": "^0.5.6" + } + } + } + }, + "babel-runtime": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", + "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", + "dev": true, + "requires": { + "core-js": "^2.4.0", + "regenerator-runtime": "^0.11.0" + } + }, + "babel-template": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-template/-/babel-template-6.26.0.tgz", + "integrity": "sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI=", + "dev": true, + "requires": { + "babel-runtime": "^6.26.0", + "babel-traverse": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "lodash": "^4.17.4" + } + }, + "babel-traverse": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.26.0.tgz", + "integrity": "sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4=", + "dev": true, + "requires": { + "babel-code-frame": "^6.26.0", + "babel-messages": "^6.23.0", + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "debug": "^2.6.8", + "globals": "^9.18.0", + "invariant": "^2.2.2", + "lodash": "^4.17.4" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "globals": { + "version": "9.18.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", + "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", + "dev": true + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "babel-types": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz", + "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=", + "dev": true, + "requires": { + "babel-runtime": "^6.26.0", + "esutils": "^2.0.2", + "lodash": "^4.17.4", + "to-fast-properties": "^1.0.3" + }, + "dependencies": { + "to-fast-properties": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", + "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=", + "dev": true + } + } + }, + "babelify": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/babelify/-/babelify-7.3.0.tgz", + "integrity": "sha1-qlau3nBn/XvVSWZu4W3ChQh+iOU=", + "dev": true, + "requires": { + "babel-core": "^6.0.14", + "object-assign": "^4.0.0" + } + }, + "babylon": { + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz", + "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==", + "dev": true + }, + "backoff": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/backoff/-/backoff-2.5.0.tgz", + "integrity": "sha1-9hbtqdPktmuMp/ynn2lXIsX44m8=", + "dev": true, + "requires": { + "precond": "0.2" + } + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "base": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "dev": true, + "requires": { + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + } + } + }, + "base-x": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.8.tgz", + "integrity": "sha512-Rl/1AWP4J/zRrk54hhlxH4drNxPJXYUaKffODVI53/dAsV4t9fBxyxYKAVPU1XBHxYwOWP9h9H0hM2MVw4YfJA==", + "dev": true, + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "dev": true + }, + "bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "dev": true, + "requires": { + "tweetnacl": "^0.14.3" + }, + "dependencies": { + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "dev": true + } + } + }, + "bignumber.js": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.1.tgz", + "integrity": "sha512-IdZR9mh6ahOBv/hYGiXyVuyCetmGJhtYkqLBpTStdhEGjegpPlUawydyaF3pbIOFynJTpllEs+NP+CS9jKFLjA==", + "dev": true, + "optional": true + }, + "bip39": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/bip39/-/bip39-2.5.0.tgz", + "integrity": "sha512-xwIx/8JKoT2+IPJpFEfXoWdYwP7UVAoUxxLNfGCfVowaJE7yg1Y5B1BVPqlUNsBq5/nGwmFkwRJ8xDW4sX8OdA==", + "dev": true, + "requires": { + "create-hash": "^1.1.0", + "pbkdf2": "^3.0.9", + "randombytes": "^2.0.1", + "safe-buffer": "^5.0.1", + "unorm": "^1.3.3" + } + }, + "blakejs": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.1.0.tgz", + "integrity": "sha1-ad+S75U6qIylGjLfarHFShVfx6U=", + "dev": true + }, + "bluebird": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", + "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", + "dev": true, + "optional": true + }, + "bn.js": { + "version": "4.11.9", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", + "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", + "dev": true + }, + "body-parser": { + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", + "integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==", + "dev": true, + "optional": true, + "requires": { + "bytes": "3.1.0", + "content-type": "~1.0.4", + "debug": "2.6.9", + "depd": "~1.1.2", + "http-errors": "1.7.2", + "iconv-lite": "0.4.24", + "on-finished": "~2.3.0", + "qs": "6.7.0", + "raw-body": "2.4.0", + "type-is": "~1.6.17" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "optional": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true, + "optional": true + }, + "qs": { + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", + "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==", + "dev": true, + "optional": true + } + } + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", + "dev": true + }, + "browserify-aes": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "dev": true, + "requires": { + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "browserify-cipher": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", + "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", + "dev": true, + "optional": true, + "requires": { + "browserify-aes": "^1.0.4", + "browserify-des": "^1.0.0", + "evp_bytestokey": "^1.0.0" + } + }, + "browserify-des": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", + "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", + "dev": true, + "optional": true, + "requires": { + "cipher-base": "^1.0.1", + "des.js": "^1.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "browserify-rsa": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.1.0.tgz", + "integrity": "sha512-AdEER0Hkspgno2aR97SAf6vi0y0k8NuOpGnVH3O99rcA5Q6sh8QxcngtHuJ6uXwnfAXNM4Gn1Gb7/MV1+Ymbog==", + "dev": true, + "optional": true, + "requires": { + "bn.js": "^5.0.0", + "randombytes": "^2.0.1" + }, + "dependencies": { + "bn.js": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.1.3.tgz", + "integrity": "sha512-GkTiFpjFtUzU9CbMeJ5iazkCzGL3jrhzerzZIuqLABjbwRaFt33I9tUdSNryIptM+RxDet6OKm2WnLXzW51KsQ==", + "dev": true, + "optional": true + } + } + }, + "browserify-sign": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.1.tgz", + "integrity": "sha512-/vrA5fguVAKKAVTNJjgSm1tRQDHUU6DbwO9IROu/0WAzC8PKhucDSh18J0RMvVeHAn5puMd+QHC2erPRNf8lmg==", + "dev": true, + "optional": true, + "requires": { + "bn.js": "^5.1.1", + "browserify-rsa": "^4.0.1", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "elliptic": "^6.5.3", + "inherits": "^2.0.4", + "parse-asn1": "^5.1.5", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + }, + "dependencies": { + "bn.js": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.1.3.tgz", + "integrity": "sha512-GkTiFpjFtUzU9CbMeJ5iazkCzGL3jrhzerzZIuqLABjbwRaFt33I9tUdSNryIptM+RxDet6OKm2WnLXzW51KsQ==", + "dev": true, + "optional": true + }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "optional": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + } + } + }, + "browserslist": { + "version": "3.2.8", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-3.2.8.tgz", + "integrity": "sha512-WHVocJYavUwVgVViC0ORikPHQquXwVh939TaelZ4WDqpWgTX/FsGhl/+P4qBUAGcRvtOgDgC+xftNWWp2RUTAQ==", + "dev": true, + "requires": { + "caniuse-lite": "^1.0.30000844", + "electron-to-chromium": "^1.3.47" + } + }, + "bs58": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", + "integrity": "sha1-vhYedsNU9veIrkBx9j806MTwpCo=", + "dev": true, + "requires": { + "base-x": "^3.0.2" + } + }, + "bs58check": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/bs58check/-/bs58check-2.1.2.tgz", + "integrity": "sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA==", + "dev": true, + "requires": { + "bs58": "^4.0.0", + "create-hash": "^1.1.0", + "safe-buffer": "^5.1.2" + } + }, + "buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "dev": true, + "requires": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "buffer-from": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "dev": true + }, + "buffer-to-arraybuffer": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/buffer-to-arraybuffer/-/buffer-to-arraybuffer-0.0.5.tgz", + "integrity": "sha1-YGSkD6dutDxyOrqe+PbhIW0QURo=", + "dev": true, + "optional": true + }, + "buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", + "dev": true + }, + "bufferutil": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.3.tgz", + "integrity": "sha512-yEYTwGndELGvfXsImMBLop58eaGW+YdONi1fNjTINSY98tmMmFijBG6WXgdkfuLNt4imzQNtIE+eBp1PVpMCSw==", + "dev": true, + "requires": { + "node-gyp-build": "^4.2.0" + } + }, + "bytes": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", + "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==", + "dev": true, + "optional": true + }, + "bytewise": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/bytewise/-/bytewise-1.1.0.tgz", + "integrity": "sha1-HRPL/3F65xWAlKqIGzXQgbOHJT4=", + "dev": true, + "requires": { + "bytewise-core": "^1.2.2", + "typewise": "^1.0.3" + } + }, + "bytewise-core": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/bytewise-core/-/bytewise-core-1.2.3.tgz", + "integrity": "sha1-P7QQx+kVWOsasiqCg0V3qmvWHUI=", + "dev": true, + "requires": { + "typewise-core": "^1.2" + } + }, + "cache-base": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "dev": true, + "requires": { + "collection-visit": "^1.0.0", + "component-emitter": "^1.2.1", + "get-value": "^2.0.6", + "has-value": "^1.0.0", + "isobject": "^3.0.1", + "set-value": "^2.0.0", + "to-object-path": "^0.3.0", + "union-value": "^1.0.0", + "unset-value": "^1.0.0" + } + }, + "cacheable-request": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-6.1.0.tgz", + "integrity": "sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg==", + "dev": true, + "optional": true, + "requires": { + "clone-response": "^1.0.2", + "get-stream": "^5.1.0", + "http-cache-semantics": "^4.0.0", + "keyv": "^3.0.0", + "lowercase-keys": "^2.0.0", + "normalize-url": "^4.1.0", + "responselike": "^1.0.2" + }, + "dependencies": { + "lowercase-keys": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", + "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", + "dev": true, + "optional": true + } + } + }, + "cachedown": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/cachedown/-/cachedown-1.0.0.tgz", + "integrity": "sha1-1D8DbkUQaWsxJG19sx6/D3rDLRU=", + "dev": true, + "requires": { + "abstract-leveldown": "^2.4.1", + "lru-cache": "^3.2.0" + }, + "dependencies": { + "abstract-leveldown": { + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.7.2.tgz", + "integrity": "sha512-+OVvxH2rHVEhWLdbudP6p0+dNMXu8JA1CbhP19T8paTYAcX7oJ4OVjT+ZUVpv7mITxXHqDMej+GdqXBmXkw09w==", + "dev": true, + "requires": { + "xtend": "~4.0.0" + } + }, + "lru-cache": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-3.2.0.tgz", + "integrity": "sha1-cXibO39Tmb7IVl3aOKow0qCX7+4=", + "dev": true, + "requires": { + "pseudomap": "^1.0.1" + } + } + } + }, + "call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "dev": true, + "requires": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + } + }, + "caniuse-lite": { + "version": "1.0.30001174", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001174.tgz", + "integrity": "sha512-tqClL/4ThQq6cfFXH3oJL4rifFBeM6gTkphjao5kgwMaW9yn0tKgQLAEfKzDwj6HQWCB/aWo8kTFlSvIN8geEA==", + "dev": true + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", + "dev": true + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "checkpoint-store": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/checkpoint-store/-/checkpoint-store-1.1.0.tgz", + "integrity": "sha1-BOTLUWuRQziTWB5tRgGnjpVS6gY=", + "dev": true, + "requires": { + "functional-red-black-tree": "^1.0.1" + } + }, + "chownr": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", + "dev": true, + "optional": true + }, + "ci-info": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", + "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", + "dev": true + }, + "cids": { + "version": "0.7.5", + "resolved": "https://registry.npmjs.org/cids/-/cids-0.7.5.tgz", + "integrity": "sha512-zT7mPeghoWAu+ppn8+BS1tQ5qGmbMfB4AregnQjA/qHY3GC1m1ptI9GkWNlgeu38r7CuRdXB47uY2XgAYt6QVA==", + "dev": true, + "optional": true, + "requires": { + "buffer": "^5.5.0", + "class-is": "^1.1.0", + "multibase": "~0.6.0", + "multicodec": "^1.0.0", + "multihashes": "~0.4.15" + }, + "dependencies": { + "multicodec": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/multicodec/-/multicodec-1.0.4.tgz", + "integrity": "sha512-NDd7FeS3QamVtbgfvu5h7fd1IlbaC4EQ0/pgU4zqE2vdHCmBGsUa0TiM8/TdSeG6BMPC92OOCf8F1ocE/Wkrrg==", + "dev": true, + "optional": true, + "requires": { + "buffer": "^5.6.0", + "varint": "^5.0.0" + } + } + } + }, + "cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "class-is": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/class-is/-/class-is-1.1.0.tgz", + "integrity": "sha512-rhjH9AG1fvabIDoGRVH587413LPjTZgmDF9fOFCbFJQV4yuocX1mHxxvXI4g3cGwbVY9wAYIoKlg1N79frJKQw==", + "dev": true, + "optional": true + }, + "class-utils": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", + "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "define-property": "^0.2.5", + "isobject": "^3.0.0", + "static-extend": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + } + }, + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + } + } + }, + "clone": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", + "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=", + "dev": true + }, + "clone-response": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz", + "integrity": "sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=", + "dev": true, + "optional": true, + "requires": { + "mimic-response": "^1.0.0" + } + }, + "collection-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", + "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "dev": true, + "requires": { + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "component-emitter": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", + "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, + "content-disposition": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", + "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==", + "dev": true, + "optional": true, + "requires": { + "safe-buffer": "5.1.2" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true, + "optional": true + } + } + }, + "content-hash": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/content-hash/-/content-hash-2.5.2.tgz", + "integrity": "sha512-FvIQKy0S1JaWV10sMsA7TRx8bpU+pqPkhbsfvOJAdjRXvYxEckAwQWGwtRjiaJfh+E0DvcWUGqcdjwMGFjsSdw==", + "dev": true, + "optional": true, + "requires": { + "cids": "^0.7.1", + "multicodec": "^0.5.5", + "multihashes": "^0.4.15" + } + }, + "content-type": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", + "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==", + "dev": true, + "optional": true + }, + "convert-source-map": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", + "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.1" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + } + } + }, + "cookie": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz", + "integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==", + "dev": true, + "optional": true + }, + "cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=", + "dev": true, + "optional": true + }, + "cookiejar": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.2.tgz", + "integrity": "sha512-Mw+adcfzPxcPeI+0WlvRrr/3lGVO0bD75SxX6811cxSh1Wbxx7xZBGK1eVtDf6si8rg2lhnUjsVLMFMfbRIuwA==", + "dev": true, + "optional": true + }, + "copy-descriptor": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", + "dev": true + }, + "core-js": { + "version": "2.6.12", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz", + "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==", + "dev": true + }, + "core-js-pure": { + "version": "3.8.2", + "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.8.2.tgz", + "integrity": "sha512-v6zfIQqL/pzTVAbZvYUozsxNfxcFb6Ks3ZfEbuneJl3FW9Jb8F6vLWB6f+qTmAu72msUdyb84V8d/yBFf7FNnw==", + "dev": true + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "dev": true, + "optional": true, + "requires": { + "object-assign": "^4", + "vary": "^1" + } + }, + "create-ecdh": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz", + "integrity": "sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A==", + "dev": true, + "optional": true, + "requires": { + "bn.js": "^4.1.0", + "elliptic": "^6.5.3" + } + }, + "create-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "dev": true, + "requires": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + } + }, + "create-hmac": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "dev": true, + "requires": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "cross-fetch": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-2.2.3.tgz", + "integrity": "sha512-PrWWNH3yL2NYIb/7WF/5vFG3DCQiXDOVf8k3ijatbrtnwNuhMWLC7YF7uqf53tbTFDzHIUD8oITw4Bxt8ST3Nw==", + "dev": true, + "requires": { + "node-fetch": "2.1.2", + "whatwg-fetch": "2.0.4" + } + }, + "crypto-browserify": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", + "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", + "dev": true, + "optional": true, + "requires": { + "browserify-cipher": "^1.0.0", + "browserify-sign": "^4.0.0", + "create-ecdh": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.0", + "diffie-hellman": "^5.0.0", + "inherits": "^2.0.1", + "pbkdf2": "^3.0.3", + "public-encrypt": "^4.0.0", + "randombytes": "^2.0.0", + "randomfill": "^1.0.3" + } + }, + "d": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", + "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", + "dev": true, + "requires": { + "es5-ext": "^0.10.50", + "type": "^1.0.1" + } + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0" + } + }, + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "decode-uri-component": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", + "dev": true + }, + "decompress-response": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", + "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", + "dev": true, + "optional": true, + "requires": { + "mimic-response": "^1.0.0" + } + }, + "deep-equal": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.1.tgz", + "integrity": "sha512-yd9c5AdiqVcR+JjcwUQb9DkhJc8ngNr0MahEBGvDiJw8puWab2yZlh+nkasOnZP+EGTAP6rRp2JzJhJZzvNF8g==", + "dev": true, + "requires": { + "is-arguments": "^1.0.4", + "is-date-object": "^1.0.1", + "is-regex": "^1.0.4", + "object-is": "^1.0.1", + "object-keys": "^1.1.1", + "regexp.prototype.flags": "^1.2.0" + } + }, + "defer-to-connect": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.1.3.tgz", + "integrity": "sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ==", + "dev": true, + "optional": true + }, + "deferred-leveldown": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-4.0.2.tgz", + "integrity": "sha512-5fMC8ek8alH16QiV0lTCis610D1Zt1+LA4MS4d63JgS32lrCjTFDUFz2ao09/j2I4Bqb5jL4FZYwu7Jz0XO1ww==", + "dev": true, + "requires": { + "abstract-leveldown": "~5.0.0", + "inherits": "^2.0.3" + }, + "dependencies": { + "abstract-leveldown": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-5.0.0.tgz", + "integrity": "sha512-5mU5P1gXtsMIXg65/rsYGsi93+MlogXZ9FA8JnwKurHQg64bfXwGYVdVdijNTVNOlAsuIiOwHdvFFD5JqCJQ7A==", + "dev": true, + "requires": { + "xtend": "~4.0.0" + } + } + } + }, + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, + "requires": { + "object-keys": "^1.0.12" + } + }, + "define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "dev": true, + "requires": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + } + }, + "defined": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", + "integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=", + "dev": true + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true + }, + "depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", + "dev": true, + "optional": true + }, + "des.js": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz", + "integrity": "sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA==", + "dev": true, + "optional": true, + "requires": { + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, + "destroy": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", + "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=", + "dev": true, + "optional": true + }, + "detect-indent": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz", + "integrity": "sha1-920GQ1LN9Docts5hnE7jqUdd4gg=", + "dev": true, + "requires": { + "repeating": "^2.0.0" + } + }, + "diffie-hellman": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", + "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", + "dev": true, + "optional": true, + "requires": { + "bn.js": "^4.1.0", + "miller-rabin": "^4.0.0", + "randombytes": "^2.0.0" + } + }, + "dom-walk": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/dom-walk/-/dom-walk-0.1.2.tgz", + "integrity": "sha512-6QvTW9mrGeIegrFXdtQi9pk7O/nSK6lSdXW2eqUspN5LWD7UTji2Fqw5V2YLjBpHEoU9Xl/eUWNpDeZvoyOv2w==", + "dev": true + }, + "dotignore": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/dotignore/-/dotignore-0.1.2.tgz", + "integrity": "sha512-UGGGWfSauusaVJC+8fgV+NVvBXkCTmVv7sk6nojDZZvuOUNGUy0Zk4UpHQD6EDjS0jpBwcACvH4eofvyzBcRDw==", + "dev": true, + "requires": { + "minimatch": "^3.0.4" + } + }, + "duplexer3": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", + "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=", + "dev": true, + "optional": true + }, + "ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "dev": true, + "requires": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=", + "dev": true, + "optional": true + }, + "electron-to-chromium": { + "version": "1.3.636", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.636.tgz", + "integrity": "sha512-Adcvng33sd3gTjNIDNXGD1G4H6qCImIy2euUJAQHtLNplEKU5WEz5KRJxupRNIIT8sD5oFZLTKBWAf12Bsz24A==", + "dev": true + }, + "elliptic": { + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz", + "integrity": "sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==", + "dev": true, + "requires": { + "bn.js": "^4.4.0", + "brorand": "^1.0.1", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.0" + } + }, + "encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=", + "dev": true, + "optional": true + }, + "encoding": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", + "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", + "dev": true, + "requires": { + "iconv-lite": "^0.6.2" + }, + "dependencies": { + "iconv-lite": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.2.tgz", + "integrity": "sha512-2y91h5OpQlolefMPmUlivelittSWy0rP+oYVpn6A7GwVHNE8AWzoYOBNmlwks3LobaJxgHCYZAnyNo2GgpNRNQ==", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + } + } + } + }, + "encoding-down": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/encoding-down/-/encoding-down-5.0.4.tgz", + "integrity": "sha512-8CIZLDcSKxgzT+zX8ZVfgNbu8Md2wq/iqa1Y7zyVR18QBEAc0Nmzuvj/N5ykSKpfGzjM8qxbaFntLPwnVoUhZw==", + "dev": true, + "requires": { + "abstract-leveldown": "^5.0.0", + "inherits": "^2.0.3", + "level-codec": "^9.0.0", + "level-errors": "^2.0.0", + "xtend": "^4.0.1" + }, + "dependencies": { + "abstract-leveldown": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-5.0.0.tgz", + "integrity": "sha512-5mU5P1gXtsMIXg65/rsYGsi93+MlogXZ9FA8JnwKurHQg64bfXwGYVdVdijNTVNOlAsuIiOwHdvFFD5JqCJQ7A==", + "dev": true, + "requires": { + "xtend": "~4.0.0" + } + } + } + }, + "end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "dev": true, + "requires": { + "once": "^1.4.0" + } + }, + "errno": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.8.tgz", + "integrity": "sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==", + "dev": true, + "requires": { + "prr": "~1.0.1" + } + }, + "es-abstract": { + "version": "1.18.0-next.1", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.1.tgz", + "integrity": "sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.2", + "is-negative-zero": "^2.0.0", + "is-regex": "^1.1.1", + "object-inspect": "^1.8.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.1", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" + } + }, + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, + "es5-ext": { + "version": "0.10.53", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.53.tgz", + "integrity": "sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q==", + "dev": true, + "requires": { + "es6-iterator": "~2.0.3", + "es6-symbol": "~3.1.3", + "next-tick": "~1.0.0" + } + }, + "es6-iterator": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", + "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", + "dev": true, + "requires": { + "d": "1", + "es5-ext": "^0.10.35", + "es6-symbol": "^3.1.1" + } + }, + "es6-symbol": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", + "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==", + "dev": true, + "requires": { + "d": "^1.0.1", + "ext": "^1.1.2" + } + }, + "escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=", + "dev": true, + "optional": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true + }, + "etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=", + "dev": true, + "optional": true + }, + "eth-block-tracker": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/eth-block-tracker/-/eth-block-tracker-3.0.1.tgz", + "integrity": "sha512-WUVxWLuhMmsfenfZvFO5sbl1qFY2IqUlw/FPVmjjdElpqLsZtSG+wPe9Dz7W/sB6e80HgFKknOmKk2eNlznHug==", + "dev": true, + "requires": { + "eth-query": "^2.1.0", + "ethereumjs-tx": "^1.3.3", + "ethereumjs-util": "^5.1.3", + "ethjs-util": "^0.1.3", + "json-rpc-engine": "^3.6.0", + "pify": "^2.3.0", + "tape": "^4.6.3" + }, + "dependencies": { + "ethereumjs-tx": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/ethereumjs-tx/-/ethereumjs-tx-1.3.7.tgz", + "integrity": "sha512-wvLMxzt1RPhAQ9Yi3/HKZTn0FZYpnsmQdbKYfUUpi4j1SEIcbkd9tndVjcPrufY3V7j2IebOpC00Zp2P/Ay2kA==", + "dev": true, + "requires": { + "ethereum-common": "^0.0.18", + "ethereumjs-util": "^5.0.0" + } + }, + "ethereumjs-util": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.1.tgz", + "integrity": "sha512-v3kT+7zdyCm1HIqWlLNrHGqHGLpGYIhjeHxQjnDXjLT2FyGJDsd3LWMYUo7pAFRrk86CR3nUJfhC81CCoJNNGQ==", + "dev": true, + "requires": { + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "^0.1.3", + "rlp": "^2.0.0", + "safe-buffer": "^5.1.1" + } + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + } + } + }, + "eth-ens-namehash": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/eth-ens-namehash/-/eth-ens-namehash-2.0.8.tgz", + "integrity": "sha1-IprEbsqG1S4MmR58sq74P/D2i88=", + "dev": true, + "optional": true, + "requires": { + "idna-uts46-hx": "^2.3.1", + "js-sha3": "^0.5.7" + } + }, + "eth-json-rpc-infura": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/eth-json-rpc-infura/-/eth-json-rpc-infura-3.2.1.tgz", + "integrity": "sha512-W7zR4DZvyTn23Bxc0EWsq4XGDdD63+XPUCEhV2zQvQGavDVC4ZpFDK4k99qN7bd7/fjj37+rxmuBOBeIqCA5Mw==", + "dev": true, + "requires": { + "cross-fetch": "^2.1.1", + "eth-json-rpc-middleware": "^1.5.0", + "json-rpc-engine": "^3.4.0", + "json-rpc-error": "^2.0.0" + } + }, + "eth-json-rpc-middleware": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/eth-json-rpc-middleware/-/eth-json-rpc-middleware-1.6.0.tgz", + "integrity": "sha512-tDVCTlrUvdqHKqivYMjtFZsdD7TtpNLBCfKAcOpaVs7orBMS/A8HWro6dIzNtTZIR05FAbJ3bioFOnZpuCew9Q==", + "dev": true, + "requires": { + "async": "^2.5.0", + "eth-query": "^2.1.2", + "eth-tx-summary": "^3.1.2", + "ethereumjs-block": "^1.6.0", + "ethereumjs-tx": "^1.3.3", + "ethereumjs-util": "^5.1.2", + "ethereumjs-vm": "^2.1.0", + "fetch-ponyfill": "^4.0.0", + "json-rpc-engine": "^3.6.0", + "json-rpc-error": "^2.0.0", + "json-stable-stringify": "^1.0.1", + "promise-to-callback": "^1.0.0", + "tape": "^4.6.3" + }, + "dependencies": { + "abstract-leveldown": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.6.3.tgz", + "integrity": "sha512-2++wDf/DYqkPR3o5tbfdhF96EfMApo1GpPfzOsR/ZYXdkSmELlvOOEAl9iKkRsktMPHdGjO4rtkBpf2I7TiTeA==", + "dev": true, + "requires": { + "xtend": "~4.0.0" + } + }, + "deferred-leveldown": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-1.2.2.tgz", + "integrity": "sha512-uukrWD2bguRtXilKt6cAWKyoXrTSMo5m7crUdLfWQmu8kIm88w3QZoUL+6nhpfKVmhHANER6Re3sKoNoZ3IKMA==", + "dev": true, + "requires": { + "abstract-leveldown": "~2.6.0" + } + }, + "ethereumjs-account": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/ethereumjs-account/-/ethereumjs-account-2.0.5.tgz", + "integrity": "sha512-bgDojnXGjhMwo6eXQC0bY6UK2liSFUSMwwylOmQvZbSl/D7NXQ3+vrGO46ZeOgjGfxXmgIeVNDIiHw7fNZM4VA==", + "dev": true, + "requires": { + "ethereumjs-util": "^5.0.0", + "rlp": "^2.0.0", + "safe-buffer": "^5.1.1" + } + }, + "ethereumjs-block": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/ethereumjs-block/-/ethereumjs-block-1.7.1.tgz", + "integrity": "sha512-B+sSdtqm78fmKkBq78/QLKJbu/4Ts4P2KFISdgcuZUPDm9x+N7qgBPIIFUGbaakQh8bzuquiRVbdmvPKqbILRg==", + "dev": true, + "requires": { + "async": "^2.0.1", + "ethereum-common": "0.2.0", + "ethereumjs-tx": "^1.2.2", + "ethereumjs-util": "^5.0.0", + "merkle-patricia-tree": "^2.1.2" + }, + "dependencies": { + "ethereum-common": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/ethereum-common/-/ethereum-common-0.2.0.tgz", + "integrity": "sha512-XOnAR/3rntJgbCdGhqdaLIxDLWKLmsZOGhHdBKadEr6gEnJLH52k93Ou+TUdFaPN3hJc3isBZBal3U/XZ15abA==", + "dev": true + } + } + }, + "ethereumjs-tx": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/ethereumjs-tx/-/ethereumjs-tx-1.3.7.tgz", + "integrity": "sha512-wvLMxzt1RPhAQ9Yi3/HKZTn0FZYpnsmQdbKYfUUpi4j1SEIcbkd9tndVjcPrufY3V7j2IebOpC00Zp2P/Ay2kA==", + "dev": true, + "requires": { + "ethereum-common": "^0.0.18", + "ethereumjs-util": "^5.0.0" + } + }, + "ethereumjs-util": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.1.tgz", + "integrity": "sha512-v3kT+7zdyCm1HIqWlLNrHGqHGLpGYIhjeHxQjnDXjLT2FyGJDsd3LWMYUo7pAFRrk86CR3nUJfhC81CCoJNNGQ==", + "dev": true, + "requires": { + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "^0.1.3", + "rlp": "^2.0.0", + "safe-buffer": "^5.1.1" + } + }, + "ethereumjs-vm": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/ethereumjs-vm/-/ethereumjs-vm-2.6.0.tgz", + "integrity": "sha512-r/XIUik/ynGbxS3y+mvGnbOKnuLo40V5Mj1J25+HEO63aWYREIqvWeRO/hnROlMBE5WoniQmPmhiaN0ctiHaXw==", + "dev": true, + "requires": { + "async": "^2.1.2", + "async-eventemitter": "^0.2.2", + "ethereumjs-account": "^2.0.3", + "ethereumjs-block": "~2.2.0", + "ethereumjs-common": "^1.1.0", + "ethereumjs-util": "^6.0.0", + "fake-merkle-patricia-tree": "^1.0.1", + "functional-red-black-tree": "^1.0.1", + "merkle-patricia-tree": "^2.3.2", + "rustbn.js": "~0.2.0", + "safe-buffer": "^5.1.1" + }, + "dependencies": { + "ethereumjs-block": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/ethereumjs-block/-/ethereumjs-block-2.2.2.tgz", + "integrity": "sha512-2p49ifhek3h2zeg/+da6XpdFR3GlqY3BIEiqxGF8j9aSRIgkb7M1Ky+yULBKJOu8PAZxfhsYA+HxUk2aCQp3vg==", + "dev": true, + "requires": { + "async": "^2.0.1", + "ethereumjs-common": "^1.5.0", + "ethereumjs-tx": "^2.1.1", + "ethereumjs-util": "^5.0.0", + "merkle-patricia-tree": "^2.1.2" + }, + "dependencies": { + "ethereumjs-util": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.1.tgz", + "integrity": "sha512-v3kT+7zdyCm1HIqWlLNrHGqHGLpGYIhjeHxQjnDXjLT2FyGJDsd3LWMYUo7pAFRrk86CR3nUJfhC81CCoJNNGQ==", + "dev": true, + "requires": { + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "^0.1.3", + "rlp": "^2.0.0", + "safe-buffer": "^5.1.1" + } + } + } + }, + "ethereumjs-tx": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ethereumjs-tx/-/ethereumjs-tx-2.1.2.tgz", + "integrity": "sha512-zZEK1onCeiORb0wyCXUvg94Ve5It/K6GD1K+26KfFKodiBiS6d9lfCXlUKGBBdQ+bv7Day+JK0tj1K+BeNFRAw==", + "dev": true, + "requires": { + "ethereumjs-common": "^1.5.0", + "ethereumjs-util": "^6.0.0" + } + }, + "ethereumjs-util": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz", + "integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==", + "dev": true, + "requires": { + "@types/bn.js": "^4.11.3", + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "0.1.6", + "rlp": "^2.2.3" + } + } + } + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "level-codec": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-7.0.1.tgz", + "integrity": "sha512-Ua/R9B9r3RasXdRmOtd+t9TCOEIIlts+TN/7XTT2unhDaL6sJn83S3rUyljbr6lVtw49N3/yA0HHjpV6Kzb2aQ==", + "dev": true + }, + "level-errors": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-1.0.5.tgz", + "integrity": "sha512-/cLUpQduF6bNrWuAC4pwtUKA5t669pCsCi2XbmojG2tFeOr9j6ShtdDCtFFQO1DRt+EVZhx9gPzP9G2bUaG4ig==", + "dev": true, + "requires": { + "errno": "~0.1.1" + } + }, + "level-iterator-stream": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-1.3.1.tgz", + "integrity": "sha1-5Dt4sagUPm+pek9IXrjqUwNS8u0=", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "level-errors": "^1.0.3", + "readable-stream": "^1.0.33", + "xtend": "^4.0.0" + }, + "dependencies": { + "readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + } + } + }, + "level-ws": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/level-ws/-/level-ws-0.0.0.tgz", + "integrity": "sha1-Ny5RIXeSSgBCSwtDrvK7QkltIos=", + "dev": true, + "requires": { + "readable-stream": "~1.0.15", + "xtend": "~2.1.1" + }, + "dependencies": { + "readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "xtend": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz", + "integrity": "sha1-bv7MKk2tjmlixJAbM3znuoe10os=", + "dev": true, + "requires": { + "object-keys": "~0.4.0" + } + } + } + }, + "levelup": { + "version": "1.3.9", + "resolved": "https://registry.npmjs.org/levelup/-/levelup-1.3.9.tgz", + "integrity": "sha512-VVGHfKIlmw8w1XqpGOAGwq6sZm2WwWLmlDcULkKWQXEA5EopA8OBNJ2Ck2v6bdk8HeEZSbCSEgzXadyQFm76sQ==", + "dev": true, + "requires": { + "deferred-leveldown": "~1.2.1", + "level-codec": "~7.0.0", + "level-errors": "~1.0.3", + "level-iterator-stream": "~1.3.0", + "prr": "~1.0.1", + "semver": "~5.4.1", + "xtend": "~4.0.0" + } + }, + "ltgt": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ltgt/-/ltgt-2.2.1.tgz", + "integrity": "sha1-81ypHEk/e3PaDgdJUwTxezH4fuU=", + "dev": true + }, + "memdown": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/memdown/-/memdown-1.4.1.tgz", + "integrity": "sha1-tOThkhdGZP+65BNhqlAPMRnv4hU=", + "dev": true, + "requires": { + "abstract-leveldown": "~2.7.1", + "functional-red-black-tree": "^1.0.1", + "immediate": "^3.2.3", + "inherits": "~2.0.1", + "ltgt": "~2.2.0", + "safe-buffer": "~5.1.1" + }, + "dependencies": { + "abstract-leveldown": { + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.7.2.tgz", + "integrity": "sha512-+OVvxH2rHVEhWLdbudP6p0+dNMXu8JA1CbhP19T8paTYAcX7oJ4OVjT+ZUVpv7mITxXHqDMej+GdqXBmXkw09w==", + "dev": true, + "requires": { + "xtend": "~4.0.0" + } + } + } + }, + "merkle-patricia-tree": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-2.3.2.tgz", + "integrity": "sha512-81PW5m8oz/pz3GvsAwbauj7Y00rqm81Tzad77tHBwU7pIAtN+TJnMSOJhxBKflSVYhptMMb9RskhqHqrSm1V+g==", + "dev": true, + "requires": { + "async": "^1.4.2", + "ethereumjs-util": "^5.0.0", + "level-ws": "0.0.0", + "levelup": "^1.2.1", + "memdown": "^1.0.0", + "readable-stream": "^2.0.0", + "rlp": "^2.0.0", + "semaphore": ">=1.0.1" + }, + "dependencies": { + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", + "dev": true + } + } + }, + "object-keys": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-0.4.0.tgz", + "integrity": "sha1-KKaq50KN0sOpLz2V8hM13SBOAzY=", + "dev": true + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "semver": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", + "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==", + "dev": true + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + } + } + }, + "eth-lib": { + "version": "0.1.29", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.1.29.tgz", + "integrity": "sha512-bfttrr3/7gG4E02HoWTDUcDDslN003OlOoBxk9virpAZQ1ja/jDgwkWB8QfJF7ojuEowrqy+lzp9VcJG7/k5bQ==", + "dev": true, + "optional": true, + "requires": { + "bn.js": "^4.11.6", + "elliptic": "^6.4.0", + "nano-json-stream-parser": "^0.1.2", + "servify": "^0.1.12", + "ws": "^3.0.0", + "xhr-request-promise": "^0.1.2" + } + }, + "eth-query": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/eth-query/-/eth-query-2.1.2.tgz", + "integrity": "sha1-1nQdkAAQa1FRDHLbktY2VFam2l4=", + "dev": true, + "requires": { + "json-rpc-random-id": "^1.0.0", + "xtend": "^4.0.1" + } + }, + "eth-sig-util": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eth-sig-util/-/eth-sig-util-3.0.0.tgz", + "integrity": "sha512-4eFkMOhpGbTxBQ3AMzVf0haUX2uTur7DpWiHzWyTURa28BVJJtOkcb9Ok5TV0YvEPG61DODPW7ZUATbJTslioQ==", + "dev": true, + "requires": { + "buffer": "^5.2.1", + "elliptic": "^6.4.0", + "ethereumjs-abi": "0.6.5", + "ethereumjs-util": "^5.1.1", + "tweetnacl": "^1.0.0", + "tweetnacl-util": "^0.15.0" + }, + "dependencies": { + "ethereumjs-abi": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/ethereumjs-abi/-/ethereumjs-abi-0.6.5.tgz", + "integrity": "sha1-WmN+8Wq0NHP6cqKa2QhxQFs/UkE=", + "dev": true, + "requires": { + "bn.js": "^4.10.0", + "ethereumjs-util": "^4.3.0" + }, + "dependencies": { + "ethereumjs-util": { + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-4.5.1.tgz", + "integrity": "sha512-WrckOZ7uBnei4+AKimpuF1B3Fv25OmoRgmYCpGsP7u8PFxXAmAgiJSYT2kRWnt6fVIlKaQlZvuwXp7PIrmn3/w==", + "dev": true, + "requires": { + "bn.js": "^4.8.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "rlp": "^2.0.0" + } + } + } + }, + "ethereumjs-util": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.1.tgz", + "integrity": "sha512-v3kT+7zdyCm1HIqWlLNrHGqHGLpGYIhjeHxQjnDXjLT2FyGJDsd3LWMYUo7pAFRrk86CR3nUJfhC81CCoJNNGQ==", + "dev": true, + "requires": { + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "^0.1.3", + "rlp": "^2.0.0", + "safe-buffer": "^5.1.1" + } + } + } + }, + "eth-tx-summary": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/eth-tx-summary/-/eth-tx-summary-3.2.4.tgz", + "integrity": "sha512-NtlDnaVZah146Rm8HMRUNMgIwG/ED4jiqk0TME9zFheMl1jOp6jL1m0NKGjJwehXQ6ZKCPr16MTr+qspKpEXNg==", + "dev": true, + "requires": { + "async": "^2.1.2", + "clone": "^2.0.0", + "concat-stream": "^1.5.1", + "end-of-stream": "^1.1.0", + "eth-query": "^2.0.2", + "ethereumjs-block": "^1.4.1", + "ethereumjs-tx": "^1.1.1", + "ethereumjs-util": "^5.0.1", + "ethereumjs-vm": "^2.6.0", + "through2": "^2.0.3" + }, + "dependencies": { + "abstract-leveldown": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.6.3.tgz", + "integrity": "sha512-2++wDf/DYqkPR3o5tbfdhF96EfMApo1GpPfzOsR/ZYXdkSmELlvOOEAl9iKkRsktMPHdGjO4rtkBpf2I7TiTeA==", + "dev": true, + "requires": { + "xtend": "~4.0.0" + } + }, + "deferred-leveldown": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-1.2.2.tgz", + "integrity": "sha512-uukrWD2bguRtXilKt6cAWKyoXrTSMo5m7crUdLfWQmu8kIm88w3QZoUL+6nhpfKVmhHANER6Re3sKoNoZ3IKMA==", + "dev": true, + "requires": { + "abstract-leveldown": "~2.6.0" + } + }, + "ethereumjs-account": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/ethereumjs-account/-/ethereumjs-account-2.0.5.tgz", + "integrity": "sha512-bgDojnXGjhMwo6eXQC0bY6UK2liSFUSMwwylOmQvZbSl/D7NXQ3+vrGO46ZeOgjGfxXmgIeVNDIiHw7fNZM4VA==", + "dev": true, + "requires": { + "ethereumjs-util": "^5.0.0", + "rlp": "^2.0.0", + "safe-buffer": "^5.1.1" + } + }, + "ethereumjs-block": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/ethereumjs-block/-/ethereumjs-block-1.7.1.tgz", + "integrity": "sha512-B+sSdtqm78fmKkBq78/QLKJbu/4Ts4P2KFISdgcuZUPDm9x+N7qgBPIIFUGbaakQh8bzuquiRVbdmvPKqbILRg==", + "dev": true, + "requires": { + "async": "^2.0.1", + "ethereum-common": "0.2.0", + "ethereumjs-tx": "^1.2.2", + "ethereumjs-util": "^5.0.0", + "merkle-patricia-tree": "^2.1.2" + }, + "dependencies": { + "ethereum-common": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/ethereum-common/-/ethereum-common-0.2.0.tgz", + "integrity": "sha512-XOnAR/3rntJgbCdGhqdaLIxDLWKLmsZOGhHdBKadEr6gEnJLH52k93Ou+TUdFaPN3hJc3isBZBal3U/XZ15abA==", + "dev": true + } + } + }, + "ethereumjs-tx": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/ethereumjs-tx/-/ethereumjs-tx-1.3.7.tgz", + "integrity": "sha512-wvLMxzt1RPhAQ9Yi3/HKZTn0FZYpnsmQdbKYfUUpi4j1SEIcbkd9tndVjcPrufY3V7j2IebOpC00Zp2P/Ay2kA==", + "dev": true, + "requires": { + "ethereum-common": "^0.0.18", + "ethereumjs-util": "^5.0.0" + } + }, + "ethereumjs-util": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.1.tgz", + "integrity": "sha512-v3kT+7zdyCm1HIqWlLNrHGqHGLpGYIhjeHxQjnDXjLT2FyGJDsd3LWMYUo7pAFRrk86CR3nUJfhC81CCoJNNGQ==", + "dev": true, + "requires": { + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "^0.1.3", + "rlp": "^2.0.0", + "safe-buffer": "^5.1.1" + } + }, + "ethereumjs-vm": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/ethereumjs-vm/-/ethereumjs-vm-2.6.0.tgz", + "integrity": "sha512-r/XIUik/ynGbxS3y+mvGnbOKnuLo40V5Mj1J25+HEO63aWYREIqvWeRO/hnROlMBE5WoniQmPmhiaN0ctiHaXw==", + "dev": true, + "requires": { + "async": "^2.1.2", + "async-eventemitter": "^0.2.2", + "ethereumjs-account": "^2.0.3", + "ethereumjs-block": "~2.2.0", + "ethereumjs-common": "^1.1.0", + "ethereumjs-util": "^6.0.0", + "fake-merkle-patricia-tree": "^1.0.1", + "functional-red-black-tree": "^1.0.1", + "merkle-patricia-tree": "^2.3.2", + "rustbn.js": "~0.2.0", + "safe-buffer": "^5.1.1" + }, + "dependencies": { + "ethereumjs-block": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/ethereumjs-block/-/ethereumjs-block-2.2.2.tgz", + "integrity": "sha512-2p49ifhek3h2zeg/+da6XpdFR3GlqY3BIEiqxGF8j9aSRIgkb7M1Ky+yULBKJOu8PAZxfhsYA+HxUk2aCQp3vg==", + "dev": true, + "requires": { + "async": "^2.0.1", + "ethereumjs-common": "^1.5.0", + "ethereumjs-tx": "^2.1.1", + "ethereumjs-util": "^5.0.0", + "merkle-patricia-tree": "^2.1.2" + }, + "dependencies": { + "ethereumjs-util": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.1.tgz", + "integrity": "sha512-v3kT+7zdyCm1HIqWlLNrHGqHGLpGYIhjeHxQjnDXjLT2FyGJDsd3LWMYUo7pAFRrk86CR3nUJfhC81CCoJNNGQ==", + "dev": true, + "requires": { + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "^0.1.3", + "rlp": "^2.0.0", + "safe-buffer": "^5.1.1" + } + } + } + }, + "ethereumjs-tx": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ethereumjs-tx/-/ethereumjs-tx-2.1.2.tgz", + "integrity": "sha512-zZEK1onCeiORb0wyCXUvg94Ve5It/K6GD1K+26KfFKodiBiS6d9lfCXlUKGBBdQ+bv7Day+JK0tj1K+BeNFRAw==", + "dev": true, + "requires": { + "ethereumjs-common": "^1.5.0", + "ethereumjs-util": "^6.0.0" + } + }, + "ethereumjs-util": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz", + "integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==", + "dev": true, + "requires": { + "@types/bn.js": "^4.11.3", + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "0.1.6", + "rlp": "^2.2.3" + } + } + } + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "level-codec": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-7.0.1.tgz", + "integrity": "sha512-Ua/R9B9r3RasXdRmOtd+t9TCOEIIlts+TN/7XTT2unhDaL6sJn83S3rUyljbr6lVtw49N3/yA0HHjpV6Kzb2aQ==", + "dev": true + }, + "level-errors": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-1.0.5.tgz", + "integrity": "sha512-/cLUpQduF6bNrWuAC4pwtUKA5t669pCsCi2XbmojG2tFeOr9j6ShtdDCtFFQO1DRt+EVZhx9gPzP9G2bUaG4ig==", + "dev": true, + "requires": { + "errno": "~0.1.1" + } + }, + "level-iterator-stream": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-1.3.1.tgz", + "integrity": "sha1-5Dt4sagUPm+pek9IXrjqUwNS8u0=", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "level-errors": "^1.0.3", + "readable-stream": "^1.0.33", + "xtend": "^4.0.0" + }, + "dependencies": { + "readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + } + } + }, + "level-ws": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/level-ws/-/level-ws-0.0.0.tgz", + "integrity": "sha1-Ny5RIXeSSgBCSwtDrvK7QkltIos=", + "dev": true, + "requires": { + "readable-stream": "~1.0.15", + "xtend": "~2.1.1" + }, + "dependencies": { + "readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "xtend": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz", + "integrity": "sha1-bv7MKk2tjmlixJAbM3znuoe10os=", + "dev": true, + "requires": { + "object-keys": "~0.4.0" + } + } + } + }, + "levelup": { + "version": "1.3.9", + "resolved": "https://registry.npmjs.org/levelup/-/levelup-1.3.9.tgz", + "integrity": "sha512-VVGHfKIlmw8w1XqpGOAGwq6sZm2WwWLmlDcULkKWQXEA5EopA8OBNJ2Ck2v6bdk8HeEZSbCSEgzXadyQFm76sQ==", + "dev": true, + "requires": { + "deferred-leveldown": "~1.2.1", + "level-codec": "~7.0.0", + "level-errors": "~1.0.3", + "level-iterator-stream": "~1.3.0", + "prr": "~1.0.1", + "semver": "~5.4.1", + "xtend": "~4.0.0" + } + }, + "ltgt": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ltgt/-/ltgt-2.2.1.tgz", + "integrity": "sha1-81ypHEk/e3PaDgdJUwTxezH4fuU=", + "dev": true + }, + "memdown": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/memdown/-/memdown-1.4.1.tgz", + "integrity": "sha1-tOThkhdGZP+65BNhqlAPMRnv4hU=", + "dev": true, + "requires": { + "abstract-leveldown": "~2.7.1", + "functional-red-black-tree": "^1.0.1", + "immediate": "^3.2.3", + "inherits": "~2.0.1", + "ltgt": "~2.2.0", + "safe-buffer": "~5.1.1" + }, + "dependencies": { + "abstract-leveldown": { + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.7.2.tgz", + "integrity": "sha512-+OVvxH2rHVEhWLdbudP6p0+dNMXu8JA1CbhP19T8paTYAcX7oJ4OVjT+ZUVpv7mITxXHqDMej+GdqXBmXkw09w==", + "dev": true, + "requires": { + "xtend": "~4.0.0" + } + } + } + }, + "merkle-patricia-tree": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-2.3.2.tgz", + "integrity": "sha512-81PW5m8oz/pz3GvsAwbauj7Y00rqm81Tzad77tHBwU7pIAtN+TJnMSOJhxBKflSVYhptMMb9RskhqHqrSm1V+g==", + "dev": true, + "requires": { + "async": "^1.4.2", + "ethereumjs-util": "^5.0.0", + "level-ws": "0.0.0", + "levelup": "^1.2.1", + "memdown": "^1.0.0", + "readable-stream": "^2.0.0", + "rlp": "^2.0.0", + "semaphore": ">=1.0.1" + }, + "dependencies": { + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", + "dev": true + } + } + }, + "object-keys": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-0.4.0.tgz", + "integrity": "sha1-KKaq50KN0sOpLz2V8hM13SBOAzY=", + "dev": true + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "semver": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", + "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==", + "dev": true + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + } + } + }, + "ethashjs": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/ethashjs/-/ethashjs-0.0.8.tgz", + "integrity": "sha512-/MSbf/r2/Ld8o0l15AymjOTlPqpN8Cr4ByUEA9GtR4x0yAh3TdtDzEg29zMjXCNPI7u6E5fOQdj/Cf9Tc7oVNw==", + "dev": true, + "requires": { + "async": "^2.1.2", + "buffer-xor": "^2.0.1", + "ethereumjs-util": "^7.0.2", + "miller-rabin": "^4.0.0" + }, + "dependencies": { + "bn.js": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.1.3.tgz", + "integrity": "sha512-GkTiFpjFtUzU9CbMeJ5iazkCzGL3jrhzerzZIuqLABjbwRaFt33I9tUdSNryIptM+RxDet6OKm2WnLXzW51KsQ==", + "dev": true + }, + "buffer-xor": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-2.0.2.tgz", + "integrity": "sha512-eHslX0bin3GB+Lx2p7lEYRShRewuNZL3fUl4qlVJGGiwoPGftmt8JQgk2Y9Ji5/01TnVDo33E5b5O3vUB1HdqQ==", + "dev": true, + "requires": { + "safe-buffer": "^5.1.1" + } + }, + "ethereumjs-util": { + "version": "7.0.7", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.0.7.tgz", + "integrity": "sha512-vU5rtZBlZsgkTw3o6PDKyB8li2EgLavnAbsKcfsH2YhHH1Le+PP8vEiMnAnvgc1B6uMoaM5GDCrVztBw0Q5K9g==", + "dev": true, + "requires": { + "@types/bn.js": "^4.11.3", + "bn.js": "^5.1.2", + "create-hash": "^1.1.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "0.1.6", + "rlp": "^2.2.4" + } + } + } + }, + "ethereum-bloom-filters": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/ethereum-bloom-filters/-/ethereum-bloom-filters-1.0.7.tgz", + "integrity": "sha512-cDcJJSJ9GMAcURiAWO3DxIEhTL/uWqlQnvgKpuYQzYPrt/izuGU+1ntQmHt0IRq6ADoSYHFnB+aCEFIldjhkMQ==", + "dev": true, + "optional": true, + "requires": { + "js-sha3": "^0.8.0" + }, + "dependencies": { + "js-sha3": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", + "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==", + "dev": true, + "optional": true + } + } + }, + "ethereum-common": { + "version": "0.0.18", + "resolved": "https://registry.npmjs.org/ethereum-common/-/ethereum-common-0.0.18.tgz", + "integrity": "sha1-L9w1dvIykDNYl26znaeDIT/5Uj8=", + "dev": true + }, + "ethereum-cryptography": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", + "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", + "dev": true, + "requires": { + "@types/pbkdf2": "^3.0.0", + "@types/secp256k1": "^4.0.1", + "blakejs": "^1.1.0", + "browserify-aes": "^1.2.0", + "bs58check": "^2.1.2", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "hash.js": "^1.1.7", + "keccak": "^3.0.0", + "pbkdf2": "^3.0.17", + "randombytes": "^2.1.0", + "safe-buffer": "^5.1.2", + "scrypt-js": "^3.0.0", + "secp256k1": "^4.0.1", + "setimmediate": "^1.0.5" + } + }, + "ethereumjs-abi": { + "version": "0.6.8", + "resolved": "https://registry.npmjs.org/ethereumjs-abi/-/ethereumjs-abi-0.6.8.tgz", + "integrity": "sha512-Tx0r/iXI6r+lRsdvkFDlut0N08jWMnKRZ6Gkq+Nmw75lZe4e6o3EkSnkaBP5NF6+m5PTGAr9JP43N3LyeoglsA==", + "dev": true, + "requires": { + "bn.js": "^4.11.8", + "ethereumjs-util": "^6.0.0" + } + }, + "ethereumjs-account": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ethereumjs-account/-/ethereumjs-account-3.0.0.tgz", + "integrity": "sha512-WP6BdscjiiPkQfF9PVfMcwx/rDvfZTjFKY0Uwc09zSQr9JfIVH87dYIJu0gNhBhpmovV4yq295fdllS925fnBA==", + "dev": true, + "requires": { + "ethereumjs-util": "^6.0.0", + "rlp": "^2.2.1", + "safe-buffer": "^5.1.1" + } + }, + "ethereumjs-block": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/ethereumjs-block/-/ethereumjs-block-2.2.2.tgz", + "integrity": "sha512-2p49ifhek3h2zeg/+da6XpdFR3GlqY3BIEiqxGF8j9aSRIgkb7M1Ky+yULBKJOu8PAZxfhsYA+HxUk2aCQp3vg==", + "dev": true, + "requires": { + "async": "^2.0.1", + "ethereumjs-common": "^1.5.0", + "ethereumjs-tx": "^2.1.1", + "ethereumjs-util": "^5.0.0", + "merkle-patricia-tree": "^2.1.2" + }, + "dependencies": { + "abstract-leveldown": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.6.3.tgz", + "integrity": "sha512-2++wDf/DYqkPR3o5tbfdhF96EfMApo1GpPfzOsR/ZYXdkSmELlvOOEAl9iKkRsktMPHdGjO4rtkBpf2I7TiTeA==", + "dev": true, + "requires": { + "xtend": "~4.0.0" + } + }, + "deferred-leveldown": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-1.2.2.tgz", + "integrity": "sha512-uukrWD2bguRtXilKt6cAWKyoXrTSMo5m7crUdLfWQmu8kIm88w3QZoUL+6nhpfKVmhHANER6Re3sKoNoZ3IKMA==", + "dev": true, + "requires": { + "abstract-leveldown": "~2.6.0" + } + }, + "ethereumjs-util": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.1.tgz", + "integrity": "sha512-v3kT+7zdyCm1HIqWlLNrHGqHGLpGYIhjeHxQjnDXjLT2FyGJDsd3LWMYUo7pAFRrk86CR3nUJfhC81CCoJNNGQ==", + "dev": true, + "requires": { + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "^0.1.3", + "rlp": "^2.0.0", + "safe-buffer": "^5.1.1" + } + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "level-codec": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-7.0.1.tgz", + "integrity": "sha512-Ua/R9B9r3RasXdRmOtd+t9TCOEIIlts+TN/7XTT2unhDaL6sJn83S3rUyljbr6lVtw49N3/yA0HHjpV6Kzb2aQ==", + "dev": true + }, + "level-errors": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-1.0.5.tgz", + "integrity": "sha512-/cLUpQduF6bNrWuAC4pwtUKA5t669pCsCi2XbmojG2tFeOr9j6ShtdDCtFFQO1DRt+EVZhx9gPzP9G2bUaG4ig==", + "dev": true, + "requires": { + "errno": "~0.1.1" + } + }, + "level-iterator-stream": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-1.3.1.tgz", + "integrity": "sha1-5Dt4sagUPm+pek9IXrjqUwNS8u0=", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "level-errors": "^1.0.3", + "readable-stream": "^1.0.33", + "xtend": "^4.0.0" + }, + "dependencies": { + "readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + } + } + }, + "level-ws": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/level-ws/-/level-ws-0.0.0.tgz", + "integrity": "sha1-Ny5RIXeSSgBCSwtDrvK7QkltIos=", + "dev": true, + "requires": { + "readable-stream": "~1.0.15", + "xtend": "~2.1.1" + }, + "dependencies": { + "readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "xtend": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz", + "integrity": "sha1-bv7MKk2tjmlixJAbM3znuoe10os=", + "dev": true, + "requires": { + "object-keys": "~0.4.0" + } + } + } + }, + "levelup": { + "version": "1.3.9", + "resolved": "https://registry.npmjs.org/levelup/-/levelup-1.3.9.tgz", + "integrity": "sha512-VVGHfKIlmw8w1XqpGOAGwq6sZm2WwWLmlDcULkKWQXEA5EopA8OBNJ2Ck2v6bdk8HeEZSbCSEgzXadyQFm76sQ==", + "dev": true, + "requires": { + "deferred-leveldown": "~1.2.1", + "level-codec": "~7.0.0", + "level-errors": "~1.0.3", + "level-iterator-stream": "~1.3.0", + "prr": "~1.0.1", + "semver": "~5.4.1", + "xtend": "~4.0.0" + } + }, + "ltgt": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ltgt/-/ltgt-2.2.1.tgz", + "integrity": "sha1-81ypHEk/e3PaDgdJUwTxezH4fuU=", + "dev": true + }, + "memdown": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/memdown/-/memdown-1.4.1.tgz", + "integrity": "sha1-tOThkhdGZP+65BNhqlAPMRnv4hU=", + "dev": true, + "requires": { + "abstract-leveldown": "~2.7.1", + "functional-red-black-tree": "^1.0.1", + "immediate": "^3.2.3", + "inherits": "~2.0.1", + "ltgt": "~2.2.0", + "safe-buffer": "~5.1.1" + }, + "dependencies": { + "abstract-leveldown": { + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.7.2.tgz", + "integrity": "sha512-+OVvxH2rHVEhWLdbudP6p0+dNMXu8JA1CbhP19T8paTYAcX7oJ4OVjT+ZUVpv7mITxXHqDMej+GdqXBmXkw09w==", + "dev": true, + "requires": { + "xtend": "~4.0.0" + } + } + } + }, + "merkle-patricia-tree": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-2.3.2.tgz", + "integrity": "sha512-81PW5m8oz/pz3GvsAwbauj7Y00rqm81Tzad77tHBwU7pIAtN+TJnMSOJhxBKflSVYhptMMb9RskhqHqrSm1V+g==", + "dev": true, + "requires": { + "async": "^1.4.2", + "ethereumjs-util": "^5.0.0", + "level-ws": "0.0.0", + "levelup": "^1.2.1", + "memdown": "^1.0.0", + "readable-stream": "^2.0.0", + "rlp": "^2.0.0", + "semaphore": ">=1.0.1" + }, + "dependencies": { + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", + "dev": true + } + } + }, + "object-keys": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-0.4.0.tgz", + "integrity": "sha1-KKaq50KN0sOpLz2V8hM13SBOAzY=", + "dev": true + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "semver": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", + "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==", + "dev": true + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + } + } + }, + "ethereumjs-blockchain": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/ethereumjs-blockchain/-/ethereumjs-blockchain-4.0.4.tgz", + "integrity": "sha512-zCxaRMUOzzjvX78DTGiKjA+4h2/sF0OYL1QuPux0DHpyq8XiNoF5GYHtb++GUxVlMsMfZV7AVyzbtgcRdIcEPQ==", + "dev": true, + "requires": { + "async": "^2.6.1", + "ethashjs": "~0.0.7", + "ethereumjs-block": "~2.2.2", + "ethereumjs-common": "^1.5.0", + "ethereumjs-util": "^6.1.0", + "flow-stoplight": "^1.0.0", + "level-mem": "^3.0.1", + "lru-cache": "^5.1.1", + "rlp": "^2.2.2", + "semaphore": "^1.1.0" + } + }, + "ethereumjs-common": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/ethereumjs-common/-/ethereumjs-common-1.5.0.tgz", + "integrity": "sha512-SZOjgK1356hIY7MRj3/ma5qtfr/4B5BL+G4rP/XSMYr2z1H5el4RX5GReYCKmQmYI/nSBmRnwrZ17IfHuG0viQ==", + "dev": true + }, + "ethereumjs-tx": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ethereumjs-tx/-/ethereumjs-tx-2.1.2.tgz", + "integrity": "sha512-zZEK1onCeiORb0wyCXUvg94Ve5It/K6GD1K+26KfFKodiBiS6d9lfCXlUKGBBdQ+bv7Day+JK0tj1K+BeNFRAw==", + "dev": true, + "requires": { + "ethereumjs-common": "^1.5.0", + "ethereumjs-util": "^6.0.0" + } + }, + "ethereumjs-util": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz", + "integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==", + "dev": true, + "requires": { + "@types/bn.js": "^4.11.3", + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "0.1.6", + "rlp": "^2.2.3" + } + }, + "ethereumjs-vm": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/ethereumjs-vm/-/ethereumjs-vm-4.2.0.tgz", + "integrity": "sha512-X6qqZbsY33p5FTuZqCnQ4+lo957iUJMM6Mpa6bL4UW0dxM6WmDSHuI4j/zOp1E2TDKImBGCJA9QPfc08PaNubA==", + "dev": true, + "requires": { + "async": "^2.1.2", + "async-eventemitter": "^0.2.2", + "core-js-pure": "^3.0.1", + "ethereumjs-account": "^3.0.0", + "ethereumjs-block": "^2.2.2", + "ethereumjs-blockchain": "^4.0.3", + "ethereumjs-common": "^1.5.0", + "ethereumjs-tx": "^2.1.2", + "ethereumjs-util": "^6.2.0", + "fake-merkle-patricia-tree": "^1.0.1", + "functional-red-black-tree": "^1.0.1", + "merkle-patricia-tree": "^2.3.2", + "rustbn.js": "~0.2.0", + "safe-buffer": "^5.1.1", + "util.promisify": "^1.0.0" + }, + "dependencies": { + "abstract-leveldown": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.6.3.tgz", + "integrity": "sha512-2++wDf/DYqkPR3o5tbfdhF96EfMApo1GpPfzOsR/ZYXdkSmELlvOOEAl9iKkRsktMPHdGjO4rtkBpf2I7TiTeA==", + "dev": true, + "requires": { + "xtend": "~4.0.0" + } + }, + "deferred-leveldown": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-1.2.2.tgz", + "integrity": "sha512-uukrWD2bguRtXilKt6cAWKyoXrTSMo5m7crUdLfWQmu8kIm88w3QZoUL+6nhpfKVmhHANER6Re3sKoNoZ3IKMA==", + "dev": true, + "requires": { + "abstract-leveldown": "~2.6.0" + } + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "level-codec": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-7.0.1.tgz", + "integrity": "sha512-Ua/R9B9r3RasXdRmOtd+t9TCOEIIlts+TN/7XTT2unhDaL6sJn83S3rUyljbr6lVtw49N3/yA0HHjpV6Kzb2aQ==", + "dev": true + }, + "level-errors": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-1.0.5.tgz", + "integrity": "sha512-/cLUpQduF6bNrWuAC4pwtUKA5t669pCsCi2XbmojG2tFeOr9j6ShtdDCtFFQO1DRt+EVZhx9gPzP9G2bUaG4ig==", + "dev": true, + "requires": { + "errno": "~0.1.1" + } + }, + "level-iterator-stream": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-1.3.1.tgz", + "integrity": "sha1-5Dt4sagUPm+pek9IXrjqUwNS8u0=", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "level-errors": "^1.0.3", + "readable-stream": "^1.0.33", + "xtend": "^4.0.0" + }, + "dependencies": { + "readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + } + } + }, + "level-ws": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/level-ws/-/level-ws-0.0.0.tgz", + "integrity": "sha1-Ny5RIXeSSgBCSwtDrvK7QkltIos=", + "dev": true, + "requires": { + "readable-stream": "~1.0.15", + "xtend": "~2.1.1" + }, + "dependencies": { + "readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "xtend": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz", + "integrity": "sha1-bv7MKk2tjmlixJAbM3znuoe10os=", + "dev": true, + "requires": { + "object-keys": "~0.4.0" + } + } + } + }, + "levelup": { + "version": "1.3.9", + "resolved": "https://registry.npmjs.org/levelup/-/levelup-1.3.9.tgz", + "integrity": "sha512-VVGHfKIlmw8w1XqpGOAGwq6sZm2WwWLmlDcULkKWQXEA5EopA8OBNJ2Ck2v6bdk8HeEZSbCSEgzXadyQFm76sQ==", + "dev": true, + "requires": { + "deferred-leveldown": "~1.2.1", + "level-codec": "~7.0.0", + "level-errors": "~1.0.3", + "level-iterator-stream": "~1.3.0", + "prr": "~1.0.1", + "semver": "~5.4.1", + "xtend": "~4.0.0" + } + }, + "ltgt": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ltgt/-/ltgt-2.2.1.tgz", + "integrity": "sha1-81ypHEk/e3PaDgdJUwTxezH4fuU=", + "dev": true + }, + "memdown": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/memdown/-/memdown-1.4.1.tgz", + "integrity": "sha1-tOThkhdGZP+65BNhqlAPMRnv4hU=", + "dev": true, + "requires": { + "abstract-leveldown": "~2.7.1", + "functional-red-black-tree": "^1.0.1", + "immediate": "^3.2.3", + "inherits": "~2.0.1", + "ltgt": "~2.2.0", + "safe-buffer": "~5.1.1" + }, + "dependencies": { + "abstract-leveldown": { + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.7.2.tgz", + "integrity": "sha512-+OVvxH2rHVEhWLdbudP6p0+dNMXu8JA1CbhP19T8paTYAcX7oJ4OVjT+ZUVpv7mITxXHqDMej+GdqXBmXkw09w==", + "dev": true, + "requires": { + "xtend": "~4.0.0" + } + } + } + }, + "merkle-patricia-tree": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-2.3.2.tgz", + "integrity": "sha512-81PW5m8oz/pz3GvsAwbauj7Y00rqm81Tzad77tHBwU7pIAtN+TJnMSOJhxBKflSVYhptMMb9RskhqHqrSm1V+g==", + "dev": true, + "requires": { + "async": "^1.4.2", + "ethereumjs-util": "^5.0.0", + "level-ws": "0.0.0", + "levelup": "^1.2.1", + "memdown": "^1.0.0", + "readable-stream": "^2.0.0", + "rlp": "^2.0.0", + "semaphore": ">=1.0.1" + }, + "dependencies": { + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", + "dev": true + }, + "ethereumjs-util": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.1.tgz", + "integrity": "sha512-v3kT+7zdyCm1HIqWlLNrHGqHGLpGYIhjeHxQjnDXjLT2FyGJDsd3LWMYUo7pAFRrk86CR3nUJfhC81CCoJNNGQ==", + "dev": true, + "requires": { + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "^0.1.3", + "rlp": "^2.0.0", + "safe-buffer": "^5.1.1" + } + } + } + }, + "object-keys": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-0.4.0.tgz", + "integrity": "sha1-KKaq50KN0sOpLz2V8hM13SBOAzY=", + "dev": true + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "semver": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", + "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==", + "dev": true + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + } + } + }, + "ethereumjs-wallet": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/ethereumjs-wallet/-/ethereumjs-wallet-0.6.5.tgz", + "integrity": "sha512-MDwjwB9VQVnpp/Dc1XzA6J1a3wgHQ4hSvA1uWNatdpOrtCbPVuQSKSyRnjLvS0a+KKMw2pvQ9Ybqpb3+eW8oNA==", + "dev": true, + "optional": true, + "requires": { + "aes-js": "^3.1.1", + "bs58check": "^2.1.2", + "ethereum-cryptography": "^0.1.3", + "ethereumjs-util": "^6.0.0", + "randombytes": "^2.0.6", + "safe-buffer": "^5.1.2", + "scryptsy": "^1.2.1", + "utf8": "^3.0.0", + "uuid": "^3.3.2" + } + }, + "ethjs-unit": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/ethjs-unit/-/ethjs-unit-0.1.6.tgz", + "integrity": "sha1-xmWSHkduh7ziqdWIpv4EBbLEFpk=", + "dev": true, + "optional": true, + "requires": { + "bn.js": "4.11.6", + "number-to-bn": "1.7.0" + }, + "dependencies": { + "bn.js": { + "version": "4.11.6", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", + "integrity": "sha1-UzRK2xRhehP26N0s4okF0cC6MhU=", + "dev": true, + "optional": true + } + } + }, + "ethjs-util": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/ethjs-util/-/ethjs-util-0.1.6.tgz", + "integrity": "sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w==", + "dev": true, + "requires": { + "is-hex-prefixed": "1.0.0", + "strip-hex-prefix": "1.0.0" + } + }, + "eventemitter3": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.4.tgz", + "integrity": "sha512-rlaVLnVxtxvoyLsQQFBx53YmXHDxRIzzTLbdfxqi4yocpSjAxXwkU0cScM5JgSKMqEhrZpnvQ2D9gjylR0AimQ==", + "dev": true, + "optional": true + }, + "events": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.2.0.tgz", + "integrity": "sha512-/46HWwbfCX2xTawVfkKLGxMifJYQBWMwY1mjywRtb4c9x8l5NP3KoJtnIOiL1hfdRkIuYhETxQlo62IF8tcnlg==", + "dev": true + }, + "evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "dev": true, + "requires": { + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" + } + }, + "expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "dev": true, + "requires": { + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + } + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + }, + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "express": { + "version": "4.17.1", + "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", + "integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==", + "dev": true, + "optional": true, + "requires": { + "accepts": "~1.3.7", + "array-flatten": "1.1.1", + "body-parser": "1.19.0", + "content-disposition": "0.5.3", + "content-type": "~1.0.4", + "cookie": "0.4.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "~1.1.2", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "~1.1.2", + "fresh": "0.5.2", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "~2.3.0", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.5", + "qs": "6.7.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.1.2", + "send": "0.17.1", + "serve-static": "1.14.1", + "setprototypeof": "1.1.1", + "statuses": "~1.5.0", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "optional": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true, + "optional": true + }, + "qs": { + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", + "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==", + "dev": true, + "optional": true + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true, + "optional": true + } + } + }, + "ext": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/ext/-/ext-1.4.0.tgz", + "integrity": "sha512-Key5NIsUxdqKg3vIsdw9dSuXpPCQ297y6wBjL30edxwPgt2E44WcWBZey/ZvUc6sERLTxKdyCu4gZFmUbk1Q7A==", + "dev": true, + "requires": { + "type": "^2.0.0" + }, + "dependencies": { + "type": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/type/-/type-2.1.0.tgz", + "integrity": "sha512-G9absDWvhAWCV2gmF1zKud3OyC61nZDwWvBL2DApaVFogI07CprggiQAOOjvp2NRjYWFzPyu7vwtDrQFq8jeSA==", + "dev": true + } + } + }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true + }, + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "dev": true, + "requires": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + } + }, + "extglob": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "dev": true, + "requires": { + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + } + } + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", + "dev": true + }, + "fake-merkle-patricia-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/fake-merkle-patricia-tree/-/fake-merkle-patricia-tree-1.0.1.tgz", + "integrity": "sha1-S4w6z7Ugr635hgsfFM2M40As3dM=", + "dev": true, + "requires": { + "checkpoint-store": "^1.1.0" + } + }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "fetch-ponyfill": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/fetch-ponyfill/-/fetch-ponyfill-4.1.0.tgz", + "integrity": "sha1-rjzl9zLGReq4fkroeTQUcJsjmJM=", + "dev": true, + "requires": { + "node-fetch": "~1.7.1" + }, + "dependencies": { + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true + }, + "node-fetch": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.3.tgz", + "integrity": "sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ==", + "dev": true, + "requires": { + "encoding": "^0.1.11", + "is-stream": "^1.0.1" + } + } + } + }, + "finalhandler": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", + "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", + "dev": true, + "optional": true, + "requires": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "~2.3.0", + "parseurl": "~1.3.3", + "statuses": "~1.5.0", + "unpipe": "~1.0.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "optional": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true, + "optional": true + } + } + }, + "find-yarn-workspace-root": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/find-yarn-workspace-root/-/find-yarn-workspace-root-1.2.1.tgz", + "integrity": "sha512-dVtfb0WuQG+8Ag2uWkbG79hOUzEsRrhBzgfn86g2sJPkzmcpGdghbNTfUKGTxymFrY/tLIodDzLoW9nOJ4FY8Q==", + "dev": true, + "requires": { + "fs-extra": "^4.0.3", + "micromatch": "^3.1.4" + }, + "dependencies": { + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "fs-extra": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-4.0.3.tgz", + "integrity": "sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } + } + } + }, + "flow-stoplight": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/flow-stoplight/-/flow-stoplight-1.0.0.tgz", + "integrity": "sha1-SiksW8/4s5+mzAyxqFPYbyfu/3s=", + "dev": true + }, + "for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dev": true, + "requires": { + "is-callable": "^1.1.3" + } + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "dev": true + }, + "form-data": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } + }, + "forwarded": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", + "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=", + "dev": true, + "optional": true + }, + "fragment-cache": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "dev": true, + "requires": { + "map-cache": "^0.2.2" + } + }, + "fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=", + "dev": true, + "optional": true + }, + "fs-extra": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", + "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, + "get-intrinsic": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.0.2.tgz", + "integrity": "sha512-aeX0vrFm21ILl3+JpFFRNe9aUvp6VFZb2/CTbgLb8j75kOhvoNYjt9d8KA/tJG4gSo8nzEDedRl0h7vDmBYRVg==", + "dev": true, + "requires": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1" + } + }, + "get-stream": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "dev": true, + "optional": true, + "requires": { + "pump": "^3.0.0" + } + }, + "get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "dev": true + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0" + } + }, + "glob": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "global": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/global/-/global-4.4.0.tgz", + "integrity": "sha512-wv/LAoHdRE3BeTGz53FAamhGlPLhlssK45usmGFThIi4XqnBmjKQ16u+RNbP7WvigRZDxUsM0J3gcQ5yicaL0w==", + "dev": true, + "requires": { + "min-document": "^2.19.0", + "process": "^0.11.10" + } + }, + "got": { + "version": "9.6.0", + "resolved": "https://registry.npmjs.org/got/-/got-9.6.0.tgz", + "integrity": "sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q==", + "dev": true, + "optional": true, + "requires": { + "@sindresorhus/is": "^0.14.0", + "@szmarczak/http-timer": "^1.1.2", + "cacheable-request": "^6.0.0", + "decompress-response": "^3.3.0", + "duplexer3": "^0.1.4", + "get-stream": "^4.1.0", + "lowercase-keys": "^1.0.1", + "mimic-response": "^1.0.1", + "p-cancelable": "^1.0.0", + "to-readable-stream": "^1.0.0", + "url-parse-lax": "^3.0.0" + }, + "dependencies": { + "get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "dev": true, + "optional": true, + "requires": { + "pump": "^3.0.0" + } + } + } + }, + "graceful-fs": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", + "dev": true + }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", + "dev": true + }, + "har-validator": { + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", + "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", + "dev": true, + "requires": { + "ajv": "^6.12.3", + "har-schema": "^2.0.0" + } + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + } + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "has-symbol-support-x": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/has-symbol-support-x/-/has-symbol-support-x-1.4.2.tgz", + "integrity": "sha512-3ToOva++HaW+eCpgqZrCfN51IPB+7bJNVT6CUATzueB5Heb8o6Nam0V3HG5dlDvZU1Gn5QLcbahiKw/XVk5JJw==", + "dev": true, + "optional": true + }, + "has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", + "dev": true + }, + "has-to-string-tag-x": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/has-to-string-tag-x/-/has-to-string-tag-x-1.4.1.tgz", + "integrity": "sha512-vdbKfmw+3LoOYVr+mtxHaX5a96+0f3DljYd8JOqvOLsf5mw2Otda2qCDT9qRqLAhrjyQ0h7ual5nOiASpsGNFw==", + "dev": true, + "optional": true, + "requires": { + "has-symbol-support-x": "^1.4.1" + } + }, + "has-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "dev": true, + "requires": { + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" + } + }, + "has-values": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", + "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "kind-of": "^4.0.0" + }, + "dependencies": { + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "hash-base": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", + "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", + "dev": true, + "requires": { + "inherits": "^2.0.4", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + }, + "dependencies": { + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + } + } + }, + "hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "heap": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/heap/-/heap-0.2.6.tgz", + "integrity": "sha1-CH4fELBGky/IWU3Z5tN4r8nR5aw=", + "dev": true + }, + "hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "dev": true, + "requires": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "home-or-tmp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz", + "integrity": "sha1-42w/LSyufXRqhX440Y1fMqeILbg=", + "dev": true, + "requires": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.1" + } + }, + "http-cache-semantics": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", + "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==", + "dev": true, + "optional": true + }, + "http-errors": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", + "integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==", + "dev": true, + "optional": true, + "requires": { + "depd": "~1.1.2", + "inherits": "2.0.3", + "setprototypeof": "1.1.1", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.0" + }, + "dependencies": { + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true, + "optional": true + } + } + }, + "http-https": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/http-https/-/http-https-1.0.0.tgz", + "integrity": "sha1-L5CN1fHbQGjAWM1ubUzjkskTOJs=", + "dev": true, + "optional": true + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + } + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "optional": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "idna-uts46-hx": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/idna-uts46-hx/-/idna-uts46-hx-2.3.1.tgz", + "integrity": "sha512-PWoF9Keq6laYdIRwwCdhTPl60xRqAloYNMQLiyUnG42VjT53oW07BXIRM+NK7eQjzXjAk2gUvX9caRxlnF9TAA==", + "dev": true, + "optional": true, + "requires": { + "punycode": "2.1.0" + }, + "dependencies": { + "punycode": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.0.tgz", + "integrity": "sha1-X4Y+3Im5bbCQdLrXlHvwkFbKTn0=", + "dev": true, + "optional": true + } + } + }, + "ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "dev": true + }, + "immediate": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.2.3.tgz", + "integrity": "sha1-0UD6j2FGWb1lQSMwl92qwlzdmRw=", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "invariant": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", + "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", + "dev": true, + "requires": { + "loose-envify": "^1.0.0" + } + }, + "ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "dev": true, + "optional": true + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-arguments": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.0.tgz", + "integrity": "sha512-1Ij4lOMPl/xB5kBDn7I+b2ttPMKa8szhEIrXDuXQD/oe3HJLTLhqhgGspwgyGd6MOywBUqVvYicF72lkgDnIHg==", + "dev": true, + "requires": { + "call-bind": "^1.0.0" + } + }, + "is-callable": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.2.tgz", + "integrity": "sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA==", + "dev": true + }, + "is-ci": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", + "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", + "dev": true, + "requires": { + "ci-info": "^2.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-date-object": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", + "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==", + "dev": true + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + }, + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + }, + "is-finite": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.1.0.tgz", + "integrity": "sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w==", + "dev": true + }, + "is-fn": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fn/-/is-fn-1.0.0.tgz", + "integrity": "sha1-lUPV3nvPWwiiLsiiC65uKG1RDYw=", + "dev": true + }, + "is-function": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-function/-/is-function-1.0.2.tgz", + "integrity": "sha512-lw7DUp0aWXYg+CBCN+JKkcE0Q2RayZnSvnZBlwgxHBQhqt5pZNVy4Ri7H9GmmXkdu7LUthszM+Tor1u/2iBcpQ==", + "dev": true + }, + "is-hex-prefixed": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz", + "integrity": "sha1-fY035q135dEnFIkTxXPggtd39VQ=", + "dev": true + }, + "is-negative-zero": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.1.tgz", + "integrity": "sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w==", + "dev": true + }, + "is-object": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-object/-/is-object-1.0.2.tgz", + "integrity": "sha512-2rRIahhZr2UWb45fIOuvZGpFtz0TyOZLf32KxBbSoUCeZR495zCKlWUKKUByk3geS2eAs7ZAABt0Y/Rx0GiQGA==", + "dev": true, + "optional": true + }, + "is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", + "dev": true, + "optional": true + }, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "is-regex": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.1.tgz", + "integrity": "sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg==", + "dev": true, + "requires": { + "has-symbols": "^1.0.1" + } + }, + "is-retry-allowed": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.2.0.tgz", + "integrity": "sha512-RUbUeKwvm3XG2VYamhJL1xFktgjvPzL0Hq8C+6yrWIswDy3BIXGqCxhxkc30N9jqK311gVU137K8Ei55/zVJRg==", + "dev": true, + "optional": true + }, + "is-symbol": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", + "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", + "dev": true, + "requires": { + "has-symbols": "^1.0.1" + } + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true + }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "dev": true + }, + "isurl": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isurl/-/isurl-1.0.0.tgz", + "integrity": "sha512-1P/yWsxPlDtn7QeRD+ULKQPaIaN6yF368GZ2vDfv0AL0NwpStafjWCDDdn0k8wgFMWpVAqG7oJhxHnlud42i9w==", + "dev": true, + "optional": true, + "requires": { + "has-to-string-tag-x": "^1.2.0", + "is-object": "^1.0.1" + } + }, + "js-sha3": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.7.tgz", + "integrity": "sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc=", + "dev": true, + "optional": true + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "dev": true + }, + "json-buffer": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", + "integrity": "sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=", + "dev": true, + "optional": true + }, + "json-rpc-engine": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/json-rpc-engine/-/json-rpc-engine-3.8.0.tgz", + "integrity": "sha512-6QNcvm2gFuuK4TKU1uwfH0Qd/cOSb9c1lls0gbnIhciktIUQJwz6NQNAW4B1KiGPenv7IKu97V222Yo1bNhGuA==", + "dev": true, + "requires": { + "async": "^2.0.1", + "babel-preset-env": "^1.7.0", + "babelify": "^7.3.0", + "json-rpc-error": "^2.0.0", + "promise-to-callback": "^1.0.0", + "safe-event-emitter": "^1.0.1" + } + }, + "json-rpc-error": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/json-rpc-error/-/json-rpc-error-2.0.0.tgz", + "integrity": "sha1-p6+cICg4tekFxyUOVH8a/3cligI=", + "dev": true, + "requires": { + "inherits": "^2.0.1" + } + }, + "json-rpc-random-id": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-rpc-random-id/-/json-rpc-random-id-1.0.1.tgz", + "integrity": "sha1-uknZat7RRE27jaPSA3SKy7zeyMg=", + "dev": true + }, + "json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "json-stable-stringify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", + "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", + "dev": true, + "requires": { + "jsonify": "~0.0.0" + } + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "dev": true + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "jsonify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", + "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=", + "dev": true + }, + "jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "dev": true, + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + } + }, + "keccak": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.1.tgz", + "integrity": "sha512-epq90L9jlFWCW7+pQa6JOnKn2Xgl2mtI664seYR6MHskvI9agt7AnDqmAlp9TqU4/caMYbA08Hi5DMZAl5zdkA==", + "dev": true, + "requires": { + "node-addon-api": "^2.0.0", + "node-gyp-build": "^4.2.0" + } + }, + "keyv": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.1.0.tgz", + "integrity": "sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA==", + "dev": true, + "optional": true, + "requires": { + "json-buffer": "3.0.0" + } + }, + "kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true + }, + "klaw-sync": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/klaw-sync/-/klaw-sync-6.0.0.tgz", + "integrity": "sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.11" + } + }, + "level-codec": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-9.0.2.tgz", + "integrity": "sha512-UyIwNb1lJBChJnGfjmO0OR+ezh2iVu1Kas3nvBS/BzGnx79dv6g7unpKIDNPMhfdTEGoc7mC8uAu51XEtX+FHQ==", + "dev": true, + "requires": { + "buffer": "^5.6.0" + } + }, + "level-errors": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-2.0.1.tgz", + "integrity": "sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw==", + "dev": true, + "requires": { + "errno": "~0.1.1" + } + }, + "level-iterator-stream": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-2.0.3.tgz", + "integrity": "sha512-I6Heg70nfF+e5Y3/qfthJFexhRw/Gi3bIymCoXAlijZdAcLaPuWSJs3KXyTYf23ID6g0o2QF62Yh+grOXY3Rig==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "readable-stream": "^2.0.5", + "xtend": "^4.0.0" + } + }, + "level-mem": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/level-mem/-/level-mem-3.0.1.tgz", + "integrity": "sha512-LbtfK9+3Ug1UmvvhR2DqLqXiPW1OJ5jEh0a3m9ZgAipiwpSxGj/qaVVy54RG5vAQN1nCuXqjvprCuKSCxcJHBg==", + "dev": true, + "requires": { + "level-packager": "~4.0.0", + "memdown": "~3.0.0" + }, + "dependencies": { + "abstract-leveldown": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-5.0.0.tgz", + "integrity": "sha512-5mU5P1gXtsMIXg65/rsYGsi93+MlogXZ9FA8JnwKurHQg64bfXwGYVdVdijNTVNOlAsuIiOwHdvFFD5JqCJQ7A==", + "dev": true, + "requires": { + "xtend": "~4.0.0" + } + }, + "ltgt": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ltgt/-/ltgt-2.2.1.tgz", + "integrity": "sha1-81ypHEk/e3PaDgdJUwTxezH4fuU=", + "dev": true + }, + "memdown": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/memdown/-/memdown-3.0.0.tgz", + "integrity": "sha512-tbV02LfZMWLcHcq4tw++NuqMO+FZX8tNJEiD2aNRm48ZZusVg5N8NART+dmBkepJVye986oixErf7jfXboMGMA==", + "dev": true, + "requires": { + "abstract-leveldown": "~5.0.0", + "functional-red-black-tree": "~1.0.1", + "immediate": "~3.2.3", + "inherits": "~2.0.1", + "ltgt": "~2.2.0", + "safe-buffer": "~5.1.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + } + } + }, + "level-packager": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/level-packager/-/level-packager-4.0.1.tgz", + "integrity": "sha512-svCRKfYLn9/4CoFfi+d8krOtrp6RoX8+xm0Na5cgXMqSyRru0AnDYdLl+YI8u1FyS6gGZ94ILLZDE5dh2but3Q==", + "dev": true, + "requires": { + "encoding-down": "~5.0.0", + "levelup": "^3.0.0" + } + }, + "level-post": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/level-post/-/level-post-1.0.7.tgz", + "integrity": "sha512-PWYqG4Q00asOrLhX7BejSajByB4EmG2GaKHfj3h5UmmZ2duciXLPGYWIjBzLECFWUGOZWlm5B20h/n3Gs3HKew==", + "dev": true, + "requires": { + "ltgt": "^2.1.2" + } + }, + "level-sublevel": { + "version": "6.6.4", + "resolved": "https://registry.npmjs.org/level-sublevel/-/level-sublevel-6.6.4.tgz", + "integrity": "sha512-pcCrTUOiO48+Kp6F1+UAzF/OtWqLcQVTVF39HLdZ3RO8XBoXt+XVPKZO1vVr1aUoxHZA9OtD2e1v7G+3S5KFDA==", + "dev": true, + "requires": { + "bytewise": "~1.1.0", + "level-codec": "^9.0.0", + "level-errors": "^2.0.0", + "level-iterator-stream": "^2.0.3", + "ltgt": "~2.1.1", + "pull-defer": "^0.2.2", + "pull-level": "^2.0.3", + "pull-stream": "^3.6.8", + "typewiselite": "~1.0.0", + "xtend": "~4.0.0" + } + }, + "level-ws": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/level-ws/-/level-ws-1.0.0.tgz", + "integrity": "sha512-RXEfCmkd6WWFlArh3X8ONvQPm8jNpfA0s/36M4QzLqrLEIt1iJE9WBHLZ5vZJK6haMjJPJGJCQWfjMNnRcq/9Q==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "readable-stream": "^2.2.8", + "xtend": "^4.0.1" + } + }, + "levelup": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/levelup/-/levelup-3.1.1.tgz", + "integrity": "sha512-9N10xRkUU4dShSRRFTBdNaBxofz+PGaIZO962ckboJZiNmLuhVT6FZ6ZKAsICKfUBO76ySaYU6fJWX/jnj3Lcg==", + "dev": true, + "requires": { + "deferred-leveldown": "~4.0.0", + "level-errors": "~2.0.0", + "level-iterator-stream": "~3.0.0", + "xtend": "~4.0.0" + }, + "dependencies": { + "level-iterator-stream": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-3.0.1.tgz", + "integrity": "sha512-nEIQvxEED9yRThxvOrq8Aqziy4EGzrxSZK+QzEFAVuJvQ8glfyZ96GB6BoI4sBbLfjMXm2w4vu3Tkcm9obcY0g==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "readable-stream": "^2.3.6", + "xtend": "^4.0.0" + } + } + } + }, + "lodash": { + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", + "dev": true + }, + "looper": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/looper/-/looper-2.0.0.tgz", + "integrity": "sha1-Zs0Md0rz1P7axTeU90LbVtqPCew=", + "dev": true + }, + "loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "dev": true, + "requires": { + "js-tokens": "^3.0.0 || ^4.0.0" + } + }, + "lowercase-keys": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", + "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==", + "dev": true, + "optional": true + }, + "lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "requires": { + "yallist": "^3.0.2" + } + }, + "ltgt": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ltgt/-/ltgt-2.1.3.tgz", + "integrity": "sha1-EIUaBtmWS5cReEQcI8nlJpjuzjQ=", + "dev": true + }, + "map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", + "dev": true + }, + "map-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "dev": true, + "requires": { + "object-visit": "^1.0.0" + } + }, + "md5.js": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "dev": true, + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=", + "dev": true, + "optional": true + }, + "merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=", + "dev": true, + "optional": true + }, + "merkle-patricia-tree": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-3.0.0.tgz", + "integrity": "sha512-soRaMuNf/ILmw3KWbybaCjhx86EYeBbD8ph0edQCTed0JN/rxDt1EBN52Ajre3VyGo+91f8+/rfPIRQnnGMqmQ==", + "dev": true, + "requires": { + "async": "^2.6.1", + "ethereumjs-util": "^5.2.0", + "level-mem": "^3.0.1", + "level-ws": "^1.0.0", + "readable-stream": "^3.0.6", + "rlp": "^2.0.0", + "semaphore": ">=1.0.1" + }, + "dependencies": { + "ethereumjs-util": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.1.tgz", + "integrity": "sha512-v3kT+7zdyCm1HIqWlLNrHGqHGLpGYIhjeHxQjnDXjLT2FyGJDsd3LWMYUo7pAFRrk86CR3nUJfhC81CCoJNNGQ==", + "dev": true, + "requires": { + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "^0.1.3", + "rlp": "^2.0.0", + "safe-buffer": "^5.1.1" + } + }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + } + } + }, + "methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=", + "dev": true, + "optional": true + }, + "miller-rabin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", + "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", + "dev": true, + "requires": { + "bn.js": "^4.0.0", + "brorand": "^1.0.1" + } + }, + "mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "dev": true, + "optional": true + }, + "mime-db": { + "version": "1.45.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.45.0.tgz", + "integrity": "sha512-CkqLUxUk15hofLoLyljJSrukZi8mAtgd+yE5uO4tqRZsdsAJKv0O+rFMhVDRJgozy+yG6md5KwuXhD4ocIoP+w==", + "dev": true + }, + "mime-types": { + "version": "2.1.28", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.28.tgz", + "integrity": "sha512-0TO2yJ5YHYr7M2zzT7gDU1tbwHxEUWBCLt0lscSNpcdAfFyJOVEpRYNS7EXVcTLNj/25QO8gulHC5JtTzSE2UQ==", + "dev": true, + "requires": { + "mime-db": "1.45.0" + } + }, + "mimic-response": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", + "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", + "dev": true, + "optional": true + }, + "min-document": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/min-document/-/min-document-2.19.0.tgz", + "integrity": "sha1-e9KC4/WELtKVu3SM3Z8f+iyCRoU=", + "dev": true, + "requires": { + "dom-walk": "^0.1.0" + } + }, + "minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", + "dev": true + }, + "minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "minizlib": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.3.3.tgz", + "integrity": "sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==", + "dev": true, + "optional": true, + "requires": { + "minipass": "^2.9.0" + }, + "dependencies": { + "minipass": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz", + "integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==", + "dev": true, + "optional": true, + "requires": { + "safe-buffer": "^5.1.2", + "yallist": "^3.0.0" + } + } + } + }, + "mixin-deep": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", + "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", + "dev": true, + "requires": { + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" + } + }, + "mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, + "mkdirp-promise": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/mkdirp-promise/-/mkdirp-promise-5.0.1.tgz", + "integrity": "sha1-6bj2jlUsaKnBcTuEiD96HdA5uKE=", + "dev": true, + "optional": true, + "requires": { + "mkdirp": "*" + } + }, + "mock-fs": { + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/mock-fs/-/mock-fs-4.13.0.tgz", + "integrity": "sha512-DD0vOdofJdoaRNtnWcrXe6RQbpHkPPmtqGq14uRX0F8ZKJ5nv89CVTYl/BZdppDxBDaV0hl75htg3abpEWlPZA==", + "dev": true, + "optional": true + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "multibase": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/multibase/-/multibase-0.6.1.tgz", + "integrity": "sha512-pFfAwyTjbbQgNc3G7D48JkJxWtoJoBMaR4xQUOuB8RnCgRqaYmWNFeJTTvrJ2w51bjLq2zTby6Rqj9TQ9elSUw==", + "dev": true, + "optional": true, + "requires": { + "base-x": "^3.0.8", + "buffer": "^5.5.0" + } + }, + "multicodec": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/multicodec/-/multicodec-0.5.7.tgz", + "integrity": "sha512-PscoRxm3f+88fAtELwUnZxGDkduE2HD9Q6GHUOywQLjOGT/HAdhjLDYNZ1e7VR0s0TP0EwZ16LNUTFpoBGivOA==", + "dev": true, + "optional": true, + "requires": { + "varint": "^5.0.0" + } + }, + "multihashes": { + "version": "0.4.21", + "resolved": "https://registry.npmjs.org/multihashes/-/multihashes-0.4.21.tgz", + "integrity": "sha512-uVSvmeCWf36pU2nB4/1kzYZjsXD9vofZKpgudqkceYY5g2aZZXJ5r9lxuzoRLl1OAp28XljXsEJ/X/85ZsKmKw==", + "dev": true, + "optional": true, + "requires": { + "buffer": "^5.5.0", + "multibase": "^0.7.0", + "varint": "^5.0.0" + }, + "dependencies": { + "multibase": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/multibase/-/multibase-0.7.0.tgz", + "integrity": "sha512-TW8q03O0f6PNFTQDvh3xxH03c8CjGaaYrjkl9UQPG6rz53TQzzxJVCIWVjzcbN/Q5Y53Zd0IBQBMVktVgNx4Fg==", + "dev": true, + "optional": true, + "requires": { + "base-x": "^3.0.8", + "buffer": "^5.5.0" + } + } + } + }, + "nano-json-stream-parser": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/nano-json-stream-parser/-/nano-json-stream-parser-0.1.2.tgz", + "integrity": "sha1-DMj20OK2IrR5xA1JnEbWS3Vcb18=", + "dev": true, + "optional": true + }, + "nanomatch": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", + "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + } + }, + "negotiator": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", + "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==", + "dev": true, + "optional": true + }, + "next-tick": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", + "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=", + "dev": true + }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, + "node-addon-api": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz", + "integrity": "sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==", + "dev": true + }, + "node-fetch": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.1.2.tgz", + "integrity": "sha1-q4hOjn5X44qUR1POxwb3iNF2i7U=", + "dev": true + }, + "node-gyp-build": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.2.3.tgz", + "integrity": "sha512-MN6ZpzmfNCRM+3t57PTJHgHyw/h4OWnZ6mR8P5j/uZtqQr46RRuDE/P+g3n0YR/AiYXeWixZZzaip77gdICfRg==", + "dev": true + }, + "normalize-url": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.0.tgz", + "integrity": "sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ==", + "dev": true, + "optional": true + }, + "number-to-bn": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/number-to-bn/-/number-to-bn-1.7.0.tgz", + "integrity": "sha1-uzYjWS9+X54AMLGXe9QaDFP+HqA=", + "dev": true, + "optional": true, + "requires": { + "bn.js": "4.11.6", + "strip-hex-prefix": "1.0.0" + }, + "dependencies": { + "bn.js": { + "version": "4.11.6", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", + "integrity": "sha1-UzRK2xRhehP26N0s4okF0cC6MhU=", + "dev": true, + "optional": true + } + } + }, + "oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, + "object-copy": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "dev": true, + "requires": { + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + } + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "object-inspect": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.9.0.tgz", + "integrity": "sha512-i3Bp9iTqwhaLZBxGkRfo5ZbE07BQRT7MGu8+nNgwW9ItGp1TzCTw2DLEoWwjClxBjOFI/hWljTAmYGCEwmtnOw==", + "dev": true + }, + "object-is": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.4.tgz", + "integrity": "sha512-1ZvAZ4wlF7IyPVOcE1Omikt7UpaFlOQq0HlSti+ZvDH3UiD2brwGMwDbyV43jao2bKJ+4+WdPJHSd7kgzKYVqg==", + "dev": true, + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3" + } + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true + }, + "object-visit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", + "dev": true, + "requires": { + "isobject": "^3.0.0" + } + }, + "object.assign": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", + "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "has-symbols": "^1.0.1", + "object-keys": "^1.1.1" + } + }, + "object.getownpropertydescriptors": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.1.tgz", + "integrity": "sha512-6DtXgZ/lIZ9hqx4GtZETobXLR/ZLaa0aqV0kzbn80Rf8Z2e/XFnhA0I7p07N2wH8bBBltr2xQPi6sbKWAY2Eng==", + "dev": true, + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "es-abstract": "^1.18.0-next.1" + } + }, + "object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "oboe": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/oboe/-/oboe-2.1.4.tgz", + "integrity": "sha1-IMiM2wwVNxuwQRklfU/dNLCqSfY=", + "dev": true, + "optional": true, + "requires": { + "http-https": "^1.0.0" + } + }, + "on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "dev": true, + "optional": true, + "requires": { + "ee-first": "1.1.1" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "os-homedir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", + "dev": true + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true + }, + "p-cancelable": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz", + "integrity": "sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw==", + "dev": true, + "optional": true + }, + "p-timeout": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-1.2.1.tgz", + "integrity": "sha1-XrOzU7f86Z8QGhA4iAuwVOu+o4Y=", + "dev": true, + "optional": true, + "requires": { + "p-finally": "^1.0.0" + }, + "dependencies": { + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "dev": true, + "optional": true + } + } + }, + "parse-asn1": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.6.tgz", + "integrity": "sha512-RnZRo1EPU6JBnra2vGHj0yhp6ebyjBZpmUCLHWiFhxlzvBCCpAuZ7elsBp1PVAbQN0/04VD/19rfzlBSwLstMw==", + "dev": true, + "optional": true, + "requires": { + "asn1.js": "^5.2.0", + "browserify-aes": "^1.0.0", + "evp_bytestokey": "^1.0.0", + "pbkdf2": "^3.0.3", + "safe-buffer": "^5.1.1" + } + }, + "parse-headers": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/parse-headers/-/parse-headers-2.0.3.tgz", + "integrity": "sha512-QhhZ+DCCit2Coi2vmAKbq5RGTRcQUOE2+REgv8vdyu7MnYx2eZztegqtTx99TZ86GTIwqiy3+4nQTWZ2tgmdCA==", + "dev": true + }, + "parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "dev": true, + "optional": true + }, + "pascalcase": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", + "dev": true + }, + "patch-package": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/patch-package/-/patch-package-6.2.2.tgz", + "integrity": "sha512-YqScVYkVcClUY0v8fF0kWOjDYopzIM8e3bj/RU1DPeEF14+dCGm6UeOYm4jvCyxqIEQ5/eJzmbWfDWnUleFNMg==", + "dev": true, + "requires": { + "@yarnpkg/lockfile": "^1.1.0", + "chalk": "^2.4.2", + "cross-spawn": "^6.0.5", + "find-yarn-workspace-root": "^1.2.1", + "fs-extra": "^7.0.1", + "is-ci": "^2.0.0", + "klaw-sync": "^6.0.0", + "minimist": "^1.2.0", + "rimraf": "^2.6.3", + "semver": "^5.6.0", + "slash": "^2.0.0", + "tmp": "^0.0.33" + }, + "dependencies": { + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "slash": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", + "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", + "dev": true + }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "requires": { + "os-tmpdir": "~1.0.2" + } + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true + }, + "path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=", + "dev": true, + "optional": true + }, + "pbkdf2": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.1.tgz", + "integrity": "sha512-4Ejy1OPxi9f2tt1rRV7Go7zmfDQ+ZectEQz3VGUQhgq62HtIRPDyG/JtnwIxs6x3uNMwo2V7q1fMvKjb+Tnpqg==", + "dev": true, + "requires": { + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", + "dev": true + }, + "posix-character-classes": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", + "dev": true + }, + "precond": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/precond/-/precond-0.2.3.tgz", + "integrity": "sha1-qpWRvKokkj8eD0hJ0kD0fvwQdaw=", + "dev": true + }, + "prepend-http": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", + "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=", + "dev": true, + "optional": true + }, + "private": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", + "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==", + "dev": true + }, + "process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", + "dev": true + }, + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true + }, + "promise-to-callback": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/promise-to-callback/-/promise-to-callback-1.0.0.tgz", + "integrity": "sha1-XSp0kBC/tn2WNZj805YHRqaP7vc=", + "dev": true, + "requires": { + "is-fn": "^1.0.0", + "set-immediate-shim": "^1.0.1" + } + }, + "proxy-addr": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.6.tgz", + "integrity": "sha512-dh/frvCBVmSsDYzw6n926jv974gddhkFPfiN8hPOi30Wax25QZyZEGveluCgliBnqmuM+UJmBErbAUFIoDbjOw==", + "dev": true, + "optional": true, + "requires": { + "forwarded": "~0.1.2", + "ipaddr.js": "1.9.1" + } + }, + "prr": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", + "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=", + "dev": true + }, + "pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", + "dev": true + }, + "psl": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", + "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==", + "dev": true + }, + "public-encrypt": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", + "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", + "dev": true, + "optional": true, + "requires": { + "bn.js": "^4.1.0", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "parse-asn1": "^5.0.0", + "randombytes": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "pull-cat": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/pull-cat/-/pull-cat-1.1.11.tgz", + "integrity": "sha1-tkLdElXaN2pwa220+pYvX9t0wxs=", + "dev": true + }, + "pull-defer": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/pull-defer/-/pull-defer-0.2.3.tgz", + "integrity": "sha512-/An3KE7mVjZCqNhZsr22k1Tx8MACnUnHZZNPSJ0S62td8JtYr/AiRG42Vz7Syu31SoTLUzVIe61jtT/pNdjVYA==", + "dev": true + }, + "pull-level": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pull-level/-/pull-level-2.0.4.tgz", + "integrity": "sha512-fW6pljDeUThpq5KXwKbRG3X7Ogk3vc75d5OQU/TvXXui65ykm+Bn+fiktg+MOx2jJ85cd+sheufPL+rw9QSVZg==", + "dev": true, + "requires": { + "level-post": "^1.0.7", + "pull-cat": "^1.1.9", + "pull-live": "^1.0.1", + "pull-pushable": "^2.0.0", + "pull-stream": "^3.4.0", + "pull-window": "^2.1.4", + "stream-to-pull-stream": "^1.7.1" + } + }, + "pull-live": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/pull-live/-/pull-live-1.0.1.tgz", + "integrity": "sha1-pOzuAeMwFV6RJLu89HYfIbOPUfU=", + "dev": true, + "requires": { + "pull-cat": "^1.1.9", + "pull-stream": "^3.4.0" + } + }, + "pull-pushable": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/pull-pushable/-/pull-pushable-2.2.0.tgz", + "integrity": "sha1-Xy867UethpGfAbEqLpnW8b13ZYE=", + "dev": true + }, + "pull-stream": { + "version": "3.6.14", + "resolved": "https://registry.npmjs.org/pull-stream/-/pull-stream-3.6.14.tgz", + "integrity": "sha512-KIqdvpqHHaTUA2mCYcLG1ibEbu/LCKoJZsBWyv9lSYtPkJPBq8m3Hxa103xHi6D2thj5YXa0TqK3L3GUkwgnew==", + "dev": true + }, + "pull-window": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/pull-window/-/pull-window-2.1.4.tgz", + "integrity": "sha1-/DuG/uvRkgx64pdpHiP3BfiFUvA=", + "dev": true, + "requires": { + "looper": "^2.0.0" + } + }, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "optional": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + }, + "qs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", + "dev": true + }, + "query-string": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/query-string/-/query-string-5.1.1.tgz", + "integrity": "sha512-gjWOsm2SoGlgLEdAGt7a6slVOk9mGiXmPFMqrEhLQ68rhQuBnpfs3+EmlvqKyxnCo9/PPlF+9MtY02S1aFg+Jw==", + "dev": true, + "optional": true, + "requires": { + "decode-uri-component": "^0.2.0", + "object-assign": "^4.1.0", + "strict-uri-encode": "^1.0.0" + } + }, + "randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "requires": { + "safe-buffer": "^5.1.0" + } + }, + "randomfill": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", + "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", + "dev": true, + "optional": true, + "requires": { + "randombytes": "^2.0.5", + "safe-buffer": "^5.1.0" + } + }, + "range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "dev": true, + "optional": true + }, + "raw-body": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz", + "integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==", + "dev": true, + "optional": true, + "requires": { + "bytes": "3.1.0", + "http-errors": "1.7.2", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + } + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + } + } + }, + "regenerate": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", + "integrity": "sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==", + "dev": true + }, + "regenerator-runtime": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", + "dev": true + }, + "regenerator-transform": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.10.1.tgz", + "integrity": "sha512-PJepbvDbuK1xgIgnau7Y90cwaAmO/LCLMI2mPvaXq2heGMR3aWW5/BQvYrhJ8jgmQjXewXvBjzfqKcVOmhjZ6Q==", + "dev": true, + "requires": { + "babel-runtime": "^6.18.0", + "babel-types": "^6.19.0", + "private": "^0.1.6" + } + }, + "regex-not": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "dev": true, + "requires": { + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" + } + }, + "regexp.prototype.flags": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.3.0.tgz", + "integrity": "sha512-2+Q0C5g951OlYlJz6yu5/M33IcsESLlLfsyIaLJaG4FA2r4yP8MvVMJUUP/fVBkSpbbbZlS5gynbEWLipiiXiQ==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1" + }, + "dependencies": { + "es-abstract": { + "version": "1.17.7", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", + "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.2", + "is-regex": "^1.1.1", + "object-inspect": "^1.8.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.1", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" + } + } + } + }, + "regexpu-core": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-2.0.0.tgz", + "integrity": "sha1-SdA4g3uNz4v6W5pCE5k45uoq4kA=", + "dev": true, + "requires": { + "regenerate": "^1.2.1", + "regjsgen": "^0.2.0", + "regjsparser": "^0.1.4" + } + }, + "regjsgen": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz", + "integrity": "sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc=", + "dev": true + }, + "regjsparser": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.1.5.tgz", + "integrity": "sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw=", + "dev": true, + "requires": { + "jsesc": "~0.5.0" + }, + "dependencies": { + "jsesc": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", + "dev": true + } + } + }, + "repeat-element": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", + "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", + "dev": true + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true + }, + "repeating": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", + "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", + "dev": true, + "requires": { + "is-finite": "^1.0.0" + } + }, + "request": { + "version": "2.88.2", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", + "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", + "dev": true, + "requires": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.3", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.5.0", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + } + }, + "resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", + "dev": true + }, + "responselike": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz", + "integrity": "sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec=", + "dev": true, + "optional": true, + "requires": { + "lowercase-keys": "^1.0.0" + } + }, + "resumer": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/resumer/-/resumer-0.0.0.tgz", + "integrity": "sha1-8ej0YeQGS6Oegq883CqMiT0HZ1k=", + "dev": true, + "requires": { + "through": "~2.3.4" + } + }, + "ret": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "dev": true + }, + "rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "dev": true, + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "rlp": { + "version": "2.2.6", + "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.2.6.tgz", + "integrity": "sha512-HAfAmL6SDYNWPUOJNrM500x4Thn4PZsEy5pijPh40U9WfNk0z15hUYzO9xVIMAdIHdFtD8CBDHd75Td1g36Mjg==", + "dev": true, + "requires": { + "bn.js": "^4.11.1" + } + }, + "rustbn.js": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/rustbn.js/-/rustbn.js-0.2.0.tgz", + "integrity": "sha512-4VlvkRUuCJvr2J6Y0ImW7NvTCriMi7ErOAqWk1y69vAdoNIzCF3yPmgeNzx+RQTLEDFq5sHfscn1MwHxP9hNfA==", + "dev": true + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true + }, + "safe-event-emitter": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/safe-event-emitter/-/safe-event-emitter-1.0.1.tgz", + "integrity": "sha512-e1wFe99A91XYYxoQbcq2ZJUWurxEyP8vfz7A7vuUe1s95q8r5ebraVaA1BukYJcpM6V16ugWoD9vngi8Ccu5fg==", + "dev": true, + "requires": { + "events": "^3.0.0" + } + }, + "safe-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "dev": true, + "requires": { + "ret": "~0.1.10" + } + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "scrypt-js": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz", + "integrity": "sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==", + "dev": true + }, + "scryptsy": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/scryptsy/-/scryptsy-1.2.1.tgz", + "integrity": "sha1-oyJfpLJST4AnAHYeKFW987LZIWM=", + "dev": true, + "optional": true, + "requires": { + "pbkdf2": "^3.0.3" + } + }, + "secp256k1": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.2.tgz", + "integrity": "sha512-UDar4sKvWAksIlfX3xIaQReADn+WFnHvbVujpcbr+9Sf/69odMwy2MUsz5CKLQgX9nsIyrjuxL2imVyoNHa3fg==", + "dev": true, + "requires": { + "elliptic": "^6.5.2", + "node-addon-api": "^2.0.0", + "node-gyp-build": "^4.2.0" + } + }, + "seedrandom": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/seedrandom/-/seedrandom-3.0.1.tgz", + "integrity": "sha512-1/02Y/rUeU1CJBAGLebiC5Lbo5FnB22gQbIFFYTLkwvp1xdABZJH1sn4ZT1MzXmPpzv+Rf/Lu2NcsLJiK4rcDg==", + "dev": true + }, + "semaphore": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/semaphore/-/semaphore-1.1.0.tgz", + "integrity": "sha512-O4OZEaNtkMd/K0i6js9SL+gqy0ZCBMgUvlSqHKi4IBdjhe7wB8pwztUk1BbZ1fmrvpwFrPbHzqd2w5pTcJH6LA==", + "dev": true + }, + "send": { + "version": "0.17.1", + "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", + "integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==", + "dev": true, + "optional": true, + "requires": { + "debug": "2.6.9", + "depd": "~1.1.2", + "destroy": "~1.0.4", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "~1.7.2", + "mime": "1.6.0", + "ms": "2.1.1", + "on-finished": "~2.3.0", + "range-parser": "~1.2.1", + "statuses": "~1.5.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "optional": true, + "requires": { + "ms": "2.0.0" + }, + "dependencies": { + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true, + "optional": true + } + } + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true, + "optional": true + } + } + }, + "serve-static": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz", + "integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==", + "dev": true, + "optional": true, + "requires": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.17.1" + } + }, + "servify": { + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/servify/-/servify-0.1.12.tgz", + "integrity": "sha512-/xE6GvsKKqyo1BAY+KxOWXcLpPsUUyji7Qg3bVD7hh1eRze5bR1uYiuDA/k3Gof1s9BTzQZEJK8sNcNGFIzeWw==", + "dev": true, + "optional": true, + "requires": { + "body-parser": "^1.16.0", + "cors": "^2.8.1", + "express": "^4.14.0", + "request": "^2.79.0", + "xhr": "^2.3.3" + } + }, + "set-immediate-shim": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", + "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=", + "dev": true + }, + "set-value": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", + "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + } + } + }, + "setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=", + "dev": true + }, + "setprototypeof": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", + "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==", + "dev": true, + "optional": true + }, + "sha.js": { + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "simple-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", + "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", + "dev": true, + "optional": true + }, + "simple-get": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-2.8.1.tgz", + "integrity": "sha512-lSSHRSw3mQNUGPAYRqo7xy9dhKmxFXIjLjp4KHpf99GEH2VH7C3AM+Qfx6du6jhfUi6Vm7XnbEVEf7Wb6N8jRw==", + "dev": true, + "optional": true, + "requires": { + "decompress-response": "^3.3.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + }, + "snapdragon": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "dev": true, + "requires": { + "base": "^0.11.1", + "debug": "^2.2.0", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "map-cache": "^0.2.2", + "source-map": "^0.5.6", + "source-map-resolve": "^0.5.0", + "use": "^3.1.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + } + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + }, + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "snapdragon-node": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "dev": true, + "requires": { + "define-property": "^1.0.0", + "isobject": "^3.0.0", + "snapdragon-util": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + } + } + }, + "snapdragon-util": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "dev": true, + "requires": { + "kind-of": "^3.2.0" + }, + "dependencies": { + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + }, + "source-map-resolve": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", + "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==", + "dev": true, + "requires": { + "atob": "^2.1.2", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" + } + }, + "source-map-support": { + "version": "0.5.12", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.12.tgz", + "integrity": "sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "source-map-url": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", + "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", + "dev": true + }, + "split-string": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "dev": true, + "requires": { + "extend-shallow": "^3.0.0" + } + }, + "sshpk": { + "version": "1.16.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", + "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", + "dev": true, + "requires": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + }, + "dependencies": { + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "dev": true + } + } + }, + "static-extend": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "dev": true, + "requires": { + "define-property": "^0.2.5", + "object-copy": "^0.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + } + }, + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + } + } + }, + "statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=", + "dev": true, + "optional": true + }, + "stream-to-pull-stream": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/stream-to-pull-stream/-/stream-to-pull-stream-1.7.3.tgz", + "integrity": "sha512-6sNyqJpr5dIOQdgNy/xcDWwDuzAsAwVzhzrWlAPAQ7Lkjx/rv0wgvxEyKwTq6FmNd5rjTrELt/CLmaSw7crMGg==", + "dev": true, + "requires": { + "looper": "^3.0.0", + "pull-stream": "^3.2.3" + }, + "dependencies": { + "looper": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/looper/-/looper-3.0.0.tgz", + "integrity": "sha1-LvpUw7HLq6m5Su4uWRSwvlf7t0k=", + "dev": true + } + } + }, + "strict-uri-encode": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz", + "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=", + "dev": true, + "optional": true + }, + "string.prototype.trim": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.3.tgz", + "integrity": "sha512-16IL9pIBA5asNOSukPfxX2W68BaBvxyiRK16H3RA/lWW9BDosh+w7f+LhomPHpXJ82QEe7w7/rY/S1CV97raLg==", + "dev": true, + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "es-abstract": "^1.18.0-next.1" + } + }, + "string.prototype.trimend": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.3.tgz", + "integrity": "sha512-ayH0pB+uf0U28CtjlLvL7NaohvR1amUvVZk+y3DYb0Ey2PUV5zPkkKy9+U1ndVEIXO8hNg18eIv9Jntbii+dKw==", + "dev": true, + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3" + } + }, + "string.prototype.trimstart": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.3.tgz", + "integrity": "sha512-oBIBUy5lea5tt0ovtOFiEQaBkoBBkyJhZXzJYrSmDo5IUUqbOPvVezuRs/agBIdZ2p2Eo1FD6bD9USyBLfl3xg==", + "dev": true, + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + } + } + }, + "strip-hex-prefix": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz", + "integrity": "sha1-DF8VX+8RUTczd96du1iNoFUA428=", + "dev": true, + "requires": { + "is-hex-prefixed": "1.0.0" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "swarm-js": { + "version": "0.1.40", + "resolved": "https://registry.npmjs.org/swarm-js/-/swarm-js-0.1.40.tgz", + "integrity": "sha512-yqiOCEoA4/IShXkY3WKwP5PvZhmoOOD8clsKA7EEcRILMkTEYHCQ21HDCAcVpmIxZq4LyZvWeRJ6quIyHk1caA==", + "dev": true, + "optional": true, + "requires": { + "bluebird": "^3.5.0", + "buffer": "^5.0.5", + "eth-lib": "^0.1.26", + "fs-extra": "^4.0.2", + "got": "^7.1.0", + "mime-types": "^2.1.16", + "mkdirp-promise": "^5.0.1", + "mock-fs": "^4.1.0", + "setimmediate": "^1.0.5", + "tar": "^4.0.2", + "xhr-request": "^1.0.1" + }, + "dependencies": { + "fs-extra": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-4.0.3.tgz", + "integrity": "sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg==", + "dev": true, + "optional": true, + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "get-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", + "dev": true, + "optional": true + }, + "got": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/got/-/got-7.1.0.tgz", + "integrity": "sha512-Y5WMo7xKKq1muPsxD+KmrR8DH5auG7fBdDVueZwETwV6VytKyU9OX/ddpq2/1hp1vIPvVb4T81dKQz3BivkNLw==", + "dev": true, + "optional": true, + "requires": { + "decompress-response": "^3.2.0", + "duplexer3": "^0.1.4", + "get-stream": "^3.0.0", + "is-plain-obj": "^1.1.0", + "is-retry-allowed": "^1.0.0", + "is-stream": "^1.0.0", + "isurl": "^1.0.0-alpha5", + "lowercase-keys": "^1.0.0", + "p-cancelable": "^0.3.0", + "p-timeout": "^1.1.1", + "safe-buffer": "^5.0.1", + "timed-out": "^4.0.0", + "url-parse-lax": "^1.0.0", + "url-to-options": "^1.0.1" + } + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true, + "optional": true + }, + "p-cancelable": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-0.3.0.tgz", + "integrity": "sha512-RVbZPLso8+jFeq1MfNvgXtCRED2raz/dKpacfTNxsx6pLEpEomM7gah6VeHSYV3+vo0OAi4MkArtQcWWXuQoyw==", + "dev": true, + "optional": true + }, + "prepend-http": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", + "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=", + "dev": true, + "optional": true + }, + "url-parse-lax": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-1.0.0.tgz", + "integrity": "sha1-evjzA2Rem9eaJy56FKxovAYJ2nM=", + "dev": true, + "optional": true, + "requires": { + "prepend-http": "^1.0.1" + } + } + } + }, + "tape": { + "version": "4.13.3", + "resolved": "https://registry.npmjs.org/tape/-/tape-4.13.3.tgz", + "integrity": "sha512-0/Y20PwRIUkQcTCSi4AASs+OANZZwqPKaipGCEwp10dQMipVvSZwUUCi01Y/OklIGyHKFhIcjock+DKnBfLAFw==", + "dev": true, + "requires": { + "deep-equal": "~1.1.1", + "defined": "~1.0.0", + "dotignore": "~0.1.2", + "for-each": "~0.3.3", + "function-bind": "~1.1.1", + "glob": "~7.1.6", + "has": "~1.0.3", + "inherits": "~2.0.4", + "is-regex": "~1.0.5", + "minimist": "~1.2.5", + "object-inspect": "~1.7.0", + "resolve": "~1.17.0", + "resumer": "~0.0.0", + "string.prototype.trim": "~1.2.1", + "through": "~2.3.8" + }, + "dependencies": { + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "is-regex": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.5.tgz", + "integrity": "sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ==", + "dev": true, + "requires": { + "has": "^1.0.3" + } + }, + "object-inspect": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.7.0.tgz", + "integrity": "sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw==", + "dev": true + }, + "resolve": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + } + } + }, + "tar": { + "version": "4.4.13", + "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.13.tgz", + "integrity": "sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA==", + "dev": true, + "optional": true, + "requires": { + "chownr": "^1.1.1", + "fs-minipass": "^1.2.5", + "minipass": "^2.8.6", + "minizlib": "^1.2.1", + "mkdirp": "^0.5.0", + "safe-buffer": "^5.1.2", + "yallist": "^3.0.3" + }, + "dependencies": { + "fs-minipass": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.7.tgz", + "integrity": "sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==", + "dev": true, + "optional": true, + "requires": { + "minipass": "^2.6.0" + } + }, + "minipass": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz", + "integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==", + "dev": true, + "optional": true, + "requires": { + "safe-buffer": "^5.1.2", + "yallist": "^3.0.0" + } + } + } + }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true + }, + "through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "dev": true, + "requires": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + } + }, + "timed-out": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz", + "integrity": "sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8=", + "dev": true, + "optional": true + }, + "tmp": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.1.0.tgz", + "integrity": "sha512-J7Z2K08jbGcdA1kkQpJSqLF6T0tdQqpR2pnSUXsIchbPdTI9v3e85cLW0d6WDhwuAleOV71j2xWs8qMPfK7nKw==", + "dev": true, + "requires": { + "rimraf": "^2.6.3" + } + }, + "to-object-path": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", + "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "to-readable-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/to-readable-stream/-/to-readable-stream-1.0.0.tgz", + "integrity": "sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q==", + "dev": true, + "optional": true + }, + "to-regex": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "dev": true, + "requires": { + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" + } + }, + "toidentifier": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", + "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==", + "dev": true, + "optional": true + }, + "tough-cookie": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", + "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", + "dev": true, + "requires": { + "psl": "^1.1.28", + "punycode": "^2.1.1" + } + }, + "trim-right": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", + "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", + "dev": true + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "dev": true, + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "tweetnacl": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", + "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==", + "dev": true + }, + "tweetnacl-util": { + "version": "0.15.1", + "resolved": "https://registry.npmjs.org/tweetnacl-util/-/tweetnacl-util-0.15.1.tgz", + "integrity": "sha512-RKJBIj8lySrShN4w6i/BonWp2Z/uxwC3h4y7xsRrpP59ZboCd0GpEVsOnMDYLMmKBpYhb5TgHzZXy7wTfYFBRw==", + "dev": true + }, + "type": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", + "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==", + "dev": true + }, + "type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "dev": true, + "optional": true, + "requires": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + } + }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", + "dev": true + }, + "typedarray-to-buffer": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", + "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", + "dev": true, + "requires": { + "is-typedarray": "^1.0.0" + } + }, + "typewise": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/typewise/-/typewise-1.0.3.tgz", + "integrity": "sha1-EGeTZUCvl5N8xdz5kiSG6fooRlE=", + "dev": true, + "requires": { + "typewise-core": "^1.2.0" + } + }, + "typewise-core": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/typewise-core/-/typewise-core-1.2.0.tgz", + "integrity": "sha1-l+uRgFx/VdL5QXSPpQ0xXZke8ZU=", + "dev": true + }, + "typewiselite": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/typewiselite/-/typewiselite-1.0.0.tgz", + "integrity": "sha1-yIgvobsQksBgBal/NO9chQjjZk4=", + "dev": true + }, + "ultron": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ultron/-/ultron-1.1.1.tgz", + "integrity": "sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og==", + "dev": true, + "optional": true + }, + "underscore": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.9.1.tgz", + "integrity": "sha512-5/4etnCkd9c8gwgowi5/om/mYO5ajCaOgdzj/oW+0eQV9WxKBDZw5+ycmKmeaTXjInS/W0BzpGLo2xR2aBwZdg==", + "dev": true, + "optional": true + }, + "union-value": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", + "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^2.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + } + } + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true + }, + "unorm": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/unorm/-/unorm-1.6.0.tgz", + "integrity": "sha512-b2/KCUlYZUeA7JFUuRJZPUtr4gZvBh7tavtv4fvk4+KV9pfGiR6CQAQAWl49ZpR3ts2dk4FYkP7EIgDJoiOLDA==", + "dev": true + }, + "unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", + "dev": true, + "optional": true + }, + "unset-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "dev": true, + "requires": { + "has-value": "^0.3.1", + "isobject": "^3.0.0" + }, + "dependencies": { + "has-value": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", + "dev": true, + "requires": { + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" + }, + "dependencies": { + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "requires": { + "isarray": "1.0.0" + } + } + } + }, + "has-values": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", + "dev": true + } + } + }, + "uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, + "urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "dev": true + }, + "url-parse-lax": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz", + "integrity": "sha1-FrXK/Afb42dsGxmZF3gj1lA6yww=", + "dev": true, + "optional": true, + "requires": { + "prepend-http": "^2.0.0" + } + }, + "url-set-query": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/url-set-query/-/url-set-query-1.0.0.tgz", + "integrity": "sha1-AW6M/Xwg7gXK/neV6JK9BwL6ozk=", + "dev": true, + "optional": true + }, + "url-to-options": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/url-to-options/-/url-to-options-1.0.1.tgz", + "integrity": "sha1-FQWgOiiaSMvXpDTvuu7FBV9WM6k=", + "dev": true, + "optional": true + }, + "use": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", + "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", + "dev": true + }, + "utf-8-validate": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.4.tgz", + "integrity": "sha512-MEF05cPSq3AwJ2C7B7sHAA6i53vONoZbMGX8My5auEVm6W+dJ2Jd/TZPyGJ5CH42V2XtbI5FD28HeHeqlPzZ3Q==", + "dev": true, + "requires": { + "node-gyp-build": "^4.2.0" + } + }, + "utf8": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/utf8/-/utf8-3.0.0.tgz", + "integrity": "sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ==", + "dev": true, + "optional": true + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "util.promisify": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/util.promisify/-/util.promisify-1.1.1.tgz", + "integrity": "sha512-/s3UsZUrIfa6xDhr7zZhnE9SLQ5RIXyYfiVnMMyMDzOc8WhWN4Nbh36H842OyurKbCDAesZOJaVyvmSl6fhGQw==", + "dev": true, + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "for-each": "^0.3.3", + "has-symbols": "^1.0.1", + "object.getownpropertydescriptors": "^2.1.1" + } + }, + "utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=", + "dev": true, + "optional": true + }, + "uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "dev": true + }, + "varint": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/varint/-/varint-5.0.2.tgz", + "integrity": "sha512-lKxKYG6H03yCZUpAGOPOsMcGxd1RHCu1iKvEHYDPmTyq2HueGhD73ssNBqqQWfvYs04G9iUFRvmAVLW20Jw6ow==", + "dev": true, + "optional": true + }, + "vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=", + "dev": true, + "optional": true + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, + "web3": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/web3/-/web3-1.2.11.tgz", + "integrity": "sha512-mjQ8HeU41G6hgOYm1pmeH0mRAeNKJGnJEUzDMoerkpw7QUQT4exVREgF1MYPvL/z6vAshOXei25LE/t/Bxl8yQ==", + "dev": true, + "optional": true, + "requires": { + "web3-bzz": "1.2.11", + "web3-core": "1.2.11", + "web3-eth": "1.2.11", + "web3-eth-personal": "1.2.11", + "web3-net": "1.2.11", + "web3-shh": "1.2.11", + "web3-utils": "1.2.11" + } + }, + "web3-bzz": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/web3-bzz/-/web3-bzz-1.2.11.tgz", + "integrity": "sha512-XGpWUEElGypBjeFyUhTkiPXFbDVD6Nr/S5jznE3t8cWUA0FxRf1n3n/NuIZeb0H9RkN2Ctd/jNma/k8XGa3YKg==", + "dev": true, + "optional": true, + "requires": { + "@types/node": "^12.12.6", + "got": "9.6.0", + "swarm-js": "^0.1.40", + "underscore": "1.9.1" + }, + "dependencies": { + "@types/node": { + "version": "12.19.12", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.19.12.tgz", + "integrity": "sha512-UwfL2uIU9arX/+/PRcIkT08/iBadGN2z6ExOROA2Dh5mAuWTBj6iJbQX4nekiV5H8cTrEG569LeX+HRco9Cbxw==", + "dev": true, + "optional": true + } + } + }, + "web3-core": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/web3-core/-/web3-core-1.2.11.tgz", + "integrity": "sha512-CN7MEYOY5ryo5iVleIWRE3a3cZqVaLlIbIzDPsvQRUfzYnvzZQRZBm9Mq+ttDi2STOOzc1MKylspz/o3yq/LjQ==", + "dev": true, + "optional": true, + "requires": { + "@types/bn.js": "^4.11.5", + "@types/node": "^12.12.6", + "bignumber.js": "^9.0.0", + "web3-core-helpers": "1.2.11", + "web3-core-method": "1.2.11", + "web3-core-requestmanager": "1.2.11", + "web3-utils": "1.2.11" + }, + "dependencies": { + "@types/node": { + "version": "12.19.12", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.19.12.tgz", + "integrity": "sha512-UwfL2uIU9arX/+/PRcIkT08/iBadGN2z6ExOROA2Dh5mAuWTBj6iJbQX4nekiV5H8cTrEG569LeX+HRco9Cbxw==", + "dev": true, + "optional": true + } + } + }, + "web3-core-helpers": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/web3-core-helpers/-/web3-core-helpers-1.2.11.tgz", + "integrity": "sha512-PEPoAoZd5ME7UfbnCZBdzIerpe74GEvlwT4AjOmHeCVZoIFk7EqvOZDejJHt+feJA6kMVTdd0xzRNN295UhC1A==", + "dev": true, + "optional": true, + "requires": { + "underscore": "1.9.1", + "web3-eth-iban": "1.2.11", + "web3-utils": "1.2.11" + } + }, + "web3-core-method": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/web3-core-method/-/web3-core-method-1.2.11.tgz", + "integrity": "sha512-ff0q76Cde94HAxLDZ6DbdmKniYCQVtvuaYh+rtOUMB6kssa5FX0q3vPmixi7NPooFnbKmmZCM6NvXg4IreTPIw==", + "dev": true, + "optional": true, + "requires": { + "@ethersproject/transactions": "^5.0.0-beta.135", + "underscore": "1.9.1", + "web3-core-helpers": "1.2.11", + "web3-core-promievent": "1.2.11", + "web3-core-subscriptions": "1.2.11", + "web3-utils": "1.2.11" + } + }, + "web3-core-promievent": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/web3-core-promievent/-/web3-core-promievent-1.2.11.tgz", + "integrity": "sha512-il4McoDa/Ox9Agh4kyfQ8Ak/9ABYpnF8poBLL33R/EnxLsJOGQG2nZhkJa3I067hocrPSjEdlPt/0bHXsln4qA==", + "dev": true, + "optional": true, + "requires": { + "eventemitter3": "4.0.4" + } + }, + "web3-core-requestmanager": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/web3-core-requestmanager/-/web3-core-requestmanager-1.2.11.tgz", + "integrity": "sha512-oFhBtLfOiIbmfl6T6gYjjj9igOvtyxJ+fjS+byRxiwFJyJ5BQOz4/9/17gWR1Cq74paTlI7vDGxYfuvfE/mKvA==", + "dev": true, + "optional": true, + "requires": { + "underscore": "1.9.1", + "web3-core-helpers": "1.2.11", + "web3-providers-http": "1.2.11", + "web3-providers-ipc": "1.2.11", + "web3-providers-ws": "1.2.11" + } + }, + "web3-core-subscriptions": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/web3-core-subscriptions/-/web3-core-subscriptions-1.2.11.tgz", + "integrity": "sha512-qEF/OVqkCvQ7MPs1JylIZCZkin0aKK9lDxpAtQ1F8niEDGFqn7DT8E/vzbIa0GsOjL2fZjDhWJsaW+BSoAW1gg==", + "dev": true, + "optional": true, + "requires": { + "eventemitter3": "4.0.4", + "underscore": "1.9.1", + "web3-core-helpers": "1.2.11" + } + }, + "web3-eth": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/web3-eth/-/web3-eth-1.2.11.tgz", + "integrity": "sha512-REvxW1wJ58AgHPcXPJOL49d1K/dPmuw4LjPLBPStOVkQjzDTVmJEIsiLwn2YeuNDd4pfakBwT8L3bz1G1/wVsQ==", + "dev": true, + "optional": true, + "requires": { + "underscore": "1.9.1", + "web3-core": "1.2.11", + "web3-core-helpers": "1.2.11", + "web3-core-method": "1.2.11", + "web3-core-subscriptions": "1.2.11", + "web3-eth-abi": "1.2.11", + "web3-eth-accounts": "1.2.11", + "web3-eth-contract": "1.2.11", + "web3-eth-ens": "1.2.11", + "web3-eth-iban": "1.2.11", + "web3-eth-personal": "1.2.11", + "web3-net": "1.2.11", + "web3-utils": "1.2.11" + } + }, + "web3-eth-abi": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.2.11.tgz", + "integrity": "sha512-PkRYc0+MjuLSgg03QVWqWlQivJqRwKItKtEpRUaxUAeLE7i/uU39gmzm2keHGcQXo3POXAbOnMqkDvOep89Crg==", + "dev": true, + "optional": true, + "requires": { + "@ethersproject/abi": "5.0.0-beta.153", + "underscore": "1.9.1", + "web3-utils": "1.2.11" + } + }, + "web3-eth-accounts": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/web3-eth-accounts/-/web3-eth-accounts-1.2.11.tgz", + "integrity": "sha512-6FwPqEpCfKIh3nSSGeo3uBm2iFSnFJDfwL3oS9pyegRBXNsGRVpgiW63yhNzL0796StsvjHWwQnQHsZNxWAkGw==", + "dev": true, + "optional": true, + "requires": { + "crypto-browserify": "3.12.0", + "eth-lib": "0.2.8", + "ethereumjs-common": "^1.3.2", + "ethereumjs-tx": "^2.1.1", + "scrypt-js": "^3.0.1", + "underscore": "1.9.1", + "uuid": "3.3.2", + "web3-core": "1.2.11", + "web3-core-helpers": "1.2.11", + "web3-core-method": "1.2.11", + "web3-utils": "1.2.11" + }, + "dependencies": { + "eth-lib": { + "version": "0.2.8", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.8.tgz", + "integrity": "sha512-ArJ7x1WcWOlSpzdoTBX8vkwlkSQ85CjjifSZtV4co64vWxSV8geWfPI9x4SVYu3DSxnX4yWFVTtGL+j9DUFLNw==", + "dev": true, + "optional": true, + "requires": { + "bn.js": "^4.11.6", + "elliptic": "^6.4.0", + "xhr-request-promise": "^0.1.2" + } + }, + "uuid": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", + "dev": true, + "optional": true + } + } + }, + "web3-eth-contract": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/web3-eth-contract/-/web3-eth-contract-1.2.11.tgz", + "integrity": "sha512-MzYuI/Rq2o6gn7vCGcnQgco63isPNK5lMAan2E51AJLknjSLnOxwNY3gM8BcKoy4Z+v5Dv00a03Xuk78JowFow==", + "dev": true, + "optional": true, + "requires": { + "@types/bn.js": "^4.11.5", + "underscore": "1.9.1", + "web3-core": "1.2.11", + "web3-core-helpers": "1.2.11", + "web3-core-method": "1.2.11", + "web3-core-promievent": "1.2.11", + "web3-core-subscriptions": "1.2.11", + "web3-eth-abi": "1.2.11", + "web3-utils": "1.2.11" + } + }, + "web3-eth-ens": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/web3-eth-ens/-/web3-eth-ens-1.2.11.tgz", + "integrity": "sha512-dbW7dXP6HqT1EAPvnniZVnmw6TmQEKF6/1KgAxbo8iBBYrVTMDGFQUUnZ+C4VETGrwwaqtX4L9d/FrQhZ6SUiA==", + "dev": true, + "optional": true, + "requires": { + "content-hash": "^2.5.2", + "eth-ens-namehash": "2.0.8", + "underscore": "1.9.1", + "web3-core": "1.2.11", + "web3-core-helpers": "1.2.11", + "web3-core-promievent": "1.2.11", + "web3-eth-abi": "1.2.11", + "web3-eth-contract": "1.2.11", + "web3-utils": "1.2.11" + } + }, + "web3-eth-iban": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/web3-eth-iban/-/web3-eth-iban-1.2.11.tgz", + "integrity": "sha512-ozuVlZ5jwFC2hJY4+fH9pIcuH1xP0HEFhtWsR69u9uDIANHLPQQtWYmdj7xQ3p2YT4bQLq/axKhZi7EZVetmxQ==", + "dev": true, + "optional": true, + "requires": { + "bn.js": "^4.11.9", + "web3-utils": "1.2.11" + } + }, + "web3-eth-personal": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/web3-eth-personal/-/web3-eth-personal-1.2.11.tgz", + "integrity": "sha512-42IzUtKq9iHZ8K9VN0vAI50iSU9tOA1V7XU2BhF/tb7We2iKBVdkley2fg26TxlOcKNEHm7o6HRtiiFsVK4Ifw==", + "dev": true, + "optional": true, + "requires": { + "@types/node": "^12.12.6", + "web3-core": "1.2.11", + "web3-core-helpers": "1.2.11", + "web3-core-method": "1.2.11", + "web3-net": "1.2.11", + "web3-utils": "1.2.11" + }, + "dependencies": { + "@types/node": { + "version": "12.19.12", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.19.12.tgz", + "integrity": "sha512-UwfL2uIU9arX/+/PRcIkT08/iBadGN2z6ExOROA2Dh5mAuWTBj6iJbQX4nekiV5H8cTrEG569LeX+HRco9Cbxw==", + "dev": true, + "optional": true + } + } + }, + "web3-net": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/web3-net/-/web3-net-1.2.11.tgz", + "integrity": "sha512-sjrSDj0pTfZouR5BSTItCuZ5K/oZPVdVciPQ6981PPPIwJJkCMeVjD7I4zO3qDPCnBjBSbWvVnLdwqUBPtHxyg==", + "dev": true, + "optional": true, + "requires": { + "web3-core": "1.2.11", + "web3-core-method": "1.2.11", + "web3-utils": "1.2.11" + } + }, + "web3-provider-engine": { + "version": "14.2.1", + "resolved": "https://registry.npmjs.org/web3-provider-engine/-/web3-provider-engine-14.2.1.tgz", + "integrity": "sha512-iSv31h2qXkr9vrL6UZDm4leZMc32SjWJFGOp/D92JXfcEboCqraZyuExDkpxKw8ziTufXieNM7LSXNHzszYdJw==", + "dev": true, + "requires": { + "async": "^2.5.0", + "backoff": "^2.5.0", + "clone": "^2.0.0", + "cross-fetch": "^2.1.0", + "eth-block-tracker": "^3.0.0", + "eth-json-rpc-infura": "^3.1.0", + "eth-sig-util": "^1.4.2", + "ethereumjs-block": "^1.2.2", + "ethereumjs-tx": "^1.2.0", + "ethereumjs-util": "^5.1.5", + "ethereumjs-vm": "^2.3.4", + "json-rpc-error": "^2.0.0", + "json-stable-stringify": "^1.0.1", + "promise-to-callback": "^1.0.0", + "readable-stream": "^2.2.9", + "request": "^2.85.0", + "semaphore": "^1.0.3", + "ws": "^5.1.1", + "xhr": "^2.2.0", + "xtend": "^4.0.1" + }, + "dependencies": { + "abstract-leveldown": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.6.3.tgz", + "integrity": "sha512-2++wDf/DYqkPR3o5tbfdhF96EfMApo1GpPfzOsR/ZYXdkSmELlvOOEAl9iKkRsktMPHdGjO4rtkBpf2I7TiTeA==", + "dev": true, + "requires": { + "xtend": "~4.0.0" + } + }, + "deferred-leveldown": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-1.2.2.tgz", + "integrity": "sha512-uukrWD2bguRtXilKt6cAWKyoXrTSMo5m7crUdLfWQmu8kIm88w3QZoUL+6nhpfKVmhHANER6Re3sKoNoZ3IKMA==", + "dev": true, + "requires": { + "abstract-leveldown": "~2.6.0" + } + }, + "eth-sig-util": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/eth-sig-util/-/eth-sig-util-1.4.2.tgz", + "integrity": "sha1-jZWCAsftuq6Dlwf7pvCf8ydgYhA=", + "dev": true, + "requires": { + "ethereumjs-abi": "git+https://github.com/ethereumjs/ethereumjs-abi.git", + "ethereumjs-util": "^5.1.1" + } + }, + "ethereumjs-abi": { + "version": "git+https://github.com/ethereumjs/ethereumjs-abi.git#ee3994657fa7a427238e6ba92a84d0b529bbcde0", + "from": "git+https://github.com/ethereumjs/ethereumjs-abi.git", + "dev": true, + "requires": { + "bn.js": "^4.11.8", + "ethereumjs-util": "^6.0.0" + }, + "dependencies": { + "ethereumjs-util": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz", + "integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==", + "dev": true, + "requires": { + "@types/bn.js": "^4.11.3", + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "0.1.6", + "rlp": "^2.2.3" + } + } + } + }, + "ethereumjs-account": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/ethereumjs-account/-/ethereumjs-account-2.0.5.tgz", + "integrity": "sha512-bgDojnXGjhMwo6eXQC0bY6UK2liSFUSMwwylOmQvZbSl/D7NXQ3+vrGO46ZeOgjGfxXmgIeVNDIiHw7fNZM4VA==", + "dev": true, + "requires": { + "ethereumjs-util": "^5.0.0", + "rlp": "^2.0.0", + "safe-buffer": "^5.1.1" + } + }, + "ethereumjs-block": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/ethereumjs-block/-/ethereumjs-block-1.7.1.tgz", + "integrity": "sha512-B+sSdtqm78fmKkBq78/QLKJbu/4Ts4P2KFISdgcuZUPDm9x+N7qgBPIIFUGbaakQh8bzuquiRVbdmvPKqbILRg==", + "dev": true, + "requires": { + "async": "^2.0.1", + "ethereum-common": "0.2.0", + "ethereumjs-tx": "^1.2.2", + "ethereumjs-util": "^5.0.0", + "merkle-patricia-tree": "^2.1.2" + }, + "dependencies": { + "ethereum-common": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/ethereum-common/-/ethereum-common-0.2.0.tgz", + "integrity": "sha512-XOnAR/3rntJgbCdGhqdaLIxDLWKLmsZOGhHdBKadEr6gEnJLH52k93Ou+TUdFaPN3hJc3isBZBal3U/XZ15abA==", + "dev": true + } + } + }, + "ethereumjs-tx": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/ethereumjs-tx/-/ethereumjs-tx-1.3.7.tgz", + "integrity": "sha512-wvLMxzt1RPhAQ9Yi3/HKZTn0FZYpnsmQdbKYfUUpi4j1SEIcbkd9tndVjcPrufY3V7j2IebOpC00Zp2P/Ay2kA==", + "dev": true, + "requires": { + "ethereum-common": "^0.0.18", + "ethereumjs-util": "^5.0.0" + } + }, + "ethereumjs-util": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.1.tgz", + "integrity": "sha512-v3kT+7zdyCm1HIqWlLNrHGqHGLpGYIhjeHxQjnDXjLT2FyGJDsd3LWMYUo7pAFRrk86CR3nUJfhC81CCoJNNGQ==", + "dev": true, + "requires": { + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "^0.1.3", + "rlp": "^2.0.0", + "safe-buffer": "^5.1.1" + } + }, + "ethereumjs-vm": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/ethereumjs-vm/-/ethereumjs-vm-2.6.0.tgz", + "integrity": "sha512-r/XIUik/ynGbxS3y+mvGnbOKnuLo40V5Mj1J25+HEO63aWYREIqvWeRO/hnROlMBE5WoniQmPmhiaN0ctiHaXw==", + "dev": true, + "requires": { + "async": "^2.1.2", + "async-eventemitter": "^0.2.2", + "ethereumjs-account": "^2.0.3", + "ethereumjs-block": "~2.2.0", + "ethereumjs-common": "^1.1.0", + "ethereumjs-util": "^6.0.0", + "fake-merkle-patricia-tree": "^1.0.1", + "functional-red-black-tree": "^1.0.1", + "merkle-patricia-tree": "^2.3.2", + "rustbn.js": "~0.2.0", + "safe-buffer": "^5.1.1" + }, + "dependencies": { + "ethereumjs-block": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/ethereumjs-block/-/ethereumjs-block-2.2.2.tgz", + "integrity": "sha512-2p49ifhek3h2zeg/+da6XpdFR3GlqY3BIEiqxGF8j9aSRIgkb7M1Ky+yULBKJOu8PAZxfhsYA+HxUk2aCQp3vg==", + "dev": true, + "requires": { + "async": "^2.0.1", + "ethereumjs-common": "^1.5.0", + "ethereumjs-tx": "^2.1.1", + "ethereumjs-util": "^5.0.0", + "merkle-patricia-tree": "^2.1.2" + }, + "dependencies": { + "ethereumjs-util": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.1.tgz", + "integrity": "sha512-v3kT+7zdyCm1HIqWlLNrHGqHGLpGYIhjeHxQjnDXjLT2FyGJDsd3LWMYUo7pAFRrk86CR3nUJfhC81CCoJNNGQ==", + "dev": true, + "requires": { + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "^0.1.3", + "rlp": "^2.0.0", + "safe-buffer": "^5.1.1" + } + } + } + }, + "ethereumjs-tx": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ethereumjs-tx/-/ethereumjs-tx-2.1.2.tgz", + "integrity": "sha512-zZEK1onCeiORb0wyCXUvg94Ve5It/K6GD1K+26KfFKodiBiS6d9lfCXlUKGBBdQ+bv7Day+JK0tj1K+BeNFRAw==", + "dev": true, + "requires": { + "ethereumjs-common": "^1.5.0", + "ethereumjs-util": "^6.0.0" + } + }, + "ethereumjs-util": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz", + "integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==", + "dev": true, + "requires": { + "@types/bn.js": "^4.11.3", + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "0.1.6", + "rlp": "^2.2.3" + } + } + } + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "level-codec": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-7.0.1.tgz", + "integrity": "sha512-Ua/R9B9r3RasXdRmOtd+t9TCOEIIlts+TN/7XTT2unhDaL6sJn83S3rUyljbr6lVtw49N3/yA0HHjpV6Kzb2aQ==", + "dev": true + }, + "level-errors": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-1.0.5.tgz", + "integrity": "sha512-/cLUpQduF6bNrWuAC4pwtUKA5t669pCsCi2XbmojG2tFeOr9j6ShtdDCtFFQO1DRt+EVZhx9gPzP9G2bUaG4ig==", + "dev": true, + "requires": { + "errno": "~0.1.1" + } + }, + "level-iterator-stream": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-1.3.1.tgz", + "integrity": "sha1-5Dt4sagUPm+pek9IXrjqUwNS8u0=", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "level-errors": "^1.0.3", + "readable-stream": "^1.0.33", + "xtend": "^4.0.0" + }, + "dependencies": { + "readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + } + } + }, + "level-ws": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/level-ws/-/level-ws-0.0.0.tgz", + "integrity": "sha1-Ny5RIXeSSgBCSwtDrvK7QkltIos=", + "dev": true, + "requires": { + "readable-stream": "~1.0.15", + "xtend": "~2.1.1" + }, + "dependencies": { + "readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "xtend": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz", + "integrity": "sha1-bv7MKk2tjmlixJAbM3znuoe10os=", + "dev": true, + "requires": { + "object-keys": "~0.4.0" + } + } + } + }, + "levelup": { + "version": "1.3.9", + "resolved": "https://registry.npmjs.org/levelup/-/levelup-1.3.9.tgz", + "integrity": "sha512-VVGHfKIlmw8w1XqpGOAGwq6sZm2WwWLmlDcULkKWQXEA5EopA8OBNJ2Ck2v6bdk8HeEZSbCSEgzXadyQFm76sQ==", + "dev": true, + "requires": { + "deferred-leveldown": "~1.2.1", + "level-codec": "~7.0.0", + "level-errors": "~1.0.3", + "level-iterator-stream": "~1.3.0", + "prr": "~1.0.1", + "semver": "~5.4.1", + "xtend": "~4.0.0" + } + }, + "ltgt": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ltgt/-/ltgt-2.2.1.tgz", + "integrity": "sha1-81ypHEk/e3PaDgdJUwTxezH4fuU=", + "dev": true + }, + "memdown": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/memdown/-/memdown-1.4.1.tgz", + "integrity": "sha1-tOThkhdGZP+65BNhqlAPMRnv4hU=", + "dev": true, + "requires": { + "abstract-leveldown": "~2.7.1", + "functional-red-black-tree": "^1.0.1", + "immediate": "^3.2.3", + "inherits": "~2.0.1", + "ltgt": "~2.2.0", + "safe-buffer": "~5.1.1" + }, + "dependencies": { + "abstract-leveldown": { + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.7.2.tgz", + "integrity": "sha512-+OVvxH2rHVEhWLdbudP6p0+dNMXu8JA1CbhP19T8paTYAcX7oJ4OVjT+ZUVpv7mITxXHqDMej+GdqXBmXkw09w==", + "dev": true, + "requires": { + "xtend": "~4.0.0" + } + } + } + }, + "merkle-patricia-tree": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-2.3.2.tgz", + "integrity": "sha512-81PW5m8oz/pz3GvsAwbauj7Y00rqm81Tzad77tHBwU7pIAtN+TJnMSOJhxBKflSVYhptMMb9RskhqHqrSm1V+g==", + "dev": true, + "requires": { + "async": "^1.4.2", + "ethereumjs-util": "^5.0.0", + "level-ws": "0.0.0", + "levelup": "^1.2.1", + "memdown": "^1.0.0", + "readable-stream": "^2.0.0", + "rlp": "^2.0.0", + "semaphore": ">=1.0.1" + }, + "dependencies": { + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", + "dev": true + } + } + }, + "object-keys": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-0.4.0.tgz", + "integrity": "sha1-KKaq50KN0sOpLz2V8hM13SBOAzY=", + "dev": true + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "semver": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", + "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==", + "dev": true + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + }, + "ws": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/ws/-/ws-5.2.2.tgz", + "integrity": "sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA==", + "dev": true, + "requires": { + "async-limiter": "~1.0.0" + } + } + } + }, + "web3-providers-http": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/web3-providers-http/-/web3-providers-http-1.2.11.tgz", + "integrity": "sha512-psh4hYGb1+ijWywfwpB2cvvOIMISlR44F/rJtYkRmQ5jMvG4FOCPlQJPiHQZo+2cc3HbktvvSJzIhkWQJdmvrA==", + "dev": true, + "optional": true, + "requires": { + "web3-core-helpers": "1.2.11", + "xhr2-cookies": "1.1.0" + } + }, + "web3-providers-ipc": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/web3-providers-ipc/-/web3-providers-ipc-1.2.11.tgz", + "integrity": "sha512-yhc7Y/k8hBV/KlELxynWjJDzmgDEDjIjBzXK+e0rHBsYEhdCNdIH5Psa456c+l0qTEU2YzycF8VAjYpWfPnBpQ==", + "dev": true, + "optional": true, + "requires": { + "oboe": "2.1.4", + "underscore": "1.9.1", + "web3-core-helpers": "1.2.11" + } + }, + "web3-providers-ws": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/web3-providers-ws/-/web3-providers-ws-1.2.11.tgz", + "integrity": "sha512-ZxnjIY1Er8Ty+cE4migzr43zA/+72AF1myzsLaU5eVgdsfV7Jqx7Dix1hbevNZDKFlSoEyq/3j/jYalh3So1Zg==", + "dev": true, + "optional": true, + "requires": { + "eventemitter3": "4.0.4", + "underscore": "1.9.1", + "web3-core-helpers": "1.2.11", + "websocket": "^1.0.31" + } + }, + "web3-shh": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/web3-shh/-/web3-shh-1.2.11.tgz", + "integrity": "sha512-B3OrO3oG1L+bv3E1sTwCx66injW1A8hhwpknDUbV+sw3fehFazA06z9SGXUefuFI1kVs4q2vRi0n4oCcI4dZDg==", + "dev": true, + "optional": true, + "requires": { + "web3-core": "1.2.11", + "web3-core-method": "1.2.11", + "web3-core-subscriptions": "1.2.11", + "web3-net": "1.2.11" + } + }, + "web3-utils": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.11.tgz", + "integrity": "sha512-3Tq09izhD+ThqHEaWYX4VOT7dNPdZiO+c/1QMA0s5X2lDFKK/xHJb7cyTRRVzN2LvlHbR7baS1tmQhSua51TcQ==", + "dev": true, + "optional": true, + "requires": { + "bn.js": "^4.11.9", + "eth-lib": "0.2.8", + "ethereum-bloom-filters": "^1.0.6", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randombytes": "^2.1.0", + "underscore": "1.9.1", + "utf8": "3.0.0" + }, + "dependencies": { + "eth-lib": { + "version": "0.2.8", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.8.tgz", + "integrity": "sha512-ArJ7x1WcWOlSpzdoTBX8vkwlkSQ85CjjifSZtV4co64vWxSV8geWfPI9x4SVYu3DSxnX4yWFVTtGL+j9DUFLNw==", + "dev": true, + "optional": true, + "requires": { + "bn.js": "^4.11.6", + "elliptic": "^6.4.0", + "xhr-request-promise": "^0.1.2" + } + } + } + }, + "websocket": { + "version": "1.0.32", + "resolved": "https://registry.npmjs.org/websocket/-/websocket-1.0.32.tgz", + "integrity": "sha512-i4yhcllSP4wrpoPMU2N0TQ/q0O94LRG/eUQjEAamRltjQ1oT1PFFKOG4i877OlJgCG8rw6LrrowJp+TYCEWF7Q==", + "dev": true, + "requires": { + "bufferutil": "^4.0.1", + "debug": "^2.2.0", + "es5-ext": "^0.10.50", + "typedarray-to-buffer": "^3.1.5", + "utf-8-validate": "^5.0.2", + "yaeti": "^0.0.6" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "whatwg-fetch": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz", + "integrity": "sha512-dcQ1GWpOD/eEQ97k66aiEVpNnapVj90/+R+SXTPYGHpYBBypfKJEQjLrvMZ7YXbKm21gXd4NcuxUTjiv1YtLng==", + "dev": true + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "ws": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/ws/-/ws-3.3.3.tgz", + "integrity": "sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA==", + "dev": true, + "optional": true, + "requires": { + "async-limiter": "~1.0.0", + "safe-buffer": "~5.1.0", + "ultron": "~1.1.0" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true, + "optional": true + } + } + }, + "xhr": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/xhr/-/xhr-2.6.0.tgz", + "integrity": "sha512-/eCGLb5rxjx5e3mF1A7s+pLlR6CGyqWN91fv1JgER5mVWg1MZmlhBvy9kjcsOdRk8RrIujotWyJamfyrp+WIcA==", + "dev": true, + "requires": { + "global": "~4.4.0", + "is-function": "^1.0.1", + "parse-headers": "^2.0.0", + "xtend": "^4.0.0" + } + }, + "xhr-request": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/xhr-request/-/xhr-request-1.1.0.tgz", + "integrity": "sha512-Y7qzEaR3FDtL3fP30k9wO/e+FBnBByZeybKOhASsGP30NIkRAAkKD/sCnLvgEfAIEC1rcmK7YG8f4oEnIrrWzA==", + "dev": true, + "optional": true, + "requires": { + "buffer-to-arraybuffer": "^0.0.5", + "object-assign": "^4.1.1", + "query-string": "^5.0.1", + "simple-get": "^2.7.0", + "timed-out": "^4.0.1", + "url-set-query": "^1.0.0", + "xhr": "^2.0.4" + } + }, + "xhr-request-promise": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/xhr-request-promise/-/xhr-request-promise-0.1.3.tgz", + "integrity": "sha512-YUBytBsuwgitWtdRzXDDkWAXzhdGB8bYm0sSzMPZT7Z2MBjMSTHFsyCT1yCRATY+XC69DUrQraRAEgcoCRaIPg==", + "dev": true, + "optional": true, + "requires": { + "xhr-request": "^1.1.0" + } + }, + "xhr2-cookies": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/xhr2-cookies/-/xhr2-cookies-1.1.0.tgz", + "integrity": "sha1-fXdEnQmZGX8VXLc7I99yUF7YnUg=", + "dev": true, + "optional": true, + "requires": { + "cookiejar": "^2.1.1" + } + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dev": true + }, + "yaeti": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/yaeti/-/yaeti-0.0.6.tgz", + "integrity": "sha1-8m9ITXJoTPQr7ft2lwqhYI+/lXc=", + "dev": true + }, + "yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true + } + } + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true + }, + "get-func-name": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", + "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", + "dev": true + }, + "get-intrinsic": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", + "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", + "dev": true, + "requires": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1" + } + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0" + } + }, + "glob": { + "version": "7.1.7", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", + "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "global": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/global/-/global-4.4.0.tgz", + "integrity": "sha512-wv/LAoHdRE3BeTGz53FAamhGlPLhlssK45usmGFThIi4XqnBmjKQ16u+RNbP7WvigRZDxUsM0J3gcQ5yicaL0w==", + "dev": true, + "requires": { + "min-document": "^2.19.0", + "process": "^0.11.10" + } + }, + "graceful-fs": { + "version": "4.2.6", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz", + "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==", + "dev": true + }, + "growl": { + "version": "1.10.5", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", + "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", + "dev": true + }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", + "dev": true + }, + "har-validator": { + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", + "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", + "dev": true, + "requires": { + "ajv": "^6.12.3", + "har-schema": "^2.0.0" + } + }, + "hardhat": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.4.3.tgz", + "integrity": "sha512-xgbnhEnmaKau8xT6wPJlzoyMLAZyxQoElACQQCyEeAY1DURpZbYwjIQUywmL/ZNv3QEl38Yqu/n8mPOc2HXyGA==", + "dev": true, + "requires": { + "@ethereumjs/block": "^3.4.0", + "@ethereumjs/blockchain": "^5.4.0", + "@ethereumjs/common": "^2.4.0", + "@ethereumjs/tx": "^3.3.0", + "@ethereumjs/vm": "^5.5.0", + "@ethersproject/abi": "^5.1.2", + "@sentry/node": "^5.18.1", + "@solidity-parser/parser": "^0.11.0", + "@types/bn.js": "^5.1.0", + "@types/lru-cache": "^5.1.0", + "abort-controller": "^3.0.0", + "adm-zip": "^0.4.16", + "ansi-escapes": "^4.3.0", + "chalk": "^2.4.2", + "chokidar": "^3.4.0", + "ci-info": "^2.0.0", + "debug": "^4.1.1", + "enquirer": "^2.3.0", + "env-paths": "^2.2.0", + "eth-sig-util": "^2.5.2", + "ethereum-cryptography": "^0.1.2", + "ethereumjs-abi": "^0.6.8", + "ethereumjs-util": "^7.1.0", + "find-up": "^2.1.0", + "fp-ts": "1.19.3", + "fs-extra": "^7.0.1", + "glob": "^7.1.3", + "https-proxy-agent": "^5.0.0", + "immutable": "^4.0.0-rc.12", + "io-ts": "1.10.4", + "lodash": "^4.17.11", + "merkle-patricia-tree": "^4.2.0", + "mnemonist": "^0.38.0", + "mocha": "^7.1.2", + "node-fetch": "^2.6.0", + "qs": "^6.7.0", + "raw-body": "^2.4.1", + "resolve": "1.17.0", + "semver": "^6.3.0", + "slash": "^3.0.0", + "solc": "0.7.3", + "source-map-support": "^0.5.13", + "stacktrace-parser": "^0.1.10", + "true-case-path": "^2.2.1", + "tsort": "0.0.1", + "uuid": "^3.3.2", + "ws": "^7.4.6" + } + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-bigints": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.1.tgz", + "integrity": "sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA==", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "has-symbols": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz", + "integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==", + "dev": true + }, + "hash-base": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", + "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", + "dev": true, + "requires": { + "inherits": "^2.0.4", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + } + }, + "hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "dev": true + }, + "hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "dev": true, + "requires": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "hosted-git-info": { + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", + "dev": true + }, + "http-errors": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.3.tgz", + "integrity": "sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw==", + "dev": true, + "requires": { + "depd": "~1.1.2", + "inherits": "2.0.4", + "setprototypeof": "1.1.1", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.0" + } + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + } + }, + "https-proxy-agent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", + "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==", + "dev": true, + "requires": { + "agent-base": "6", + "debug": "4" + } + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "idna-uts46-hx": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/idna-uts46-hx/-/idna-uts46-hx-2.3.1.tgz", + "integrity": "sha512-PWoF9Keq6laYdIRwwCdhTPl60xRqAloYNMQLiyUnG42VjT53oW07BXIRM+NK7eQjzXjAk2gUvX9caRxlnF9TAA==", + "dev": true, + "requires": { + "punycode": "2.1.0" + } + }, + "ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "dev": true + }, + "immediate": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.3.0.tgz", + "integrity": "sha512-HR7EVodfFUdQCTIeySw+WDRFJlPcLOJbXfwwZ7Oom6tjsvZ3bOkCDJHehQC3nxJrv7+f9XecwazynjU8e4Vw3Q==", + "dev": true + }, + "immutable": { + "version": "4.0.0-rc.14", + "resolved": "https://registry.npmjs.org/immutable/-/immutable-4.0.0-rc.14.tgz", + "integrity": "sha512-pfkvmRKJSoW7JFx0QeYlAmT+kNYvn5j0u7bnpNq4N2RCvHSTlLT208G8jgaquNe+Q8kCPHKOSpxJkyvLDpYq0w==", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "invert-kv": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", + "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", + "dev": true + }, + "io-ts": { + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/io-ts/-/io-ts-1.10.4.tgz", + "integrity": "sha512-b23PteSnYXSONJ6JQXRAlvJhuw8KOtkqa87W4wDtvMrud/DTJd5X+NpOOI+O/zZwVq6v0VLAaJ+1EDViKEuN9g==", + "dev": true, + "requires": { + "fp-ts": "^1.0.0" + } + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "is-bigint": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.2.tgz", + "integrity": "sha512-0JV5+SOCQkIdzjBK9buARcV804Ddu7A0Qet6sHi3FimE9ne6m4BGQZfRn+NZiXbBk4F4XmHfDZIipLj9pX8dSA==", + "dev": true + }, + "is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "requires": { + "binary-extensions": "^2.0.0" + } + }, + "is-boolean-object": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.1.tgz", + "integrity": "sha512-bXdQWkECBUIAcCkeH1unwJLIpZYaa5VvuygSyS/c2lf719mTKZDU5UdDRlpd01UjADgmW8RfqaP+mRaVPdr/Ng==", + "dev": true, + "requires": { + "call-bind": "^1.0.2" + } + }, + "is-buffer": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz", + "integrity": "sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==", + "dev": true + }, + "is-callable": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.3.tgz", + "integrity": "sha512-J1DcMe8UYTBSrKezuIUTUwjXsho29693unXM2YhJUTR2txK/eG47bvNa/wipPFmZFgr/N6f1GA66dv0mEyTIyQ==", + "dev": true + }, + "is-ci": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", + "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", + "dev": true, + "requires": { + "ci-info": "^2.0.0" + } + }, + "is-date-object": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.4.tgz", + "integrity": "sha512-/b4ZVsG7Z5XVtIxs/h9W8nvfLgSAyKYdtGWQLbqy6jA1icmgjf8WCoTKgeS4wy5tYaPePouzFMANbnj94c2Z+A==", + "dev": true + }, + "is-docker": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", + "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", + "dev": true + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "is-function": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-function/-/is-function-1.0.2.tgz", + "integrity": "sha512-lw7DUp0aWXYg+CBCN+JKkcE0Q2RayZnSvnZBlwgxHBQhqt5pZNVy4Ri7H9GmmXkdu7LUthszM+Tor1u/2iBcpQ==", + "dev": true + }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-hex-prefixed": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz", + "integrity": "sha1-fY035q135dEnFIkTxXPggtd39VQ=", + "dev": true + }, + "is-negative-zero": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.1.tgz", + "integrity": "sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w==", + "dev": true + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "is-number-object": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.5.tgz", + "integrity": "sha512-RU0lI/n95pMoUKu9v1BZP5MBcZuNSVJkMkAG2dJqC4z2GlkGUNeH68SuHuBKBD/XFe+LHZ+f9BKkLET60Niedw==", + "dev": true + }, + "is-regex": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.3.tgz", + "integrity": "sha512-qSVXFz28HM7y+IWX6vLCsexdlvzT1PJNFSBuaQLQ5o0IEw8UDYW6/2+eCMVyIsbM8CNLX2a/QWmSpyxYEHY7CQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "has-symbols": "^1.0.2" + } + }, + "is-string": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.6.tgz", + "integrity": "sha512-2gdzbKUuqtQ3lYNrUTQYoClPhm7oQu4UdpSZMp1/DGgkHBT8E2Z1l0yMdb6D4zNAxwDiMv8MdulKROJGNl0Q0w==", + "dev": true + }, + "is-symbol": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", + "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", + "dev": true, + "requires": { + "has-symbols": "^1.0.2" + } + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true + }, + "is-url": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/is-url/-/is-url-1.2.4.tgz", + "integrity": "sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww==", + "dev": true + }, + "is-utf8": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", + "dev": true + }, + "is-wsl": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", + "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", + "dev": true, + "requires": { + "is-docker": "^2.0.0" + } + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "dev": true + }, + "js-sha3": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.7.tgz", + "integrity": "sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc=", + "dev": true + }, + "js-yaml": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "dev": true + }, + "json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "dev": true + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "dev": true, + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + } + }, + "keccak": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.1.tgz", + "integrity": "sha512-epq90L9jlFWCW7+pQa6JOnKn2Xgl2mtI664seYR6MHskvI9agt7AnDqmAlp9TqU4/caMYbA08Hi5DMZAl5zdkA==", + "dev": true, + "requires": { + "node-addon-api": "^2.0.0", + "node-gyp-build": "^4.2.0" + } + }, + "klaw": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", + "integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.9" + } + }, + "klaw-sync": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/klaw-sync/-/klaw-sync-6.0.0.tgz", + "integrity": "sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.11" + } + }, + "lcid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", + "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", + "dev": true, + "requires": { + "invert-kv": "^1.0.0" + } + }, + "level-codec": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-9.0.2.tgz", + "integrity": "sha512-UyIwNb1lJBChJnGfjmO0OR+ezh2iVu1Kas3nvBS/BzGnx79dv6g7unpKIDNPMhfdTEGoc7mC8uAu51XEtX+FHQ==", + "dev": true, + "requires": { + "buffer": "^5.6.0" + } + }, + "level-concat-iterator": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/level-concat-iterator/-/level-concat-iterator-2.0.1.tgz", + "integrity": "sha512-OTKKOqeav2QWcERMJR7IS9CUo1sHnke2C0gkSmcR7QuEtFNLLzHQAvnMw8ykvEcv0Qtkg0p7FOwP1v9e5Smdcw==", + "dev": true + }, + "level-errors": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-2.0.1.tgz", + "integrity": "sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw==", + "dev": true, + "requires": { + "errno": "~0.1.1" + } + }, + "level-iterator-stream": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-4.0.2.tgz", + "integrity": "sha512-ZSthfEqzGSOMWoUGhTXdX9jv26d32XJuHz/5YnuHZzH6wldfWMOVwI9TBtKcya4BKTyTt3XVA0A3cF3q5CY30Q==", + "dev": true, + "requires": { + "inherits": "^2.0.4", + "readable-stream": "^3.4.0", + "xtend": "^4.0.2" + } + }, + "level-mem": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/level-mem/-/level-mem-5.0.1.tgz", + "integrity": "sha512-qd+qUJHXsGSFoHTziptAKXoLX87QjR7v2KMbqncDXPxQuCdsQlzmyX+gwrEHhlzn08vkf8TyipYyMmiC6Gobzg==", + "dev": true, + "requires": { + "level-packager": "^5.0.3", + "memdown": "^5.0.0" + } + }, + "level-packager": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/level-packager/-/level-packager-5.1.1.tgz", + "integrity": "sha512-HMwMaQPlTC1IlcwT3+swhqf/NUO+ZhXVz6TY1zZIIZlIR0YSn8GtAAWmIvKjNY16ZkEg/JcpAuQskxsXqC0yOQ==", + "dev": true, + "requires": { + "encoding-down": "^6.3.0", + "levelup": "^4.3.2" + } + }, + "level-supports": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/level-supports/-/level-supports-1.0.1.tgz", + "integrity": "sha512-rXM7GYnW8gsl1vedTJIbzOrRv85c/2uCMpiiCzO2fndd06U/kUXEEU9evYn4zFggBOg36IsBW8LzqIpETwwQzg==", + "dev": true, + "requires": { + "xtend": "^4.0.2" + } + }, + "level-ws": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/level-ws/-/level-ws-2.0.0.tgz", + "integrity": "sha512-1iv7VXx0G9ec1isqQZ7y5LmoZo/ewAsyDHNA8EFDW5hqH2Kqovm33nSFkSdnLLAK+I5FlT+lo5Cw9itGe+CpQA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "readable-stream": "^3.1.0", + "xtend": "^4.0.1" + } + }, + "levelup": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/levelup/-/levelup-4.4.0.tgz", + "integrity": "sha512-94++VFO3qN95cM/d6eBXvd894oJE0w3cInq9USsyQzzoJxmiYzPAocNcuGCPGGjoXqDVJcr3C1jzt1TSjyaiLQ==", + "dev": true, + "requires": { + "deferred-leveldown": "~5.3.0", + "level-errors": "~2.0.0", + "level-iterator-stream": "~4.0.0", + "level-supports": "~1.0.0", + "xtend": "~4.0.0" + } + }, + "load-json-file": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "strip-bom": "^2.0.0" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "lodash.assign": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz", + "integrity": "sha1-DZnzzNem0mHRm9rrkkUAXShYCOc=", + "dev": true + }, + "log-symbols": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-3.0.0.tgz", + "integrity": "sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ==", + "dev": true, + "requires": { + "chalk": "^2.4.2" + } + }, + "lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "requires": { + "yallist": "^3.0.2" + } + }, + "lru_map": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/lru_map/-/lru_map-0.3.3.tgz", + "integrity": "sha1-tcg1G5Rky9dQM1p5ZQoOwOVhGN0=", + "dev": true + }, + "ltgt": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ltgt/-/ltgt-2.2.1.tgz", + "integrity": "sha1-81ypHEk/e3PaDgdJUwTxezH4fuU=", + "dev": true + }, + "mcl-wasm": { + "version": "0.7.8", + "resolved": "https://registry.npmjs.org/mcl-wasm/-/mcl-wasm-0.7.8.tgz", + "integrity": "sha512-qNHlYO6wuEtSoH5A8TcZfCEHtw8gGPqF6hLZpQn2SVd/Mck0ELIKOkmj072D98S9B9CI/jZybTUC96q1P2/ZDw==", + "dev": true, + "requires": { + "typescript": "^4.3.4" + } + }, + "md5.js": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "dev": true, + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "memdown": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/memdown/-/memdown-5.1.0.tgz", + "integrity": "sha512-B3J+UizMRAlEArDjWHTMmadet+UKwHd3UjMgGBkZcKAxAYVPS9o0Yeiha4qvz7iGiL2Sb3igUft6p7nbFWctpw==", + "dev": true, + "requires": { + "abstract-leveldown": "~6.2.1", + "functional-red-black-tree": "~1.0.1", + "immediate": "~3.2.3", + "inherits": "~2.0.1", + "ltgt": "~2.2.0", + "safe-buffer": "~5.2.0" + }, + "dependencies": { + "abstract-leveldown": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz", + "integrity": "sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ==", + "dev": true, + "requires": { + "buffer": "^5.5.0", + "immediate": "^3.2.3", + "level-concat-iterator": "~2.0.0", + "level-supports": "~1.0.0", + "xtend": "~4.0.0" + } + }, + "immediate": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.2.3.tgz", + "integrity": "sha1-0UD6j2FGWb1lQSMwl92qwlzdmRw=", + "dev": true + } + } + }, + "memorystream": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", + "integrity": "sha1-htcJCzDORV1j+64S3aUaR93K+bI=", + "dev": true + }, + "merkle-patricia-tree": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-4.2.0.tgz", + "integrity": "sha512-0sBVXs7z1Q1/kxzWZ3nPnxSPiaHKF/f497UQzt9O7isRcS10tel9jM/4TivF6Jv7V1yFq4bWyoATxbDUOen5vQ==", + "dev": true, + "requires": { + "@types/levelup": "^4.3.0", + "ethereumjs-util": "^7.0.10", + "level-mem": "^5.0.1", + "level-ws": "^2.0.0", + "readable-stream": "^3.6.0", + "rlp": "^2.2.4", + "semaphore-async-await": "^1.5.1" + } + }, + "micromatch": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", + "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", + "dev": true, + "requires": { + "braces": "^3.0.1", + "picomatch": "^2.2.3" + } + }, + "miller-rabin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", + "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", + "dev": true, + "requires": { + "bn.js": "^4.0.0", + "brorand": "^1.0.1" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true + } + } + }, + "mime-db": { + "version": "1.48.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.48.0.tgz", + "integrity": "sha512-FM3QwxV+TnZYQ2aRqhlKBMHxk10lTbMt3bBkMAp54ddrNeVSfcQYOOKuGuy3Ddrm38I04If834fOUSq1yzslJQ==", + "dev": true + }, + "mime-types": { + "version": "2.1.31", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.31.tgz", + "integrity": "sha512-XGZnNzm3QvgKxa8dpzyhFTHmpP3l5YNusmne07VUOXxou9CqUqYa/HBy124RqtVh/O2pECas/MOcsDgpilPOPg==", + "dev": true, + "requires": { + "mime-db": "1.48.0" + } + }, + "mimic-response": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", + "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", + "dev": true + }, + "min-document": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/min-document/-/min-document-2.19.0.tgz", + "integrity": "sha1-e9KC4/WELtKVu3SM3Z8f+iyCRoU=", + "dev": true, + "requires": { + "dom-walk": "^0.1.0" + } + }, + "minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", + "dev": true + }, + "minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, + "mnemonist": { + "version": "0.38.3", + "resolved": "https://registry.npmjs.org/mnemonist/-/mnemonist-0.38.3.tgz", + "integrity": "sha512-2K9QYubXx/NAjv4VLq1d1Ly8pWNC5L3BrixtdkyTegXWJIqY+zLNDhhX/A+ZwWt70tB1S8H4BE8FLYEFyNoOBw==", + "dev": true, + "requires": { + "obliterator": "^1.6.1" + } + }, + "mocha": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-7.2.0.tgz", + "integrity": "sha512-O9CIypScywTVpNaRrCAgoUnJgozpIofjKUYmJhiCIJMiuYnLI6otcb1/kpW9/n/tJODHGZ7i8aLQoDVsMtOKQQ==", + "dev": true, + "requires": { + "ansi-colors": "3.2.3", + "browser-stdout": "1.3.1", + "chokidar": "3.3.0", + "debug": "3.2.6", + "diff": "3.5.0", + "escape-string-regexp": "1.0.5", + "find-up": "3.0.0", + "glob": "7.1.3", + "growl": "1.10.5", + "he": "1.2.0", + "js-yaml": "3.13.1", + "log-symbols": "3.0.0", + "minimatch": "3.0.4", + "mkdirp": "0.5.5", + "ms": "2.1.1", + "node-environment-flags": "1.0.6", + "object.assign": "4.1.0", + "strip-json-comments": "2.0.1", + "supports-color": "6.0.0", + "which": "1.3.1", + "wide-align": "1.1.3", + "yargs": "13.3.2", + "yargs-parser": "13.1.2", + "yargs-unparser": "1.6.0" + }, + "dependencies": { + "ansi-colors": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz", + "integrity": "sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw==", + "dev": true + }, + "chokidar": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.3.0.tgz", + "integrity": "sha512-dGmKLDdT3Gdl7fBUe8XK+gAtGmzy5Fn0XkkWQuYxGIgWVPPse2CxFA5mtrlD0TOHaHjEUqkWNyP1XdHoJES/4A==", + "dev": true, + "requires": { + "anymatch": "~3.1.1", + "braces": "~3.0.2", + "fsevents": "~2.1.1", + "glob-parent": "~5.1.0", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.2.0" + } + }, + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "fsevents": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", + "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", + "dev": true, + "optional": true + }, + "glob": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + }, + "object.assign": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", + "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "function-bind": "^1.1.1", + "has-symbols": "^1.0.0", + "object-keys": "^1.0.11" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "readdirp": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.2.0.tgz", + "integrity": "sha512-crk4Qu3pmXwgxdSgGhgA/eXiJAPQiX4GMOZZMXnqKxHX7TaoL+3gQVo/WeuAiogr07DpnfjIMpXXa+PAIvwPGQ==", + "dev": true, + "requires": { + "picomatch": "^2.0.4" + } + }, + "supports-color": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz", + "integrity": "sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, + "node-addon-api": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz", + "integrity": "sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==", + "dev": true + }, + "node-environment-flags": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/node-environment-flags/-/node-environment-flags-1.0.6.tgz", + "integrity": "sha512-5Evy2epuL+6TM0lCQGpFIj6KwiEsGh1SrHUhTbNX+sLbBtjidPZFAnVK9y5yU1+h//RitLbRHTIMyxQPtxMdHw==", + "dev": true, + "requires": { + "object.getownpropertydescriptors": "^2.0.3", + "semver": "^5.7.0" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "node-fetch": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", + "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==", + "dev": true + }, + "node-gyp-build": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.2.3.tgz", + "integrity": "sha512-MN6ZpzmfNCRM+3t57PTJHgHyw/h4OWnZ6mR8P5j/uZtqQr46RRuDE/P+g3n0YR/AiYXeWixZZzaip77gdICfRg==", + "dev": true + }, + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true + }, + "number-to-bn": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/number-to-bn/-/number-to-bn-1.7.0.tgz", + "integrity": "sha1-uzYjWS9+X54AMLGXe9QaDFP+HqA=", + "dev": true, + "requires": { + "bn.js": "4.11.6", + "strip-hex-prefix": "1.0.0" + }, + "dependencies": { + "bn.js": { + "version": "4.11.6", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", + "integrity": "sha1-UzRK2xRhehP26N0s4okF0cC6MhU=", + "dev": true + } + } + }, + "oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, + "object-inspect": { + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.10.3.tgz", + "integrity": "sha512-e5mCJlSH7poANfC8z8S9s9S2IN5/4Zb3aZ33f5s8YqoazCFzNLloLU8r5VCG+G7WoqLvAAZoVMcy3tp/3X0Plw==", + "dev": true + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true + }, + "object.assign": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", + "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "has-symbols": "^1.0.1", + "object-keys": "^1.1.1" + } + }, + "object.getownpropertydescriptors": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.2.tgz", + "integrity": "sha512-WtxeKSzfBjlzL+F9b7M7hewDzMwy+C8NRssHd1YrNlzHzIDrXcXiNOMrezdAEM4UXixgV+vvnyBeN7Rygl2ttQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.18.0-next.2" + } + }, + "obliterator": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/obliterator/-/obliterator-1.6.1.tgz", + "integrity": "sha512-9WXswnqINnnhOG/5SLimUlzuU1hFJUc8zkwyD59Sd+dPOMf05PmnYG/d6Q7HZ+KmgkZJa1PxRso6QdM3sTNHig==", + "dev": true + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "open": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/open/-/open-7.4.2.tgz", + "integrity": "sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q==", + "dev": true, + "requires": { + "is-docker": "^2.0.0", + "is-wsl": "^2.1.1" + } + }, + "os-locale": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", + "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", + "dev": true, + "requires": { + "lcid": "^1.0.0" + } + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, + "parse-headers": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/parse-headers/-/parse-headers-2.0.3.tgz", + "integrity": "sha512-QhhZ+DCCit2Coi2vmAKbq5RGTRcQUOE2+REgv8vdyu7MnYx2eZztegqtTx99TZ86GTIwqiy3+4nQTWZ2tgmdCA==", + "dev": true + }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "dev": true, + "requires": { + "error-ex": "^1.2.0" + } + }, + "patch-package": { + "version": "6.4.7", + "resolved": "https://registry.npmjs.org/patch-package/-/patch-package-6.4.7.tgz", + "integrity": "sha512-S0vh/ZEafZ17hbhgqdnpunKDfzHQibQizx9g8yEf5dcVk3KOflOfdufRXQX8CSEkyOQwuM/bNz1GwKvFj54kaQ==", + "dev": true, + "requires": { + "@yarnpkg/lockfile": "^1.1.0", + "chalk": "^2.4.2", + "cross-spawn": "^6.0.5", + "find-yarn-workspace-root": "^2.0.0", + "fs-extra": "^7.0.1", + "is-ci": "^2.0.0", + "klaw-sync": "^6.0.0", + "minimist": "^1.2.0", + "open": "^7.4.2", + "rimraf": "^2.6.3", + "semver": "^5.6.0", + "slash": "^2.0.0", + "tmp": "^0.0.33" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, + "slash": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", + "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", + "dev": true + } + } + }, + "path-browserify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", + "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", + "dev": true + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, + "path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "path-type": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", + "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "pathval": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", + "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "dev": true + }, + "pbkdf2": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz", + "integrity": "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==", + "dev": true, + "requires": { + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", + "dev": true + }, + "picomatch": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", + "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==", + "dev": true + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, + "requires": { + "pinkie": "^2.0.0" + } + }, + "postinstall-postinstall": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/postinstall-postinstall/-/postinstall-postinstall-2.1.0.tgz", + "integrity": "sha512-7hQX6ZlZXIoRiWNrbMQaLzUUfH+sSx39u8EJ9HYuDc1kLo9IXKWjM5RSquZN1ad5GnH8CGFM78fsAAQi3OKEEQ==", + "dev": true + }, + "prettier": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.3.2.tgz", + "integrity": "sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ==", + "dev": true + }, + "printj": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/printj/-/printj-1.1.2.tgz", + "integrity": "sha512-zA2SmoLaxZyArQTOPj5LXecR+RagfPSU5Kw1qP+jkWeNlrq+eJZyY2oS68SU1Z/7/myXM4lo9716laOFAVStCQ==", + "dev": true + }, + "process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", + "dev": true + }, + "prr": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", + "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=", + "dev": true + }, + "psl": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", + "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==", + "dev": true + }, + "punycode": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.0.tgz", + "integrity": "sha1-X4Y+3Im5bbCQdLrXlHvwkFbKTn0=", + "dev": true + }, + "qs": { + "version": "6.10.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.1.tgz", + "integrity": "sha512-M528Hph6wsSVOBiYUnGf+K/7w0hNshs/duGsNXPUCLH5XAqjEtiPGwNONLV0tBH8NoGb0mvD5JubnUTrujKDTg==", + "dev": true, + "requires": { + "side-channel": "^1.0.4" + } + }, + "query-string": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/query-string/-/query-string-5.1.1.tgz", + "integrity": "sha512-gjWOsm2SoGlgLEdAGt7a6slVOk9mGiXmPFMqrEhLQ68rhQuBnpfs3+EmlvqKyxnCo9/PPlF+9MtY02S1aFg+Jw==", + "dev": true, + "requires": { + "decode-uri-component": "^0.2.0", + "object-assign": "^4.1.0", + "strict-uri-encode": "^1.0.0" + } + }, + "querystring": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", + "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", + "dev": true + }, + "randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "requires": { + "safe-buffer": "^5.1.0" + } + }, + "raw-body": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.1.tgz", + "integrity": "sha512-9WmIKF6mkvA0SLmA2Knm9+qj89e+j1zqgyn8aXGd7+nAduPoqgI9lO57SAZNn/Byzo5P7JhXTyg9PzaJbH73bA==", + "dev": true, + "requires": { + "bytes": "3.1.0", + "http-errors": "1.7.3", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + } + }, + "read-pkg": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", + "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", + "dev": true, + "requires": { + "load-json-file": "^1.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^1.0.0" + } + }, + "read-pkg-up": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", + "dev": true, + "requires": { + "find-up": "^1.0.0", + "read-pkg": "^1.0.0" + }, + "dependencies": { + "find-up": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "dev": true, + "requires": { + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "path-exists": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "dev": true, + "requires": { + "pinkie-promise": "^2.0.0" + } + } + } + }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, + "readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "requires": { + "picomatch": "^2.2.1" + } + }, + "request": { + "version": "2.88.2", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", + "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", + "dev": true, + "requires": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.3", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.5.0", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + }, + "dependencies": { + "qs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", + "dev": true + } + } + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true + }, + "require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true + }, + "require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "dev": true + }, + "resolve": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + }, + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "dev": true, + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "rlp": { + "version": "2.2.6", + "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.2.6.tgz", + "integrity": "sha512-HAfAmL6SDYNWPUOJNrM500x4Thn4PZsEy5pijPh40U9WfNk0z15hUYzO9xVIMAdIHdFtD8CBDHd75Td1g36Mjg==", + "dev": true, + "requires": { + "bn.js": "^4.11.1" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true + } + } + }, + "rustbn.js": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/rustbn.js/-/rustbn.js-0.2.0.tgz", + "integrity": "sha512-4VlvkRUuCJvr2J6Y0ImW7NvTCriMi7ErOAqWk1y69vAdoNIzCF3yPmgeNzx+RQTLEDFq5sHfscn1MwHxP9hNfA==", + "dev": true + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "scrypt-js": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz", + "integrity": "sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==", + "dev": true + }, + "secp256k1": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.2.tgz", + "integrity": "sha512-UDar4sKvWAksIlfX3xIaQReADn+WFnHvbVujpcbr+9Sf/69odMwy2MUsz5CKLQgX9nsIyrjuxL2imVyoNHa3fg==", + "dev": true, + "requires": { + "elliptic": "^6.5.2", + "node-addon-api": "^2.0.0", + "node-gyp-build": "^4.2.0" + } + }, + "semaphore-async-await": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/semaphore-async-await/-/semaphore-async-await-1.5.1.tgz", + "integrity": "sha1-hXvvXjZEYBykuVcLh+nfXKEpdPo=", + "dev": true + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true + }, + "setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=", + "dev": true + }, + "setprototypeof": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", + "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==", + "dev": true + }, + "sha.js": { + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "side-channel": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "dev": true, + "requires": { + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" + } + }, + "simple-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", + "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", + "dev": true + }, + "simple-get": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-2.8.1.tgz", + "integrity": "sha512-lSSHRSw3mQNUGPAYRqo7xy9dhKmxFXIjLjp4KHpf99GEH2VH7C3AM+Qfx6du6jhfUi6Vm7XnbEVEf7Wb6N8jRw==", + "dev": true, + "requires": { + "decompress-response": "^3.3.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + }, + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true + }, + "solc": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/solc/-/solc-0.7.3.tgz", + "integrity": "sha512-GAsWNAjGzIDg7VxzP6mPjdurby3IkGCjQcM8GFYZT6RyaoUZKmMU6Y7YwG+tFGhv7dwZ8rmR4iwFDrrD99JwqA==", + "dev": true, + "requires": { + "command-exists": "^1.2.8", + "commander": "3.0.2", + "follow-redirects": "^1.12.1", + "fs-extra": "^0.30.0", + "js-sha3": "0.8.0", + "memorystream": "^0.3.1", + "require-from-string": "^2.0.0", + "semver": "^5.5.0", + "tmp": "0.0.33" + }, + "dependencies": { + "fs-extra": { + "version": "0.30.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", + "integrity": "sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^2.1.0", + "klaw": "^1.0.0", + "path-is-absolute": "^1.0.0", + "rimraf": "^2.2.8" + } + }, + "js-sha3": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", + "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==", + "dev": true + }, + "jsonfile": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", + "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "source-map-support": { + "version": "0.5.19", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", + "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "spdx-correct": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", + "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", + "dev": true, + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.9.tgz", + "integrity": "sha512-Ki212dKK4ogX+xDo4CtOZBVIwhsKBEfsEEcwmJfLQzirgc2jIWdzg40Unxz/HzEUqM1WFzVlQSMF9kZZ2HboLQ==", + "dev": true + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "sshpk": { + "version": "1.16.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", + "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", + "dev": true, + "requires": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + }, + "dependencies": { + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "dev": true + } + } + }, + "stacktrace-parser": { + "version": "0.1.10", + "resolved": "https://registry.npmjs.org/stacktrace-parser/-/stacktrace-parser-0.1.10.tgz", + "integrity": "sha512-KJP1OCML99+8fhOHxwwzyWrlUuVX5GQ0ZpJTd1DFXhdkrvg1szxfHhawXUZ3g9TkXORQd4/WG68jMlQZ2p8wlg==", + "dev": true, + "requires": { + "type-fest": "^0.7.1" + }, + "dependencies": { + "type-fest": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.7.1.tgz", + "integrity": "sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg==", + "dev": true + } + } + }, + "statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=", + "dev": true + }, + "strict-uri-encode": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz", + "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=", + "dev": true + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "string.prototype.trimend": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz", + "integrity": "sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3" + } + }, + "string.prototype.trimstart": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz", + "integrity": "sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3" + } + }, + "string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dev": true, + "requires": { + "safe-buffer": "~5.2.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + }, + "strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "dev": true, + "requires": { + "is-utf8": "^0.2.0" + } + }, + "strip-hex-prefix": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz", + "integrity": "sha1-DF8VX+8RUTczd96du1iNoFUA428=", + "dev": true, + "requires": { + "is-hex-prefixed": "1.0.0" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "test-value": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/test-value/-/test-value-2.1.0.tgz", + "integrity": "sha1-Edpv9nDzRxpztiXKTz/c97t0gpE=", + "dev": true, + "requires": { + "array-back": "^1.0.3", + "typical": "^2.6.0" + }, + "dependencies": { + "array-back": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-1.0.4.tgz", + "integrity": "sha1-ZEun8JX3/898Q7Xw3DnTwfA8Bjs=", + "dev": true, + "requires": { + "typical": "^2.6.0" + } + } + } + }, + "testrpc": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/testrpc/-/testrpc-0.0.1.tgz", + "integrity": "sha512-afH1hO+SQ/VPlmaLUFj2636QMeDvPCeQMc/9RBMW0IfjNe9gFD9Ra3ShqYkB7py0do1ZcCna/9acHyzTJ+GcNA==", + "dev": true + }, + "timed-out": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz", + "integrity": "sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8=", + "dev": true + }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "requires": { + "os-tmpdir": "~1.0.2" + } + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + }, + "toidentifier": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", + "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==", + "dev": true + }, + "tough-cookie": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", + "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", + "dev": true, + "requires": { + "psl": "^1.1.28", + "punycode": "^2.1.1" + }, + "dependencies": { + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + } + } + }, + "true-case-path": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/true-case-path/-/true-case-path-2.2.1.tgz", + "integrity": "sha512-0z3j8R7MCjy10kc/g+qg7Ln3alJTodw9aDuVWZa3uiWqfuBMKeAeP2ocWcxoyM3D73yz3Jt/Pu4qPr4wHSdB/Q==", + "dev": true + }, + "ts-essentials": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/ts-essentials/-/ts-essentials-1.0.4.tgz", + "integrity": "sha512-q3N1xS4vZpRouhYHDPwO0bDW3EZ6SK9CrrDHxi/D6BPReSjpVgWIOpLS2o0gSBZm+7q/wyKp6RVM1AeeW7uyfQ==", + "dev": true + }, + "ts-generator": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ts-generator/-/ts-generator-0.1.1.tgz", + "integrity": "sha512-N+ahhZxTLYu1HNTQetwWcx3so8hcYbkKBHTr4b4/YgObFTIKkOSSsaa+nal12w8mfrJAyzJfETXawbNjSfP2gQ==", + "dev": true, + "requires": { + "@types/mkdirp": "^0.5.2", + "@types/prettier": "^2.1.1", + "@types/resolve": "^0.0.8", + "chalk": "^2.4.1", + "glob": "^7.1.2", + "mkdirp": "^0.5.1", + "prettier": "^2.1.2", + "resolve": "^1.8.1", + "ts-essentials": "^1.0.0" + } + }, + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, + "tsort": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/tsort/-/tsort-0.0.1.tgz", + "integrity": "sha1-4igPXoF/i/QnVlf9D5rr1E9aJ4Y=", + "dev": true + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "dev": true, + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "tweetnacl": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", + "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==", + "dev": true + }, + "tweetnacl-util": { + "version": "0.15.1", + "resolved": "https://registry.npmjs.org/tweetnacl-util/-/tweetnacl-util-0.15.1.tgz", + "integrity": "sha512-RKJBIj8lySrShN4w6i/BonWp2Z/uxwC3h4y7xsRrpP59ZboCd0GpEVsOnMDYLMmKBpYhb5TgHzZXy7wTfYFBRw==", + "dev": true + }, + "type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true + }, + "type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "dev": true + }, + "typechain": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/typechain/-/typechain-3.0.0.tgz", + "integrity": "sha512-ft4KVmiN3zH4JUFu2WJBrwfHeDf772Tt2d8bssDTo/YcckKW2D+OwFrHXRC6hJvO3mHjFQTihoMV6fJOi0Hngg==", + "dev": true, + "requires": { + "command-line-args": "^4.0.7", + "debug": "^4.1.1", + "fs-extra": "^7.0.0", + "js-sha3": "^0.8.0", + "lodash": "^4.17.15", + "ts-essentials": "^6.0.3", + "ts-generator": "^0.1.1" + }, + "dependencies": { + "js-sha3": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", + "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==", + "dev": true + }, + "ts-essentials": { + "version": "6.0.7", + "resolved": "https://registry.npmjs.org/ts-essentials/-/ts-essentials-6.0.7.tgz", + "integrity": "sha512-2E4HIIj4tQJlIHuATRHayv0EfMGK3ris/GRk1E3CFnsZzeNV+hUmelbaTZHLtXaZppM5oLhHRtO04gINC4Jusw==", + "dev": true + } + } + }, + "typescript": { + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.3.5.tgz", + "integrity": "sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA==", + "dev": true + }, + "typical": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/typical/-/typical-2.6.1.tgz", + "integrity": "sha1-XAgOXWYcu+OCWdLnCjxyU+hziB0=", + "dev": true + }, + "unbox-primitive": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz", + "integrity": "sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1", + "has-bigints": "^1.0.1", + "has-symbols": "^1.0.2", + "which-boxed-primitive": "^1.0.2" + } + }, + "underscore": { + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.12.1.tgz", + "integrity": "sha512-hEQt0+ZLDVUMhebKxL4x1BTtDY7bavVofhZ9KZ4aI26X9SRaE+Y3m83XUL1UP2jn8ynjndwCCpEHdUG+9pP1Tw==", + "dev": true + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true + }, + "unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", + "dev": true + }, + "uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, + "url": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", + "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", + "dev": true, + "requires": { + "punycode": "1.3.2", + "querystring": "0.2.0" + }, + "dependencies": { + "punycode": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", + "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", + "dev": true + } + } + }, + "url-set-query": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/url-set-query/-/url-set-query-1.0.0.tgz", + "integrity": "sha1-AW6M/Xwg7gXK/neV6JK9BwL6ozk=", + "dev": true + }, + "utf8": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/utf8/-/utf8-3.0.0.tgz", + "integrity": "sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ==", + "dev": true + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "util.promisify": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/util.promisify/-/util.promisify-1.1.1.tgz", + "integrity": "sha512-/s3UsZUrIfa6xDhr7zZhnE9SLQ5RIXyYfiVnMMyMDzOc8WhWN4Nbh36H842OyurKbCDAesZOJaVyvmSl6fhGQw==", + "dev": true, + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "for-each": "^0.3.3", + "has-symbols": "^1.0.1", + "object.getownpropertydescriptors": "^2.1.1" + } + }, + "uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "dev": true + }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, + "web3-utils": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.4.0.tgz", + "integrity": "sha512-b8mEhwh/J928Xk+SQFjtqrR2EGPhpknWLcIt9aCpVPVRXiqjUGo/kpOHKz0azu9c6/onEJ9tWXZt0cVjmH0N5Q==", + "dev": true, + "requires": { + "bn.js": "^4.11.9", + "eth-lib": "0.2.8", + "ethereum-bloom-filters": "^1.0.6", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randombytes": "^2.1.0", + "underscore": "1.12.1", + "utf8": "3.0.0" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true + } + } + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "which-boxed-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", + "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", + "dev": true, + "requires": { + "is-bigint": "^1.0.1", + "is-boolean-object": "^1.1.0", + "is-number-object": "^1.0.4", + "is-string": "^1.0.5", + "is-symbol": "^1.0.3" + } + }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "dev": true + }, + "wide-align": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", + "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", + "dev": true, + "requires": { + "string-width": "^1.0.2 || 2" + } + }, + "window-size": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.2.0.tgz", + "integrity": "sha1-tDFbtCFKPXBY6+7okuE/ok2YsHU=", + "dev": true + }, + "wrap-ansi": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "ws": { + "version": "7.5.2", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.2.tgz", + "integrity": "sha512-lkF7AWRicoB9mAgjeKbGqVUekLnSNO4VjKVnuPHpQeOxZOErX6BPXwJk70nFslRCEEA8EVW7ZjKwXaP9N+1sKQ==", + "dev": true + }, + "xhr": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/xhr/-/xhr-2.6.0.tgz", + "integrity": "sha512-/eCGLb5rxjx5e3mF1A7s+pLlR6CGyqWN91fv1JgER5mVWg1MZmlhBvy9kjcsOdRk8RrIujotWyJamfyrp+WIcA==", + "dev": true, + "requires": { + "global": "~4.4.0", + "is-function": "^1.0.1", + "parse-headers": "^2.0.0", + "xtend": "^4.0.0" + } + }, + "xhr-request": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/xhr-request/-/xhr-request-1.1.0.tgz", + "integrity": "sha512-Y7qzEaR3FDtL3fP30k9wO/e+FBnBByZeybKOhASsGP30NIkRAAkKD/sCnLvgEfAIEC1rcmK7YG8f4oEnIrrWzA==", + "dev": true, + "requires": { + "buffer-to-arraybuffer": "^0.0.5", + "object-assign": "^4.1.1", + "query-string": "^5.0.1", + "simple-get": "^2.7.0", + "timed-out": "^4.0.1", + "url-set-query": "^1.0.0", + "xhr": "^2.0.4" + } + }, + "xhr-request-promise": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/xhr-request-promise/-/xhr-request-promise-0.1.3.tgz", + "integrity": "sha512-YUBytBsuwgitWtdRzXDDkWAXzhdGB8bYm0sSzMPZT7Z2MBjMSTHFsyCT1yCRATY+XC69DUrQraRAEgcoCRaIPg==", + "dev": true, + "requires": { + "xhr-request": "^1.1.0" + } + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dev": true + }, + "y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", + "dev": true + }, + "yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true + }, + "yargs": { + "version": "13.3.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", + "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", + "dev": true, + "requires": { + "cliui": "^5.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^13.1.2" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, + "yargs-parser": { + "version": "13.1.2", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", + "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + }, + "yargs-unparser": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.6.0.tgz", + "integrity": "sha512-W9tKgmSn0DpSatfri0nx52Joq5hVXgeLiqR/5G0sZNDoLZFOr/xjBUDcShCOGNsBnEMNo1KAMBkTej1Hm62HTw==", + "dev": true, + "requires": { + "flat": "^4.1.0", + "lodash": "^4.17.15", + "yargs": "^13.3.0" + } + } + } +} diff --git a/contracts/package.json b/contracts/package.json new file mode 100644 index 00000000..77ed89b8 --- /dev/null +++ b/contracts/package.json @@ -0,0 +1,21 @@ +{ + "name": "map", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "devDependencies": { + "@nomiclabs/hardhat-ethers": "^2.0.2", + "@nomiclabs/hardhat-waffle": "^2.0.1", + "chai": "^4.3.4", + "ethereum-waffle": "^3.4.0", + "ethers": "^5.4.1", + "hardhat": "^2.4.3", + "@openzeppelin/contracts": "^4.0.0" + } +} diff --git a/contracts/scripts/deploy.js b/contracts/scripts/deploy.js new file mode 100644 index 00000000..8bbbd8d6 --- /dev/null +++ b/contracts/scripts/deploy.js @@ -0,0 +1,25 @@ +async function main() { + + const [deployer] = await ethers.getSigners(); + + console.log( + "Deploying contracts with the account:", + await deployer.getAddress() + ); + + console.log("Account balance:", (await deployer.getBalance()).toString()); + + const Token = await ethers.getContractFactory("Token"); + const token = await Token.deploy(); + + await token.deployed(); + + console.log("Token address:", token.address); +} + +main() + .then(() => process.exit(0)) + .catch(error => { + console.error(error); + process.exit(1); + }); \ No newline at end of file diff --git a/contracts/scripts/deploy_ethereum.js b/contracts/scripts/deploy_ethereum.js new file mode 100644 index 00000000..c5acb285 --- /dev/null +++ b/contracts/scripts/deploy_ethereum.js @@ -0,0 +1,33 @@ +async function main() { + + const [deployer] = await ethers.getSigners(); + + console.log( + "Deploying contracts with the account:", + await deployer.getAddress() + ); + + console.log("Account balance:", (await deployer.getBalance()).toString()); + + const EthData = await ethers.getContractFactory("EthereumData"); + const eData = await EthData.deploy(); + await eData.deployed(); + console.log("EthData address:", eData.address); + + const EthStaking = await ethers.getContractFactory("EthereumStaking"); + //test + const eStaking = await EthStaking.deploy(eData.address,"0x07cc6bbe1ea85a39ee3fe359750a553a906fbf4e"); + await eStaking.deployed(); + console.log("EthStaking address:", eStaking.address); + + await eData.addManager(eStaking.address); + await eStaking.addManager("0x228F78fC398DB973B96eD666C92E78753b9466Eb") + +} + +main() + .then(() => process.exit(0)) + .catch(error => { + console.error(error); + process.exit(1); + }); \ No newline at end of file diff --git a/contracts/scripts/deploy_matic.js b/contracts/scripts/deploy_matic.js new file mode 100644 index 00000000..0998d323 --- /dev/null +++ b/contracts/scripts/deploy_matic.js @@ -0,0 +1,29 @@ +async function main() { + const [deployer] = await ethers.getSigners(); + console.log( + "Deploying contracts with the account:", + await deployer.getAddress() + ); + console.log("Account balance:", (await deployer.getBalance()).toString()); + + const MaticData = await ethers.getContractFactory("MaticData"); + const mData = await MaticData.deploy(); + await mData.deployed(); + console.log("MaticData address:", mData.address); + + const MaticStaking = await ethers.getContractFactory("MaticStaking"); + const mStaking = await MaticStaking.deploy(mData.address); + await mStaking.deployed(); + console.log("MaticStaking address:", mStaking.address); + + await mData.addManager(mStaking.address); + await mStaking.addManager("0x228F78fC398DB973B96eD666C92E78753b9466Eb"); + +} + +main() + .then(() => process.exit(0)) + .catch(error => { + console.error(error); + process.exit(1); + }); \ No newline at end of file diff --git a/contracts/scripts/pub.sh b/contracts/scripts/pub.sh new file mode 100755 index 00000000..63c95c51 --- /dev/null +++ b/contracts/scripts/pub.sh @@ -0,0 +1,2 @@ +npx hardhat run scripts/deploy_ethereum.js --network HecoTest +npx hardhat run scripts/deploy_matic.js --network MaticTest \ No newline at end of file diff --git a/contracts/scriptsmain/deploy.js b/contracts/scriptsmain/deploy.js new file mode 100644 index 00000000..8bbbd8d6 --- /dev/null +++ b/contracts/scriptsmain/deploy.js @@ -0,0 +1,25 @@ +async function main() { + + const [deployer] = await ethers.getSigners(); + + console.log( + "Deploying contracts with the account:", + await deployer.getAddress() + ); + + console.log("Account balance:", (await deployer.getBalance()).toString()); + + const Token = await ethers.getContractFactory("Token"); + const token = await Token.deploy(); + + await token.deployed(); + + console.log("Token address:", token.address); +} + +main() + .then(() => process.exit(0)) + .catch(error => { + console.error(error); + process.exit(1); + }); \ No newline at end of file diff --git a/contracts/scriptsmain/deploy_ethereum.js b/contracts/scriptsmain/deploy_ethereum.js new file mode 100644 index 00000000..19347458 --- /dev/null +++ b/contracts/scriptsmain/deploy_ethereum.js @@ -0,0 +1,32 @@ +async function main() { + + const [deployer] = await ethers.getSigners(); + + console.log( + "Deploying contracts with the account:", + await deployer.getAddress() + ); + + console.log("Account balance:", (await deployer.getBalance()).toString()); + + const EthData = await ethers.getContractFactory("EthereumData"); + const eData = await EthData.deploy(); + await eData.deployed(); + console.log("EthData address:", eData.address); + + const EthStaking = await ethers.getContractFactory("EthereumStaking"); + const eStaking = await EthStaking.deploy(eData.address,"0x9E976F211daea0D652912AB99b0Dc21a7fD728e4"); + await eStaking.deployed(); + console.log("EthStaking address:", eStaking.address); + + await eData.addManager(eStaking.address); + //await eStaking.addManager("0x200aee9ba7040d778922a763ce8a50948d61aff5"); + +} + +main() + .then(() => process.exit(0)) + .catch(error => { + console.error(error); + process.exit(1); + }); \ No newline at end of file diff --git a/contracts/scriptsmain/deploy_ethereum_next.js b/contracts/scriptsmain/deploy_ethereum_next.js new file mode 100644 index 00000000..1b142a1a --- /dev/null +++ b/contracts/scriptsmain/deploy_ethereum_next.js @@ -0,0 +1,31 @@ +async function main() { + const [deployer] = await ethers.getSigners(); + + console.log( + "Deploying contracts with the account:", + await deployer.getAddress() + ); + + console.log("Account balance:", (await deployer.getBalance()).toString()); + + // const EthData = await ethers.getContractFactory("EthereumData"); + // const eData = await EthData.deploy(); + // await eData.deployed(); + // console.log("EthData address:", eData.address); + + const EthStaking = await ethers.getContractFactory("EthereumStaking"); + const eStaking = await EthStaking.deploy("0x9c6190c02E30D0a8dB5F9F39C8B4d3AF513C5C16","0x9E976F211daea0D652912AB99b0Dc21a7fD728e4"); + await eStaking.deployed(); + console.log("EthStaking address:", eStaking.address); + + await eData.addManager(eStaking.address); + await eStaking.addManager("0x200aee9ba7040d778922a763ce8a50948d61aff5"); + +} + +main() + .then(() => process.exit(0)) + .catch(error => { + console.error(error); + process.exit(1); + }); \ No newline at end of file diff --git a/contracts/scriptsmain/deploy_matic.js b/contracts/scriptsmain/deploy_matic.js new file mode 100644 index 00000000..b6eb0634 --- /dev/null +++ b/contracts/scriptsmain/deploy_matic.js @@ -0,0 +1,30 @@ +async function main() { + const [deployer] = await ethers.getSigners(); + console.log( + "Deploying contracts with the account:", + await deployer.getAddress() + ); + console.log("Account balance:", (await deployer.getBalance()).toString()); + + const MaticData = await ethers.getContractFactory("MaticData"); + const mData = await MaticData.deploy(); + await mData.deployed(); + console.log("MaticData address:", mData.address); + + const MaticStaking = await ethers.getContractFactory("MaticStaking"); + const mStaking = await MaticStaking.deploy(mData.address); + await mStaking.deployed(); + console.log("MaticStaking address:", mStaking.address); + + await mData.addManager(mStaking.address); + //await mStaking.addManager("0x228F78fC398DB973B96eD666C92E78753b9466Eb"); + //await mStaking.addManager("0x200aee9ba7040d778922a763ce8a50948d61aff5"); + +} + +main() + .then(() => process.exit(0)) + .catch(error => { + console.error(error); + process.exit(1); + }); \ No newline at end of file diff --git a/contracts/scriptsmain/pub.sh b/contracts/scriptsmain/pub.sh new file mode 100755 index 00000000..ffe3e06b --- /dev/null +++ b/contracts/scriptsmain/pub.sh @@ -0,0 +1,2 @@ +npx hardhat run scriptsmain/deploy_ethereum.js --network Eth +npx hardhat run scriptsmain/deploy_matic.js --network Matic \ No newline at end of file diff --git a/contracts/test/test.js b/contracts/test/test.js new file mode 100644 index 00000000..af30a7b0 --- /dev/null +++ b/contracts/test/test.js @@ -0,0 +1,15 @@ +const { expect } = require("chai"); + +describe("Token contract", function() { + it("Deployment should assign the total supply of tokens to the owner", async function() { + const [owner] = await ethers.getSigners(); + + const EthData = await ethers.getContractFactory("EthData"); + + const hardhatEthData = await EthData.deploy(); + await hardhatEthData.deployed(); + + const info = await hardhatEthData.getUserInfo(owner.getAddress()); + console.log(hardhatEthData.address); + }); +}); \ No newline at end of file diff --git a/core/chain.go b/core/chain.go deleted file mode 100644 index 7bc3ae08..00000000 --- a/core/chain.go +++ /dev/null @@ -1,80 +0,0 @@ -package core - -import ( - "github.com/mapprotocol/compass/pkg/msg" - "math/big" - - "github.com/ethereum/go-ethereum/accounts/keystore" - - "github.com/ChainSafe/log15" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/mapprotocol/compass/internal/eth2" - "github.com/mapprotocol/compass/internal/klaytn" - "github.com/mapprotocol/compass/pkg/ethclient" -) - -type Chain interface { - Start() error // Start chain - SetRouter(Router) - Id() msg.ChainId - Name() string - Stop() - Conn() Connection -} - -type ChainConfig struct { - Name string // Human-readable chain name - Id msg.ChainId // ChainID - Endpoint string // url for rpc endpoint - Network string // - From string // address of key to use - KeystorePath string // Location of key files - NearKeystorePath string // Location of key files - Insecure bool // Indicated whether the test keyring should be used - BlockstorePath string // Location of blockstore - FreshStart bool // If true, blockstore is ignored at start. - LatestBlock bool // If true, overrides blockstore or latest block in config and starts from current block - Opts map[string]string // Per chain options - SkipError bool // Flag of Skip Error - Filter bool - FilterHost string - BtcHost string - ButterHost string -} - -type Connection interface { - Connect() error - Keypair() *keystore.Key - Opts() *bind.TransactOpts - CallOpts() *bind.CallOpts - LockAndUpdateOpts(bool) error - UnlockOpts() - Client() *ethclient.Client - EnsureHasBytecode(address common.Address) error - LatestBlock() (*big.Int, error) - WaitForBlock(block *big.Int, delay *big.Int) error - Close() -} - -type KConnection interface { - Connection - KClient() *klaytn.Client -} - -type Eth2Connection interface { - Connection - Eth2Client() *eth2.Client -} - -type CreateConn func(string, bool, *keystore.Key, log15.Logger, *big.Int, *big.Int, float64) Connection - -type Router interface { - Send(message msg.Message) error - Listen(id msg.ChainId, w Writer) -} - -type Listener interface { - Sync() error - SetRouter(r Router) -} diff --git a/core/core.go b/core/core.go deleted file mode 100644 index 6c95798e..00000000 --- a/core/core.go +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2021 Compass Systems -// SPDX-License-Identifier: LGPL-3.0-only - -package core - -import ( - "fmt" - "github.com/mapprotocol/compass/internal/mapprotocol" - "github.com/mapprotocol/compass/pkg/msg" - "os" - "os/signal" - "syscall" - - utilcore "github.com/ChainSafe/chainbridge-utils/core" - "github.com/ChainSafe/log15" -) - -type Core struct { - Registry []Chain - route *Route - log log15.Logger - sysErr <-chan error - role mapprotocol.Role -} - -func NewCore(sysErr <-chan error, mapcid msg.ChainId, role mapprotocol.Role) *Core { - return &Core{ - Registry: make([]Chain, 0), - route: NewRouter(log15.New("system", "router"), mapcid), - log: log15.New("system", "core"), - sysErr: sysErr, - role: role, - } -} - -// AddChain registers the chain in the Registry and calls Chain.SetRouter() -func (c *Core) AddChain(chain Chain) { - c.Registry = append(c.Registry, chain) - chain.SetRouter(c.route) -} - -// Start will call all registered chains' Start methods and block forever (or until signal is received) -func (c *Core) Start() { - for _, chain := range c.Registry { - err := chain.Start() - if err != nil { - c.log.Error("failed to start chain", "chain", chain.Id(), "err", err) - return - } - c.log.Info(fmt.Sprintf("Started %s chain", chain.Name())) - } - - sigc := make(chan os.Signal, 1) - signal.Notify(sigc, syscall.SIGINT, syscall.SIGTERM) - defer signal.Stop(sigc) - - // Block here and wait for a signal - select { - case err := <-c.sysErr: - c.log.Error("FATAL ERROR. Shutting down.", "err", err) - case <-sigc: - c.log.Warn("Interrupt received, shutting down now.") - } - - // Signal chains to shutdown - for _, chain := range c.Registry { - chain.Stop() - } -} - -func (c *Core) Errors() <-chan error { - return c.sysErr -} - -func (c *Core) ToUCoreRegistry() []utilcore.Chain { - ucRegistry := make([]utilcore.Chain, len(c.Registry)) - - for idx, reg := range c.Registry { - ucRegistry[idx] = reg.(utilcore.Chain) - } - return ucRegistry -} diff --git a/core/router.go b/core/router.go deleted file mode 100644 index 5222f772..00000000 --- a/core/router.go +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright 2021 Compass Systems -// SPDX-License-Identifier: LGPL-3.0-only - -package core - -import ( - "fmt" - "github.com/mapprotocol/compass/pkg/msg" - "sync" - - log "github.com/ChainSafe/log15" -) - -// Writer consumes a message and makes the requried on-chain interactions. -type Writer interface { - ResolveMessage(message msg.Message) bool -} - -// Route forwards messages from their source to their destination -type Route struct { - registry map[msg.ChainId]Writer - lock *sync.RWMutex - log log.Logger - mapcid msg.ChainId -} - -func NewRouter(log log.Logger, mapcid msg.ChainId) *Route { - return &Route{ - registry: make(map[msg.ChainId]Writer), - lock: &sync.RWMutex{}, - log: log, - mapcid: mapcid, - } -} - -// Send passes a message to the destination Writer if it exists -func (r *Route) Send(msg msg.Message) error { - r.lock.Lock() - defer r.lock.Unlock() - - r.log.Trace("Routing message", "src", msg.Source, "dest", msg.Destination) - dest := msg.Destination - - w := r.registry[dest] - if w == nil { - return fmt.Errorf("unknown destination chainId: %d", msg.Destination) - } - - go w.ResolveMessage(msg) - return nil -} - -// Listen registers a Writer with a ChainId which Router.Send can then use to propagate messages -func (r *Route) Listen(id msg.ChainId, w Writer) { - r.lock.Lock() - defer r.lock.Unlock() - r.log.Debug("Registering new chain in router", "id", id) - r.registry[id] = w -} diff --git a/core/router_test.go b/core/router_test.go deleted file mode 100644 index 42959b84..00000000 --- a/core/router_test.go +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2021 Compass Systems -// SPDX-License-Identifier: LGPL-3.0-only - -package core - -import ( - "github.com/mapprotocol/compass/pkg/msg" - "reflect" - "testing" - "time" - - "github.com/ChainSafe/log15" -) - -type mockWriter struct { - msgs []msg.Message -} - -func (w *mockWriter) Start() error { return nil } -func (w *mockWriter) Stop() error { return nil } - -func (w *mockWriter) ResolveMessage(msg msg.Message) bool { - w.msgs = append(w.msgs, msg) - return true -} - -func TestRouter(t *testing.T) { - tLog := log15.New("test_router") - tLog.SetHandler(log15.LvlFilterHandler(log15.LvlTrace, tLog.GetHandler())) - router := NewRouter(tLog) - - ethW := &mockWriter{msgs: *new([]msg.Message)} - router.Listen(msg.ChainId(0), ethW) - - ctfgW := &mockWriter{msgs: *new([]msg.Message)} - router.Listen(msg.ChainId(1), ctfgW) - - msgEthToCtfg := msg.Message{ - Source: msg.ChainId(0), - Destination: msg.ChainId(1), - } - - msgCtfgToEth := msg.Message{ - Source: msg.ChainId(1), - Destination: msg.ChainId(0), - } - - err := router.Send(msgCtfgToEth) - if err != nil { - t.Fatal(err) - } - err = router.Send(msgEthToCtfg) - if err != nil { - t.Fatal(err) - } - - time.Sleep(time.Second) - - if !reflect.DeepEqual(ethW.msgs[0], msgCtfgToEth) { - t.Error("Unexpected message") - } - - if !reflect.DeepEqual(ctfgW.msgs[0], msgEthToCtfg) { - t.Error("Unexpected message") - } -} diff --git a/example.config.toml b/example.config.toml new file mode 100644 index 00000000..ea99797e --- /dev/null +++ b/example.config.toml @@ -0,0 +1,38 @@ +[global] +# keystore path,absolute path, or current path +keystore="keystore.json" +# The password can be empty,but it can't be wrong. If it is empty,enter the password manually when required. +# The password does not support plaintext. Run a subcommand password to generate AES ciphertext +# Ciphertext is machine related +password = "1234561" +# Suggest that block_number_by_estimation is true, if it is true, block_creating_seconds is more important +# True will work a little faster, +block_number_by_estimation = false +router_contract = "" +# start_with_block, You can only change the value to a larger value, but cannot change it to a smaller value. +# To change the value to a smaller value, you need to delete the database content +start_with_block = 1 +# How many blocks are synchronized at one time? This value can only be between 1 and 20, preferably less than 10 +# nan will set to 1 +block_number_limit_once = 5 + +[src_chain] +#The name doesn't matter, it only shows up in the log +name = "Ethereum test net" +chain_id = 10 +block_creating_seconds = 15 +rpc_url = "http://119.8.165.158:8545" +stable_block = 10 +router_contract_address = "" + +[dst_chain] +##The name doesn't matter, it only shows up in the log +name = "map_chain_test" +chain_id = 211 +block_creating_seconds = 6 +rpc_url = "http://119.8.165.158:7445" +stable_block = 10 +relayer_contract_address = "0x00000000000052656c6179657241646472657373" +header_store_contract_address = "0x000068656164657273746F726541646472657373" +router_contract_address = "" + diff --git a/go.mod b/go.mod index 43f38234..2e01be2d 100644 --- a/go.mod +++ b/go.mod @@ -1,132 +1,18 @@ module github.com/mapprotocol/compass -go 1.19 +go 1.16 require ( - github.com/ChainSafe/chainbridge-utils v1.0.6 - github.com/ChainSafe/log15 v1.0.0 - github.com/ethereum/go-ethereum v1.12.2 - github.com/gagliardetto/solana-go v1.12.0 - github.com/gin-gonic/gin v1.10.0 - github.com/go-redis/redis/v8 v8.11.5 - github.com/klaytn/klaytn v1.10.2 - github.com/lbtsm/gotron-sdk v0.0.0-20240606062614-534038e71cd3 - github.com/mapprotocol/atlas v0.5.1-0.20220530091946-06b376fbe9bd - github.com/mapprotocol/near-api-go v0.0.0-20220801061430-b9e1d4580dc5 - github.com/mr-tron/base58 v1.2.0 - github.com/pkg/errors v0.9.1 - github.com/sirupsen/logrus v1.9.0 - github.com/stretchr/testify v1.9.0 - github.com/urfave/cli/v2 v2.24.1 - github.com/xssnick/tonutils-go v1.10.2 - golang.org/x/term v0.20.0 - google.golang.org/grpc v1.41.0 -) - -require ( - filippo.io/edwards25519 v1.0.0-rc.1 // indirect - github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect - github.com/VictoriaMetrics/fastcache v1.6.0 // indirect - github.com/andres-erbsen/clock v0.0.0-20160526145045-9e14626cd129 // indirect - github.com/beorn7/perks v1.0.1 // indirect - github.com/blendle/zapdriver v1.3.1 // indirect + github.com/alexeyco/simpletable v1.0.0 github.com/btcsuite/btcd v0.22.0-beta // indirect - github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect - github.com/buraksezer/consistent v0.9.0 // indirect - github.com/bytedance/sonic v1.11.6 // indirect - github.com/bytedance/sonic/loader v0.1.1 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect - github.com/cloudwego/base64x v0.1.4 // indirect - github.com/cloudwego/iasm v0.2.0 // indirect - github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/deckarep/golang-set v1.8.0 // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect - github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect - github.com/eteu-technologies/borsh-go v0.3.2 // indirect - github.com/eteu-technologies/golang-uint128 v1.1.2-eteu // indirect - github.com/fatih/color v1.10.0 // indirect - github.com/fsnotify/fsnotify v1.6.0 // indirect - github.com/gabriel-vasile/mimetype v1.4.3 // indirect - github.com/gagliardetto/binary v0.8.0 // indirect - github.com/gagliardetto/treeout v0.1.4 // indirect - github.com/gin-contrib/sse v0.1.0 // indirect - github.com/go-ole/go-ole v1.2.5 // indirect - github.com/go-playground/locales v0.14.1 // indirect - github.com/go-playground/universal-translator v0.18.1 // indirect - github.com/go-playground/validator/v10 v10.20.0 // indirect - github.com/go-stack/stack v1.8.1 // indirect - github.com/goccy/go-json v0.10.2 // indirect - github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect - github.com/golang/protobuf v1.5.4 // indirect - github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/gorilla/websocket v1.5.0 // indirect - github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect - github.com/holiman/bloomfilter/v2 v2.0.3 // indirect - github.com/holiman/uint256 v1.2.3 // indirect - github.com/huin/goupnp v1.0.3 // indirect - github.com/jackpal/go-nat-pmp v1.0.2 // indirect - github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.15.0 // indirect - github.com/klauspost/cpuid/v2 v2.2.7 // indirect - github.com/kr/pretty v0.3.1 // indirect - github.com/leodido/go-urn v1.4.0 // indirect - github.com/logrusorgru/aurora v2.0.3+incompatible // indirect - github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.20 // indirect - github.com/mattn/go-runewidth v0.0.10 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect - github.com/mitchellh/go-homedir v1.1.0 // indirect - github.com/mitchellh/go-testing-interface v1.14.1 // indirect - github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/mostynb/zstdpool-freelist v0.0.0-20201229113212-927304c0c3b1 // indirect - github.com/oasisprotocol/curve25519-voi v0.0.0-20220328075252-7dd334e3daae // indirect - github.com/olekukonko/tablewriter v0.0.5 // indirect - github.com/pbnjay/memory v0.0.0-20190104145345-974d429e7ae4 // indirect - github.com/pborman/uuid v1.2.1 // indirect - github.com/pelletier/go-toml/v2 v2.2.2 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.14.0 // indirect - github.com/prometheus/client_model v0.3.0 // indirect - github.com/prometheus/common v0.39.0 // indirect - github.com/prometheus/procfs v0.9.0 // indirect - github.com/prometheus/tsdb v0.10.0 // indirect - github.com/rivo/uniseg v0.2.0 // indirect - github.com/rjeczalik/notify v0.9.3 // indirect - github.com/russross/blackfriday/v2 v2.1.0 // indirect - github.com/shengdoushi/base58 v1.0.0 // indirect - github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect - github.com/sigurn/crc16 v0.0.0-20211026045750-20ab5afb07e3 // indirect - github.com/streamingfast/logging v0.0.0-20230608130331-f22c91403091 // indirect - github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect - github.com/tklauser/go-sysconf v0.3.5 // indirect - github.com/tklauser/numcpus v0.2.2 // indirect - github.com/twitchyliquid64/golang-asm v0.15.1 // indirect - github.com/tyler-smith/go-bip39 v1.1.0 // indirect - github.com/ugorji/go/codec v1.2.12 // indirect - github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect - github.com/zondax/hid v0.9.1 // indirect - go.mongodb.org/mongo-driver v1.12.2 // indirect - go.uber.org/atomic v1.7.0 // indirect - go.uber.org/multierr v1.6.0 // indirect - go.uber.org/ratelimit v0.2.0 // indirect - go.uber.org/zap v1.21.0 // indirect - golang.org/x/arch v0.8.0 // indirect - golang.org/x/crypto v0.23.0 // indirect - golang.org/x/net v0.25.0 // indirect - golang.org/x/sync v0.3.0 // indirect - golang.org/x/sys v0.20.0 // indirect - golang.org/x/text v0.15.0 // indirect - golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11 // indirect - google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84 // indirect - google.golang.org/protobuf v1.34.1 // indirect - gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect -) - -replace ( - github.com/coreos/bbolt => go.etcd.io/bbolt v1.3.7 - github.com/ethereum/go-ethereum v1.12.2 => github.com/ethereum/go-ethereum v1.10.10 + github.com/denisbrodbeck/machineid v1.0.1 // indirect + github.com/ethereum/go-ethereum v1.10.8 + github.com/mattn/go-runewidth v0.0.13 // indirect + github.com/pelletier/go-toml v1.9.3 // indirect + github.com/sirupsen/logrus v1.8.1 // indirect + github.com/spf13/cobra v1.2.1 + github.com/syndtr/goleveldb v1.0.1-0.20210305035536-64b5b1c73954 // indirect + golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 // indirect + golang.org/x/sys v0.0.0-20210909193231-528a39cd75f3 // indirect + golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b // indirect ) diff --git a/go.sum b/go.sum index d822f4b7..e93866a7 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,5 @@ -bou.ke/monkey v1.0.1/go.mod h1:FgHuK96Rv2Nlf+0u1OOVDpCMdsWyOFmeeketDHE7LIg= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.37.4/go.mod h1:NHPJ89PdicEuT9hdPXMROBD91xc5uRDxsMtSB16k7hw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= cloud.google.com/go v0.43.0/go.mod h1:BOSR3VbTLkk6FDC/TcffxP4NF/FFBGA5ku+jvKOP7pg= cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= @@ -15,6 +13,13 @@ cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6 cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= +cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= +cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= +cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= +cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= @@ -24,157 +29,73 @@ cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM7 cloud.google.com/go/bigtable v1.2.0/go.mod h1:JcVAOl45lrTmQfLj7T6TxyMzIN/3FGGcFm+2xVAli2o= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= -cloud.google.com/go/pubsub v1.4.0/go.mod h1:LFrqilwgdw4X2cJS9ALgzYmMu+ULyrUN6IHV3CPK4TM= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= collectd.org v0.3.0/go.mod h1:A/8DzQBkF6abtvrT2j/AU/4tiBgJWYyh0y/oB/4MlWE= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -filippo.io/edwards25519 v1.0.0-rc.1 h1:m0VOOB23frXZvAOK44usCgLWvtsxIoMCTBGJZlpmGfU= -filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= -github.com/AlekSi/pointer v1.1.0 h1:SSDMPcXD9jSl8FPy9cRzoRaMJtm9g9ggGTxecRUbQoI= -github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= github.com/Azure/azure-pipeline-go v0.2.1/go.mod h1:UGSo8XybXnIGZ3epmeBw7Jdz+HiUVpqIlpz/HKHylF4= github.com/Azure/azure-pipeline-go v0.2.2/go.mod h1:4rQ/NZncSvGqNkkOsNpOU1tgoNuIlp9AfUH5G1tvCHc= github.com/Azure/azure-storage-blob-go v0.7.0/go.mod h1:f9YQKtsG1nMisotuTPpO0tjNuEjKRYAcJU8/ydDI++4= -github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= -github.com/Azure/go-autorest/autorest v0.11.18/go.mod h1:dSiJPy22c3u0OtOKDNttNgqpNFY/GeWa7GH/Pz56QRA= github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= github.com/Azure/go-autorest/autorest/adal v0.8.0/go.mod h1:Z6vX6WXXuyieHAXwMj0S6HY6e6wcHn37qQMBQlvY3lc= -github.com/Azure/go-autorest/autorest/adal v0.9.13/go.mod h1:W/MM4U6nLxnIskrw4UwWzlHfGjwUS50aOsc/I3yuU8M= github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= github.com/Azure/go-autorest/autorest/date v0.2.0/go.mod h1:vcORJHLJEh643/Ioh9+vPmf1Ij9AEBM5FuBIXLmIy0g= -github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN3SVSiiO77gL2j2ronKKP0syM= -github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= -github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= -github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/ChainSafe/chainbridge-utils v1.0.6 h1:DV9dNnrsU7fRG49biyRlHsPLd9Augv9lepxnP581ixM= -github.com/ChainSafe/chainbridge-utils v1.0.6/go.mod h1:T5cOZhxdY4x0DrE0EqOnMwAPE8d4bNGqiPfN16o1rzc= -github.com/ChainSafe/log15 v1.0.0 h1:vRDVtWtVwIH5uSCBvgTTZh6FA58UBJ6+QiiypaZfBf8= -github.com/ChainSafe/log15 v1.0.0/go.mod h1:5v1+ALHtdW0NfAeeoYyKmzCAMcAeqkdhIg4uxXWIgOg= github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= -github.com/DataDog/datadog-agent/pkg/obfuscate v0.0.0-20211129110424-6491aa3bf583/go.mod h1:EP9f4GqaDJyP1F5jTNMtzdIpw3JpNs3rMSJOnYywCiw= -github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= -github.com/DataDog/datadog-go v4.8.2+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= -github.com/DataDog/datadog-go/v5 v5.0.2/go.mod h1:ZI9JFB4ewXbw1sBnF4sxsR2k1H3xjV+PUAOUsHvKpcU= -github.com/DataDog/gostackparse v0.5.0/go.mod h1:lTfqcJKqS9KnXQGnyQMCugq3u1FP6UZMfWR0aitKFMM= -github.com/DataDog/sketches-go v1.2.1/go.mod h1:1xYmPLY1So10AwxV6MJV0J53XVH+WL9Ad1KetxVivVI= -github.com/DataDog/zstd v1.3.5/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= -github.com/DataDog/zstd v1.3.6-0.20190409195224-796139022798/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= -github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= -github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= -github.com/Microsoft/go-winio v0.5.0/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= -github.com/Microsoft/go-winio v0.5.1/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= -github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/PuerkitoBio/goquery v1.5.1/go.mod h1:GsLWisAFVj4WgDibEWF4pvYnkVQBpKBKeU+7zCJoLcc= -github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= -github.com/Shopify/sarama v1.22.0/go.mod h1:lm3THZ8reqBDBQKQyb5HB3sY1lKp3grEbQ81aWSgPp4= -github.com/Shopify/sarama v1.23.1/go.mod h1:XLH1GYJnLVE0XCr6KdJGVJRTwY30moWNJ4sERjXX6fs= -github.com/Shopify/sarama v1.26.4/go.mod h1:NbSGBSSndYaIhRcBtY9V0U7AyH+x71bG668AuWys/yU= -github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= +github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 h1:fLjPD/aNc3UIOA6tDi6QXUemppXK3P9BI7mr2hd6gx8= github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= -github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d h1:G0m3OIz70MZUWq3EgK3CesDbo8upS2Vm9/P3FtgI+Jk= -github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= -github.com/VictoriaMetrics/fastcache v1.5.7/go.mod h1:ptDBkNMQI4RtmVo8VS/XwRY6RoTu1dAWCbrk+6WsEM8= github.com/VictoriaMetrics/fastcache v1.6.0 h1:C/3Oi3EiBCqufydp1neRZkqcwmEiuRT9c3fqvvgKm5o= github.com/VictoriaMetrics/fastcache v1.6.0/go.mod h1:0qHz5QP0GMX4pfmMA/zt5RgfNuXJrTP0zS7DqpHGGTw= -github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= -github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alexeyco/simpletable v1.0.0 h1:ZQ+LvJ4bmoeHb+dclF64d0LX+7QAi7awsfCrptZrpHk= +github.com/alexeyco/simpletable v1.0.0/go.mod h1:VJWVTtGUnW7EKbMRH8cE13SigKGx/1fO2SeeOiGeBkk= github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= -github.com/allegro/bigcache v1.2.1 h1:hg1sY1raCwic3Vnsvje6TT7/pnZba83LeFck5NrFKSc= -github.com/allegro/bigcache v1.2.1/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= -github.com/andres-erbsen/clock v0.0.0-20160526145045-9e14626cd129 h1:MzBOUgng9orim59UnfUTLRjMpd09C5uEVQ6RPGeCaVI= -github.com/andres-erbsen/clock v0.0.0-20160526145045-9e14626cd129/go.mod h1:rFgpPQZYZ8vdbc+48xibu8ALc3yeyd64IhHS+PU6Yyg= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= -github.com/andybalholm/brotli v1.0.2/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= -github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= -github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/apache/arrow/go/arrow v0.0.0-20191024131854-af6fa24be0db/go.mod h1:VTxUBvSJ3s3eHAg65PNgrsn5BtqCRPdmyXh6rAfdxN0= -github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= -github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= -github.com/aristanetworks/fsnotify v1.4.2/go.mod h1:D/rtu7LpjYM8tRJphJ0hUBYpjai8SfX+aSNsWDTq/Ks= -github.com/aristanetworks/glog v0.0.0-20180419172825-c15b03b3054f/go.mod h1:KASm+qXFKs/xjSoWn30NrWBBvdTTQq+UjkhjEJHfSFA= -github.com/aristanetworks/goarista v0.0.0-20170210015632-ea17b1a17847/go.mod h1:D/tb0zPVXnP7fmsLZjtdUhSsumbK/ij54UXjjVgMGxQ= -github.com/aristanetworks/goarista v0.0.0-20191001182449-186a6201b8ef/go.mod h1:Z4RTxGAuYhPzcq8+EdRM+R8M48Ssle2TsWtwRKa+vns= -github.com/aristanetworks/splunk-hec-go v0.3.3/go.mod h1:1VHO9r17b0K7WmOlLb9nTk/2YanvOEnLMUgsFrxBROc= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= -github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-metrics v0.3.0/go.mod h1:zXjbSimjXTd7vOpY8B0/2LpvNvDoXBuplAD+gJD3GYs= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= -github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= -github.com/aws/aws-sdk-go v1.25.37/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go v1.25.48/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go v1.34.28/go.mod h1:H7NKnBqNVzoTJpGfLrQkkD+ytBA93eiDYi/+8rV9s48= -github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= -github.com/aws/aws-sdk-go-v2 v1.0.0/go.mod h1:smfAbmpW+tcRVuNUjo3MOArSZmW72t62rkCzc2i0TWM= github.com/aws/aws-sdk-go-v2 v1.2.0/go.mod h1:zEQs02YRBw1DjK0PoJv3ygDYOFTre1ejlJWl8FwAuQo= -github.com/aws/aws-sdk-go-v2/config v1.0.0/go.mod h1:WysE/OpUgE37tjtmtJd8GXgT8s1euilE5XtUkRNUQ1w= github.com/aws/aws-sdk-go-v2/config v1.1.1/go.mod h1:0XsVy9lBI/BCXm+2Tuvt39YmdHwS5unDQmxZOYe8F5Y= -github.com/aws/aws-sdk-go-v2/credentials v1.0.0/go.mod h1:/SvsiqBf509hG4Bddigr3NB12MIpfHhZapyBurJe8aY= github.com/aws/aws-sdk-go-v2/credentials v1.1.1/go.mod h1:mM2iIjwl7LULWtS6JCACyInboHirisUUdkBPoTHMOUo= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.0.0/go.mod h1:wpMHDCXvOXZxGCRSidyepa8uJHY4vaBGfY2/+oKU/Bc= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.0.2/go.mod h1:3hGg3PpiEjHnrkrlasTfxFqUsZ2GCk/fMUn4CbKgSkM= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.0/go.mod h1:3jExOmpbjgPnz2FJaMOfbSk1heTkZ66aD3yNtVhnjvI= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.2/go.mod h1:45MfaXZ0cNbeuT0KQ1XJylq8A6+OpVV2E5kvY/Kq+u8= github.com/aws/aws-sdk-go-v2/service/route53 v1.1.1/go.mod h1:rLiOUrPLW/Er5kRcQ7NkwbjlijluLsrIbu/iyl35RO4= -github.com/aws/aws-sdk-go-v2/service/sqs v1.0.0/go.mod h1:w5BclCU8ptTbagzXS/fHBr+vAyXUjggg/72qDIURKMk= github.com/aws/aws-sdk-go-v2/service/sso v1.1.1/go.mod h1:SuZJxklHxLAXgLTc1iFXbEWkXs7QRTQpCLGaKIprQW0= -github.com/aws/aws-sdk-go-v2/service/sts v1.0.0/go.mod h1:5f+cELGATgill5Pu3/vK3Ebuigstc+qYEHW5MvGWZO4= github.com/aws/aws-sdk-go-v2/service/sts v1.1.1/go.mod h1:Wi0EBZwiz/K44YliU0EKxqTCJGUfYTWXrrBwkq736bM= -github.com/aws/smithy-go v1.0.0/go.mod h1:EzMw8dbp/YJL4A5/sbhGddag+NPT7q084agLbB9LgIw= github.com/aws/smithy-go v1.1.0/go.mod h1:EzMw8dbp/YJL4A5/sbhGddag+NPT7q084agLbB9LgIw= -github.com/aws/smithy-go v1.11.0/go.mod h1:3xHYmszWVx2c0kIwQeEVf9uSm4fYZt67FBJnwub1bgM= -github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= -github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= -github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= -github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bitly/go-hostpool v0.0.0-20171023180738-a3a6125de932/go.mod h1:NOuUCSz6Q9T7+igc/hlvDOUdtWKryOrtFyIVABv/p7k= -github.com/blendle/zapdriver v1.3.1 h1:C3dydBOWYRiOk+B8X9IVZ5IOe+7cl+tGOexN4QqHfpE= -github.com/blendle/zapdriver v1.3.1/go.mod h1:mdXfREi6u5MArG4j9fewC+FGnXaBR+T4Ox4J2u4eHCc= -github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= +github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM= github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40/go.mod h1:8rLXio+WjiTceGBHIoTvn60HIbs7Hm7bcHjyrSqYB9c= github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= -github.com/bradfitz/gomemcache v0.0.0-20220106215444-fb4bf637b56d/go.mod h1:H0wQNHz2YrLsuXOZozoeDmnHXkNCRmMW0gwFWDfEZDA= -github.com/bt51/ntpclient v0.0.0-20140310165113-3045f71e2530/go.mod h1:OahuhAz81f/KxpjyyO0H3rTNypHk3qd9s8BWriP7DAI= -github.com/btcsuite/btcd v0.0.0-20171128150713-2e60448ffcc6/go.mod h1:Dmm/EzmjnCiweXmzRIAiUWCInVmPgjkzgv5k4tVyXiQ= +github.com/btcsuite/btcd v0.20.1-beta h1:Ik4hyJqN8Jfyv3S4AGBOmyouMsYE3EdYODkMbQjwPGw= github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= -github.com/btcsuite/btcd v0.21.0-beta/go.mod h1:ZSWyehm27aAuS9bvkATT+Xte3hjHZ+MRgMY/8NJ7K94= github.com/btcsuite/btcd v0.22.0-beta h1:LTDpDKUM5EeOFBPM8IXpinEcmZ6FWfNZbE3lfrfdnWo= github.com/btcsuite/btcd v0.22.0-beta/go.mod h1:9n5ntfhhHQBIhUvlhDvD3Qg6fRUj4jkN0VB8L8svzOA= -github.com/btcsuite/btcd/btcec/v2 v2.2.0 h1:fzn1qaOt32TuLjFlkzYSsBC35Q3KUjT1SwPxiMSCF5k= -github.com/btcsuite/btcd/btcec/v2 v2.2.0/go.mod h1:U7MHm051Al6XmscBQ0BoNydpOTsFAn707034b5nY8zU= github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= -github.com/btcsuite/btcutil v1.0.2/go.mod h1:j9HUFwoQRsZL3V4n+qG+CUnEGHOarIxfC3Le2Yhbcts= github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce/go.mod h1:0DVlHczLPewLcPGEIeUEzfOJhqGPQ0mJJRDBtD307+o= github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY= @@ -183,257 +104,100 @@ github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= -github.com/buraksezer/consistent v0.9.0 h1:Zfs6bX62wbP3QlbPGKUhqDw7SmNkOzY5bHZIYXYpR5g= -github.com/buraksezer/consistent v0.9.0/go.mod h1:6BrVajWq7wbKZlTOUPs/XVfR8c0maujuPowduSpZqmw= -github.com/bytedance/sonic v1.11.6 h1:oUp34TzMlL+OY1OUWxHqsdkgC/Zfc85zGqw9siXjrc0= -github.com/bytedance/sonic v1.11.6/go.mod h1:LysEHSvpvDySVdC2f87zGWf6CIKJcAvqab1ZaiQtds4= -github.com/bytedance/sonic/loader v0.1.1 h1:c+e5Pt1k/cy5wMveRDyk2X4B9hF4g7an8N3zCYjJFNM= -github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= github.com/c-bata/go-prompt v0.2.2/go.mod h1:VzqtzE2ksDBcdln8G7mk2RX9QyGjH+OVqOCSiVIqS34= -github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= -github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/centrifuge/go-substrate-rpc-client v2.0.0-alpha.5+incompatible/go.mod h1:GBMLH8MQs5g4FcrytcMm9uRgBnTL1LIkNTue6lUPhZU= +github.com/cespare/cp v0.1.0 h1:SE+dxFebS7Iik5LK0tsi1k9ZCxEaFX4AjQmoyA+1dJk= github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= -github.com/cespare/cp v1.0.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= -github.com/cespare/cp v1.1.1 h1:nCb6ZLdB7NRaqsm91JtQTAme2SKJzXVsdPIPkyJr1MU= -github.com/cespare/cp v1.1.1/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= +github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= -github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= -github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= -github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= -github.com/clevergo/websocket v1.0.0/go.mod h1:4cxGDd7ljHn+Ng5VPV2neXYBGNZRWx9JMisSmCwQxFU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cloudflare/cloudflare-go v0.10.2-0.20190916151808-a80f83b9add9/go.mod h1:1MxXX1Ux4x6mqPmjkUgTP1CdXIBXKX7T+Jk9Gxrmx+U= github.com/cloudflare/cloudflare-go v0.14.0/go.mod h1:EnwdgGMaFOruiPZRFSgn+TsQ3hQ7C/YWzIGLeu5c304= -github.com/cloudwego/base64x v0.1.4 h1:jwCgWpFanWmN8xoIUHa2rtzmkd5J2plF/dnLS6Xd/0Y= -github.com/cloudwego/base64x v0.1.4/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w= -github.com/cloudwego/iasm v0.2.0 h1:1KNIy1I1H9hNNFEEH3DVnI4UujN+1zjpuk6gwHLTssg= -github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= -github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/confluentinc/confluent-kafka-go v1.4.0/go.mod h1:u2zNLny2xq+5rWeTQjFHbDzzNuba4P1vo31r9r4uAdg= github.com/consensys/bavard v0.1.8-0.20210406032232-f3452dc9b572/go.mod h1:Bpd0/3mZuaj6Sj+PqrmIquiOKy397AKGThQPaGzNXAQ= github.com/consensys/gnark-crypto v0.4.1-0.20210426202927-39ac3d4b3f1f/go.mod h1:815PAHg3wvysy0SyIqanF8gZ0Y1wjk/hrDHD/iT88+Q= -github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= -github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= +github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= -github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= github.com/dave/jennifer v1.2.0/go.mod h1:fIb+770HOpJ2fmN9EPPKOqm1vMGhB+TwXKMZhrIygKg= -github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/deckarep/golang-set v0.0.0-20180603214616-504e848d77ea h1:j4317fAZh7X6GqbFowYdYdI0L9bwxL07jyPZIdepyZ0= github.com/deckarep/golang-set v0.0.0-20180603214616-504e848d77ea/go.mod h1:93vsz/8Wt4joVM7c2AVqh+YRMiUSc14yDtF28KmMOgQ= -github.com/deckarep/golang-set v1.7.1/go.mod h1:93vsz/8Wt4joVM7c2AVqh+YRMiUSc14yDtF28KmMOgQ= -github.com/deckarep/golang-set v1.8.0 h1:sk9/l/KqpunDwP7pSjUg0keiOOLEnOBHzykLrsPppp4= -github.com/deckarep/golang-set v1.8.0/go.mod h1:5nI87KwE7wgsBU1F4GKAw2Qod7p5kyS383rP6+o6qqo= -github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 h1:YLtO71vCjJRCBcrPMtQ9nqBsqpA1m5sE92cU+pd5Mcc= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= github.com/deepmap/oapi-codegen v1.6.0/go.mod h1:ryDa9AgbELGeB+YEXE1dR53yAjHwFvE9iAUlWl9Al3M= github.com/deepmap/oapi-codegen v1.8.2/go.mod h1:YLgSKSDv/bZQB7N4ws6luhozi3cEdRktEqrX88CvjIw= -github.com/denisenkom/go-mssqldb v0.0.0-20190515213511-eb9f6a1743f3/go.mod h1:zAg7JM8CkOJ43xKXIj7eRO9kmWm/TW578qo+oDO6tuM= -github.com/denisenkom/go-mssqldb v0.0.0-20191124224453-732737034ffd/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= -github.com/denisenkom/go-mssqldb v0.0.0-20200428022330-06a60b6afbbc/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= -github.com/denisenkom/go-mssqldb v0.11.0/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= -github.com/dgraph-io/badger v1.6.0/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= -github.com/dgraph-io/ristretto v0.1.0/go.mod h1:fux0lOrBhrVCJd3lcTHsIJhq1T2rokOu6v9Vcb3Q9ug= +github.com/denisbrodbeck/machineid v1.0.1 h1:geKr9qtkB876mXguW2X6TU4ZynleN6ezuMSRhl4D7AQ= +github.com/denisbrodbeck/machineid v1.0.1/go.mod h1:dJUwb7PTidGDeYyUBmXZ2GphQBbjJCrnectwCyxcUSI= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dgrijalva/jwt-go/v4 v4.0.0-preview1/go.mod h1:+hnT3ywWDTAFrW5aE+u2Sa/wT555ZqwoCS+pk3p6ry4= github.com/dgryski/go-bitstream v0.0.0-20180413035011-3522498ce2c8/go.mod h1:VMaSuZ+SZcx/wljOQKvp5srsbCiKDEb6K2wC4+PiBmQ= -github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= -github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= -github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/dlclark/regexp2 v1.2.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= -github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= github.com/docker/docker v1.4.2-0.20180625184442-8e610b2b55bf/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker v1.13.1/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= -github.com/dop251/goja v0.0.0-20200219165308-d1232e640a87/go.mod h1:Mw6PkjjMXWbTj+nnj4s3QPXq1jaT0s5pC0iFD4+BOAA= -github.com/dop251/goja v0.0.0-20211011172007-d99e4b8cbf48/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk= -github.com/dop251/goja_nodejs v0.0.0-20210225215109-d91c329300e7/go.mod h1:hn7BA7c8pLvoGndExHudxTDKZ84Pyvv+90pbBjbTz0Y= -github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/dvyukov/go-fuzz v0.0.0-20210103155950-6a8e9d1f2415/go.mod h1:11Gm+ccJnvAhCNLlf5+cS9KjtbaD5I5zaZpFMsTHWTw= -github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= -github.com/eapache/go-resiliency v1.2.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= -github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= -github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= +github.com/dop251/goja v0.0.0-20200721192441-a695b0cdd498/go.mod h1:Mw6PkjjMXWbTj+nnj4s3QPXq1jaT0s5pC0iFD4+BOAA= github.com/eclipse/paho.mqtt.golang v1.2.0/go.mod h1:H9keYFcgq3Qr5OUJm/JZI/i6U7joQ8SYLhZwfeOo6Ts= -github.com/edsrzf/mmap-go v0.0.0-20160512033002-935e0e8a636c/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= github.com/edsrzf/mmap-go v1.0.0 h1:CEBF7HpRnUCSJgGUb5h1Gm7e3VkmVDrR8lvWVLtrOFw= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= -github.com/elastic/go-elasticsearch/v6 v6.8.5/go.mod h1:UwaDJsD3rWLM5rKNFzv9hgox93HoX8utj1kxD9aFUcI= -github.com/elastic/go-elasticsearch/v7 v7.17.1/go.mod h1:OJ4wdbtDNk5g503kvlHLyErCgQwwzmDtaFC4XyOxXA4= -github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= -github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5/go.mod h1:a2zkGnVExMxdzMo3M0Hi/3sEU+cWnZpSni0O6/Yb/P0= -github.com/eteu-technologies/borsh-go v0.3.2 h1:2c4H5yNtgzvgiYOZbN/DKE+iFjS6hK0QibEvw/5ELsI= -github.com/eteu-technologies/borsh-go v0.3.2/go.mod h1:WK4tVIecqMGB9WXrvULSeEe3POIXw+ZUFWV4HRTUCZA= -github.com/eteu-technologies/golang-uint128 v1.1.1-eteu/go.mod h1:5Vr5yDsJV9eBl44ziSgt1xDZbVfJv4+IpqnUf0wa8t4= -github.com/eteu-technologies/golang-uint128 v1.1.2-eteu h1:hEc9sN76qbV0l40GUq2lMyBDXZlTkts7cLCd+3vHkao= -github.com/eteu-technologies/golang-uint128 v1.1.2-eteu/go.mod h1:5Vr5yDsJV9eBl44ziSgt1xDZbVfJv4+IpqnUf0wa8t4= -github.com/ethereum/go-ethereum v1.9.17/go.mod h1:kihoiSg74VC4dZAXMkmoWp70oQabz48BJg1tuzricFc= -github.com/ethereum/go-ethereum v1.10.10 h1:Ft2GcLQrr2M89l49g9NoqgNtJZ9AahzMb7N6VXKZy5U= -github.com/ethereum/go-ethereum v1.10.10/go.mod h1:W3yfrFyL9C1pHcwY5hmRHVDaorTiQxhYBkKyu5mEDHw= -github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/fatih/color v1.3.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/ethereum/go-ethereum v1.10.4 h1:JPZPL2MHbegfFStcaOrrggMVIcf57OQHQ0J3UhjQ+xQ= +github.com/ethereum/go-ethereum v1.10.4/go.mod h1:nEE0TP5MtxGzOMd7egIrbPJMQBnhVU3ELNxhBglIzhg= +github.com/ethereum/go-ethereum v1.10.8 h1:0UP5WUR8hh46ffbjJV7PK499+uGEyasRIfffS0vy06o= +github.com/ethereum/go-ethereum v1.10.8/go.mod h1:pJNuIUYfX5+JKzSD/BTdNsvJSZ1TJqmz0dVyXMAbf6M= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= -github.com/fatih/color v1.10.0 h1:s36xzo75JdqLaaWoiEHk767eHiwo0598uUxyfiPkDsg= -github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= -github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= -github.com/fjl/memsize v0.0.0-20180418122429-ca190fb6ffbc/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= +github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 h1:FtmdgXiUlNeRsoNMFlKLDt+S+6hbjVMEW6RGQ7aUf7c= github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= -github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= -github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= -github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= -github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= -github.com/frankban/quicktest v1.7.2/go.mod h1:jaStnuzAqU1AJdCO0l53JDCJrVDKcS03DbaAcR7Ks/o= -github.com/frankban/quicktest v1.13.0/go.mod h1:qLE0fzW0VuyUAJgPU19zByoIr0HtCHN/r/VLSOOIySU= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= -github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= -github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0= -github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk= -github.com/gagliardetto/binary v0.8.0 h1:U9ahc45v9HW0d15LoN++vIXSJyqR/pWw8DDlhd7zvxg= -github.com/gagliardetto/binary v0.8.0/go.mod h1:2tfj51g5o9dnvsc+fL3Jxr22MuWzYXwx9wEoN0XQ7/c= -github.com/gagliardetto/solana-go v1.12.0 h1:rzsbilDPj6p+/DOPXBMLhwMZeBgeRuXjm5zQFCoXgsg= -github.com/gagliardetto/solana-go v1.12.0/go.mod h1:l/qqqIN6qJJPtxW/G1PF4JtcE3Zg2vD2EliZrr9Gn5k= -github.com/gagliardetto/treeout v0.1.4 h1:ozeYerrLCmCubo1TcIjFiOWTTGteOOHND1twdFpgwaw= -github.com/gagliardetto/treeout v0.1.4/go.mod h1:loUefvXTrlRG5rYmJmExNryyBRh8f89VZhmMOyCyqok= -github.com/garyburd/redigo v1.6.0/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= -github.com/garyburd/redigo v1.6.3/go.mod h1:rTb6epsqigu3kYKBnaF028A7Tf/Aw5s0cqA47doKKqw= +github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff h1:tY80oXqGNY4FhTFhk+o9oFHGINQ/+vhlm8HFzi6znCI= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= -github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/getkin/kin-openapi v0.53.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= github.com/getkin/kin-openapi v0.61.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= -github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= -github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.7.7/go.mod h1:axIBovoeJpVj8S3BwE0uPMTeReE4+AfFtqpqaZ1qq1U= -github.com/gin-gonic/gin v1.10.0 h1:nTuyha1TYqgedzytsKYqna+DfLos46nTv2ygFy86HFU= -github.com/gin-gonic/gin v1.10.0/go.mod h1:4PMNQiOhvDRa013RKVbsiNwoyezlm2rm0uX/T7kzp5Y= -github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= github.com/glycerine/go-unsnap-stream v0.0.0-20180323001048-9f0cb55181dd/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE= github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24= -github.com/go-asn1-ber/asn1-ber v1.3.1/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0= -github.com/go-chi/chi v1.5.0/go.mod h1:REp24E+25iKvxgeTfHmdUoL5x15kBiDBlnIl5bCwe2k= github.com/go-chi/chi/v5 v5.0.0/go.mod h1:BBug9lr0cqtdAhsu6R4AAdvufI0/XBzAQSsUqJpoZOs= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.10.0 h1:dXFJfIHVvUcpSgDOV+Ne6t7jXri8Tfv2uOLHUZ2XNuo= -github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= -github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= -github.com/go-ldap/ldap/v3 v3.1.3/go.mod h1:3rbOH3jRS2u6jg2rJnKAMLE/xQyCKIveG2Sa/Cohzb8= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA= -github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= +github.com/go-ole/go-ole v1.2.1 h1:2lOsA72HgjxAuMlKpFiCbHTvu44PIVkZ5hqm3RSdI/E= github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= -github.com/go-ole/go-ole v1.2.5 h1:t4MGB5xEDZvXI+0rMjjsfBsD7yAgp/s9ZDkL1JndXwY= -github.com/go-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= -github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= -github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= -github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-pg/pg/v10 v10.0.0/go.mod h1:XHU1AkQW534GFuUdSiQ46+Xw6Ah+9+b8DlT4YwhiXL8= -github.com/go-pg/zerochecker v0.2.0/go.mod h1:NJZ4wKL0NmTtz0GKCoJ8kym6Xn/EQzXRl2OnAe7MmDo= -github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= -github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= -github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= -github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= -github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= -github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= -github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= -github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= -github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= -github.com/go-playground/validator/v10 v10.20.0 h1:K9ISHbSaI0lyB2eWMPJo+kOS/FBExVwjEviJTixqxL8= -github.com/go-playground/validator/v10 v10.20.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM= -github.com/go-redis/redis v6.15.9+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= -github.com/go-redis/redis/v7 v7.1.0/go.mod h1:JDNMw23GTyLNC4GZu9njt15ctBQVn7xjRfnwdHj/Dcg= -github.com/go-redis/redis/v7 v7.4.0/go.mod h1:JDNMw23GTyLNC4GZu9njt15ctBQVn7xjRfnwdHj/Dcg= -github.com/go-redis/redis/v8 v8.0.0/go.mod h1:isLoQT/NFSP7V67lyvM9GmdvLdyZ7pEhsXvvyQtnQTo= -github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= -github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= github.com/go-sourcemap/sourcemap v2.1.2+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= -github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= -github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= -github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= -github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= +github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw= -github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4= -github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= -github.com/go-test/deep v1.0.2-0.20181118220953-042da051cf31/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= -github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= -github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= -github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= -github.com/gocql/gocql v0.0.0-20220224095938-0eacd3183625/go.mod h1:3gM2c4D3AnkISwBxGnMMsS8Oy4y2lhbPRsH4xnJrHG8= -github.com/gofiber/fiber/v2 v2.11.0/go.mod h1:oZTLWqYnqpMMuF922SjGbsYZsdpE1MCfh416HNdweIM= -github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= +github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= -github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= -github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/geo v0.0.0-20190916061304-5b978397cfec/go.mod h1:QZ0nwyI2jOfgRAoBvP+ab5aRr7c9x7lhGEJrKvBwjWI= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 h1:f+oWsMOmNPc8JmEHVZIycC7hBoQxHH9pNKQORJNozsQ= -github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8/go.mod h1:wcDNUvekVysuuOpQKo3191zZyTpiI6se1N1ULghS0sw= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= @@ -441,10 +205,9 @@ github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= -github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2-0.20190517061210-b285ee9cfc6c/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= @@ -458,20 +221,16 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= -github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.2-0.20200707131729-196ae77b8a26/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.3 h1:fHPg5GQYlCeLIPB9BZqMVR5nR9A+IM5zcgeTdjMYmLA= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb h1:PBC98N2aIaM3XXiurYmW7fx4GZkL8feAMVq7nEjURHk= -github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golangci/lint-1 v0.0.0-20181222135242-d2cdd8c08219/go.mod h1:/X8TswGSh1pIozq4ZwCfxS0WA5JGXguxk94ar/4c87Y= -github.com/gomodule/redigo v1.7.0/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/flatbuffers v1.11.0/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -482,129 +241,76 @@ github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= -github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20210423192551-a2663126120b/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.1.5 h1:kxhtnfFVi+rYdOALN0B3k9UT86zVJKfBimRaciULW4I= github.com/google/uuid v1.1.5/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= -github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= -github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= -github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/gorilla/websocket v1.4.1-0.20190629185528-ae1634f6a989/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= -github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/graph-gophers/graphql-go v0.0.0-20191115155744-f33e81362277/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= github.com/graph-gophers/graphql-go v0.0.0-20201113091052-beb923fada29/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= -github.com/graph-gophers/graphql-go v1.3.0/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= -github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed/go.mod h1:tMWxXQ9wFIaZeTI9F+hmhFiGpFmhOHzyShyFUhRm0H4= -github.com/hashicorp/consul/api v1.0.0/go.mod h1:mbFwfRxOTDHZpT3iUsMAFcLNoVm6Xbe1xZ6KiSm8FY0= -github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= -github.com/hashicorp/consul/internal v0.1.0/go.mod h1:zi9bMZYbiPHyAjgBWo7kCUcy5l2NrTdrkVupCc7Oo6c= -github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= +github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= +github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-bexpr v0.1.10/go.mod h1:oxlubA2vC/gFVfX1A6JGp7ls7uCDlfJn732ehYYg+g0= -github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= -github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI= -github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= -github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= -github.com/hashicorp/go-hclog v0.16.2/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-kms-wrapping/entropy v0.1.0/go.mod h1:d1g9WGtAunDNpek8jUIEJnBlbgKS1N2Q61QkHiZyR1g= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= -github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= -github.com/hashicorp/go-plugin v1.0.1/go.mod h1:++UyYGoz3o5w9ZzAdZxtQKrWWP+iqPBn3cQptSMzBuY= -github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= -github.com/hashicorp/go-retryablehttp v0.6.6/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= -github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= -github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuWpEqDnvIw251EVy4zlP8gWbsGj4BsUKCRpYs= github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= -github.com/hashicorp/memberlist v0.1.6/go.mod h1:5VDNHjqFMgEcclnwmkCnC99IPwxBmIsxwY8qn+Nl0H4= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= -github.com/hashicorp/serf v0.8.6/go.mod h1:P/AVgr4UHsUYqVHG1y9eFhz8S35pqhGhLZaDpfGKIMo= -github.com/hashicorp/vault/api v1.1.0/go.mod h1:R3Umvhlxi2TN7Ex2hzOowyeNb+SfbVWI973N+ctaFMk= -github.com/hashicorp/vault/sdk v0.1.14-0.20200519221838-e0cfd64bc267/go.mod h1:WX57W2PwkrOPQ6rVQk+dy5/htHIaB4aBM70EwKThu10= -github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao= github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA= -github.com/holiman/uint256 v1.1.0/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= +github.com/holiman/uint256 v1.2.0 h1:gpSYcPLWGv4sG43I2mVLiDZCNDh/EpGjSk8tmtxitHM= github.com/holiman/uint256 v1.2.0/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= -github.com/holiman/uint256 v1.2.3 h1:K8UWO1HUJpRMXBxbmaY1Y8IAMZC/RsKB+ArEnnK4l5o= -github.com/holiman/uint256 v1.2.3/go.mod h1:SC8Ryt4n+UBbPbIBKaG9zbbDlp4jOru9xFZmPzLUTxw= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= -github.com/huin/goupnp v1.0.0/go.mod h1:n9v9KO1tAxYH82qOn+UTIFQDmx5n1Zxd/ClZDMX7Bnc= +github.com/huin/goupnp v1.0.1-0.20210310174557-0ca763054c88 h1:bcAj8KroPf552TScjFPIakjH2/tdIrIH8F+cc4v4SRo= +github.com/huin/goupnp v1.0.1-0.20210310174557-0ca763054c88/go.mod h1:nNs7wvRfN1eKaMknBydLNQU6146XQim8t4h+q90biWo= +github.com/huin/goupnp v1.0.2 h1:RfGLP+h3mvisuWEyybxNq5Eft3NWhHLPeUN72kpKZoI= github.com/huin/goupnp v1.0.2/go.mod h1:0dxJBVBHqTMjIUMkESDTNgOOx/Mw5wYIfyFmdzSamkM= -github.com/huin/goupnp v1.0.3-0.20220313090229-ca81a64b4204/go.mod h1:ZxNlw5WqJj6wSsRK5+YfflQGXYfccj5VgQsMNixHM7Y= -github.com/huin/goupnp v1.0.3 h1:N8No57ls+MnjlB+JPiCVSOyy/ot7MJTqlo7rn+NYSqQ= -github.com/huin/goupnp v1.0.3/go.mod h1:ZxNlw5WqJj6wSsRK5+YfflQGXYfccj5VgQsMNixHM7Y= github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/influxdata/flux v0.65.1/go.mod h1:J754/zds0vvpfwuq7Gc2wRdVwEodfpCFM7mYlOw2LqY= -github.com/influxdata/influxdb v1.2.3-0.20180221223340-01288bdb0883/go.mod h1:qZna6X/4elxqT3yI9iZYdZrWWdeFOOprn86kgg4+IzY= github.com/influxdata/influxdb v1.8.3/go.mod h1:JugdFhsvvI8gadxOI6noqNeeBHvWNTbfYGtiAn+2jhI= -github.com/influxdata/influxdb v1.8.5/go.mod h1:oFH+pbEyDln/1TKwa98oJzVrkZwdjrJOwIDGYZj7Ma0= github.com/influxdata/influxdb-client-go/v2 v2.4.0/go.mod h1:vLNHdxTJkIf2mSLvGrpj8TCcISApPoXkaxP8g9uRlW8= -github.com/influxdata/influxdb1-client v0.0.0-20190809212627-fc22c7df067e/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= -github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= github.com/influxdata/influxql v1.1.1-0.20200828144457-65d3ef77d385/go.mod h1:gHp9y86a/pxhjJ+zMjNXiQAA197Xk9wLxaz+fGG+kWk= github.com/influxdata/line-protocol v0.0.0-20180522152040-32c6aa80de5e/go.mod h1:4kt73NQhadE3daL3WhR5EJ/J2ocX0PZzwxQ0gXJ7oFE= github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839/go.mod h1:xaLFMmpvUxqXtVkUJfg9QmT88cDaCJ3ZKgdZ78oO8Qo= @@ -613,664 +319,246 @@ github.com/influxdata/promql/v2 v2.12.0/go.mod h1:fxOPu+DY0bqCTCECchSRtWfc+0X19y github.com/influxdata/roaring v0.4.13-0.20180809181101-fc520f41fab6/go.mod h1:bSgUQ7q5ZLSO+bKBGqJiCBGAl+9DxyW63zLTujjUlOE= github.com/influxdata/tdigest v0.0.0-20181121200506-bf2b5ad3c0a9/go.mod h1:Js0mqiSBE6Ffsg94weZZ2c+v/ciT8QRHFOap7EKDrR0= github.com/influxdata/usage-client v0.0.0-20160829180054-6d3895376368/go.mod h1:Wbbw6tYNvwa5dlB6304Sd+82Z3f7PmVZHVKU637d4po= -github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo= -github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= -github.com/jackc/chunkreader/v2 v2.0.1/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= -github.com/jackc/pgconn v0.0.0-20190420214824-7e0022ef6ba3/go.mod h1:jkELnwuX+w9qN5YIfX0fl88Ehu4XC3keFuOJJk9pcnA= -github.com/jackc/pgconn v0.0.0-20190824142844-760dd75542eb/go.mod h1:lLjNuW/+OfW9/pnVKPazfWOgNfH2aPem8YQ7ilXGvJE= -github.com/jackc/pgconn v0.0.0-20190831204454-2fabfa3c18b7/go.mod h1:ZJKsE/KZfsUgOEh9hBm+xYTstcNHg7UPMVJqRfQxq4s= -github.com/jackc/pgconn v1.4.0/go.mod h1:Y2O3ZDF0q4mMacyWV3AstPJpeHXWGEetiFttmq5lahk= -github.com/jackc/pgconn v1.5.0/go.mod h1:QeD3lBfpTFe8WUnPZWN5KY/mB8FGMIYRdd8P8Jr0fAI= -github.com/jackc/pgconn v1.5.1-0.20200601181101-fa742c524853/go.mod h1:QeD3lBfpTFe8WUnPZWN5KY/mB8FGMIYRdd8P8Jr0fAI= -github.com/jackc/pgconn v1.6.4/go.mod h1:w2pne1C2tZgP+TvjqLpOigGzNqjBgQW9dUw/4Chex78= -github.com/jackc/pgconn v1.8.0/go.mod h1:1C2Pb36bGIP9QHGBYCjnyhqu7Rv3sGshaQUvmfGIB/o= -github.com/jackc/pgconn v1.9.0/go.mod h1:YctiPyvzfU11JFxoXokUOOKQXQmDMoJL9vJzHH8/2JY= -github.com/jackc/pgconn v1.9.1-0.20210724152538-d89c8390a530/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI= -github.com/jackc/pgconn v1.10.1/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI= -github.com/jackc/pgio v1.0.0/go.mod h1:oP+2QK2wFfUWgr+gxjoBH9KGBb31Eio69xUb0w5bYf8= -github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2/go.mod h1:fGZlG77KXmcq05nJLRkk0+p82V8B8Dw8KN2/V9c/OAE= -github.com/jackc/pgmock v0.0.0-20201204152224-4fe30f7445fd/go.mod h1:hrBW0Enj2AZTNpt/7Y5rr2xe/9Mn757Wtb2xeBzPv2c= -github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65/go.mod h1:5R2h2EEX+qri8jOWMbJCtaPWkrrNc7OHwsp2TCqp7ak= -github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= -github.com/jackc/pgproto3 v1.1.0/go.mod h1:eR5FA3leWg7p9aeAqi37XOTgTIbkABlvcPB3E5rlc78= -github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190420180111-c116219b62db/go.mod h1:bhq50y+xrl9n5mRYyCBFKkpRVTLYJVWeCc+mEAI3yXA= -github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190609003834-432c2951c711/go.mod h1:uH0AWtUmuShn0bcesswc4aBTWGvw0cAxIJp+6OB//Wg= -github.com/jackc/pgproto3/v2 v2.0.0-rc3/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= -github.com/jackc/pgproto3/v2 v2.0.0-rc3.0.20190831210041-4c03ce451f29/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= -github.com/jackc/pgproto3/v2 v2.0.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= -github.com/jackc/pgproto3/v2 v2.0.2/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= -github.com/jackc/pgproto3/v2 v2.0.6/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= -github.com/jackc/pgproto3/v2 v2.1.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= -github.com/jackc/pgproto3/v2 v2.2.0/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= -github.com/jackc/pgservicefile v0.0.0-20200307190119-3430c5407db8/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E= -github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E= -github.com/jackc/pgtype v0.0.0-20190421001408-4ed0de4755e0/go.mod h1:hdSHsc1V01CGwFsrv11mJRHWJ6aifDLfdV3aVjFF0zg= -github.com/jackc/pgtype v0.0.0-20190824184912-ab885b375b90/go.mod h1:KcahbBH1nCMSo2DXpzsoWOAfFkdEtEJpPbVLq8eE+mc= -github.com/jackc/pgtype v0.0.0-20190828014616-a8802b16cc59/go.mod h1:MWlu30kVJrUS8lot6TQqcg7mtthZ9T0EoIBFiJcmcyw= -github.com/jackc/pgtype v1.2.0/go.mod h1:5m2OfMh1wTK7x+Fk952IDmI4nw3nPrvtQdM0ZT4WpC0= -github.com/jackc/pgtype v1.3.1-0.20200510190516-8cd94a14c75a/go.mod h1:vaogEUkALtxZMCH411K+tKzNpwzCKU+AnPzBKZ+I+Po= -github.com/jackc/pgtype v1.3.1-0.20200606141011-f6355165a91c/go.mod h1:cvk9Bgu/VzJ9/lxTO5R5sf80p0DiucVtN7ZxvaC4GmQ= -github.com/jackc/pgtype v1.4.2/go.mod h1:JCULISAZBFGrHaOXIIFiyfzW5VY0GRitRr8NeJsrdig= -github.com/jackc/pgtype v1.8.1-0.20210724151600-32e20a603178/go.mod h1:C516IlIV9NKqfsMCXTdChteoXmwgUceqaLfjg2e3NlM= -github.com/jackc/pgtype v1.9.0/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4= -github.com/jackc/pgx/v4 v4.0.0-20190420224344-cc3461e65d96/go.mod h1:mdxmSJJuR08CZQyj1PVQBHy9XOp5p8/SHH6a0psbY9Y= -github.com/jackc/pgx/v4 v4.0.0-20190421002000-1b8f0016e912/go.mod h1:no/Y67Jkk/9WuGR0JG/JseM9irFbnEPbuWV2EELPNuM= -github.com/jackc/pgx/v4 v4.0.0-pre1.0.20190824185557-6972a5742186/go.mod h1:X+GQnOEnf1dqHGpw7JmHqHc1NxDoalibchSk9/RWuDc= -github.com/jackc/pgx/v4 v4.5.0/go.mod h1:EpAKPLdnTorwmPUUsqrPxy5fphV18j9q3wrfRXgo+kA= -github.com/jackc/pgx/v4 v4.6.1-0.20200510190926-94ba730bb1e9/go.mod h1:t3/cdRQl6fOLDxqtlyhe9UWgfIi9R8+8v8GKV5TRA/o= -github.com/jackc/pgx/v4 v4.6.1-0.20200606145419-4e5062306904/go.mod h1:ZDaNWkt9sW1JMiNn0kdYBaLelIhw7Pg4qd+Vk6tw7Hg= -github.com/jackc/pgx/v4 v4.8.1/go.mod h1:4HOLxrl8wToZJReD04/yB20GDwf4KBYETvlHciCnwW0= -github.com/jackc/pgx/v4 v4.12.1-0.20210724153913-640aa07df17c/go.mod h1:1QD0+tgSXP7iUjYm9C1NxKhny7lq6ee99u/z+IHFcgs= -github.com/jackc/pgx/v4 v4.14.0/go.mod h1:jT3ibf/A0ZVCp89rtCIN0zCJxcE74ypROmHEZYsG/j8= -github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jackc/puddle v1.1.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jackc/puddle v1.1.1/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jackc/puddle v1.2.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jackpal/go-nat-pmp v1.0.2-0.20160603034137-1fa385a6f458 h1:6OvNmYgJyexcZ3pYbTI9jWx5tHo1Dee/tWbLMfPe2TA= github.com/jackpal/go-nat-pmp v1.0.2-0.20160603034137-1fa385a6f458/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= -github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus= -github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= -github.com/jcmturner/gofork v0.0.0-20190328161633-dc7c13fece03/go.mod h1:MK8+TM0La+2rjBD4jE12Kj1pCCxK7d2LK/UM3ncEo0o= -github.com/jcmturner/gofork v1.0.0/go.mod h1:MK8+TM0La+2rjBD4jE12Kj1pCCxK7d2LK/UM3ncEo0o= github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e/go.mod h1:G1CVv03EnqU1wYL2dFwXxW2An0az9JTl/ZsqXQeBlkU= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jinzhu/gorm v1.9.10/go.mod h1:Kh6hTsSGffh4ui079FHrR5Gg+5D0hgihqDcsDN2BBJY= -github.com/jinzhu/gorm v1.9.15/go.mod h1:G3LB3wezTOWM2ITLzPxEXgSkOXAntiLHS7UdBefADcs= -github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= -github.com/jinzhu/now v1.0.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= -github.com/jinzhu/now v1.1.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= -github.com/jinzhu/now v1.1.3/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= -github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= -github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks= -github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= -github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= +github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= +github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= -github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= -github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jsternberg/zap-logfmt v1.0.0/go.mod h1:uvPs/4X51zdkcm5jXl5SYoN+4RK21K8mysFmDaM/h+o= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/julienschmidt/httprouter v1.1.1-0.20170430222011-975b5c4c7c21/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/jwilder/encoding v0.0.0-20170811194829-b4e1701a28ef/go.mod h1:Ct9fl0F6iIOGgxJ5npU/IUOhOhqlVrGjyIZc8/MagT0= +github.com/karalabe/usb v0.0.0-20190919080040-51dc0efba356 h1:I/yrLt2WilKxlQKCM52clh5rGzTKpVctGT1lH4Dc8Jw= github.com/karalabe/usb v0.0.0-20190919080040-51dc0efba356/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= -github.com/karalabe/usb v0.0.0-20211005121534-4c5740d64559/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= -github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= github.com/klauspost/compress v1.4.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.9.8/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.11.4/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.12.2/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/klauspost/compress v1.14.2/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/klauspost/compress v1.15.0 h1:xqfchp4whNFxn5A4XFyyYtitiWI8Hy5EW59jEwcyL6U= -github.com/klauspost/compress v1.15.0/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= -github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= -github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= -github.com/klauspost/cpuid/v2 v2.2.7 h1:ZWSB3igEs+d0qvnxR/ZBzXVmxkgt8DdzP6m9pfuVLDM= -github.com/klauspost/cpuid/v2 v2.2.7/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= github.com/klauspost/crc32 v0.0.0-20161016154125-cb6bfca970f6/go.mod h1:+ZoRqAPRLkC4NPOvfYeR5KNOrY6TD+/sAC3HXPZgDYg= github.com/klauspost/pgzip v1.0.2-0.20170402124221-0bf5dcad4ada/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= -github.com/klauspost/reedsolomon v1.9.2/go.mod h1:CwCi+NUr9pqSVktrkN+Ondf06rkhYZ/pcNv7fu+8Un4= -github.com/klaytn/klaytn v1.10.2 h1:AAmPn2fcuOTkprMLXkkpvo4uFwqcfAdFpvqBKKqXnNE= -github.com/klaytn/klaytn v1.10.2/go.mod h1:R8eUX9g0sXiiPnQMCDHlWOnDC4oJWWz/1pnudW+1u9c= -github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= -github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/labstack/echo v3.3.10+incompatible/go.mod h1:0INS7j/VjnFxD4E2wkz67b8cVwCLbBmJyDaka6Cmk1s= -github.com/labstack/echo/v4 v4.2.0/go.mod h1:AA49e0DZ8kk5jTOOCKNuPR6oTnBS0dYiM4FW1e6jwpg= github.com/labstack/echo/v4 v4.2.1/go.mod h1:AA49e0DZ8kk5jTOOCKNuPR6oTnBS0dYiM4FW1e6jwpg= github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= -github.com/labstack/gommon v0.3.1/go.mod h1:uW6kP17uPlLJsD3ijUYn3/M5bAxtlZhMI6m3MFxTMTM= -github.com/lbtsm/gotron-sdk v0.0.0-20240606062614-534038e71cd3 h1:qQl12EKzZEBlO673q0JcwYmKcchsNU3AmUk+tpil07A= -github.com/lbtsm/gotron-sdk v0.0.0-20240606062614-534038e71cd3/go.mod h1:rwhdwJSs5ffxJP/rWDjwOmOm95jHuGctideF2iKVly8= github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= -github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= -github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ= -github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= -github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/logrusorgru/aurora v2.0.3+incompatible h1:tOpm7WcpBTn4fjmVfgpQq0EfczGlG91VSDkswnjF5A8= -github.com/logrusorgru/aurora v2.0.3+incompatible/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4= -github.com/loinfish/azure-storage-go v0.0.1/go.mod h1:YsT+4v7OqiQBdDsBXv+FFJybzt9dkHWOagHklsnQ1s0= -github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= -github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20180730094502-03f2033d19d5/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/mapprotocol/atlas v0.5.1-0.20220530091946-06b376fbe9bd h1:krkCRyCyN86ZWDsMEDXF6yWdwy1ED8L+L05j3Ef8f1Q= -github.com/mapprotocol/atlas v0.5.1-0.20220530091946-06b376fbe9bd/go.mod h1:+8rp2bisFkLOTObsmvfbAdlK7exl73oFaQvhuBNTn3E= -github.com/mapprotocol/near-api-go v0.0.0-20220801061430-b9e1d4580dc5 h1:jxUzl2Aeh929pD4g43s5PhiCGCR9gDGF26gMNHOFJBY= -github.com/mapprotocol/near-api-go v0.0.0-20220801061430-b9e1d4580dc5/go.mod h1:5UbxScOB/xumHSVu0QDatqT8ccm4n/mHWbX+4OjggKk= github.com/matryer/moq v0.0.0-20190312154309-6cfb0558e1bd/go.mod h1:9ELz6aaclSIGnZBoaSLZ3NAl1VTufbOrXBPvtcy6WiQ= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-colorable v0.1.0 h1:v2XXALHHh6zHfYTJ+cSkwtyffnaOyR1MXaA91mTrb8o= github.com/mattn/go-colorable v0.1.0/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= -github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= -github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-ieproxy v0.0.0-20190610004146-91bb50d98149/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc= github.com/mattn/go-ieproxy v0.0.0-20190702010315-6dee0af9227d/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.5-0.20180830101745-3fb116b82035 h1:USWjF42jDCSEeikX/G1g40ZWnsPXN5WkZ4jMHZWyBK4= github.com/mattn/go-isatty v0.0.5-0.20180830101745-3fb116b82035/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= -github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= -github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= +github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= -github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= -github.com/mattn/go-runewidth v0.0.10 h1:CoZ3S2P7pvtP45xOtBw+/mDL2z0RKI576gSkzRRpdGg= -github.com/mattn/go-runewidth v0.0.10/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk= -github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= -github.com/mattn/go-sqlite3 v1.10.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= +github.com/mattn/go-runewidth v0.0.12/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk= +github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU= +github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= -github.com/mattn/go-sqlite3 v1.14.0/go.mod h1:JIl7NbARA7phWnGvh0LKTyg7S9BA+6gx71ShQilpsus= -github.com/mattn/go-sqlite3 v1.14.12/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= +github.com/mattn/go-sqlite3 v1.14.8 h1:gDp86IdQsN/xWjIEmr9MF6o9mpksUgh0fu+9ByFxzIU= +github.com/mattn/go-sqlite3 v1.14.8/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/mattn/go-tty v0.0.0-20180907095812-13ff1204f104/go.mod h1:XPvLUNfbS4fJH25nqRHfWLMa1ONC8Amw+mIA639KxkE= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= -github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/miekg/dns v1.1.25/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= -github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= -github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= -github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.3.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.4.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/pointerstructure v1.2.0/go.mod h1:BRAsLI5zgXmw97Lf6s25bs8ohIXc3tViBH44KcwB2g4= -github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180320133207-05fbef0ca5da/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= -github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= -github.com/mostynb/zstdpool-freelist v0.0.0-20201229113212-927304c0c3b1 h1:mPMvm6X6tf4w8y7j9YIt6V9jfWhL6QlbEc7CCmeQlWk= -github.com/mostynb/zstdpool-freelist v0.0.0-20201229113212-927304c0c3b1/go.mod h1:ye2e/VUEtE2BHE+G/QcKkcLQVAEJoYRFj5VUOQatCRE= -github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= -github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae/go.mod h1:qAyveg+e4CE+eKJXWVjKXM4ck2QobLqTDytGJbLLhJg= -github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/naoina/go-stringutil v0.1.0/go.mod h1:XJ2SJL9jCtBh+P9q5btrd/Ylo8XwT/h1USek5+NqSA0= github.com/naoina/toml v0.1.2-0.20170918210437-9fafd6967416/go.mod h1:NBIhNtsFMo3G2szEBne+bO4gS192HuIYRqfvOWb4i1E= -github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= -github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= -github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= -github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= -github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= -github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= -github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= -github.com/newrelic/go-agent/v3 v3.11.0/go.mod h1:1A1dssWBwzB7UemzRU6ZVaGDsI+cEn5/bNxI0wiYlIc= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= -github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= -github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= -github.com/oasisprotocol/curve25519-voi v0.0.0-20220328075252-7dd334e3daae h1:7smdlrfdcZic4VfsGKD2ulWL804a4GVphr4s7WZxGiY= -github.com/oasisprotocol/curve25519-voi v0.0.0-20220328075252-7dd334e3daae/go.mod h1:hVoHR2EVESiICEMbg137etN/Lx+lSrHPTD39Z/uE+2s= -github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= -github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= -github.com/olekukonko/tablewriter v0.0.1/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= -github.com/olekukonko/tablewriter v0.0.2-0.20190409134802-7e037d187b0c/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= -github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/ginkgo v1.14.1/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= -github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.10.2/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.16.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= -github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE= -github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= -github.com/openconfig/gnmi v0.0.0-20190823184014-89b2bf29312c/go.mod h1:t+O9It+LKzfOAhKTT5O0ehDix+MTqbtT0T9t+7zzOvc= -github.com/openconfig/reference v0.0.0-20190727015836-8dfd928c9696/go.mod h1:ym2A+zigScwkSEb/cVQB0/ZMpU3rqiH6X7WRRsxgOGw= -github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= -github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.0.3-0.20180606204148-bd9c31933947/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= -github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxSfWAKL3wpBW7V8scJMt8N8gnaMCS9E/cA= -github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= -github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= -github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= -github.com/otiai10/copy v1.0.1/go.mod h1:8bMCJrAqOtN/d9oyh5HR7HhLQMvcGMpGdwRDYsfOCHc= -github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE= -github.com/otiai10/mint v1.2.3/go.mod h1:YnfyPNhBvnY8bW4SGQHCs/aAFhkgySlMZbrF5U0bOVw= -github.com/otiai10/mint v1.2.4/go.mod h1:d+b7n/0R3tdyUYYylALXpWQ/kTN+QobSq/4SRGBkR3M= -github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/paulbellamy/ratecounter v0.2.0/go.mod h1:Hfx1hDpSGoqxkVVpBi/IlYD7kChlfo5C6hzIHwPqfFE= -github.com/pbnjay/memory v0.0.0-20190104145345-974d429e7ae4 h1:MfIUBZ1bz7TgvQLVa/yPJZOGeKEgs6eTKUjz3zB4B+U= -github.com/pbnjay/memory v0.0.0-20190104145345-974d429e7ae4/go.mod h1:RMU2gJXhratVxBDTFeOdNhd540tG57lt9FIUV0YLvIQ= -github.com/pborman/uuid v0.0.0-20170112150404-1b00554d8222/go.mod h1:VyrYX9gd7irzKovcSS6BIIEwPRkP2Wm2m9ufcdFSJ34= -github.com/pborman/uuid v0.0.0-20170612153648-e790cca94e6c/go.mod h1:VyrYX9gd7irzKovcSS6BIIEwPRkP2Wm2m9ufcdFSJ34= -github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= -github.com/pborman/uuid v1.2.1 h1:+ZZIw58t/ozdjRaXh/3awHfmWRbzYxJoAdNJxe/3pvw= -github.com/pborman/uuid v1.2.1/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM= -github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= -github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= +github.com/pelletier/go-toml v1.9.3 h1:zeC5b1GviRUyKYd6OJPvBU/mcVDVoL1OhT17FCt5dSQ= +github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= +github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/peterh/liner v1.0.1-0.20180619022028-8c1271fcf47f/go.mod h1:xIteQHvHuaLYG9IFj6mSxM0fCKrs34IrEQUhOYuGPHc= +github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7 h1:oYW+YCJ1pachXTQmzR3rNLYGGz4g/UgFcjb28p/viDM= github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0= -github.com/peterh/liner v1.2.1/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0= github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= -github.com/philhofer/fwd v1.1.1/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= -github.com/pierrec/lz4 v0.0.0-20190327172049-315a67e90e41/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= -github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= -github.com/pierrec/lz4 v2.4.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= -github.com/pierrec/lz4 v2.5.2+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= -github.com/pierrec/lz4/v4 v4.1.14/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= -github.com/pierrec/xxHash v0.1.5/go.mod h1:w2waW5Zoa/Wc4Yqe0wgrIYAGKqRMf7czn2HNKXmuL+I= -github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= +github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= github.com/pkg/term v0.0.0-20180730021639-bffc007b7fd5/go.mod h1:eCbImbZ95eXtAUIbLAuAVnBnwf83mjf6QIVH8SHYwqQ= -github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4xf/QclQDMrYNZzcM= -github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g= -github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= -github.com/prometheus/client_golang v1.4.1/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= -github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw= -github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= -github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= -github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= -github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= -github.com/prometheus/common v0.39.0 h1:oOyhkDq05hPZKItWVBkJ6g6AtGxi+fy7F4JvUV8uhsI= -github.com/prometheus/common v0.39.0/go.mod h1:6XBZ7lYdLCbkAVhwRsWTZn+IN5AB9F/NXd5w0BbEX0Y= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= -github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= -github.com/prometheus/procfs v0.0.10/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= -github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI= -github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY= -github.com/prometheus/prometheus v2.1.0+incompatible/go.mod h1:oAIUtOny2rjMX0OWN5vPR5/q/twIROJvdqnQKDdil/s= -github.com/prometheus/tsdb v0.6.2-0.20190402121629-4f204dcbc150/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= +github.com/prometheus/tsdb v0.7.1 h1:YZcsG11NqnK4czYLrWd9mpEuAJIHVQLwdrleYfszMAA= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= -github.com/prometheus/tsdb v0.10.0 h1:If5rVCMTp6W2SiRAQFlbpJNgVlgMEd+U2GZckwK38ic= -github.com/prometheus/tsdb v0.10.0/go.mod h1:oi49uRhEe9dPUTlS3JRZOwJuVi6tmh10QSgwXEyGCt4= -github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/rcrowley/go-metrics v0.0.0-20190826022208-cac0b30c2563/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/retailnext/hllpp v1.0.1-0.20180308014038-101a6d2f8b52/go.mod h1:RDpi1RftBQPUCDRw6SmxeaREsAaRKnOclghuzp/WRzc= github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rjeczalik/notify v0.9.1 h1:CLCKso/QK1snAlnhNR/CNvNiFU2saUtjV0bx3EwNeCE= github.com/rjeczalik/notify v0.9.1/go.mod h1:rKwnCoCGeuQnwBtTSPL9Dad03Vh2n40ePRrjvIXnJho= -github.com/rjeczalik/notify v0.9.2/go.mod h1:aErll2f0sUX9PXZnVNyeiObbmTlk5jnMoCa4QEjJeqM= -github.com/rjeczalik/notify v0.9.3 h1:6rJAzHTGKXGj76sbRgDiDcYj/HniypXmSJo1SWakZeY= -github.com/rjeczalik/notify v0.9.3/go.mod h1:gF3zSOrafR9DQEWSE8TjfI9NkooDxbyT4UgRGKZA0lc= -github.com/robertkrimen/otto v0.0.0-20180506084358-03d472dc43ab/go.mod h1:xvqspoSXJTIpemEonrMDFq6XzwHYYgToXWj5eRX1OtY= -github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= -github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rs/cors v0.0.0-20160617231935-a62a804a8a00/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= +github.com/rs/cors v1.7.0 h1:+88SsELBHx5r+hZ8TCkggzSstaWNbDvThkVK8H6f9ik= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= -github.com/rs/xhandler v0.0.0-20160618193221-ed27b6fd6521/go.mod h1:RvLn4FgxWubrpZHtQLnOf6EwhN2hEMusxZOhcW9H3UQ= -github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= -github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= -github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc= -github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= -github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= -github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= -github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/segmentio/kafka-go v0.1.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo= github.com/segmentio/kafka-go v0.2.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo= -github.com/segmentio/kafka-go v0.4.29/go.mod h1:m1lXeqJtIFYZayv0shM/tjrAFljvWLTprxBHd+3PnaU= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= -github.com/shengdoushi/base58 v1.0.0 h1:tGe4o6TmdXFJWoI31VoSWvuaKxf0Px3gqa3sUWhAxBs= -github.com/shengdoushi/base58 v1.0.0/go.mod h1:m5uIILfzcKMw6238iWAhP4l3s5+uXyF3+bJKUNhAL9I= -github.com/shirou/gopsutil v2.20.5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible h1:Bn1aCHHRnjv4Bl16T8rcaFjYSrGrIZvpiGO6P3Q4GpU= github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= -github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= -github.com/shopspring/decimal v0.0.0-20200227202807-02e2044944cc/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= -github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= -github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= -github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/sigurn/crc16 v0.0.0-20211026045750-20ab5afb07e3 h1:aQKxg3+2p+IFXXg97McgDGT5zcMrQoi0EICZs8Pgchs= -github.com/sigurn/crc16 v0.0.0-20211026045750-20ab5afb07e3/go.mod h1:9/etS5gpQq9BJsJMWg1wpLbfuSnkm8dPF6FdW2JXVhA= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= -github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= -github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= +github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/go-aws-auth v0.0.0-20180515143844-0c1422d1fdb9/go.mod h1:SnhjPscd9TpLiy1LpzGSKh3bXCfxxXuqd9xmQJy3slM= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= -github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= +github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/cobra v1.2.1 h1:+KmjbUw1hriSNMF55oPrkZcb27aECyrj8V2ytv7kWDw= +github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk= +github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= +github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= +github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4 h1:Gb2Tyox57NRNuZ2d3rmvB3pcmbu7O1RS3m8WRx7ilrg= github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q= -github.com/status-im/keycard-go v0.0.0-20191119114148-6dd40a46baa0/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q= -github.com/steakknife/bloomfilter v0.0.0-20180922174646-6819c0d2a570/go.mod h1:8OR4w3TdeIHIh1g6EMY5p0gVNOovcWC+1vpc7naMuAw= -github.com/steakknife/hamming v0.0.0-20180906055917-c99c65617cd3/go.mod h1:hpGUWaI9xL8pRQCTXQgocU38Qw1g0Us7n5PxxTwTCYU= -github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= -github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= -github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= -github.com/streamingfast/logging v0.0.0-20230608130331-f22c91403091 h1:RN5mrigyirb8anBEtdjtHFIufXdacyTi6i4KBfeNXeo= -github.com/streamingfast/logging v0.0.0-20230608130331-f22c91403091/go.mod h1:VlduQ80JcGJSargkRU4Sg9Xo63wZD/l8A5NC/Uo1/uU= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= -github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= -github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.0/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -github.com/syndtr/goleveldb v1.0.0/go.mod h1:ZVVdQEZoIme9iO1Ch2Jdy24qqXrMMOU6lpPAyBWyWuQ= -github.com/syndtr/goleveldb v1.0.1-0.20190923125748-758128399b1d/go.mod h1:9OrXJhf154huy1nPWmuSrkgjPUtUNhA+Zmy+6AESzuA= -github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= -github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= -github.com/templexxx/cpufeat v0.0.0-20180724012125-cef66df7f161/go.mod h1:wM7WEvslTq+iOEAMDLSzhVuOt5BRZ05WirO+b09GHQU= -github.com/templexxx/xor v0.0.0-20181023030647-4e92f724b73b/go.mod h1:5XA7W9S6mni3h5uvOC75dA3m9CCCaS83lltmc0ukdi4= -github.com/test-go/testify v1.1.4 h1:Tf9lntrKUMHiXQ07qBScBTSA0dhYQlu83hswqelv1iE= -github.com/test-go/testify v1.1.4/go.mod h1:rH7cfJo/47vWGdi4GPj16x3/t1xGOj2YxzmNQzk2ghU= -github.com/tidwall/btree v0.3.0/go.mod h1:huei1BkDWJ3/sLXmO+bsCNELL+Bp2Kks9OLyQFkzvA8= -github.com/tidwall/btree v1.1.0/go.mod h1:TzIRzen6yHbibdSfK6t8QimqbUnoxUSrZfeW7Uob0q4= -github.com/tidwall/buntdb v1.2.0/go.mod h1:XLza/dhlwzO6dc5o/KWor4kfZSt3BP8QV+77ZMKfI58= -github.com/tidwall/gjson v1.6.7/go.mod h1:zeFuBCIqD4sN/gmqBzZ4j7Jd6UcA2Fc56x7QFsv+8fI= -github.com/tidwall/gjson v1.6.8/go.mod h1:zeFuBCIqD4sN/gmqBzZ4j7Jd6UcA2Fc56x7QFsv+8fI= -github.com/tidwall/gjson v1.12.1/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= -github.com/tidwall/grect v0.1.0/go.mod h1:sa5O42oP6jWfTShL9ka6Sgmg3TgIK649veZe05B7+J8= -github.com/tidwall/grect v0.1.4/go.mod h1:9FBsaYRaR0Tcy4UwefBX/UDcDcDy9V5jUcxHzv2jd5Q= -github.com/tidwall/match v1.0.3/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= -github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= -github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= -github.com/tidwall/pretty v1.0.2/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= -github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= -github.com/tidwall/rtred v0.1.2/go.mod h1:hd69WNXQ5RP9vHd7dqekAz+RIdtfBogmglkZSRxCHFQ= -github.com/tidwall/tinyqueue v0.1.1/go.mod h1:O/QNHwrnjqr6IHItYrzoHAKYhBkLI67Q096fQP5zMYw= +github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= +github.com/syndtr/goleveldb v1.0.1-0.20210305035536-64b5b1c73954 h1:xQdMZ1WLrgkkvOZ/LDQxjVxMLdby7osSh4ZEVa5sIjs= +github.com/syndtr/goleveldb v1.0.1-0.20210305035536-64b5b1c73954/go.mod h1:u2MKkTVTVJWe5D1rCvame8WqhBd88EuIwODJZ1VHCPM= github.com/tinylib/msgp v1.0.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= -github.com/tinylib/msgp v1.1.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= -github.com/tjfoc/gmsm v1.0.1/go.mod h1:XxO4hdhhrzAd+G4CjDqaOkd0hUzmtPR/d3EiBBMn/wc= github.com/tklauser/go-sysconf v0.3.5 h1:uu3Xl4nkLzQfXNsWn15rPc/HQCJKObbt1dKJeWp3vU4= github.com/tklauser/go-sysconf v0.3.5/go.mod h1:MkWzOF4RMCshBAMXuhXJs64Rte09mITnppBXY/rYEFI= github.com/tklauser/numcpus v0.2.2 h1:oyhllyrScuYI6g+h/zUvNXNp1wy7x8qQy3t/piefldA= github.com/tklauser/numcpus v0.2.2/go.mod h1:x3qojaO3uyYt0i56EW/VUYs7uBvdl2fkfZFu0T9wgjM= -github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc/go.mod h1:bciPuU6GHm1iF1pBvUfxfsH0Wmnc2VbpgvbI9ZWuIRs= -github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= -github.com/twitchtv/twirp v8.1.1+incompatible/go.mod h1:RRJoFSAmTEh2weEqWtpPE3vFK5YBhA6bqp2l1kfCC5A= -github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= -github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= +github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef h1:wHSqTBrZW24CsNJDfeh9Ex6Pm0Rcpc7qrgKBiL44vF4= github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= -github.com/tyler-smith/go-bip39 v1.0.2/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= -github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2nyfOP8= -github.com/tyler-smith/go-bip39 v1.1.0/go.mod h1:gUYDtqQw1JS3ZJ8UWVcGTGqqr6YIN3CWg+kkNaLt55U= -github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= -github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= -github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= -github.com/ugorji/go/codec v1.2.12 h1:9LC83zGrHhuUA9l16C9AHXAqEV/2wBQ4nkvumAE65EE= -github.com/ugorji/go/codec v1.2.12/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= -github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= -github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= -github.com/urfave/cli/v2 v2.24.1 h1:/QYYr7g0EhwXEML8jO+8OYt5trPnLHS0p3mrgExJ5NU= -github.com/urfave/cli/v2 v2.24.1/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc= -github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.26.0/go.mod h1:cmWIqlu99AO/RKcp1HWaViTqc57FswJOfYYdPJBl8BA= -github.com/valyala/fasthttp v1.34.0/go.mod h1:epZA5N+7pY6ZaEKRmstzOuYJx9HI8DI1oaCGZpdH4h0= github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= -github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= -github.com/vmihailenco/bufpool v0.1.11/go.mod h1:AFf/MOy3l2CFTKbxwt0mp2MwnqjNEs5H/UxrkA5jxTQ= -github.com/vmihailenco/msgpack/v4 v4.3.11/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+NXzzngzBKDPIqw4= -github.com/vmihailenco/msgpack/v5 v5.0.0-beta.1/go.mod h1:xlngVLeyQ/Qi05oQxhQ+oTuqa03RjMwMfk/7/TCs+QI= -github.com/vmihailenco/msgpack/v5 v5.3.4/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc= -github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= -github.com/vmihailenco/tagparser v0.1.2/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= -github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= github.com/willf/bitset v1.1.3/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= -github.com/wsddn/go-ecdh v0.0.0-20161211032359-48726bab9208/go.mod h1:IotVbo4F+mw0EzQ08zFqg7pK3FebNXpaMsRy2RT+Ees= -github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= -github.com/xdg-go/scram v1.0.2/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+hCSs= -github.com/xdg-go/scram v1.1.2/go.mod h1:RT/sEzTbU5y00aCK8UOx6R7YryM0iF1N2MOmC3kKLN4= -github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM= -github.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gijq1dTyGkM= -github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= -github.com/xdg/stringprep v1.0.0/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= -github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= -github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= -github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= -github.com/xssnick/tonutils-go v1.10.2 h1:1wgnQPrzbOt+5PtuNrlMSUyh1/y0pvWRi0zeRNRLEbw= -github.com/xssnick/tonutils-go v1.10.2/go.mod h1:p1l1Bxdv9sz6x2jfbuGQUGJn6g5cqg7xsTp8rBHFoJY= -github.com/xtaci/kcp-go v5.4.5+incompatible/go.mod h1:bN6vIwHQbfHaHtFpEssmWsN45a+AZwO7eyRCmEIbtvE= -github.com/xtaci/lossyconn v0.0.0-20190602105132-8df528c0c9ae/go.mod h1:gXtu8J62kEgmN++bm9BVICuT/e8yiLI2KFobd/TRFsE= -github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= -github.com/zenazn/goji v1.0.1/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= -github.com/zondax/hid v0.9.1 h1:gQe66rtmyZ8VeGFcOpbuH3r7erYtNEAezCAYu8LdkJo= -github.com/zondax/hid v0.9.1/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= -go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= -go.mongodb.org/mongo-driver v1.7.5/go.mod h1:VXEWRZ6URJIkUq2SCAyapmhH0ZLRBP+FT4xhp5Zvxng= -go.mongodb.org/mongo-driver v1.12.2 h1:gbWY1bJkkmUB9jjZzcdhOL8O85N9H+Vvsf2yFN0RDws= -go.mongodb.org/mongo-driver v1.12.2/go.mod h1:/rGBTebI3XYboVmgz+Wv3Bcbl3aD0QF9zl6kDDw18rQ= -go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= -go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= +go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= +go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= +go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opentelemetry.io/otel v0.11.0/go.mod h1:G8UCk+KooF2HLkgo8RHX9epABH/aRGYET7gQOqBVdB0= -go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= +go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI= -go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= -go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= -go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= -go.uber.org/ratelimit v0.2.0 h1:UQE2Bgi7p2B85uP5dC2bbRtig0C+OeNRnNEafLjsLPA= -go.uber.org/ratelimit v0.2.0/go.mod h1:YYBV4e4naJvhpitQrWJu1vCpgB7CboMe0qhltKt6mUg= -go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= -go.uber.org/zap v1.21.0 h1:WefMeulhovoZ2sYXz7st6K0sLj7bBhpiFaud4r4zST8= -go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= -go4.org/intern v0.0.0-20211027215823-ae77deb06f29/go.mod h1:cS2ma+47FKrLPdXFpr7CuxiTW3eyJbWew4qx0qtQWDA= -go4.org/unsafe/assume-no-moving-gc v0.0.0-20211027215541-db492cf91b37/go.mod h1:FftLjUGFEDu5k8lt0ddY+HcrH/qU/0qk+H8j9/nTl3E= -golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= -golang.org/x/arch v0.8.0 h1:3wRIsP3pM4yUptoR96otTUOXI367OS0+c9eeRi9doIc= -golang.org/x/arch v0.8.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= +go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20180910181607-0e37d006457b/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190404164418-38d8ce5564a5/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= -golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= -golang.org/x/crypto v0.0.0-20190418165655-df01cb2cc480/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= -golang.org/x/crypto v0.0.0-20190506204251-e1dfcc566284/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190909091759-094676da4a83/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191205180655-e7c4368fe9dd/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200204104054-c9f3fb736b72/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= +golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2 h1:It14KIkyBFYkHkwZ7k45minvA9aorojkyjGk9KJ5B/w= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= +golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e h1:gsTQYXdTw2Gq7RBsWvlQ91b+aEQ6bXFUngBGuR8sPpI= golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= -golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= +golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 h1:HWj/xjIHfjYU5nVXpTM0s39J9CbLn7Cc5a7IC5rwsMQ= +golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1284,8 +572,6 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20200901203048-c4f52b2c50aa/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20200908183739-ae8ad444f925/go.mod h1:1phAWC201xIgDyaFpmDeZkgf70Q4Pd/CNqfRtVPtxNw= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= @@ -1299,6 +585,7 @@ golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= @@ -1308,11 +595,9 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.3.1-0.20200828183125-ce943fd02449/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1321,9 +606,7 @@ golang.org/x/net v0.0.0-20181011144130-49bb7cea24b1/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -1332,11 +615,8 @@ golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190912160710-24e19bdeb0f2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -1349,29 +629,34 @@ golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210220033124-5f55cee0dc0d/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 h1:4nGaVu0QrbjT/AK2PRLuQfQuh6DJve+pELhqTdAj3x0= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= -golang.org/x/net v0.0.0-20210510120150-4163338589ed/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d h1:20cMwl2fHAzkJMEA+8J4JgqBQcQGzbisXo31MIeenXI= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= -golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1379,52 +664,34 @@ golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= -golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= -golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180926160741-c2ed4eda69e7/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190912141932-bc967efca4b8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200107162124-548cf772de50/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1441,72 +708,56 @@ golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200826173525-f9321e4c35a6/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210316164454-77fc1eacc6aa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210420205809-ac73e9fd8988/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1 h1:SrN+KX8Art/Sf4HNj6Zcz06G7VEz+7w9tdXTPOZ7+l4= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211103235746-7861aae1554b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= -golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.0.0-20210909193231-528a39cd75f3 h1:3Ad41xy2WCESpufXwgs7NpDSu+vjxqLt2UFqUV+20bI= +golang.org/x/sys v0.0.0-20210909193231-528a39cd75f3/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.20.0 h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw= -golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= -golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b h1:9zKuko04nR4gjZ4+DNjHqRlAJqbJETHwiNKDqTfOjfE= +golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= -golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20201208040808-7e3f01d25324 h1:Hir2P/De0WpUhtrKGGjvSb2YxUgyZ7EFOSLIcSSpiwE= golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba h1:O8mE0/t419eoIwhTFpKVkHiTs/Igowgfkj25AcZrtiE= golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11 h1:GZokNIeuVkl3aZHJchRrr13WCsols02MLUcz1U9is6M= -golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -1516,21 +767,15 @@ golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3 golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190425163242-31fd60d6bfdc/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190823170909-c4a336ef6a2f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190912185636-87d9f09c5d89/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -1538,7 +783,6 @@ golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200108203644-89082a384178/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -1554,16 +798,19 @@ golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWc golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200527183253-8e7acdbce89d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= +golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1574,7 +821,6 @@ gonum.org/v1/gonum v0.6.0/go.mod h1:9mxDZsDKxgMAuccQkewq682L+0eCu4dCN2yonUJTCLU= gonum.org/v1/netlib v0.0.0-20181029234149-ec6d1f5cefe6/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= -google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= @@ -1588,22 +834,27 @@ google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/ google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.25.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= +google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= +google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= +google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= +google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= +google.golang.org/api v0.44.0/go.mod h1:EBOGZqzyhtvMDoxwS97ctnh0zUmYY6CxqXsc1AvkYD8= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= google.golang.org/genproto v0.0.0-20190716160619-c506a9f90610/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= @@ -1627,33 +878,41 @@ google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200528110217-3d3490e7e671/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200726014623-da3ae01ef02d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84 h1:R1r5J0u6Cx+RNl/6mezTw6oA14cmKC96FeUwL6A9bd4= -google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= -google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= +google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= +google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.41.0 h1:f+PlOh7QV4iIJkPrx5NQ7qaNGFQ3OTse67yaDHfju4E= -google.golang.org/grpc v1.41.0/go.mod h1:U3l9uK9J0sini8mHphKoXyaqDA/8VyGnDee1zzIUK6k= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -1665,68 +924,31 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= -google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= -gopkg.in/DataDog/dd-trace-go.v1 v1.40.1/go.mod h1:tlSNIf2aKOah7PmoEP4qQETNVKgonk5BWwNnblw8C8w= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= -gopkg.in/bsm/ratelimit.v1 v1.0.0-20160220154919-db14e161995a/go.mod h1:KF9sEfUPAXdG8Oev9e99iLGnl2uJMjc5B+4y3O7x610= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/fatih/set.v0 v0.1.0/go.mod h1:5eLWEndGL4zGGemXWrKuts+wTJR0y+w+auqUJZbmyBg= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= -gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s= -gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/jcmturner/aescts.v1 v1.0.1/go.mod h1:nsR8qBOg+OucoIW+WMhB3GspUQXq9XorLnQb9XtvcOo= -gopkg.in/jcmturner/dnsutils.v1 v1.0.1/go.mod h1:m3v+5svpVOhtFAP/wSz+yzh4Mc0Fg7eRhxkJMWSIz9Q= -gopkg.in/jcmturner/goidentity.v3 v3.0.0/go.mod h1:oG2kH0IvSYNIu80dVAyu/yoefjq1mNfM5bm88whjWx4= -gopkg.in/jcmturner/gokrb5.v7 v7.2.3/go.mod h1:l8VISx+WGYp+Fp7KRbsiUuXTTOnxIc3Tuvyavf11/WM= -gopkg.in/jcmturner/gokrb5.v7 v7.5.0/go.mod h1:l8VISx+WGYp+Fp7KRbsiUuXTTOnxIc3Tuvyavf11/WM= -gopkg.in/jcmturner/rpc.v1 v1.1.0/go.mod h1:YIdkC4XfD6GXbzje11McwsDuOlZQSb9W4vfLvuNnlv8= -gopkg.in/jinzhu/gorm.v1 v1.9.1/go.mod h1:56JJPUzbikvTVnoyP1nppSkbJ2L8sunqTBDY2fDrmFg= +gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce h1:+JknDZhAj8YMt7GC73Ei8pv4MzjDUNPHgQWJdtMAaDU= gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200619000410-60c24ae608a6/go.mod h1:uAJfkITjFhyEEuUfm7bsmCZRbW5WRq8s9EY8HZ6hCns= -gopkg.in/olivere/elastic.v3 v3.0.75/go.mod h1:yDEuSnrM51Pc8dM5ov7U8aI/ToR3PG0llA8aRv2qmw0= -gopkg.in/olivere/elastic.v5 v5.0.84/go.mod h1:LXF6q9XNBxpMqrcgax95C6xyARXWbbCXUrtTxrNrxJI= -gopkg.in/redis.v4 v4.2.4/go.mod h1:8KREHdypkCEojGKQcjMqAODMICIVwZAONWq8RowTITA= -gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= -gopkg.in/sourcemap.v1 v1.0.5/go.mod h1:2RlvNNSMglmRrcvhfuzp4hQHwOtjxlbjX7UPY/GXb78= -gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/urfave/cli.v1 v1.20.0 h1:NdAVW6RYxDif9DhDHaAortIu956m2c0v+09AZBPTbE0= gopkg.in/urfave/cli.v1 v1.20.0/go.mod h1:vuBzUtMdQeixQj8LVd+/98pzhxNGQoyuPBlsXHOQNO0= -gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= -gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gorm.io/driver/mysql v1.0.1/go.mod h1:KtqSthtg55lFp3S5kUXqlGaelnWpKitn4k1xZTnoiPw= -gorm.io/driver/postgres v1.0.0/go.mod h1:wtMFcOzmuA5QigNsgEIb7O5lhvH1tHAF1RbWmLWV4to= -gorm.io/driver/sqlserver v1.0.4/go.mod h1:ciEo5btfITTBCj9BkoUVDvgQbUdLWQNqdFY5OGuGnRg= -gorm.io/gorm v1.9.19/go.mod h1:0HFTzE/SqkGTzK6TlDPPQbAYCluiVvhzoA1+aVyzenw= -gorm.io/gorm v1.20.0/go.mod h1:0HFTzE/SqkGTzK6TlDPPQbAYCluiVvhzoA1+aVyzenw= -gorm.io/gorm v1.20.6/go.mod h1:0HFTzE/SqkGTzK6TlDPPQbAYCluiVvhzoA1+aVyzenw= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= -honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -1735,22 +957,7 @@ honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= -inet.af/netaddr v0.0.0-20211027220019-c74959edd3b6/go.mod h1:y3MGhcFMlh0KZPMuXXow8mpjxxAk3yoDNsp4cQz54i8= -k8s.io/api v0.17.0/go.mod h1:npsyOePkeP0CPwyGfXDHxvypiYMJxBWAMpQxCaJ4ZxI= -k8s.io/apimachinery v0.17.0/go.mod h1:b9qmWdKlLuU9EBh+06BtLcSf/Mu89rWL33naRxs1uZg= -k8s.io/client-go v0.17.0/go.mod h1:TYgR6EUHs6k45hb6KWjVD6jFZvJV4gHDikv/It0xz+k= -k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= -k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= -k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= -k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= -k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= -mellium.im/sasl v0.2.1/go.mod h1:ROaEDLQNuf9vjKqE1SrAfnsobm2YKXT1gnN1uDp1PjQ= -nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= -sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= -sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= diff --git a/http_call/head_store.go b/http_call/head_store.go new file mode 100644 index 00000000..2d5fb894 --- /dev/null +++ b/http_call/head_store.go @@ -0,0 +1,25 @@ +package http_call + +import ( + "encoding/json" + "github.com/mapprotocol/compass/types" + "github.com/mapprotocol/compass/utils" + log "github.com/sirupsen/logrus" +) + +func HeaderCurrentNumber(url string, chainEnum types.ChainId) (num uint64) { + requestBody, _ := json.Marshal(types.Request{ + Method: "header_currentHeaderNumber", + Params: []types.ChainId{chainEnum}, + Id: "1", + }) + responseByte := utils.RpcToolFromRequestByte2ResponseByte(&url, &requestBody) + err := json.Unmarshal(*responseByte, &struct { + Result *uint64 `json:"result"` + }{&num}) + if err != nil { + log.Warnln("HeaderCurrentNumber error: ", err) + return ^uint64(0) + } + return +} diff --git a/internal/abi/abi.go b/internal/abi/abi.go deleted file mode 100644 index 4f426703..00000000 --- a/internal/abi/abi.go +++ /dev/null @@ -1,49 +0,0 @@ -package abi - -import ( - "fmt" - "math/big" - "strings" - - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/common" -) - -type BridgeParam struct { - Relay bool `json:"relay"` - Referrer common.Address `json:"referrer"` - TransferId [32]byte `json:"transferId"` - GasLimit *big.Int `json:"gasLimit"` - SwapData []byte `json:"swapData"` -} - -func DecodeBridgeParam(_bridgeData []byte) (*BridgeParam, error) { - // 定义ABI参数类型 - nAbi, err := abi.JSON(strings.NewReader(`[{"inputs":[{"components":[{"name":"relay","type":"bool"},{"name":"referrer","type":"address"},{"name":"transferId","type":"bytes32"},{"name":"gasLimit","type":"uint256"},{"name":"swapData","type":"bytes"}],"internalType":"","name":"","type":"tuple"}],"name":"bridgeParse","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]`)) - if err != nil { - return nil, err - } - decodedValues, err := nAbi.Methods["bridgeParse"].Inputs.UnpackValues(_bridgeData) - if err != nil { - return nil, err - } - - c, ok := decodedValues[0].(struct { - Relay bool `json:"relay"` - Referrer common.Address `json:"referrer"` - TransferId [32]byte `json:"transferId"` - GasLimit *big.Int `json:"gasLimit"` - SwapData []byte `json:"swapData"` - }) - if !ok { - return nil, fmt.Errorf("abi: cannot unpack into bridge param") - } - - return &BridgeParam{ - Relay: c.Relay, - Referrer: c.Referrer, - TransferId: c.TransferId, - GasLimit: c.GasLimit, - SwapData: c.SwapData, - }, nil -} diff --git a/internal/arb/arb.go b/internal/arb/arb.go deleted file mode 100644 index f50a6828..00000000 --- a/internal/arb/arb.go +++ /dev/null @@ -1,45 +0,0 @@ -package arb - -import ( - "bytes" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/rlp" - "github.com/mapprotocol/compass/internal/constant" - "github.com/mapprotocol/compass/internal/proof" -) - -const ( - ArbitrumLegacyTxType = 120 -) - -type Receipts []*Receipt - -type Receipt struct { - *types.Receipt -} - -func (r *Receipt) statusEncoding() []byte { - if len(r.PostState) == 0 { - if r.Status == constant.ReceiptStatusFailed { - return constant.ReceiptStatusFailedRLP - } - return constant.ReceiptStatusSuccessfulRLP - } - return r.PostState -} - -// Len returns the number of receipts in this list. -func (rs Receipts) Len() int { return len(rs) } - -// EncodeIndex encodes the i'th receipt to w. -func (rs Receipts) EncodeIndex(i int, w *bytes.Buffer) { - r := rs[i] - data := &proof.ReceiptRLP{PostStateOrStatus: r.statusEncoding(), CumulativeGasUsed: r.CumulativeGasUsed, Bloom: r.Bloom, Logs: r.Logs} - switch r.Type { - case constant.LegacyTxType, ArbitrumLegacyTxType: - rlp.Encode(w, data) - default: - w.WriteByte(r.Type) - rlp.Encode(w, data) - } -} diff --git a/internal/blacklist/blacklist.go b/internal/blacklist/blacklist.go deleted file mode 100644 index 5b6a7b48..00000000 --- a/internal/blacklist/blacklist.go +++ /dev/null @@ -1,64 +0,0 @@ -package blacklist - -import ( - "fmt" - "github.com/mapprotocol/compass/internal/client" - "github.com/pkg/errors" - "strconv" -) - -type Blacklist interface { - CheckAccount(account string) (bool, error) - CheckTxs(chainId, txHash string) (bool, error) -} - -type blockList struct { - domain string -} - -var defaultBlockList *blockList - -const ( - UrlOfCheckAccount = "/blocklist/blockedAccount" - UrlOfCheckTx = "/blocklist/blockedTxn" -) - -func Init(domain string) { - defaultBlockList = &blockList{domain: domain} -} - -func (b *blockList) CheckAccount(account, chainId string) (bool, error) { - uri := fmt.Sprintf("%s%s?account=%s,chainId=%s", b.domain, UrlOfCheckAccount, account, chainId) - body, err := client.JsonGet(uri) - if err != nil { - return false, errors.Wrap(err, "CheckAccount JsonGet") - } - - ret, err := strconv.ParseBool(string(body)) - if err != nil { - return false, errors.Wrap(err, fmt.Sprintf("CheckAccount, account: %s body: %s", account, string(body))) - } - return ret, nil -} - -func (b *blockList) CheckTxs(chainId, txHash string) (bool, error) { - uri := fmt.Sprintf("%s%s?chainId=%s&txHash=%s", b.domain, UrlOfCheckTx, chainId, txHash) - body, err := client.JsonGet(uri) - if err != nil { - return false, errors.Wrap(err, "CheckTxs JsonGet") - } - - ret, err := strconv.ParseBool(string(body)) - if err != nil { - return false, errors.Wrap(err, fmt.Sprintf("CheckTxs, chainId: %s txHash: %s body: %s", chainId, txHash, string(body))) - } - return ret, nil -} - -func CheckTxs(chainId, txHash string) (bool, error) { - return defaultBlockList.CheckTxs(chainId, txHash) -} - -func CheckAccount(account, chainId string) (bool, error) { - return defaultBlockList.CheckAccount(account, chainId) -} diff --git a/internal/bsc/bsc.go b/internal/bsc/bsc.go deleted file mode 100644 index a825faf9..00000000 --- a/internal/bsc/bsc.go +++ /dev/null @@ -1,169 +0,0 @@ -package bsc - -import ( - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/rlp" - maptypes "github.com/mapprotocol/atlas/core/types" - "github.com/mapprotocol/compass/internal/constant" - "github.com/mapprotocol/compass/internal/mapo" - "github.com/mapprotocol/compass/internal/mapprotocol" - "github.com/mapprotocol/compass/internal/op" - "github.com/mapprotocol/compass/internal/proof" - iproof "github.com/mapprotocol/compass/internal/proof" - "github.com/mapprotocol/compass/pkg/ethclient" - "github.com/mapprotocol/compass/pkg/msg" - "math/big" - "strings" -) - -type Header struct { - ParentHash []byte `json:"parentHash"` - Sha3Uncles []byte `json:"sha3Uncles"` - Miner common.Address `json:"miner"` - StateRoot []byte `json:"stateRoot"` - TransactionsRoot []byte `json:"transactionsRoot"` - ReceiptsRoot []byte `json:"receiptsRoot"` - LogsBloom []byte `json:"logsBloom"` - Difficulty *big.Int `json:"difficulty"` - Number *big.Int `json:"number"` - GasLimit *big.Int `json:"gasLimit"` - GasUsed *big.Int `json:"gasUsed"` - Timestamp *big.Int `json:"timestamp"` - ExtraData []byte `json:"extraData"` - MixHash []byte `json:"mixHash"` - Nonce []byte `json:"nonce"` - BaseFeePerGas *big.Int `json:"baseFeePerGas"` - WithdrawalsRoot []byte `json:"withdrawalsRoot"` - BlobGasUsed *big.Int `json:"blobGasUsed"` - ExcessBlobGas *big.Int `json:"excessBlobGas"` - ParentBeaconBlockRoot []byte `json:"parentBeaconBlockRoot"` -} - -func ConvertHeader(header *ethclient.BscHeader) Header { - bloom := make([]byte, 0, len(header.Bloom)) - for _, b := range header.Bloom { - bloom = append(bloom, b) - } - nonce := make([]byte, 0, len(header.Nonce)) - for _, b := range header.Nonce { - nonce = append(nonce, b) - } - if header.BaseFee == nil { - header.BaseFee = new(big.Int) - } - parentBeaconBlockRoot := common.Hex2Bytes("0000000000000000000000000000000000000000000000000000000000000001") - if header.ParentBeaconBlockRoot != "" && strings.TrimPrefix(header.ParentBeaconBlockRoot, "0x") != "" { - //fmt.Println(header.Number, " ---- header.ParentBeaconBlockRoot ---------------------------- ", header.ParentBeaconBlockRoot) - parentBeaconBlockRoot = common.Hex2Bytes(strings.TrimPrefix(header.ParentBeaconBlockRoot, "0x")) - } - - blobGasUsed, excessBlobGas := big.NewInt(0), big.NewInt(0) - if header.BlobGasUsed != "" && strings.TrimPrefix(header.BlobGasUsed, "0x") != "" { - blobGasUsed, _ = blobGasUsed.SetString(strings.TrimPrefix(header.BlobGasUsed, "0x"), 16) - } - if header.ExcessBlobGas != "" && strings.TrimPrefix(header.ExcessBlobGas, "0x") != "" { - excessBlobGas, _ = excessBlobGas.SetString(strings.TrimPrefix(header.ExcessBlobGas, "0x"), 16) - } - - return Header{ - ParentHash: hashToByte(header.ParentHash), - Sha3Uncles: hashToByte(header.UncleHash), - Miner: header.Coinbase, - StateRoot: hashToByte(header.Root), - TransactionsRoot: hashToByte(header.TxHash), - ReceiptsRoot: hashToByte(header.ReceiptHash), - LogsBloom: bloom, - Difficulty: header.Difficulty, - Number: header.Number, - GasLimit: new(big.Int).SetUint64(header.GasLimit), - GasUsed: new(big.Int).SetUint64(header.GasUsed), - Timestamp: new(big.Int).SetUint64(header.Time), - ExtraData: header.Extra, - MixHash: hashToByte(header.MixDigest), - Nonce: nonce, - BaseFeePerGas: header.BaseFee, - WithdrawalsRoot: common.Hex2Bytes(strings.TrimPrefix(header.WithdrawalsRoot, "0x")), - BlobGasUsed: blobGasUsed, - ExcessBlobGas: excessBlobGas, - ParentBeaconBlockRoot: parentBeaconBlockRoot, - } -} - -func hashToByte(h common.Hash) []byte { - ret := make([]byte, 0, len(h)) - for _, b := range h { - ret = append(ret, b) - } - return ret -} - -type ProofData struct { - Headers []Header - ReceiptProof ReceiptProof -} - -type ReceiptProof struct { - TxReceipt mapprotocol.TxReceipt - KeyIndex []byte - Proof [][]byte - ReceiptProof proof.NewReceiptProof -} - -func AssembleProof(header []Header, log *types.Log, receipts []*types.Receipt, method string, - fId msg.ChainId, proofType int64, sign [][]byte, orderId [32]byte) ([]byte, error) { - var ret []byte - txIndex := log.TxIndex - receipt, err := mapprotocol.GetTxReceipt(receipts[txIndex]) - if err != nil { - return nil, err - } - - pr := op.Receipts{} - for _, r := range receipts { - pr = append(pr, &op.Receipt{Receipt: r}) - } - - prf, err := iproof.Get(pr, txIndex) - if err != nil { - return nil, err - } - - var key []byte - key = rlp.AppendUint64(key[:0], uint64(txIndex)) - ek := mapo.Key2Hex(key, len(prf)) - - idx := 0 - for i, ele := range receipts[txIndex].Logs { - if ele.Index != log.Index { - continue - } - idx = i - } - switch proofType { - case constant.ProofTypeOfOrigin: - pd := ProofData{ - Headers: header, - ReceiptProof: ReceiptProof{ - TxReceipt: *receipt, - KeyIndex: ek, - Proof: prf, - }, - } - - ret, err = iproof.V3Pack(fId, method, mapprotocol.Bsc, idx, orderId, false, pd) - if err != nil { - return nil, err - } - case constant.ProofTypeOfNewOracle: - fallthrough - case constant.ProofTypeOfLogOracle: - ret, err = proof.SignOracle(&maptypes.Header{ - ReceiptHash: common.BytesToHash(header[0].ReceiptsRoot), - }, receipt, key, prf, fId, idx, method, sign, orderId, log, proofType) - default: - - } - - return ret, nil -} diff --git a/internal/butter/butter.go b/internal/butter/butter.go deleted file mode 100644 index 3005b425..00000000 --- a/internal/butter/butter.go +++ /dev/null @@ -1,75 +0,0 @@ -package butter - -import ( - "encoding/json" - "fmt" - "github.com/mapprotocol/compass/internal/client" -) - -const ( - UrlOfExecSwap = "/execSwap" - UrlOfSolCrossIn = "/solanaCrossIn" - UrlOfRetryMessageIn = "/retryMessageIn" -) - -var defaultButter = New() - -type Butter struct { -} - -func New() *Butter { - return &Butter{} -} - -func (b *Butter) ExecSwap(domain, query string) ([]byte, error) { - return client.JsonGet(fmt.Sprintf("%s%s?%s", domain, UrlOfExecSwap, query)) -} - -func (b *Butter) RetryMessageIn(domain, query string) ([]byte, error) { - return client.JsonGet(fmt.Sprintf("%s%s?%s", domain, UrlOfRetryMessageIn, query)) -} - -func (b *Butter) SolCrossIn(domain, query string) (*SolCrossInResp, error) { - fmt.Println("SolCrossIn uri ", fmt.Sprintf("%s%s?%s", domain, UrlOfSolCrossIn, query)) - body, err := client.JsonGet(fmt.Sprintf("%s%s?%s", domain, UrlOfSolCrossIn, query)) - if err != nil { - return nil, err - } - data := SolCrossInResp{} - err = json.Unmarshal(body, &data) - if err != nil { - return nil, err - } - if data.Errno != 0 { - return nil, fmt.Errorf("code %d, mess:%s", data.Errno, data.Message) - } - if data.StatusCode != 0 { - return nil, fmt.Errorf("code %d, mess:%s", data.StatusCode, data.Message) - } - - if len(data.Data) <= 0 { - return nil, fmt.Errorf("data is zero") - } - - if data.Data[0].Error.Response.Errno != 0 { - return nil, fmt.Errorf("code %d, mess:%s", data.Data[0].Error.Response.Errno, data.Data[0].Error.Response.Message) - } - - if len(data.Data[0].TxParam) <= 0 { - return nil, fmt.Errorf("data txParam is zero") - } - - return &data, nil -} - -func ExecSwap(domain, query string) ([]byte, error) { - return defaultButter.ExecSwap(domain, query) -} - -func RetryMessageIn(domain, query string) ([]byte, error) { - return defaultButter.RetryMessageIn(domain, query) -} - -func SolCrossIn(domain, query string) (*SolCrossInResp, error) { - return defaultButter.SolCrossIn(domain, query) -} diff --git a/internal/butter/model.go b/internal/butter/model.go deleted file mode 100644 index 238ff0f6..00000000 --- a/internal/butter/model.go +++ /dev/null @@ -1,211 +0,0 @@ -package butter - -type SolCrossInResp struct { - Errno int `json:"errno"` - StatusCode int `json:"statusCode"` - Message string `json:"message"` - Data []struct { - Route struct { - Diff string `json:"diff"` - BridgeFee struct { - Amount string `json:"amount"` - } `json:"bridgeFee"` - TradeType int `json:"tradeType"` - GasFee struct { - Amount string `json:"amount"` - Symbol string `json:"symbol"` - } `json:"gasFee"` - SwapFee struct { - NativeFee string `json:"nativeFee"` - TokenFee string `json:"tokenFee"` - } `json:"swapFee"` - FeeConfig struct { - FeeType int `json:"feeType"` - Referrer string `json:"referrer"` - RateOrNativeFee int `json:"rateOrNativeFee"` - } `json:"feeConfig"` - GasEstimated string `json:"gasEstimated"` - GasEstimatedTarget string `json:"gasEstimatedTarget"` - TimeEstimated int `json:"timeEstimated"` - Hash string `json:"hash"` - Timestamp int64 `json:"timestamp"` - HasLiquidity bool `json:"hasLiquidity"` - SrcChain struct { - ChainID string `json:"chainId"` - TokenIn struct { - Address string `json:"address"` - Name string `json:"name"` - Decimals int `json:"decimals"` - Symbol string `json:"symbol"` - Icon string `json:"icon"` - } `json:"tokenIn"` - TokenOut struct { - Address string `json:"address"` - Name string `json:"name"` - Decimals int `json:"decimals"` - Symbol string `json:"symbol"` - Icon string `json:"icon"` - } `json:"tokenOut"` - TotalAmountIn string `json:"totalAmountIn"` - TotalAmountOut string `json:"totalAmountOut"` - Route []struct { - AmountIn string `json:"amountIn"` - AmountOut string `json:"amountOut"` - DexName string `json:"dexName"` - Path []interface{} `json:"path"` - } `json:"route"` - Bridge string `json:"bridge"` - } `json:"srcChain"` - MinAmountOut struct { - Amount string `json:"amount"` - Symbol string `json:"symbol"` - } `json:"minAmountOut"` - } `json:"route"` - TxParam []struct { - To string `json:"to"` - ChainID string `json:"chainId"` - Data string `json:"data"` - Value string `json:"value"` - Method string `json:"method"` - } `json:"txParam"` - Error struct { - Response struct { - Errno int `json:"errno"` - Message string `json:"message"` - } `json:"response"` - Status int `json:"status"` - Message string `json:"message"` - Name string `json:"name"` - } `json:"error"` - } `json:"data"` -} - -type ExecSwapResp struct { - Data struct { - MinReceivedInLog string `json:"minReceivedInLog"` - RescueFundsTxParam struct { - Args []struct { - Type string `json:"type"` - Value string `json:"value"` - } `json:"args"` - ChainID string `json:"chainId"` - Data string `json:"data"` - Method string `json:"method"` - To string `json:"to"` - Value string `json:"value"` - } `json:"rescueFundsTxParam"` - RouteWithTxParams []struct { - Route struct { - BridgeFee struct { - Amount string `json:"amount"` - } `json:"bridgeFee"` - Contract string `json:"contract"` - Diff string `json:"diff"` - Entrance string `json:"entrance"` - FeeConfig struct { - FeeType int `json:"feeType"` - RateOrNativeFee int `json:"rateOrNativeFee"` - Referrer string `json:"referrer"` - } `json:"feeConfig"` - GasEstimated string `json:"gasEstimated"` - GasEstimatedTarget string `json:"gasEstimatedTarget"` - GasFee struct { - Amount string `json:"amount"` - InUSD string `json:"inUSD"` - Symbol string `json:"symbol"` - } `json:"gasFee"` - HasLiquidity bool `json:"hasLiquidity"` - Hash string `json:"hash"` - MinAmountOut struct { - Amount string `json:"amount"` - Symbol string `json:"symbol"` - } `json:"minAmountOut"` - SrcChain struct { - Bridge string `json:"bridge"` - ChainID string `json:"chainId"` - Route []struct { - AmountIn string `json:"amountIn"` - AmountOut string `json:"amountOut"` - DexName string `json:"dexName"` - Extra interface{} `json:"extra"` - Path []interface{} `json:"path"` - } `json:"route"` - TokenIn struct { - Address string `json:"address"` - Decimals int `json:"decimals"` - Icon string `json:"icon"` - Name string `json:"name"` - Symbol string `json:"symbol"` - } `json:"tokenIn"` - TokenOut struct { - Address string `json:"address"` - Decimals int `json:"decimals"` - Icon string `json:"icon"` - Name string `json:"name"` - Symbol string `json:"symbol"` - } `json:"tokenOut"` - TotalAmountIn string `json:"totalAmountIn"` - TotalAmountOut string `json:"totalAmountOut"` - TotalAmountOutUSD string `json:"totalAmountOutUSD"` - } `json:"srcChain"` - SwapFee struct { - NativeFee string `json:"nativeFee"` - TokenFee string `json:"tokenFee"` - } `json:"swapFee"` - TimeEstimated int `json:"timeEstimated"` - Timestamp int64 `json:"timestamp"` - TotalAmountInUSD string `json:"totalAmountInUSD"` - TotalAmountOutUSD string `json:"totalAmountOutUSD"` - TradeType int `json:"tradeType"` - } `json:"route"` - TxParam []struct { - Args []struct { - Type string `json:"type"` - Value string `json:"value"` - } `json:"args"` - ChainID string `json:"chainId"` - Data string `json:"data"` - Method string `json:"method"` - To string `json:"to"` - Value string `json:"value"` - } `json:"txParam"` - } `json:"routeWithTxParams"` - } `json:"data"` - Errno int `json:"errno"` - Message string `json:"message"` -} - -//type OldRetryMessageInData struct { -// Errno int `json:"errno"` -// Message string `json:"message"` -// Data struct { -// To string `json:"to"` -// Data string `json:"data"` -// Value string `json:"value"` -// ChainID string `json:"chainId"` -// Method string `json:"method"` -// Args []struct { -// Type string `json:"type"` -// Value string `json:"value"` -// } `json:"args"` -// } `json:"data"` -//} - -type RetryMessageInData struct { - Errno int `json:"errno"` - Message string `json:"message"` - Data struct { - TxParam struct { - To string `json:"to"` - Data string `json:"data"` - Value string `json:"value"` - ChainID string `json:"chainId"` - Method string `json:"method"` - Args []struct { - Type string `json:"type"` - Value string `json:"value"` - } `json:"args"` - } `json:"txParam"` - MinReceivedOrigin string `json:"minReceivedOrigin"` - } `json:"data"` -} diff --git a/internal/chain/block_2map.go b/internal/chain/block_2map.go deleted file mode 100644 index 10b152e8..00000000 --- a/internal/chain/block_2map.go +++ /dev/null @@ -1,97 +0,0 @@ -package chain - -import ( - "context" - "fmt" - "github.com/mapprotocol/compass/internal/mapprotocol" - "github.com/mapprotocol/compass/pkg/msg" - "math/big" - "strings" - "time" - - "github.com/mapprotocol/compass/pkg/util" - - "github.com/mapprotocol/compass/internal/constant" -) - -// execToMapMsg executes sync msg, and send tx to the destination blockchain -// the current function is only responsible for sending messages and is not responsible for processing data formats, -func (w *Writer) execToMapMsg(m msg.Message) bool { - var ( - errorCount int64 - needNonce = true - ) - for { - select { - case <-w.stop: - return false - default: - id, _ := m.Payload[0].(*big.Int) - marshal, _ := m.Payload[1].([]byte) - isEth2 := false - if len(m.Payload) >= 3 { - isEth2, _ = m.Payload[2].(bool) - } - - method := mapprotocol.MethodUpdateBlockHeader - if isEth2 { - method = mapprotocol.MethodUpdateLightClient - } - - err := w.toMap(m, id, marshal, method, needNonce) - if err != nil { - needNonce = w.needNonce(err) - time.Sleep(constant.TxRetryInterval) - errorCount++ - if errorCount >= 10 { - util.Alarm(context.Background(), fmt.Sprintf("%s2map updateHeader failed, err is %s", - mapprotocol.OnlineChaId[m.Source], err.Error())) - errorCount = 0 - } - continue - } - m.DoneCh <- struct{}{} - return true - } - } -} - -func (w *Writer) toMap(m msg.Message, id *big.Int, marshal []byte, method string, needNonce bool) error { - err := w.conn.LockAndUpdateOpts(needNonce) - if err != nil { - w.log.Error("BlockToMap Failed to update nonce", "err", err) - return err - } - - data, err := mapprotocol.PackInput(mapprotocol.LightManger, method, id, marshal) - if err != nil { - w.log.Error("block2Map Failed to pack abi data", "err", err) - w.conn.UnlockOpts() - return err - } - tx, err := w.sendTx(&w.cfg.LightNode, nil, data) - w.conn.UnlockOpts() - if err == nil { - // message successfully handled - w.log.Info("Sync Header to map tx execution", "tx", tx.Hash(), "src", m.Source, "dst", m.Destination, - "method", method, "needNonce", needNonce, "nonce", w.conn.Opts().Nonce) - err = w.txStatus(tx.Hash()) - if err != nil { - w.log.Warn("TxHash Status is not successful, will retry", "err", err) - } else { - return nil - } - } else if w.cfg.SkipError { - w.log.Warn("Execution failed, ignore this error, Continue to the next ", "err", err) - return nil - } else { - for e := range constant.IgnoreError { - if strings.Index(err.Error(), e) != -1 { - w.log.Info("Ignore This Error, Continue to the next", "id", id, "method", method, "err", err) - return nil - } - } - w.log.Warn("Sync Header to map Execution failed, will retry", "id", id, "method", method, "err", err) - } - return err -} diff --git a/internal/chain/block_map2other.go b/internal/chain/block_map2other.go deleted file mode 100644 index 77ea4753..00000000 --- a/internal/chain/block_map2other.go +++ /dev/null @@ -1,68 +0,0 @@ -package chain - -import ( - "context" - "fmt" - "github.com/mapprotocol/compass/internal/mapprotocol" - "github.com/mapprotocol/compass/pkg/msg" - "strings" - "time" - - "github.com/mapprotocol/compass/internal/constant" - "github.com/mapprotocol/compass/pkg/util" -) - -// execMap2OtherMsg executes sync msg, and send tx to the destination blockchain -func (w *Writer) execMap2OtherMsg(m msg.Message) bool { - var ( - errorCount int64 - needNonce = true - ) - for { - select { - case <-w.stop: - return false - default: - err := w.conn.LockAndUpdateOpts(needNonce) - if err != nil { - w.log.Error("Failed to update nonce", "err", err) - time.Sleep(constant.TxRetryInterval) - continue - } - - tx, err := w.sendTx(&w.cfg.LightNode, nil, m.Payload[0].([]byte)) - w.conn.UnlockOpts() - if err == nil { - // message successfully handled - w.log.Info("Sync Map Header to other chain tx execution", "tx", tx.Hash(), "src", m.Source, "dst", m.Destination, "needNonce", needNonce, "nonce", w.conn.Opts().Nonce) - err = w.txStatus(tx.Hash()) - if err != nil { - w.log.Warn("TxHash Status is not successful, will retry", "err", err) - } else { - m.DoneCh <- struct{}{} - return true - } - } else if w.cfg.SkipError { - w.log.Warn("Execution failed, ignore this error, Continue to the next ", "err", err) - m.DoneCh <- struct{}{} - return true - } else { - for e := range constant.IgnoreError { - if strings.Index(err.Error(), e) != -1 { - w.log.Info("Ignore This Error, Continue to the next", "id", m.Destination, "err", err) - m.DoneCh <- struct{}{} - return true - } - } - w.log.Warn("Sync Map Header to other chain Execution failed, header may already been synced", "id", m.Destination, "err", err) - } - needNonce = w.needNonce(err) - errorCount++ - if errorCount >= 10 { - util.Alarm(context.Background(), fmt.Sprintf("map2%s updateHeader failed, err is %s", mapprotocol.OnlineChaId[m.Destination], err.Error())) - errorCount = 0 - } - time.Sleep(constant.TxRetryInterval) - } - } -} diff --git a/internal/chain/blockstore.go b/internal/chain/blockstore.go deleted file mode 100644 index 6029070e..00000000 --- a/internal/chain/blockstore.go +++ /dev/null @@ -1,34 +0,0 @@ -package chain - -import ( - "github.com/mapprotocol/compass/internal/mapprotocol" - "math/big" - - "github.com/mapprotocol/compass/pkg/blockstore" -) - -func SetupBlockStore(cfg *Config, role mapprotocol.Role) (*blockstore.Blockstore, error) { - if cfg.Filter { - role += "-filter" - } - bs, err := blockstore.NewBlockstore(cfg.BlockstorePath, cfg.Id, cfg.From, role) - if err != nil { - return nil, err - } - - if !cfg.FreshStart { - latestBlock, err := bs.TryLoadLatestBlock() - if err != nil { - return nil, err - } - if latestBlock == nil { - latestBlock = new(big.Int) - } - - if latestBlock.Cmp(cfg.StartBlock) == 1 { - cfg.StartBlock = latestBlock - } - } - - return bs, nil -} diff --git a/internal/chain/chain.go b/internal/chain/chain.go deleted file mode 100644 index 85db7e51..00000000 --- a/internal/chain/chain.go +++ /dev/null @@ -1,137 +0,0 @@ -package chain - -import ( - "github.com/ChainSafe/log15" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/log" - "github.com/mapprotocol/compass/core" - "github.com/mapprotocol/compass/internal/mapprotocol" - "github.com/mapprotocol/compass/pkg/abi" - "github.com/mapprotocol/compass/pkg/contract" - "github.com/mapprotocol/compass/pkg/ethclient" - "github.com/mapprotocol/compass/pkg/keystore" - "github.com/mapprotocol/compass/pkg/msg" - "github.com/pkg/errors" -) - -type Chain struct { - cfg *core.ChainConfig // The config of the Chain - conn core.Connection // The chains connection - writer *Writer // The writer of the Chain - stop chan<- int - listen core.Listener // The listener of this Chain -} - -func New(chainCfg *core.ChainConfig, logger log15.Logger, sysErr chan<- error, role mapprotocol.Role, - createConn core.CreateConn, opts ...SyncOpt) (*Chain, error) { - cfg, err := ParseConfig(chainCfg) - if err != nil { - return nil, err - } - - kpI, err := keystore.KeypairFromEth(cfg.KeystorePath) - if err != nil { - return nil, err - } - - bs, err := SetupBlockStore(cfg, role) - if err != nil { - return nil, err - } - - stop := make(chan int) - conn := createConn(cfg.Endpoint, cfg.Http, kpI, logger, cfg.GasLimit, cfg.MaxGasPrice, cfg.GasMultiplier) - err = conn.Connect() - if err != nil { - return nil, err - } - - if (chainCfg.LatestBlock || cfg.StartBlock == nil || cfg.StartBlock.Int64() == 0) && !chainCfg.Filter { - curr, err := conn.LatestBlock() - if err != nil { - return nil, err - } - cfg.StartBlock = curr - } - - var listen core.Listener - cs := NewCommonSync(conn, cfg, logger, stop, sysErr, bs, opts...) - switch role { - case mapprotocol.RoleOfMaintainer: - if cfg.Id != cfg.MapChainID { - fn := mapprotocol.Map2EthHeight(cfg.From, cfg.LightNode, conn.Client()) - height, err := fn() - if err != nil { - return nil, errors.Wrap(err, "Map2Other get init headerHeight failed") - } - logger.Info("Map2other Current situation", "id", cfg.Id, "height", height, "lightNode", cfg.LightNode) - mapprotocol.SyncOtherMap[cfg.Id] = height - mapprotocol.Map2OtherHeight[cfg.Id] = fn - } - listen = NewMaintainer(cs) - case mapprotocol.RoleOfMessenger: - oracleAbi, _ := abi.New(mapprotocol.OracleAbiJson) - call := contract.New(conn, cfg.McsContract, oracleAbi) - mapprotocol.ContractMapping[cfg.Id] = call - listen = NewMessenger(cs) - case mapprotocol.RoleOfOracle: - otherAbi, _ := abi.New(mapprotocol.OtherAbi) - call := contract.New(conn, []common.Address{cfg.LightNode}, otherAbi) - mapprotocol.LightNodeMapping[cfg.Id] = call - listen = NewOracle(cs) - } - oAbi, _ := abi.New(mapprotocol.SignerJson) - oracleCall := contract.New(conn, []common.Address{cfg.OracleNode}, oAbi) - mapprotocol.SingMapping[cfg.Id] = oracleCall - wri := NewWriter(conn, cfg, logger, stop, sysErr) - mapprotocol.MosMapping[cfg.Id] = cfg.McsContract[0].String() - - return &Chain{ - cfg: chainCfg, - conn: conn, - writer: wri, - stop: stop, - listen: listen, - }, nil -} - -func (c *Chain) SetRouter(r core.Router) { - r.Listen(c.cfg.Id, c.writer) - c.listen.SetRouter(r) -} - -func (c *Chain) Start() error { - err := c.listen.Sync() - if err != nil { - return err - } - - log.Debug("Successfully started Chain") - return nil -} - -func (c *Chain) Id() msg.ChainId { - return c.cfg.Id -} - -func (c *Chain) Name() string { - return c.cfg.Name -} - -// Stop signals to any running routines to exit -func (c *Chain) Stop() { - close(c.stop) - if c.conn != nil { - c.conn.Close() - } -} - -// EthClient return EthClient for global map connection -func (c *Chain) EthClient() *ethclient.Client { - return c.conn.Client() -} - -// Conn return Connection interface for relayer register -func (c *Chain) Conn() core.Connection { - return c.conn -} diff --git a/internal/chain/common.go b/internal/chain/common.go deleted file mode 100644 index e33e0e05..00000000 --- a/internal/chain/common.go +++ /dev/null @@ -1,97 +0,0 @@ -package chain - -import ( - "fmt" - "github.com/mapprotocol/compass/internal/mapprotocol" - "github.com/mapprotocol/compass/pkg/msg" - "math/big" - - "github.com/ethereum/go-ethereum/common" - - "github.com/pkg/errors" -) - -var ( - OrderExist = errors.New("order exist") - NotVerifyAble = errors.New("not verify able") - ContractNotExist = errors.New("contract not exist") -) - -type OrderStatusResp struct { - Exists bool - Verifiable bool - NodeType *big.Int -} - -func OrderStatus(idx int, selfChainId, toChainID uint64, blockNumber *big.Int, orderId []byte) (*OrderStatusResp, error) { - call, ok := mapprotocol.ContractMapping[msg.ChainId(toChainID)] - if !ok { - return nil, ContractNotExist - } - var fixedOrderId [32]byte - for i, v := range orderId { - fixedOrderId[i] = v - } - ret := OrderStatusResp{} - err := call.Call(mapprotocol.MethodOfOrderStatus, &ret, idx, big.NewInt(int64(selfChainId)), blockNumber, fixedOrderId) - if err != nil { - return nil, err - } - return &ret, nil -} - -func PreSendTx(idx int, selfChainId, toChainID uint64, blockNumber *big.Int, orderId []byte) (int64, error) { - ret, err := OrderStatus(idx, selfChainId, toChainID, blockNumber, orderId) - if err != nil { - return 0, errors.Wrap(err, "OrderStatus failed") - } - - if ret.Exists { - return ret.NodeType.Int64(), OrderExist - } - if !ret.Verifiable { - return ret.NodeType.Int64(), NotVerifyAble - } - - return ret.NodeType.Int64(), nil -} - -type MulSignInfoResp struct { - Version [32]byte - Quorum *big.Int - Singers []common.Address -} - -func MulSignInfo(idx int, toChainID uint64) (*MulSignInfoResp, error) { - call, ok := mapprotocol.SingMapping[msg.ChainId(toChainID)] - if !ok { - return nil, ContractNotExist - } - - ret := MulSignInfoResp{} - err := call.Call(mapprotocol.MethodOfMulSignInfo, &ret, idx) - if err != nil { - return nil, fmt.Errorf("call failed:err:%v", err) - } - return &ret, nil -} - -type ProposalInfoResp struct { - Singers []common.Address - Signatures [][]byte - CanVerify bool -} - -func ProposalInfo(idx int, selfChainId, toChainID uint64, blockNumber *big.Int, receipt common.Hash, version [32]byte) (*ProposalInfoResp, error) { - call, ok := mapprotocol.SingMapping[msg.ChainId(toChainID)] - if !ok { - return nil, ContractNotExist - } - ret := ProposalInfoResp{} - fmt.Println("MethodOfProposalInfo request ", big.NewInt(int64(selfChainId)), blockNumber, receipt, version) - err := call.Call(mapprotocol.MethodOfProposalInfo, &ret, idx, big.NewInt(int64(selfChainId)), blockNumber, receipt, version) - if err != nil { - return nil, err - } - return &ret, nil -} diff --git a/internal/chain/common_sync.go b/internal/chain/common_sync.go deleted file mode 100644 index 3aabeb82..00000000 --- a/internal/chain/common_sync.go +++ /dev/null @@ -1,163 +0,0 @@ -package chain - -import ( - "fmt" - "github.com/ethereum/go-ethereum/core/types" - "github.com/mapprotocol/compass/internal/constant" - "github.com/mapprotocol/compass/internal/mapprotocol" - "github.com/mapprotocol/compass/pkg/msg" - "math/big" - "time" - - "github.com/mapprotocol/compass/core" - - "github.com/ChainSafe/log15" - eth "github.com/ethereum/go-ethereum" - ethcommon "github.com/ethereum/go-ethereum/common" - "github.com/mapprotocol/compass/pkg/blockstore" -) - -type ( - SyncOpt func(*CommonSync) - SyncHeader2Map func(*Maintainer, *big.Int) error - Mos func(*Messenger, *big.Int) (int, error) - AssembleProof func(*Messenger, *types.Log, int64, uint64, [][]byte) (*msg.Message, error) - OracleHandler func(*Oracle, *big.Int) error -) - -func OptOfInitHeight(height int64) SyncOpt { - return func(sync *CommonSync) { - sync.height = height - } -} - -func OptOfSync2Map(fn SyncHeader2Map) SyncOpt { - return func(sync *CommonSync) { - sync.syncHeaderToMap = fn - } -} - -func OptOfMos(fn Mos) SyncOpt { - return func(sync *CommonSync) { - sync.mosHandler = fn - } -} - -func OptOfOracleHandler(fn OracleHandler) SyncOpt { - return func(sync *CommonSync) { - sync.oracleHandler = fn - } -} - -func OptOfAssembleProof(fn AssembleProof) SyncOpt { - return func(sync *CommonSync) { - sync.assembleProof = fn - } -} - -type CommonSync struct { - Cfg Config - Conn core.Connection - Log log15.Logger - Router core.Router - Stop <-chan int - MsgCh chan struct{} - SysErr chan<- error // Reports fatal error to core - BlockConfirmations *big.Int - BlockStore blockstore.Blockstorer - height int64 - syncHeaderToMap SyncHeader2Map - mosHandler Mos - oracleHandler OracleHandler - assembleProof AssembleProof - reqTime, cacheBlockNumber int64 -} - -// NewCommonSync creates and returns a listener -func NewCommonSync(conn core.Connection, cfg *Config, log log15.Logger, stop <-chan int, sysErr chan<- error, - bs blockstore.Blockstorer, opts ...SyncOpt) *CommonSync { - cs := &CommonSync{ - Cfg: *cfg, - Conn: conn, - Log: log, - Stop: stop, - SysErr: sysErr, - BlockConfirmations: cfg.BlockConfirmations, - MsgCh: make(chan struct{}), - BlockStore: bs, - height: 1, - mosHandler: defaultMosHandler, - } - for _, op := range opts { - op(cs) - } - - return cs -} - -func (c *CommonSync) SetRouter(r core.Router) { - c.Router = r -} - -// WaitUntilMsgHandled this function will block untill message is handled -func (c *CommonSync) WaitUntilMsgHandled(counter int) error { - c.Log.Debug("WaitUntilMsgHandled", "counter", counter) - for counter > 0 { - <-c.MsgCh - counter -= 1 - } - return nil -} - -// BuildQuery constructs a query for the bridgeContract by hashing sig to get the event topic -func (c *CommonSync) BuildQuery(contract ethcommon.Address, sig []constant.EventSig, startBlock *big.Int, endBlock *big.Int) eth.FilterQuery { - topics := make([]ethcommon.Hash, 0, len(sig)) - for _, s := range sig { - topics = append(topics, s.GetTopic()) - } - query := eth.FilterQuery{ - FromBlock: startBlock, - ToBlock: endBlock, - Addresses: []ethcommon.Address{contract}, - Topics: [][]ethcommon.Hash{topics}, - } - return query -} - -func (c *CommonSync) GetMethod(topic ethcommon.Hash) string { - return mapprotocol.MethodOfMessageIn -} - -func (c *CommonSync) FilterLatestBlock() (*big.Int, error) { - if time.Now().Unix()-c.reqTime < constant.ReqInterval { - return big.NewInt(c.cacheBlockNumber), nil - } - data, err := Request(fmt.Sprintf("%s/%s", c.Cfg.FilterHost, fmt.Sprintf("%s?chain_id=%d", constant.FilterBlockUrl, c.Cfg.Id))) - if err != nil { - c.Log.Error("Unable to get latest block", "err", err) - time.Sleep(constant.BlockRetryInterval) - return nil, err - } - c.Log.Debug("Filter latest block", "block", data) - latestBlock, ok := big.NewInt(0).SetString(data.(string), 10) - if !ok { - return nil, fmt.Errorf("get latest failed, block is %v", data) - } - c.cacheBlockNumber = latestBlock.Int64() - c.reqTime = time.Now().Unix() - return latestBlock, nil -} - -func (c *CommonSync) Match(target string) int { - for idx, ele := range append(c.Cfg.McsContract, c.Cfg.LightNode) { - if ele.Hex() == target { - return idx - } - } - return -1 -} - -func GetMethod(topic ethcommon.Hash) string { - def := &CommonSync{} - return def.GetMethod(topic) -} diff --git a/internal/chain/config.go b/internal/chain/config.go deleted file mode 100644 index 43ee0525..00000000 --- a/internal/chain/config.go +++ /dev/null @@ -1,230 +0,0 @@ -package chain - -import ( - "encoding/json" - "errors" - "fmt" - "github.com/mapprotocol/compass/pkg/msg" - "math/big" - "strconv" - "strings" - - "github.com/mapprotocol/compass/internal/constant" - - "github.com/ethereum/go-ethereum/common" - gconfig "github.com/mapprotocol/compass/config" - "github.com/mapprotocol/compass/core" -) - -const ( - DefaultGasLimit = 1000000 - DefaultGasPrice = 50000000 - DefaultBlockConfirmations = 10 - DefaultGasMultiplier = 1 -) - -// Chain specific options -var ( - McsOpt = "mcs" - TronMcsOpt = "tronmcs" - MaxGasPriceOpt = "maxGasPrice" - GasLimitOpt = "gasLimit" - GasMultiplier = "gasMultiplier" - LimitMultiplier = "limitMultiplier" - StartBlockOpt = "startBlock" - BlockConfirmationsOpt = "blockConfirmations" - SyncToMap = "syncToMap" - SyncIDList = "syncIdList" - LightNode = "lightnode" - Event = "event" - Eth2Url = "eth2Url" - RedisOpt = "redis" - ApiUrl = "apiUrl" - OracleNode = "oracleNode" - RentNode = "rentNode" - EthFrom = "ethFrom" - FeeKey = "feeKey" - FeeType = "feeType" - EnergySupply = "energySupply" - Private = "private" - Words = "words" - Rent = "rent" - Addr = "addr" - Validate = "validate" -) - -// Config encapsulates all necessary parameters in ethereum compatible forms -type Config struct { - Name string // Human-readable chain name - Id msg.ChainId // ChainID - Endpoint string // url for rpc endpoint - From string // address of key to use - KeystorePath string // Location of keyfiles - BlockstorePath string - FreshStart bool // Disables loading from blockstore at start - McsContract []common.Address - GasLimit *big.Int - MaxGasPrice *big.Int - GasMultiplier float64 - LimitMultiplier float64 - Http bool // Config for type of connection - StartBlock *big.Int - BlockConfirmations *big.Int - SyncToMap bool // Whether sync blockchain headers to Map - MapChainID msg.ChainId - SyncChainIDList []msg.ChainId // chain ids which map sync to - LightNode common.Address // the lightnode to sync header - SyncMap map[msg.ChainId]*big.Int - Events []constant.EventSig - SkipError bool - Eth2Endpoint string - ApiUrl string - OracleNode common.Address - Filter bool - FilterHost string - BtcHost string -} - -// ParseConfig uses a core.ChainConfig to construct a corresponding Config -func ParseConfig(chainCfg *core.ChainConfig) (*Config, error) { - config := &Config{ - Name: chainCfg.Name, - Id: chainCfg.Id, - Endpoint: chainCfg.Endpoint, - From: chainCfg.From, - KeystorePath: chainCfg.KeystorePath, - BlockstorePath: chainCfg.BlockstorePath, - FreshStart: chainCfg.FreshStart, - McsContract: []common.Address{}, - GasLimit: big.NewInt(DefaultGasLimit), - MaxGasPrice: big.NewInt(DefaultGasPrice), - GasMultiplier: DefaultGasMultiplier, - LimitMultiplier: DefaultGasMultiplier, - Http: true, - SyncToMap: true, - StartBlock: big.NewInt(0), - BlockConfirmations: big.NewInt(0), - Events: make([]constant.EventSig, 0), - SkipError: chainCfg.SkipError, - Filter: chainCfg.Filter, - FilterHost: chainCfg.FilterHost, - BtcHost: chainCfg.BtcHost, - } - - if contract, ok := chainCfg.Opts[McsOpt]; ok && contract != "" { - for _, addr := range strings.Split(contract, ",") { - config.McsContract = append(config.McsContract, common.HexToAddress(addr)) - } - } - if gasPrice, ok := chainCfg.Opts[MaxGasPriceOpt]; ok { - price := big.NewInt(0) - _, pass := price.SetString(gasPrice, 10) - if pass { - config.MaxGasPrice = price - } else { - return nil, errors.New("unable to parse max gas price") - } - } - - if gasLimit, ok := chainCfg.Opts[GasLimitOpt]; ok { - limit := big.NewInt(0) - _, pass := limit.SetString(gasLimit, 10) - if pass { - config.GasLimit = limit - } else { - return nil, errors.New("unable to parse gas limit") - } - } - - if gasMultiplier, ok := chainCfg.Opts[GasMultiplier]; ok { - float, err := strconv.ParseFloat(gasMultiplier, 64) - if err == nil { - config.GasMultiplier = float - } else { - return nil, errors.New("unable to parse gasMultiplier to float") - } - } - - if limitMultiplier, ok := chainCfg.Opts[LimitMultiplier]; ok { - float, err := strconv.ParseFloat(limitMultiplier, 64) - if err == nil { - config.LimitMultiplier = float - } else { - return nil, errors.New("unable to parse limitMultiplier to float") - } - } - - if startBlock, ok := chainCfg.Opts[StartBlockOpt]; ok && startBlock != "" { - block := big.NewInt(0) - _, pass := block.SetString(startBlock, 10) - if pass { - config.StartBlock = block - } else { - return nil, fmt.Errorf("unable to parse %s", StartBlockOpt) - } - } - - if blockConfirmations, ok := chainCfg.Opts[BlockConfirmationsOpt]; ok && blockConfirmations != "" { - val := big.NewInt(DefaultBlockConfirmations) - _, pass := val.SetString(blockConfirmations, 10) - if pass { - config.BlockConfirmations = val - } else { - return nil, fmt.Errorf("unable to parse %s", BlockConfirmationsOpt) - } - } else { - config.BlockConfirmations = big.NewInt(DefaultBlockConfirmations) - } - - if syncToMap, ok := chainCfg.Opts[SyncToMap]; ok && syncToMap == "false" { - config.SyncToMap = false - } - - if mapChainID, ok := chainCfg.Opts[gconfig.MapChainID]; ok { - chainId, errr := strconv.Atoi(mapChainID) - if errr != nil { - return nil, errr - } - config.MapChainID = msg.ChainId(chainId) - } - - if syncIDList, ok := chainCfg.Opts[SyncIDList]; ok && syncIDList != "[]" { - err := json.Unmarshal([]byte(syncIDList), &config.SyncChainIDList) - if err != nil { - return nil, err - } - } - - if lightnode, ok := chainCfg.Opts[LightNode]; ok && lightnode != "" { - config.LightNode = common.HexToAddress(lightnode) - } - - if oracleNode, ok := chainCfg.Opts[OracleNode]; ok && oracleNode != "" { - config.OracleNode = common.HexToAddress(oracleNode) - } - - if v, ok := chainCfg.Opts[Event]; ok && v != "" { - vs := strings.Split(v, "|") - for _, s := range vs { - config.Events = append(config.Events, constant.EventSig(s)) - } - } - - if eth2Url, ok := chainCfg.Opts[Eth2Url]; ok && eth2Url != "" { - config.Eth2Endpoint = eth2Url - } - - if v, ok := chainCfg.Opts[ApiUrl]; ok && v != "" { - config.ApiUrl = v - } - - if config.OracleNode == constant.ZeroAddress { - config.OracleNode = config.LightNode - } - - if config.Id == config.MapChainID { - config.SyncToMap = false - } - - return config, nil -} diff --git a/internal/chain/filter.go b/internal/chain/filter.go deleted file mode 100644 index df5a5712..00000000 --- a/internal/chain/filter.go +++ /dev/null @@ -1,177 +0,0 @@ -package chain - -import ( - "encoding/json" - "fmt" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/mapprotocol/compass/internal/constant" - "github.com/mapprotocol/compass/internal/stream" - "github.com/pkg/errors" - "io" - "math/big" - "net/http" - "strings" -) - -func (m *Messenger) filterMosHandler(latestBlock uint64) (int, error) { - count := 0 - topic := "" - for idx, ele := range m.Cfg.Events { - topic += ele.GetTopic().Hex() - if idx != len(m.Cfg.Events)-1 { - topic += "," - } - } - data, err := Request(fmt.Sprintf("%s/%s?%s", m.Cfg.FilterHost, constant.FilterUrl, - fmt.Sprintf("id=%d&project_id=%d&chain_id=%d&topic=%s&limit=1", - m.Cfg.StartBlock.Int64(), constant.ProjectOfMsger, m.Cfg.Id, topic))) - if err != nil { - return 0, err - } - listData, err := json.Marshal(data) - if err != nil { - return 0, errors.Wrap(err, "marshal resp.Data failed") - } - back := stream.MosListResp{} - err = json.Unmarshal(listData, &back) - if err != nil { - return 0, err - } - if len(back.List) == 0 { - return 0, nil - } - - for _, ele := range back.List { - idx := m.Match(ele.ContractAddress) - if idx == -1 { - m.Log.Info("Filter Log Address Not Match", "id", ele.Id, "address", ele.ContractAddress) - m.Cfg.StartBlock = big.NewInt(ele.Id) - continue - } - if latestBlock-ele.BlockNumber < m.BlockConfirmations.Uint64() { - m.Log.Debug("Block not ready, will retry", "currentBlock", ele.BlockNumber, "latest", latestBlock) - continue - } - - split := strings.Split(ele.Topic, ",") - topics := make([]common.Hash, 0, len(split)) - for _, sp := range split { - topics = append(topics, common.HexToHash(sp)) - } - log := &types.Log{ - Address: common.HexToAddress(ele.ContractAddress), - Topics: topics, - Data: common.Hex2Bytes(ele.LogData), - BlockNumber: ele.BlockNumber, - TxHash: common.HexToHash(ele.TxHash), - TxIndex: ele.TxIndex, - BlockHash: common.HexToHash(ele.BlockHash), - Index: ele.LogIndex, - } - send, err := log2Msg(m, log, idx) - if err != nil { - return 0, err - } - count += send - m.Cfg.StartBlock = big.NewInt(ele.Id) - } - - return count, nil -} - -func (m *Oracle) filterOracle() error { - topic := "" - for idx, ele := range m.Cfg.Events { - topic += ele.GetTopic().Hex() - if idx != len(m.Cfg.Events)-1 { - topic += "," - } - } - - tmp := int64(0) - defer func() { - if tmp == 0 { - return - } - if tmp > m.Cfg.StartBlock.Int64() { - m.Cfg.StartBlock = big.NewInt(tmp) - } - }() - for _, pid := range []int64{constant.ProjectOfOracle, constant.ProjectOfMsger} { - data, err := Request(fmt.Sprintf("%s/%s?%s", m.Cfg.FilterHost, constant.FilterUrl, - fmt.Sprintf("id=%d&project_id=%d&chain_id=%d&topic=%s&limit=1", - m.Cfg.StartBlock.Int64(), pid, m.Cfg.Id, topic))) - if err != nil { - return err - } - listData, err := json.Marshal(data) - if err != nil { - return errors.Wrap(err, "marshal resp.Data failed") - } - back := stream.MosListResp{} - err = json.Unmarshal(listData, &back) - if err != nil { - return err - } - if len(back.List) == 0 { - continue - } - - for _, ele := range back.List { - idx := m.Match(ele.ContractAddress) // 新版 oracle - if idx == -1 { - m.Log.Info("Filter Log Address Not Match", "id", ele.Id, "address", ele.ContractAddress) - tmp = ele.Id - continue - } - - split := strings.Split(ele.Topic, ",") - topics := make([]common.Hash, 0, len(split)) - for _, sp := range split { - topics = append(topics, common.HexToHash(sp)) - } - log := types.Log{ - Address: common.HexToAddress(ele.ContractAddress), - Topics: topics, - Data: common.Hex2Bytes(ele.LogData), - BlockNumber: ele.BlockNumber, - TxHash: common.HexToHash(ele.TxHash), - TxIndex: ele.TxIndex, - BlockHash: common.HexToHash(ele.BlockHash), - Index: ele.LogIndex, - } - err = log2Oracle(m, []types.Log{log}, big.NewInt(0).SetUint64(ele.BlockNumber)) - if err != nil { - return err - } - tmp = ele.Id - } - } - return nil -} - -func Request(urlPath string) (interface{}, error) { - resp, err := http.Get(urlPath) - if err != nil { - return nil, errors.Wrap(err, "request get failed") - } - data, err := io.ReadAll(resp.Body) - if err != nil { - return nil, errors.Wrap(err, "readAll failed") - } - ret := stream.CommonResp{} - err = json.Unmarshal(data, &ret) - if err != nil { - return nil, errors.Wrap(err, "unMarshal resp failed") - } - if ret.Code != http.StatusOK && ret.Code != 2000 { - msg := ret.Message - if msg == "" { - msg = ret.Msg - } - return nil, fmt.Errorf("request code is not success, msg is %s", msg) - } - - return ret.Data, nil -} diff --git a/internal/chain/maintainer.go b/internal/chain/maintainer.go deleted file mode 100644 index d91351ee..00000000 --- a/internal/chain/maintainer.go +++ /dev/null @@ -1,145 +0,0 @@ -package chain - -import ( - "context" - "fmt" - "github.com/mapprotocol/compass/internal/constant" - "github.com/mapprotocol/compass/internal/mapprotocol" - "github.com/mapprotocol/compass/pkg/util" - "github.com/pkg/errors" - "math/big" - "time" -) - -type Maintainer struct { - *CommonSync - syncedHeight *big.Int -} - -func NewMaintainer(cs *CommonSync) *Maintainer { - return &Maintainer{ - CommonSync: cs, - syncedHeight: new(big.Int), - } -} - -func (m *Maintainer) Sync() error { - m.Log.Debug("Starting listener...") - go func() { - err := m.sync() - if err != nil { - m.Log.Error("Polling blocks failed", "err", err) - } - }() - - return nil -} - -// sync function of Maintainer will poll for the latest block and proceed to parse the associated events as it sees new blocks. -// Polling begins at the block defined in `m.Cfg.StartBlock`. Failed attempts to fetch the latest block or parse -// a block will be retried up to BlockRetryLimit times before continuing to the next block. -func (m *Maintainer) sync() error { - if m.Cfg.Id != m.Cfg.MapChainID && !m.Cfg.SyncToMap { - time.Sleep(time.Hour * 2400) - return nil - } - var currentBlock = m.Cfg.StartBlock - m.Log.Info("Polling Blocks...", "block", currentBlock) - - if m.Cfg.SyncToMap { - syncedHeight, err := mapprotocol.Get2MapHeight(m.Cfg.Id) - if err != nil { - m.Log.Error("Get synced Height failed", "err", err) - return err - } - - m.Log.Info("Check Block Sync Status...", "synced", syncedHeight, "currentBlock", currentBlock) - m.syncedHeight = syncedHeight - - if syncedHeight.Cmp(currentBlock) != 0 { - currentBlock.Add(syncedHeight, new(big.Int).SetInt64(m.height)) - m.Log.Info("SyncedHeight is higher or lower than currentHeight, so let currentHeight = syncedHeight", - "syncedHeight", syncedHeight, "currentBlock", currentBlock) - } - } else if m.Cfg.Id == m.Cfg.MapChainID { - minHeight := big.NewInt(0) - for cId, height := range mapprotocol.SyncOtherMap { - if minHeight.Uint64() == 0 || minHeight.Cmp(height) == 1 { - m.Log.Info("map to other chain find min sync height ", "chainId", cId, - "syncedHeight", minHeight, "currentHeight", height) - minHeight = height - } - } - if m.Cfg.StartBlock.Cmp(minHeight) != 0 { // When the synchronized height is less than or more than the local starting height, use height - currentBlock = big.NewInt(minHeight.Int64() + m.height) - m.Log.Info("Map2other chain", "initial height", currentBlock) - } - } - - for { - select { - case <-m.Stop: - return errors.New("polling terminated") - default: - var ( - latestBlock *big.Int - err error - ) - if m.Cfg.Filter { - latestBlock, err = m.FilterLatestBlock() - } else { - latestBlock, err = m.Conn.LatestBlock() - } - if err != nil { - m.Log.Error("Unable to get latest block", "filter", m.Cfg.Filter, "err", err) - time.Sleep(constant.BlockRetryInterval) - continue - } - - if big.NewInt(0).Sub(latestBlock, currentBlock).Cmp(m.BlockConfirmations) == -1 { - m.Log.Debug("Block not ready, will retry", "current", currentBlock, "latest", latestBlock) - time.Sleep(constant.QueryRetryInterval) - continue - } - difference := new(big.Int).Sub(currentBlock, latestBlock) - if difference.Int64() > 0 { - m.Log.Info("chain online blockNumber less than local latestBlock, waiting...", "chainBlcNum", latestBlock, - "localBlock", currentBlock, "waiting", difference.Int64()) - time.Sleep(constant.BlockRetryInterval * time.Duration(difference.Int64())) - } - - if m.Cfg.Id == m.Cfg.MapChainID && len(m.Cfg.SyncChainIDList) > 0 { - err = m.syncHeaderToMap(m, currentBlock) - if err != nil { - m.Log.Error("Failed to listen header for block", "block", currentBlock, "err", err) - time.Sleep(constant.QueryRetryInterval) - util.Alarm(context.Background(), fmt.Sprintf("map sync header to other failed, err is %s", err.Error())) - continue - } - } else if currentBlock.Cmp(m.syncedHeight) == 1 { - err = m.syncHeaderToMap(m, currentBlock) - if err != nil { - m.Log.Error("Failed to listen header for block", "block", currentBlock, "err", err) - time.Sleep(constant.QueryRetryInterval) - if err.Error() != "not found" { - util.Alarm(context.Background(), fmt.Sprintf("%s sync header failed, err is %s", m.Cfg.Name, err.Error())) - } - continue - } - } else { - time.Sleep(time.Hour) - } - - // Write to block store. Not a critical operation, no need to retry - err = m.BlockStore.StoreBlock(currentBlock) - if err != nil { - m.Log.Error("Failed to write latest block to blockstore", "block", currentBlock, "err", err) - } - - currentBlock.Add(currentBlock, big.NewInt(1)) - if latestBlock.Int64()-currentBlock.Int64() <= m.Cfg.BlockConfirmations.Int64() { - time.Sleep(constant.MaintainerInterval) - } - } - } -} diff --git a/internal/chain/mcs.go b/internal/chain/mcs.go deleted file mode 100644 index de9882da..00000000 --- a/internal/chain/mcs.go +++ /dev/null @@ -1,371 +0,0 @@ -package chain - -import ( - "context" - "fmt" - "github.com/mapprotocol/compass/internal/mapprotocol" - "github.com/mapprotocol/compass/pkg/msg" - "math/big" - "strings" - "time" - - "github.com/ethereum/go-ethereum/crypto" - - "github.com/mapprotocol/compass/internal/constant" - "github.com/mapprotocol/compass/pkg/util" - - "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/pkg/errors" -) - -// exeSwapMsg executes swap msg, and send tx to the destination blockchain -func (w *Writer) exeSwapMsg(m msg.Message) bool { - return w.callContractWithMsg(w.cfg.McsContract[m.Idx], m) - //return w.callContractWithMsg(w.cfg.LightNode, m) -} - -// callContractWithMsg contract using address and function signature with message info -func (w *Writer) callContractWithMsg(addr common.Address, m msg.Message) bool { - var ( - errorCount, checkIdCount int64 - needNonce = true - ) - for { - select { - case <-w.stop: - return false - default: - orderId := m.Payload[1].([32]byte) - exits, err := w.checkOrderId(&addr, orderId, mapprotocol.Mcs, mapprotocol.MethodOfOrderList) - if err != nil { - w.log.Error("check orderId exist failed ", "err", err) - checkIdCount++ - if checkIdCount == 10 { - util.Alarm(context.Background(), fmt.Sprintf("writer mos checkOrderId failed, err is %s", err.Error())) - checkIdCount = 0 - } - } - if exits { - w.log.Info("Mcs orderId has been processed, Skip this request", "orderId", common.Bytes2Hex(orderId[:])) - m.DoneCh <- struct{}{} - return true - } - - err = w.conn.LockAndUpdateOpts(needNonce) - if err != nil { - w.log.Error("Failed to update nonce", "err", err) - time.Sleep(constant.TxRetryInterval) - continue - } - - var inputHash interface{} - if len(m.Payload) > 3 { - inputHash = m.Payload[3] - } - w.log.Info("Send transaction", "addr", addr, "srcHash", inputHash, "needNonce", needNonce, "nonce", w.conn.Opts().Nonce) - //err := w.call(&addr, m.Payload[0].([]byte), mapprotocol.Other, mapprotocol.MethodVerifyProofData) - mcsTx, err := w.sendTx(&addr, nil, m.Payload[0].([]byte)) - if err == nil { - w.log.Info("Submitted cross tx execution", "src", m.Source, "dst", m.Destination, - "srcHash", inputHash, "mcsTx", mcsTx.Hash()) - err = w.txStatus(mcsTx.Hash()) - if err != nil { - w.log.Warn("TxHash Status is not successful, will retry", "err", err) - } else { - m.DoneCh <- struct{}{} - return true - } - } else if w.cfg.SkipError && errorCount >= 9 { - w.log.Warn("Execution failed, ignore this error, Continue to the next ", "srcHash", inputHash, "err", err) - m.DoneCh <- struct{}{} - return true - } else { - for e := range constant.IgnoreError { - if strings.Index(err.Error(), e) != -1 { - w.log.Info("Ignore This Error, Continue to the next", "id", m.Destination, "err", err) - m.DoneCh <- struct{}{} - return true - } - } - w.log.Warn("Execution failed, will retry", "srcHash", inputHash, "err", err) - } - needNonce = w.needNonce(err) - errorCount++ - if errorCount >= 10 { - w.mosAlarm(m, inputHash, err) - errorCount = 0 - } - time.Sleep(constant.TxRetryInterval) - } - } -} - -func (w *Writer) merlinWithMsg(m msg.Message) bool { - var ( - errorCount int64 - needNonce = true - addr = w.cfg.McsContract[m.Idx] - ) - for { - select { - case <-w.stop: - return false - default: - err := w.conn.LockAndUpdateOpts(needNonce) - if err != nil { - w.log.Error("Failed to update nonce", "err", err) - time.Sleep(constant.TxRetryInterval) - continue - } - var inputHash = m.Payload[3] - w.log.Info("Send transaction", "method", m.Payload[4], "srcHash", inputHash, "needNonce", needNonce, "nonce", w.conn.Opts().Nonce) - mcsTx, err := w.sendTx(&addr, nil, m.Payload[0].([]byte)) - if err == nil { - w.log.Info("Submitted cross tx execution", "src", m.Source, "dst", m.Destination, "srcHash", inputHash, "mcsTx", mcsTx.Hash()) - err = w.txStatus(mcsTx.Hash()) - if err != nil { - w.log.Warn("Store TxHash Status is not successful, will retry", "err", err) - } else { - m.DoneCh <- struct{}{} - return true - } - } else if w.cfg.SkipError && errorCount >= 9 { - w.log.Warn("Execution failed, ignore this error, Continue to the next ", "srcHash", inputHash, "err", err) - m.DoneCh <- struct{}{} - return true - } else { - for e := range constant.IgnoreError { - if strings.Index(err.Error(), e) != -1 { - w.log.Info("Ignore This Error, Continue to the next", "id", m.Destination, "err", err) - m.DoneCh <- struct{}{} - return true - } - } - w.log.Warn("Execution SwapInVerify failed, will retry", "srcHash", inputHash, "err", err) - } - - needNonce = w.needNonce(err) - errorCount++ - if errorCount >= 10 { - w.mosAlarm(m, inputHash, err) - errorCount = 0 - } - time.Sleep(constant.TxRetryInterval) - } - } -} - -func (w *Writer) proposal(m msg.Message) bool { - var ( - errorCount int64 - needNonce = true - addr = w.cfg.OracleNode - ) - for { - select { - case <-w.stop: - return false - default: - pack := m.Payload[0].([]byte) - receiptHash := m.Payload[1].(*common.Hash) - blockNumber := m.Payload[2].(*big.Int) - hash := common.Bytes2Hex(crypto.Keccak256(pack)) - fmt.Println("sign before hash", hash) - sign, err := personalSign(string(common.Hex2Bytes(hash)), w.conn.Keypair().PrivateKey) - if err != nil { - return false - } - var fixedHash [32]byte - for i, v := range receiptHash { - fixedHash[i] = v - } - - fmt.Println("m.Source ", m.Source) - fmt.Println("m.blockNumber ", blockNumber) - fmt.Println("m.fixedHash ", receiptHash) - fmt.Println("m.sign ", common.Bytes2Hex(sign)) - data, err := mapprotocol.SignerAbi.Pack(mapprotocol.MethodOfPropose, big.NewInt(int64(m.Source)), blockNumber, fixedHash, sign) - if err != nil { - return false - } - - err = w.conn.LockAndUpdateOpts(needNonce) - if err != nil { - w.log.Error("Failed to update nonce", "err", err) - time.Sleep(constant.TxRetryInterval) - continue - } - - w.log.Info("Send tronProposal transaction", "addr", addr, "needNonce", needNonce, "nonce", w.conn.Opts().Nonce, "receiptHash", receiptHash) - mcsTx, err := w.sendTx(&addr, nil, data) - if err == nil { - w.log.Info("Submitted cross tx execution", "src", m.Source, "dst", m.Destination, "mcsTx", mcsTx.Hash()) - err = w.txStatus(mcsTx.Hash()) - if err != nil { - w.log.Warn("Store TxHash Status is not successful, will retry", "err", err) - } else { - m.DoneCh <- struct{}{} - return true - } - } else if w.cfg.SkipError && errorCount >= 9 { - w.log.Warn("Execution failed, ignore this error, Continue to the next ", "err", err) - m.DoneCh <- struct{}{} - return true - } else { - for e := range constant.IgnoreError { - if strings.Index(err.Error(), e) != -1 { - w.log.Info("Ignore This Error, Continue to the next", "id", m.Destination, "err", err) - m.DoneCh <- struct{}{} - return true - } - } - w.log.Warn("Execution SwapInVerify failed, will retry", "err", err) - } - - needNonce = w.needNonce(err) - errorCount++ - if errorCount >= 10 { - w.mosAlarm(m, "proposal", err) - errorCount = 0 - } - time.Sleep(constant.TxRetryInterval) - } - } -} - -func (w *Writer) mosAlarm(m msg.Message, tx interface{}, err error) { - util.Alarm(context.Background(), fmt.Sprintf("mos %s2%s failed, srcHash=%v err is %s", mapprotocol.OnlineChaId[m.Source], - mapprotocol.OnlineChaId[m.Destination], tx, err.Error())) -} - -func (w *Writer) call(toAddress *common.Address, input []byte, useAbi abi.ABI, method string) error { - from := w.conn.Keypair().Address - outPut, err := w.conn.Client().CallContract(context.Background(), - ethereum.CallMsg{ - From: from, - To: toAddress, - Data: input, - }, - nil, - ) - if err != nil { - w.log.Error("Mcs callContract verify failed", "err", err.Error()) - return err - } - - fmt.Println("0x", len(outPut)) - resp, err := useAbi.Methods[method].Outputs.Unpack(outPut) - if err != nil { - w.log.Error("Writer Unpack failed ", "method", method, "err", err.Error()) - return err - } - - ret := struct { - Success bool - Message string - Logs []byte - }{} - - err = useAbi.Methods[method].Outputs.Copy(&ret, resp) - if err != nil { - return errors.Wrap(err, "resp copy failed") - } - - if !ret.Success { - return fmt.Errorf("verify proof failed, message is (%s)", ret.Message) - } - if ret.Success == true { - w.log.Info("Mcs verify log success", "success", ret.Success) - w.log.Info("Mcs verify log success", "data", common.Bytes2Hex(ret.Logs)) - } - - return nil -} - -func (w *Writer) checkOrderId(toAddress *common.Address, input [32]byte, useAbi abi.ABI, method string) (bool, error) { - data, err := mapprotocol.PackInput(useAbi, method, input) - if err != nil { - return false, err - } - from := w.conn.Keypair().Address - outPut, err := w.conn.Client().CallContract(context.Background(), - ethereum.CallMsg{ - From: from, - To: toAddress, - Data: data, - }, - nil, - ) - if err != nil { - return false, errors.Wrap(err, "callContract failed") - } - - resp, err := useAbi.Methods[method].Outputs.Unpack(outPut) - if err != nil { - return false, errors.Wrap(err, "output Unpack failed") - } - - var exist bool - err = useAbi.Methods[method].Outputs.Copy(&exist, resp) - if err != nil { - return false, errors.Wrap(err, "checkOrderId output copy failed") - } - - return exist, nil -} - -func (w *Writer) txStatus(txHash common.Hash) error { - var count int64 - //time.Sleep(time.Second * 2) - for { - pending, err := w.conn.Client().IsPendingByTxHash(context.Background(), txHash) // Query whether it is on the chain - if pending { - w.log.Info("Tx is Pending, please wait...", "tx", txHash) - time.Sleep(w.queryInterval()) - count++ - if count == 60 { - return errors.New("The Tx pending state is too long") - } - continue - } - if err != nil { - time.Sleep(w.queryInterval()) - count++ - if count == 60 { - return err - } - w.log.Error("Tx Found failed, please wait...", "tx", txHash, "err", err) - continue - } - break - } - count = 0 - for { - receipt, err := w.conn.Client().TransactionReceipt(context.Background(), txHash) // Query receipt after chaining - if err != nil { - if strings.Index(err.Error(), "not found") != -1 { - w.log.Info("Tx is temporary not found, please wait...", "tx", txHash) - time.Sleep(w.queryInterval()) - count++ - if count == 40 { - return err - } - continue - } - return err - } - - if receipt.Status == types.ReceiptStatusSuccessful { - w.log.Info("Tx receipt status is success", "hash", txHash) - return nil - } - return fmt.Errorf("txHash(%s), status not success, current status is (%d)", txHash, receipt.Status) - } -} - -func (w *Writer) queryInterval() time.Duration { - return time.Second * 3 -} diff --git a/internal/chain/messenger.go b/internal/chain/messenger.go deleted file mode 100644 index e20dfb74..00000000 --- a/internal/chain/messenger.go +++ /dev/null @@ -1,320 +0,0 @@ -package chain - -import ( - "context" - "crypto/ecdsa" - "errors" - "fmt" - "math/big" - "strconv" - "strings" - "time" - - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/mapprotocol/compass/internal/constant" - "github.com/mapprotocol/compass/internal/mapprotocol" - "github.com/mapprotocol/compass/internal/proof" - "github.com/mapprotocol/compass/pkg/ethclient" - "github.com/mapprotocol/compass/pkg/msg" - "github.com/mapprotocol/compass/pkg/util" -) - -type Messenger struct { - *CommonSync -} - -func NewMessenger(cs *CommonSync) *Messenger { - return &Messenger{ - CommonSync: cs, - } -} - -func (m *Messenger) Sync() error { - m.Log.Debug("Starting listener...") - go func() { - if !m.Cfg.SyncToMap && m.Cfg.Id != m.Cfg.MapChainID { - time.Sleep(time.Hour * 2400) - return - } - if m.Cfg.Filter { - err := m.filter() - if err != nil { - m.Log.Error("Polling blocks failed", "err", err) - } - return - } - err := m.sync() - if err != nil { - m.Log.Error("Polling blocks failed", "err", err) - } - }() - - return nil -} - -// sync function of Messenger will poll for the latest block and listen the log information of transactions in the block -// Polling begins at the block defined in `m.Cfg.startBlock`. Failed attempts to fetch the latest block or parse -// a block will be retried up to BlockRetryLimit times before continuing to the next block. -// However,an error in synchronizing the log will cause the entire program to block -func (m *Messenger) sync() error { - var currentBlock = m.Cfg.StartBlock - for { - select { - case <-m.Stop: - return errors.New("polling terminated") - default: - latestBlock, err := m.Conn.LatestBlock() - if err != nil { - m.Log.Error("Unable to get latest block", "block", currentBlock, "err", err) - time.Sleep(constant.QueryRetryInterval) - continue - } - - if big.NewInt(0).Sub(latestBlock, currentBlock).Cmp(m.BlockConfirmations) == -1 { - m.Log.Debug("Block not ready, will retry", "currentBlock", currentBlock, "latest", latestBlock) - time.Sleep(constant.BalanceRetryInterval) - continue - } - count, err := m.mosHandler(m, currentBlock) - if m.Cfg.SkipError && errors.Is(err, NotVerifyAble) { - m.Log.Info("Block not verify, will ignore", "startBlock", m.Cfg.StartBlock) - m.Cfg.StartBlock = m.Cfg.StartBlock.Add(m.Cfg.StartBlock, big.NewInt(1)) - err = m.BlockStore.StoreBlock(m.Cfg.StartBlock) - continue - } - if err != nil { - if errors.Is(err, NotVerifyAble) { - time.Sleep(constant.BlockRetryInterval) - continue - } - m.Log.Error("Failed to get events for block", "block", currentBlock, "err", err) - util.Alarm(context.Background(), fmt.Sprintf("mos failed, chain=%s, err is %s", m.Cfg.Name, err.Error())) - time.Sleep(constant.BlockRetryInterval) - continue - } - - _ = m.WaitUntilMsgHandled(count) - err = m.BlockStore.StoreBlock(currentBlock) - if err != nil { - m.Log.Error("Failed to write latest block to blockstore", "block", currentBlock, "err", err) - } - - currentBlock.Add(currentBlock, big.NewInt(1)) - if latestBlock.Int64()-currentBlock.Int64() <= m.Cfg.BlockConfirmations.Int64() { - time.Sleep(constant.MessengerInterval) - } - if currentBlock.Int64()%100 == 0 { - m.Log.Info("Msger report progress", "latestBlock", latestBlock, "block", currentBlock) - } - } - } -} - -func (m *Messenger) filter() error { - for { - select { - case <-m.Stop: - return errors.New("filter polling terminated") - default: - latestBlock, err := m.FilterLatestBlock() - if err != nil { - m.Log.Error("Unable to get latest block", "err", err) - time.Sleep(constant.BlockRetryInterval) - continue - } - count, err := m.filterMosHandler(latestBlock.Uint64()) - if m.Cfg.SkipError && errors.Is(err, NotVerifyAble) { - m.Log.Info("Block not verify, will ignore", "startBlock", m.Cfg.StartBlock) - m.Cfg.StartBlock = m.Cfg.StartBlock.Add(m.Cfg.StartBlock, big.NewInt(1)) - err = m.BlockStore.StoreBlock(m.Cfg.StartBlock) - continue - } - if err != nil { - m.Log.Error("Filter Failed to get events for block", "err", err) - if errors.Is(err, NotVerifyAble) { - time.Sleep(constant.BlockRetryInterval) - continue - } - if strings.Index(err.Error(), "missing required field") != -1 { - time.Sleep(constant.BlockRetryInterval) - continue - } - util.Alarm(context.Background(), fmt.Sprintf("filter mos failed, chain=%s, err is %s", m.Cfg.Name, err.Error())) - time.Sleep(constant.BlockRetryInterval) - continue - } - - // hold until all messages are handled - _ = m.WaitUntilMsgHandled(count) - err = m.BlockStore.StoreBlock(m.Cfg.StartBlock) - if err != nil { - m.Log.Error("Filter Failed to write latest block to blockStore", "err", err) - } - - time.Sleep(constant.MessengerInterval) - } - } -} - -func defaultMosHandler(m *Messenger, blockNumber *big.Int) (int, error) { - count := 0 - for idx, addr := range m.Cfg.McsContract { - query := m.BuildQuery(addr, m.Cfg.Events, blockNumber, blockNumber) - logs, err := m.Conn.Client().FilterLogs(context.Background(), query) - if err != nil { - return 0, fmt.Errorf("unable to Filter Logs: %w", err) - } - - m.Log.Debug("event", "blockNumber ", blockNumber, " logs ", len(logs), "mcs", addr, "events", m.Cfg.Events) - for _, log := range logs { - ele := log - send, err := log2Msg(m, &ele, idx) - if err != nil { - return 0, err - } - count += send - } - } - return count, nil -} - -func log2Msg(m *Messenger, log *types.Log, idx int) (int, error) { - var ( - proofType int64 - toChainID uint64 - err error - ) - - orderId := log.Topics[1] - toChainID, _ = strconv.ParseUint(strconv.FormatUint(uint64(m.Cfg.MapChainID), 10), 10, 64) - if m.Cfg.Id == m.Cfg.MapChainID { - toChainID = big.NewInt(0).SetBytes(log.Topics[2].Bytes()[8:16]).Uint64() - } - chainName, ok := mapprotocol.OnlineChaId[msg.ChainId(toChainID)] - if !ok { - m.Log.Info("Map Found a log that is not the current task ", "blockNumber", log.BlockNumber, "toChainID", toChainID) - return 0, nil - } - m.Log.Info("Event found", "blockNumber", log.BlockNumber, "txHash", log.TxHash, "logIdx", log.Index, "toChainID", toChainID, "orderId", orderId) - if strings.ToLower(chainName) == "near" { - proofType = 1 - } else if strings.ToLower(chainName) == "tron" || strings.ToLower(chainName) == "sol" { - proofType = constant.ProofTypeOfLogOracle - } else if strings.ToLower(chainName) == "ton" { - proofType = constant.ProofTypeOfLogOracle - } else { - proofType, err = PreSendTx(idx, uint64(m.Cfg.Id), toChainID, big.NewInt(0).SetUint64(log.BlockNumber), orderId.Bytes()) - if errors.Is(err, OrderExist) { - m.Log.Info("This txHash order exist", "txHash", log.TxHash, "toChainID", toChainID) - return 0, nil - } - if errors.Is(err, NotVerifyAble) { - m.Log.Info("CurrentBlock not verify", "txHash", log.TxHash, "toChainID", toChainID) - return 0, err - } - if err != nil { - return 0, err - } - } - - var sign [][]byte - if proofType == constant.ProofTypeOfNewOracle || proofType == constant.ProofTypeOfLogOracle { - ret, err := Signer(m.Conn.Client(), uint64(m.Cfg.Id), uint64(m.Cfg.MapChainID), log, proofType) - if err != nil { - return 0, err - } - sign = ret.Signatures - } - - tmpLog := log - message, err := m.assembleProof(m, tmpLog, proofType, toChainID, sign) - if err != nil { - return 0, err - } - message.Idx = idx - err = m.Router.Send(*message) - if err != nil { - m.Log.Error("Subscription error: failed to route message", "err", err) - return 0, err - } - return 1, nil -} - -func Signer(cli *ethclient.Client, selfId, toId uint64, log *types.Log, proofType int64) (*ProposalInfoResp, error) { - bn := big.NewInt(int64(log.BlockNumber)) - ret, err := MulSignInfo(0, toId) - if err != nil { - return nil, fmt.Errorf("MulSignInfo failed: %w", err) - } - header, err := cli.HeaderByNumber(context.Background(), big.NewInt(int64(log.BlockNumber))) - if err != nil { - return nil, err - } - switch proofType { - case constant.ProofTypeOfNewOracle: - genRece, err := genMptReceipt(cli, int64(selfId), bn) // hash修改 - if err != nil { - return nil, err - } - if genRece != nil { - header.ReceiptHash = *genRece - } - case constant.ProofTypeOfLogOracle: - hash, _ := GenLogReceipt(log) - if hash != nil { - header.ReceiptHash = *hash - } - - idx := log.Index - if selfId != constant.CfxChainId && selfId != constant.MapChainId && selfId != constant.BscChainId { - idx = 0 - } - bn = proof.GenLogBlockNumber(bn, idx) - default: - return nil, fmt.Errorf("unknown proof type %d", proofType) - } - - piRet, err := ProposalInfo(0, selfId, toId, bn, header.ReceiptHash, ret.Version) - if err != nil { - return nil, fmt.Errorf("ProposalInfo failed: %w", err) - } - if !piRet.CanVerify { - return nil, NotVerifyAble - } - return piRet, nil -} - -func PersonalSign(message string, privateKey *ecdsa.PrivateKey) ([]byte, error) { - return personalSign(message, privateKey) -} - -func personalSign(message string, privateKey *ecdsa.PrivateKey) ([]byte, error) { - fullMessage := fmt.Sprintf("\x19Ethereum Signed Message:\n%d%s", len(message), message) - hash := crypto.Keccak256Hash([]byte(fullMessage)) - signatureBytes, err := crypto.Sign(hash.Bytes(), privateKey) - if err != nil { - return nil, err - } - signatureBytes[64] += 27 - return signatureBytes, nil -} - -func GetSigner(blockNumber *big.Int, receiptHash common.Hash, selfId, toChainID uint64) (*ProposalInfoResp, error) { - ret, err := MulSignInfo(0, toChainID) - if err != nil { - return nil, err - } - - piRet, err := ProposalInfo(0, selfId, toChainID, blockNumber, receiptHash, ret.Version) - if err != nil { - return nil, err - } - - if !piRet.CanVerify { - return nil, NotVerifyAble - } - - return piRet, nil -} diff --git a/internal/chain/oracle.go b/internal/chain/oracle.go deleted file mode 100644 index b3163b51..00000000 --- a/internal/chain/oracle.go +++ /dev/null @@ -1,399 +0,0 @@ -package chain - -import ( - "context" - "crypto/ecdsa" - "encoding/binary" - "fmt" - "github.com/mapprotocol/compass/internal/mapprotocol" - "github.com/mapprotocol/compass/pkg/msg" - "math/big" - "time" - - eth "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/ethdb/memorydb" - "github.com/ethereum/go-ethereum/trie" - "github.com/mapprotocol/compass/internal/constant" - "github.com/mapprotocol/compass/internal/proof" - "github.com/mapprotocol/compass/internal/tx" - "github.com/mapprotocol/compass/pkg/ethclient" - "github.com/mapprotocol/compass/pkg/util" - "github.com/pkg/errors" -) - -type Oracle struct { - *CommonSync -} - -func NewOracle(cs *CommonSync) *Oracle { - return &Oracle{ - CommonSync: cs, - } -} - -func (m *Oracle) Sync() error { - m.Log.Debug("Starting listener...") - go func() { - if !m.Cfg.SyncToMap && m.Cfg.Id != m.Cfg.MapChainID { - time.Sleep(time.Hour * 2400) - return - } - if m.Cfg.Filter { - err := m.filter() - if err != nil { - m.Log.Error("Filter Polling blocks failed", "err", err) - } - return - } - err := m.sync() - if err != nil { - m.Log.Error("Polling blocks failed", "err", err) - } - }() - - return nil -} - -func (m *Oracle) sync() error { - var currentBlock = m.Cfg.StartBlock - for { - select { - case <-m.Stop: - return errors.New("polling terminated") - default: - latestBlock, err := m.Conn.LatestBlock() - if err != nil { - m.Log.Error("Unable to get latest block", "block", currentBlock, "err", err) - time.Sleep(constant.QueryRetryInterval) - continue - } - - if big.NewInt(0).Sub(latestBlock, currentBlock).Cmp(m.BlockConfirmations) == -1 { - m.Log.Debug("Block not ready, will retry", "currentBlock", currentBlock, "latest", latestBlock, "sub", big.NewInt(0).Sub(latestBlock, currentBlock)) - time.Sleep(constant.BalanceRetryInterval) - continue - } - - err = m.oracleHandler(m, currentBlock) - if err != nil { - m.Log.Error("Failed to get events for block", "block", currentBlock, "err", err) - time.Sleep(constant.BlockRetryInterval) - util.Alarm(context.Background(), fmt.Sprintf("oracle failed, chain=%s, err is %s", m.Cfg.Name, err.Error())) - continue - } - - err = m.BlockStore.StoreBlock(currentBlock) - if err != nil { - m.Log.Error("Failed to write latest block to blockStore", "block", currentBlock, "err", err) - } - - currentBlock.Add(currentBlock, big.NewInt(1)) - if latestBlock.Int64()-currentBlock.Int64() <= m.Cfg.BlockConfirmations.Int64() { - time.Sleep(constant.MessengerInterval) - } - } - } -} - -func (m *Oracle) filter() error { - for { - select { - case <-m.Stop: - return errors.New("filter polling terminated") - default: - err := m.filterOracle() - if err != nil { - m.Log.Error("Failed to get events for block", "err", err) - time.Sleep(constant.BlockRetryInterval) - util.Alarm(context.Background(), fmt.Sprintf("oracle failed, chain=%s, err is %s", m.Cfg.Name, err.Error())) - continue - } - - err = m.BlockStore.StoreBlock(m.Cfg.StartBlock) - if err != nil { - m.Log.Error("Filter Failed to write latest block to blockstore", "err", err) - } - - time.Sleep(constant.MessengerInterval) - } - } -} - -func BuildQuery(contract []common.Address, sig []constant.EventSig, startBlock *big.Int, endBlock *big.Int) eth.FilterQuery { - topics := make([]common.Hash, 0, len(sig)) - for _, s := range sig { - topics = append(topics, s.GetTopic()) - } - query := eth.FilterQuery{ - FromBlock: startBlock, - ToBlock: endBlock, - Addresses: contract, - Topics: [][]common.Hash{topics}, - } - return query -} - -func DefaultOracleHandler(m *Oracle, currentBlock *big.Int) error { - // 区分 - query := BuildQuery(append(m.Cfg.McsContract, m.Cfg.LightNode), m.Cfg.Events, currentBlock, currentBlock) - // querying for logs - logs, err := m.Conn.Client().FilterLogs(context.Background(), query) - if err != nil { - return fmt.Errorf("oracle unable to Filter Logs: %w", err) - } - if len(logs) == 0 { - return nil - } - m.Log.Info("Querying block for events", "block", currentBlock, "logs", len(logs)) - err = log2Oracle(m, logs, currentBlock) - if err != nil { - return err - } - - return nil -} - -func getToChainId(topics []common.Hash) uint64 { - var ret uint64 - if topics[0] == mapprotocol.TopicOfManagerNotifySend { - ret = binary.BigEndian.Uint64(topics[1][len(topics[1])-8:]) - } else { - ret = big.NewInt(0).SetBytes(topics[2].Bytes()[8:16]).Uint64() - } - return ret -} - -func log2Oracle(m *Oracle, logs []types.Log, blockNumber *big.Int) error { - count := 0 - var ( - err error - receipt *common.Hash - ) - id := big.NewInt(int64(m.Cfg.Id)) - for _, log := range logs { - toChainID := uint64(m.Cfg.MapChainID) - if m.Cfg.Id == m.Cfg.MapChainID { - toChainID = getToChainId(log.Topics) - if _, ok := mapprotocol.OnlineChaId[msg.ChainId(toChainID)]; !ok { - m.Log.Info("Map Oracle Found a log that is not the current task", "blockNumber", log.BlockNumber, "toChainID", toChainID) - continue - } - } - - nodeType := new(big.Int) - if m.Cfg.Id == m.Cfg.MapChainID { - nodeType, err = GetMap2OtherNodeType(0, toChainID) - if err != nil { - return errors.Wrap(err, "Get2OtherNodeType failed") - } - } else { - nodeType, err = mapprotocol.GetNodeTypeByManager(mapprotocol.MethodOfNodeType, big.NewInt(int64(m.Cfg.Id))) - if err != nil { - return err - } - } - - m.Log.Info("Oracle model get node type is", "blockNumber", blockNumber, "nodeType", nodeType, "topic", log.Topics[0]) - tmp := log - targetBn := blockNumber - switch nodeType.Int64() { - case constant.ProofTypeOfNewOracle: // mpt - if log.Topics[0] != mapprotocol.TopicOfClientNotify && log.Topics[0] != mapprotocol.TopicOfManagerNotifySend { - m.Log.Info("Oracle model ignore this topic", "blockNumber", blockNumber) - continue - } - header, err := m.Conn.Client().HeaderByNumber(context.Background(), blockNumber) - if err != nil { - return fmt.Errorf("oracle get header failed, err: %w", err) - } - receipt = &header.ReceiptHash - genRece, err := genMptReceipt(m.Conn.Client(), int64(m.Cfg.Id), blockNumber) - if genRece != nil { - receipt = genRece - } - log.Index = 0 - case constant.ProofTypeOfLogOracle: // log - if log.Topics[0] == mapprotocol.TopicOfClientNotify || log.Topics[0] == mapprotocol.TopicOfManagerNotifySend { - m.Log.Info("Oracle model ignore this topic", "blockNumber", blockNumber) - continue - } - receipt, err = GenLogReceipt(&tmp) - idx := log.Index - if m.Cfg.Id != constant.CfxChainId && m.Cfg.Id != constant.MapChainId && m.Cfg.Id != constant.BscChainId { - idx = 0 - } - targetBn = proof.GenLogBlockNumber(blockNumber, idx) // update block number - default: - panic("unhandled default case") - } - if err != nil { - return fmt.Errorf("oracle generate receipt failed, err is %w", err) - } - - m.Log.Info("Find log", "block", blockNumber, "logIndex", log.Index, "receipt", receipt, "targetBn", targetBn) - ret, err := MulSignInfo(0, uint64(m.Cfg.MapChainID)) - if err != nil { - return err - } - pack, err := mapprotocol.PackAbi.Methods[mapprotocol.MethodOfSolidityPack].Inputs.Pack(receipt, ret.Version, targetBn, id) - if err != nil { - return err - } - - err = m.Router.Send(msg.NewProposal(m.Cfg.Id, m.Cfg.MapChainID, []interface{}{pack, receipt, targetBn}, m.MsgCh)) - if err != nil { - m.Log.Error("Proposal error: failed to route message", "err", err) - return err - } - count++ - } - - err = m.WaitUntilMsgHandled(count) - if err != nil { - return err - } - return nil -} - -// GenLogReceipt generate log receipt -func GenLogReceipt(log *types.Log) (*common.Hash, error) { - recePack := make([]byte, 0) - recePack = append(recePack, log.Address.Bytes()...) - recePack = append(recePack, []byte{0, 0, 0, 0}...) - recePack = append(recePack, Completion(big.NewInt(int64(len(log.Topics))).Bytes(), 4)...) - recePack = append(recePack, Completion(big.NewInt(int64(len(log.Data))).Bytes(), 4)...) - for _, tp := range log.Topics { - recePack = append(recePack, tp.Bytes()...) - } - recePack = append(recePack, log.Data...) - receipt := common.BytesToHash(crypto.Keccak256(recePack)) - return &receipt, nil -} - -func Completion(bytes []byte, number int) []byte { - ret := make([]byte, 0, number) - for i := 0; i < number-len(bytes); i++ { - ret = append(ret, byte(0)) - } - ret = append(ret, bytes...) - return ret -} - -func genMptReceipt(cli *ethclient.Client, selfId int64, latestBlock *big.Int) (*common.Hash, error) { - if !exist(selfId, []int64{constant.MerlinChainId, constant.CfxChainId, constant.ZkSyncChainId}) { - return nil, nil - } - txsHash, err := mapprotocol.GetTxsByBn(cli, latestBlock) - if err != nil { - return nil, fmt.Errorf("unable to get tx hashes Logs: %w", err) - } - receipts, err := tx.GetReceiptsByTxsHash(cli, txsHash) - if err != nil { - return nil, fmt.Errorf("unable to get receipts hashes Logs: %w", err) - } - tr, _ := trie.New(common.Hash{}, trie.NewDatabase(memorydb.New())) - tr = proof.DeriveTire(types.Receipts(receipts), tr) - ret := tr.Hash() - return &ret, nil -} - -func exist(target int64, dst []int64) bool { - for _, d := range dst { - if target == d { - return true - } - } - return false -} - -func GetMap2OtherNodeType(idx int, toChainID uint64) (*big.Int, error) { - switch toChainID { - case constant.TronChainId, constant.SolTestChainId, constant.SolMainChainId: - return big.NewInt(5), nil - default: - - } - if toChainID == constant.TonChainId { - return big.NewInt(5), nil - } - call, ok := mapprotocol.LightNodeMapping[msg.ChainId(toChainID)] - if !ok { - return nil, ContractNotExist - } - - ret := new(big.Int) - err := call.Call(mapprotocol.MethodOfNodeType, &ret, idx) - if err != nil { - return nil, err - } - return ret, nil -} - -func DefaultOracle(selfId, nodeType int64, log *types.Log, client *ethclient.Client, pri *ecdsa.PrivateKey) ([]byte, error) { - var ( - err error - blockNumber = big.NewInt(int64(log.BlockNumber)) - receipt *common.Hash - targetBn = blockNumber - ) - switch nodeType { - case constant.ProofTypeOfNewOracle: //mpt - if log.Topics[0] != mapprotocol.TopicOfClientNotify && log.Topics[0] != mapprotocol.TopicOfManagerNotifySend { - return nil, ContractNotExist - } - header, err := client.HeaderByNumber(context.Background(), blockNumber) - if err != nil { - return nil, fmt.Errorf("oracle get header failed, err: %w", err) - } - receipt = &header.ReceiptHash - genRece, err := genMptReceipt(client, selfId, blockNumber) - if genRece != nil { - receipt = genRece - } - log.Index = 0 - case constant.ProofTypeOfLogOracle: - if log.Topics[0] == mapprotocol.TopicOfClientNotify || log.Topics[0] == mapprotocol.TopicOfManagerNotifySend { - return nil, ContractNotExist - } - receipt, err = GenLogReceipt(log) - idx := log.Index - if selfId != constant.CfxChainId && selfId != constant.MapChainId { - idx = 0 - } - targetBn = proof.GenLogBlockNumber(blockNumber, idx) - default: - panic("unhandled default case") - } - if err != nil { - return nil, fmt.Errorf("oracle generate receipt failed, err is %w", err) - } - ret, err := MulSignInfo(0, uint64(constant.MapChainId)) - if err != nil { - return nil, err - } - pack, err := mapprotocol.PackAbi.Methods[mapprotocol.MethodOfSolidityPack].Inputs.Pack(receipt, ret.Version, - targetBn, big.NewInt(selfId)) - if err != nil { - return nil, err - } - - hash := common.Bytes2Hex(crypto.Keccak256(pack)) - sign, err := personalSign(string(common.Hex2Bytes(hash)), pri) - if err != nil { - return nil, err - } - var fixedHash [32]byte - for i, v := range receipt { - fixedHash[i] = v - } - - data, err := mapprotocol.SignerAbi.Pack(mapprotocol.MethodOfPropose, big.NewInt(selfId), targetBn, fixedHash, sign) - if err != nil { - return nil, err - } - - return data, nil -} diff --git a/internal/chain/writer.go b/internal/chain/writer.go deleted file mode 100644 index d8f2c15b..00000000 --- a/internal/chain/writer.go +++ /dev/null @@ -1,153 +0,0 @@ -package chain - -import ( - "context" - "github.com/mapprotocol/compass/pkg/msg" - "math/big" - "strings" - - "github.com/mapprotocol/compass/core" - - "github.com/mapprotocol/compass/internal/constant" - - "github.com/ChainSafe/log15" - "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" -) - -type Writer struct { - cfg Config - conn core.Connection - log log15.Logger - stop <-chan int - sysErr chan<- error // Reports fatal error to core -} - -// NewWriter creates and returns Writer -func NewWriter(conn core.Connection, cfg *Config, log log15.Logger, stop <-chan int, sysErr chan<- error) *Writer { - return &Writer{ - cfg: *cfg, - conn: conn, - log: log, - stop: stop, - sysErr: sysErr, - } -} - -func (w *Writer) start() error { - w.log.Debug("Starting Writer...") - return nil -} - -// ResolveMessage handles any given message based on type -// A bool is returned to indicate failure/success, this should be ignored except for within tests. -func (w *Writer) ResolveMessage(m msg.Message) bool { - w.log.Info("Attempting to resolve message", "type", m.Type, "src", m.Source, "dst", m.Destination) - - switch m.Type { - case msg.SyncToMap: - return w.execToMapMsg(m) - case msg.SyncFromMap: - return w.execMap2OtherMsg(m) - case msg.SwapWithProof: - fallthrough - case msg.SwapWithMapProof: - return w.exeSwapMsg(m) - case msg.SwapWithMerlin: - return w.merlinWithMsg(m) - case msg.Proposal: - return w.proposal(m) - default: - w.log.Error("Unknown message type received", "type", m.Type) - return false - } -} - -// sendTx send tx to an address with value and input data -func (w *Writer) sendTx(toAddress *common.Address, value *big.Int, input []byte) (*types.Transaction, error) { - gasPrice := w.conn.Opts().GasPrice - nonce := w.conn.Opts().Nonce - from := w.conn.Keypair().Address - - msg := ethereum.CallMsg{ - From: from, - To: toAddress, - GasPrice: gasPrice, - Value: value, - Data: input, - } - - gasLimit, err := w.conn.Client().EstimateGas(context.Background(), msg) - if err != nil { - w.log.Error("EstimateGas failed sendTx", "error:", err.Error()) - if err.Error() == "execution reverted" { - _, serr := w.conn.Client().SelfEstimateGas(context.Background(), - w.cfg.Endpoint, from.Hex(), toAddress.Hex(), "0x"+common.Bytes2Hex(input)) - w.log.Error("EstimateGas failed sendTx", "error:", serr) - if serr != nil { - return nil, serr - } - } - return nil, err - } - - gasTipCap := w.conn.Opts().GasTipCap - gasFeeCap := w.conn.Opts().GasFeeCap - w.log.Info("SendTx gasPrice before", "gasPrice", gasPrice, "gasTipCap", gasTipCap, "gasFeeCap", gasFeeCap) - if w.cfg.LimitMultiplier > 1 { - gasLimit = uint64(float64(gasLimit) * w.cfg.LimitMultiplier) - } - w.log.Info("SendTx gasPrice", "gasPrice", gasPrice, "gasTipCap", gasTipCap, "gasFeeCap", gasFeeCap, "gasLimit", gasLimit, - "limitMultiplier", w.cfg.LimitMultiplier, "gasMultiplier", w.cfg.GasMultiplier, "nonce", nonce.Uint64()) - // td interface - var td types.TxData - // EIP-1559 - if gasPrice != nil { - // legacy branch - td = &types.LegacyTx{ - Nonce: nonce.Uint64(), - Value: value, - To: toAddress, - Gas: gasLimit, - GasPrice: gasPrice, - Data: input, - } - } else { - // london branch - td = &types.DynamicFeeTx{ - Nonce: nonce.Uint64(), - Value: value, - To: toAddress, - Gas: gasLimit, - GasTipCap: gasTipCap, - GasFeeCap: gasFeeCap, - Data: input, - } - } - - tx := types.NewTx(td) - chainID := big.NewInt(int64(w.cfg.Id)) - privateKey := w.conn.Keypair().PrivateKey - - signedTx, err := types.SignTx(tx, types.NewLondonSigner(chainID), privateKey) - if err != nil { - w.log.Error("SignTx failed", "error:", err.Error()) - return nil, err - } - - err = w.conn.Client().SendTransaction(context.Background(), signedTx) - if err != nil { - w.log.Error("SendTransaction failed", "error:", err.Error()) - return nil, err - } - return signedTx, nil -} - -func (w *Writer) needNonce(err error) bool { - if err == nil || err.Error() == constant.ErrNonceTooLow.Error() || strings.Index(err.Error(), "nonce too low") != -1 { - return true - } - - return false -} diff --git a/internal/client/client.go b/internal/client/client.go deleted file mode 100644 index 2f42c86b..00000000 --- a/internal/client/client.go +++ /dev/null @@ -1,38 +0,0 @@ -package client - -import ( - "bytes" - log "github.com/ChainSafe/log15" - "io" - "net/http" -) - -func JsonPost(url string, data []byte) ([]byte, error) { - resp, err := http.Post(url, "application/json", bytes.NewBuffer(data)) - if err != nil { - log.Error("JsonPost request error", "url", url, "error", err) - return nil, err - } - defer resp.Body.Close() - body, err := io.ReadAll(resp.Body) - if err != nil { - log.Error("JsonPost io.ReadAll error", "url", url, "error", err) - return nil, err - } - return body, nil -} - -func JsonGet(url string) ([]byte, error) { - resp, err := http.Get(url) - if err != nil { - log.Error("JsonGet request error", "url", url, "error", err) - return nil, err - } - defer resp.Body.Close() - body, err := io.ReadAll(resp.Body) - if err != nil { - log.Error("JsonGet io.ReadAll error", "url", url, "error", err) - return nil, err - } - return body, nil -} diff --git a/internal/conflux/client.go b/internal/conflux/client.go deleted file mode 100644 index b79a01fd..00000000 --- a/internal/conflux/client.go +++ /dev/null @@ -1,292 +0,0 @@ -// Copyright 2019 Conflux Foundation. All rights reserved. -// Conflux is free software and distributed under GNU General Public License. -// See http://www.gnu.org/licenses/ - -package conflux - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "io" - "io/ioutil" - "net/http" - "net/url" - "reflect" - "strconv" - "sync" - "sync/atomic" - - "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/mapprotocol/compass/internal/conflux/types" - "github.com/pkg/errors" -) - -const ( - contentType = "application/json" - vsn = "2.0" -) - -var ErrNoResult = errors.New("no result in JSON-RPC response") - -type Client struct { - client *http.Client - url string - closeOnce sync.Once - closch chan interface{} - mu sync.Mutex // protcts headers - headers http.Header - isHttp bool - idCounter uint32 -} - -func NewClient(endpoint string) (*Client, error) { - // Sanity chck URL so we don't end up with a client that will fail every request. - _, err := url.Parse(endpoint) - if err != nil { - return nil, err - } - - headers := make(http.Header, 2) - headers.Set("accept", contentType) - headers.Set("content-type", contentType) - return &Client{ - client: new(http.Client), - url: endpoint, - closeOnce: sync.Once{}, - closch: make(chan interface{}), - mu: sync.Mutex{}, - headers: headers, - }, nil -} - -func (c *Client) GetStatus(ctx context.Context) (*Status, error) { - data, err := c.call(ctx, "pos_getStatus") - if err != nil { - return nil, err - } - var ret Status - err = json.Unmarshal(data, &ret) - if err != nil { - return nil, err - } - return &ret, nil -} - -func (c *Client) GetBlockByNumber(ctx context.Context, blockNumber BlockNumber) (*Block, error) { - data, err := c.call(ctx, "pos_getBlockByNumber", blockNumber) - if err != nil { - return nil, err - } - var ret Block - err = json.Unmarshal(data, &ret) - if err != nil { - return nil, err - } - return &ret, nil -} - -func (c *Client) GetLedgerInfoByEpochAndRound(ctx context.Context, epochNumber hexutil.Uint64, - round hexutil.Uint64) (*LedgerInfoWithSignatures, error) { - data, err := c.call(ctx, "pos_getLedgerInfoByEpochAndRound", epochNumber, round) - if err != nil { - return nil, err - } - var ret LedgerInfoWithSignatures - err = json.Unmarshal(data, &ret) - if err != nil { - return nil, err - } - return &ret, nil -} - -func (c *Client) GetBlockByEpochNumber(ctx context.Context, blockNumber hexutil.Uint64) (*BlockSummary, error) { - data, err := c.call(ctx, "cfx_getBlockByEpochNumber", blockNumber, false) - if err != nil { - return nil, err - } - - var ret BlockSummary - err = json.Unmarshal(data, &ret) - if err != nil { - return nil, err - } - return &ret, nil -} - -func (c *Client) GetEpochReceipts(ctx context.Context, epoch types.EpochOrBlockHash, - includeEthReceipts ...bool) ([][]types.TransactionReceipt, error) { - includeEth := get1stBoolIfy(includeEthReceipts) - data, err := c.call(ctx, "cfx_getEpochReceipts", epoch, includeEth) - if err != nil { - return nil, err - } - - var ret [][]types.TransactionReceipt - err = json.Unmarshal(data, &ret) - if err != nil { - return nil, err - } - return ret, nil -} - -func get1stBoolIfy(values []bool) bool { - value := false - if len(values) > 0 { - value = values[0] - } - return value -} - -func (c *Client) call(ctx context.Context, method string, args ...interface{}) ([]byte, error) { - var raw json.RawMessage - err := c.CallContext(ctx, &raw, method, args...) - if err != nil { - return nil, err - } else if len(raw) == 0 { - return nil, ethereum.NotFound - } - - data, err := raw.MarshalJSON() - if err != nil { - return nil, err - } - - return data, nil -} - -type jsonrpcMessage struct { - Version string `json:"jsonrpc,omitempty"` - ID json.RawMessage `json:"id,omitempty"` - Method string `json:"method,omitempty"` - Params json.RawMessage `json:"params,omitempty"` - Error *jsonError `json:"error,omitempty"` - Result json.RawMessage `json:"result,omitempty"` -} - -type jsonError struct { - Code int `json:"code"` - Message string `json:"message"` - Data interface{} `json:"data,omitempty"` -} - -func (err *jsonError) Error() string { - if err.Message == "" { - return fmt.Sprintf("json-rpc error %d", err.Code) - } - return err.Message -} - -type requestOp struct { - ids []json.RawMessage - err error - resp chan *jsonrpcMessage // receives up to len(ids) responses -} - -func (op *requestOp) wait(ctx context.Context) (*jsonrpcMessage, error) { - select { - case <-ctx.Done(): - return nil, ctx.Err() - case resp := <-op.resp: - return resp, op.err - } -} - -func (c *Client) CallContext(ctx context.Context, result interface{}, method string, args ...interface{}) error { - if result != nil && reflect.TypeOf(result).Kind() != reflect.Ptr { - return fmt.Errorf("call result parameter must be pointer or nil interface: %v", result) - } - msg, err := c.newMessage(method, args...) - if err != nil { - return err - } - op := &requestOp{ids: []json.RawMessage{msg.ID}, resp: make(chan *jsonrpcMessage, 1)} - - err = c.sendHTTP(ctx, op, msg) - if err != nil { - return err - } - - // dispatch has accepted the request and will close the channel when it quits. - switch resp, err := op.wait(ctx); { - case err != nil: - return err - case resp.Error != nil: - return resp.Error - case len(resp.Result) == 0: - return ErrNoResult - default: - return json.Unmarshal(resp.Result, &result) - } -} - -func (c *Client) nextID() json.RawMessage { - id := atomic.AddUint32(&c.idCounter, 1) - return strconv.AppendUint(nil, uint64(id), 10) -} - -func (c *Client) newMessage(method string, paramsIn ...interface{}) (*jsonrpcMessage, error) { - msg := &jsonrpcMessage{Version: vsn, ID: c.nextID(), Method: method} - if paramsIn != nil { // prevent sending "params":null - var err error - if msg.Params, err = json.Marshal(paramsIn); err != nil { - return nil, err - } - } - return msg, nil -} - -func (c *Client) sendHTTP(ctx context.Context, op *requestOp, msg interface{}) error { - respBody, err := c.doRequest(ctx, msg) - if err != nil { - return err - } - defer respBody.Close() - - var respmsg jsonrpcMessage - if err := json.NewDecoder(respBody).Decode(&respmsg); err != nil { - return err - } - op.resp <- &respmsg - return nil -} - -func (c *Client) doRequest(ctx context.Context, msg interface{}) (io.ReadCloser, error) { - body, err := json.Marshal(msg) - if err != nil { - return nil, err - } - req, err := http.NewRequestWithContext(ctx, "POST", c.url, ioutil.NopCloser(bytes.NewReader(body))) - if err != nil { - return nil, err - } - req.ContentLength = int64(len(body)) - - // set headers - c.mu.Lock() - req.Header = c.headers.Clone() - c.mu.Unlock() - - // do request - resp, err := c.client.Do(req) - if err != nil { - return nil, err - } - if resp.StatusCode < 200 || resp.StatusCode >= 300 { - //var buf bytes.Buffer - //var body []byte - //if _, err := buf.ReadFrom(resp.Body); err == nil { - // body = buf.Bytes() - //} - - return nil, fmt.Errorf("conflux request code is(%d)", resp.StatusCode) - //return nil, HTTPError{ - // Status: resp.Status, - // StatusCode: resp.StatusCode, - // Body: body, - //} - } - return resp.Body, nil -} diff --git a/internal/conflux/conflux.go b/internal/conflux/conflux.go deleted file mode 100644 index 07771b6f..00000000 --- a/internal/conflux/conflux.go +++ /dev/null @@ -1,328 +0,0 @@ -package conflux - -import ( - "context" - "github.com/ethereum/go-ethereum/ethdb/memorydb" - "github.com/ethereum/go-ethereum/trie" - maptypes "github.com/mapprotocol/atlas/core/types" - "github.com/mapprotocol/compass/internal/constant" - "github.com/mapprotocol/compass/internal/mapprotocol" - "github.com/mapprotocol/compass/internal/proof" - "github.com/mapprotocol/compass/pkg/msg" - "io" - "math/big" - - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - ethtypes "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/rlp" - "github.com/mapprotocol/compass/internal/conflux/mpt" - primitives "github.com/mapprotocol/compass/internal/conflux/primipives" - "github.com/mapprotocol/compass/internal/conflux/types" - "github.com/pkg/errors" -) - -const DeferredExecutionEpochs uint64 = 5 - -var ErrTransactionExecutionFailed = errors.New("transaction execution failed") - -func ConvertLedger(ledger *LedgerInfoWithSignatures) LedgerInfoLibLedgerInfoWithSignatures { - committee, _ := ConvertCommittee(ledger) - - result := LedgerInfoLibLedgerInfoWithSignatures{ - Epoch: uint64(ledger.LedgerInfo.CommitInfo.Epoch), - Round: uint64(ledger.LedgerInfo.CommitInfo.Round), - Id: common.BytesToHash(ledger.LedgerInfo.CommitInfo.Id), - ExecutedStateId: common.BytesToHash(ledger.LedgerInfo.CommitInfo.ExecutedStateId), - Version: uint64(ledger.LedgerInfo.CommitInfo.Version), - TimestampUsecs: uint64(ledger.LedgerInfo.CommitInfo.TimestampUsecs), - NextEpochState: committee, - ConsensusDataHash: common.BytesToHash(ledger.LedgerInfo.ConsensusDataHash), - } - - if pivot := ledger.LedgerInfo.CommitInfo.Pivot; pivot != nil { - result.Pivot.Height = uint64(pivot.Height) - result.Pivot.BlockHash = pivot.BlockHash.ToHash() - } - - result.AggregatedSignature = ABIEncodeSignature(ledger.AggregatedSignature) - for _, v := range ledger.ValidatorsSorted() { - result.Accounts = append(result.Accounts, v) - } - - return result -} - -func ABIEncodeSignature(signature []byte) []byte { - if len(signature) != 192 { - return signature - } - - encoded := make([]byte, 256) - - copy(encoded[16:64], signature[:48]) - copy(encoded[80:128], signature[48:96]) - copy(encoded[144:192], signature[96:144]) - copy(encoded[208:256], signature[144:192]) - - return encoded -} - -func ABIEncodePublicKey(publicKey []byte) []byte { - if len(publicKey) != 96 { - return publicKey - } - - encoded := make([]byte, 128) - - copy(encoded[16:64], publicKey[:48]) - copy(encoded[80:128], publicKey[48:]) - - return encoded -} - -func ConvertCommittee(ledger *LedgerInfoWithSignatures) (LedgerInfoLibEpochState, bool) { - if ledger == nil { - return LedgerInfoLibEpochState{}, false - } - - state := ledger.LedgerInfo.CommitInfo.NextEpochState - if state == nil { - return LedgerInfoLibEpochState{}, false - } - - var validators []LedgerInfoLibValidatorInfo - for _, v := range ledger.NextEpochValidatorsSorted() { - info := state.Verifier.AddressToValidatorInfo[v] - - uncompressedPubKey, ok := ledger.NextEpochValidators[v] - if !ok { - return LedgerInfoLibEpochState{}, false - } - - validator := LedgerInfoLibValidatorInfo{ - Account: v, - UncompressedPublicKey: ABIEncodePublicKey(uncompressedPubKey), - VotingPower: uint64(info.VotingPower), - } - - if info.VrfPublicKey != nil { - validator.VrfPublicKey = *info.VrfPublicKey - } - - validators = append(validators, validator) - } - - return LedgerInfoLibEpochState{ - Epoch: uint64(state.Epoch), - Validators: validators, - QuorumVotingPower: uint64(state.Verifier.QuorumVotingPower), - TotalVotingPower: uint64(state.Verifier.TotalVotingPower), - VrfSeed: state.VrfSeed, - }, true -} - -func MustRLPEncodeBlock(block *BlockSummary) []byte { - val := ConvertBlock(block) - encoded, err := rlp.EncodeToBytes(val) - if err != nil { - panic(err) - } - return encoded -} - -func ConvertBlock(block *BlockSummary) BlockRlp { - return BlockRlp{block} -} - -type BlockRlp struct { - raw *BlockSummary -} - -func (header BlockRlp) EncodeRLP(w io.Writer) error { - var adaptive uint64 - if header.raw.Adaptive { - adaptive = 1 - } - - var referees []common.Hash - for _, v := range header.raw.RefereeHashes { - referees = append(referees, *v.ToCommonHash()) - } - - list := []interface{}{ - header.raw.ParentHash.ToCommonHash(), - header.raw.Height.ToInt(), - header.raw.Timestamp.ToInt(), - header.raw.Miner.MustGetCommonAddress(), - header.raw.TransactionsRoot.ToCommonHash(), - header.raw.DeferredStateRoot.ToCommonHash(), - header.raw.DeferredReceiptsRoot.ToCommonHash(), - header.raw.DeferredLogsBloomHash.ToCommonHash(), - header.raw.Blame, - header.raw.Difficulty.ToInt(), - adaptive, - header.raw.GasLimit.ToInt(), - referees, - header.raw.Nonce.ToInt(), - } - - if header.raw.PosReference != nil { - // simulate RLP encoding for rust Option type - item := []common.Hash{*header.raw.PosReference.ToCommonHash()} - list = append(list, item) - } - - for _, v := range header.raw.Custom { - list = append(list, rlp.RawValue(v)) - } - - return rlp.Encode(w, list) -} - -func AssembleProof(client *Client, pivot, proofType uint64, method string, fId msg.ChainId, log *ethtypes.Log, - receipts []*ethtypes.Receipt, orderId [32]byte, sign [][]byte) ([]byte, error) { - var ( - err error - ret, input []byte - key []byte - ) - key = rlp.AppendUint64(key[:0], uint64(log.TxIndex)) - prf, err := proof.Get(ethtypes.Receipts(receipts), log.TxIndex) - if err != nil { - return nil, err - } - //ek := util.Key2Hex(key, len(prf)) - receipt, err := mapprotocol.GetTxReceipt(receipts[log.TxIndex]) - switch proofType { - case constant.ProofTypeOfOracle: - - ret, err = proof.Oracle(log.BlockNumber, receipt, key, prf, fId, method, 0, - mapprotocol.ProofAbi, orderId, false) - case constant.ProofTypeOfNewOracle: - case constant.ProofTypeOfLogOracle: - idx := 0 - for i, ele := range receipts[log.TxIndex].Logs { - if ele.Index != log.Index { - continue - } - idx = i - } - tr, _ := trie.New(common.Hash{}, trie.NewDatabase(memorydb.New())) - tr = proof.DeriveTire(ethtypes.Receipts(receipts), tr) - ret, err = proof.SignOracle(&maptypes.Header{ - ReceiptHash: tr.Hash(), - }, receipt, key, prf, fId, idx, method, sign, orderId, log, int64(proofType)) - default: - if log.BlockNumber+DeferredExecutionEpochs > pivot { - return nil, errors.New("Pivot less than current block") - } - epoch := types.NewEpochNumberUint64(log.BlockNumber) - epochOrHash := types.NewEpochOrBlockHashWithEpoch(epoch) - epochReceipts, err := client.GetEpochReceipts(context.Background(), *epochOrHash, true) - if err != nil { - return nil, errors.WithMessagef(err, "Failed to get receipts by epoch number %v", log.BlockNumber) - } - - blockIndex, receipt := matchReceipt(epochReceipts, log.TxHash.Hex()) - if receipt == nil { - return nil, nil - } - - if receipt.MustGetOutcomeType() != types.TRANSACTION_OUTCOME_SUCCESS { - return nil, ErrTransactionExecutionFailed - } - - subtrees, root := CreateReceiptsMPT(epochReceipts) - - blockIndexKey := mpt.IndexToKey(blockIndex, len(subtrees)) - blockProof, ok := root.Proof(blockIndexKey) - if !ok { - return nil, errors.New("Failed to generate block proof") - } - - receiptsRoot := subtrees[blockIndex].Hash() - receiptKey := mpt.IndexToKey(int(receipt.Index), len(epochReceipts[blockIndex])) - receiptProof, ok := subtrees[blockIndex].Proof(receiptKey) - if !ok { - return nil, errors.New("Failed to generate receipt proof") - } - - var headers [][]byte - // 195 - 200 - for i := log.BlockNumber + DeferredExecutionEpochs; i <= pivot; i++ { - block, err := client.GetBlockByEpochNumber(context.Background(), hexutil.Uint64(i)) - if err != nil { - return nil, errors.WithMessagef(err, "Failed to get block summary by epoch %v", i) - } - - headers = append(headers, MustRLPEncodeBlock(block)) - } - - prf := &mpt.TypesReceiptProof{ - Headers: headers, - BlockIndex: blockIndexKey, - BlockProof: mpt.ConvertProofNode(blockProof), - ReceiptsRoot: receiptsRoot, - Index: receiptKey, - Receipt: primitives.MustRLPEncodeReceipt(receipt), - ReceiptProof: mpt.ConvertProofNode(receiptProof), - } - input, err = mapprotocol.Conflux.Methods[mapprotocol.MethodOfVerifyReceiptProof].Inputs.Pack(prf) - if err != nil { - return nil, err - } - ret, err = mapprotocol.PackInput(mapprotocol.Mcs, method, new(big.Int).SetUint64(uint64(fId)), input) - } - if err != nil { - return nil, err - } - - return ret, nil -} - -func matchReceipt(epochReceipts [][]types.TransactionReceipt, txHash string) (blockIndex int, receipt *types.TransactionReceipt) { - for i, blockReceipts := range epochReceipts { - for _, v := range blockReceipts { - if v.MustGetOutcomeType() == types.TRANSACTION_OUTCOME_SKIPPED { - continue - } - - if v.TransactionHash.String() != txHash { - continue - } - - return i, &v - } - } - - return 0, nil -} - -func CreateReceiptsMPT(epochReceipts [][]types.TransactionReceipt) ([]*mpt.Node, *mpt.Node) { - var subtrees []*mpt.Node - - for _, blockReceipts := range epochReceipts { - var root mpt.Node - - keyLen := mpt.MinReprBytes(len(blockReceipts)) - - for i, v := range blockReceipts { - key := mpt.ToIndexBytes(i, keyLen) - value := primitives.MustRLPEncodeReceipt(&v) - root.Insert(key, value) - } - - subtrees = append(subtrees, &root) - } - - var root mpt.Node - keyLen := mpt.MinReprBytes(len(subtrees)) - for i, v := range subtrees { - key := mpt.ToIndexBytes(i, keyLen) - value := v.Hash().Bytes() - root.Insert(key, value) - } - - return subtrees, &root -} diff --git a/internal/conflux/mpt/key.go b/internal/conflux/mpt/key.go deleted file mode 100644 index 06607aa0..00000000 --- a/internal/conflux/mpt/key.go +++ /dev/null @@ -1,32 +0,0 @@ -package mpt - -func IndexToKey(index, total int) []byte { - keyLen := MinReprBytes(total) - return ToIndexBytes(index, keyLen) -} - -func MinReprBytes(numKeys int) (keyLen int) { - switch numKeys { - case 0: - return 0 - case 1: - return 1 - default: - for tmp := numKeys - 1; tmp != 0; tmp >>= 8 { - keyLen++ - } - - return - } -} - -func ToIndexBytes(index, keyLen int) []byte { - result := make([]byte, keyLen) - - for i := keyLen - 1; i >= 0; i-- { - result[i] = uint8(index) - index >>= 8 - } - - return result -} diff --git a/internal/conflux/mpt/nibble_path.go b/internal/conflux/mpt/nibble_path.go deleted file mode 100644 index fdc0cbac..00000000 --- a/internal/conflux/mpt/nibble_path.go +++ /dev/null @@ -1,157 +0,0 @@ -package mpt - -import ( - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" -) - -type NibblePath struct { - nibbles []byte - start int // inclusive - end int // exclusive -} - -func NewNibblePath(key []byte) NibblePath { - nibbles := make([]byte, 2*len(key)) - - for i := 0; i < len(key); i++ { - nibbles[2*i] = key[i] >> 4 - nibbles[2*i+1] = key[i] & 0x0F - } - - return NibblePath{nibbles, 0, len(nibbles)} -} - -func (path *NibblePath) Length() int { - return path.end - path.start -} - -func (path NibblePath) value() []byte { - return path.nibbles[path.start:path.end] -} - -func (path *NibblePath) ToChild() (childIndex byte, childPath NibblePath, ok bool) { - if path.start == path.end { - return - } - - childIndex = path.nibbles[path.start] - childPath = NibblePath{path.nibbles, path.start + 1, path.end} - ok = true - - return -} - -func (path *NibblePath) CommonPrefix(other *NibblePath) (prefix, path1, path2 NibblePath) { - var offset int - - for { - pathPos := path.start + offset - if pathPos >= path.end { - break - } - - otherPos := other.start + offset - if otherPos >= other.end { - break - } - - if path.nibbles[pathPos] != other.nibbles[otherPos] { - break - } - - offset++ - } - - prefix = NibblePath{ - nibbles: path.nibbles, - start: path.start, - end: path.start + offset, - } - - path1 = NibblePath{ - nibbles: path.nibbles, - start: path.start + offset, - end: path.end, - } - - path2 = NibblePath{ - nibbles: other.nibbles, - start: other.start + offset, - end: other.end, - } - - return -} - -func (path *NibblePath) ComputeMerkle(nodeMerkle common.Hash) common.Hash { - if path.Length() == 0 { - return nodeMerkle - } - - var buffer []byte - var start = path.start - - pathInfo := 128 - if start%2 == 1 { - pathInfo += 64 - } - pathInfo += path.Length() % 63 - buffer = append(buffer, byte(pathInfo)) - buffer = append(buffer, path.fullBytes()...) - buffer = append(buffer, nodeMerkle.Bytes()...) - - return crypto.Keccak256Hash(buffer) -} - -func (path *NibblePath) fullBytes() []byte { - var result []byte - - start := path.start - if start%2 == 1 { - result = append(result, path.nibbles[start]) - start++ - } - - end := path.end - if end%2 == 1 { - end++ - } - - for i := start; i < end; i += 2 { - key := path.nibbles[i]<<4 + path.nibbles[i+1] - result = append(result, key) - } - - return result -} - -func (path *NibblePath) Trim() NibblePath { - if path.start == path.end { - return NibblePath{} - } - - result := *path - - start := result.start - if start%2 == 1 { - start-- - } - - if start > 0 { - result.nibbles = result.nibbles[start:] - result.start -= start - result.end -= start - } - - end := result.end - if end%2 == 1 { - end++ - } - - if end < len(result.nibbles) { - result.nibbles = result.nibbles[:end] - } - - return result -} diff --git a/internal/conflux/mpt/node.go b/internal/conflux/mpt/node.go deleted file mode 100644 index 750126f4..00000000 --- a/internal/conflux/mpt/node.go +++ /dev/null @@ -1,190 +0,0 @@ -package mpt - -import ( - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" - "sync/atomic" -) - -const CHILDREN_COUNT = 16 - -var ( - KECCAKE_EMPTY = crypto.Keccak256Hash() - LEAF_NODE_CHILDREN = [CHILDREN_COUNT]common.Hash{ - KECCAKE_EMPTY, KECCAKE_EMPTY, KECCAKE_EMPTY, KECCAKE_EMPTY, - KECCAKE_EMPTY, KECCAKE_EMPTY, KECCAKE_EMPTY, KECCAKE_EMPTY, - KECCAKE_EMPTY, KECCAKE_EMPTY, KECCAKE_EMPTY, KECCAKE_EMPTY, - KECCAKE_EMPTY, KECCAKE_EMPTY, KECCAKE_EMPTY, KECCAKE_EMPTY, - } -) - -type nodeType int - -const ( - nodeTypeBranch = iota - nodeTypeLeaf -) - -type Node struct { - nType nodeType - path NibblePath - value []byte // for leaf node only - children [CHILDREN_COUNT]*Node // unlike Ethereum, no extension node in Conflux - - merkle atomic.Value -} - -func mustNewLeafNode(path NibblePath, value []byte) (childIndex byte, leaf *Node) { - index, childPath, ok := path.ToChild() - if !ok { - panic("path too short to create leaf node") - } - - return index, &Node{ - nType: nodeTypeLeaf, - path: childPath, - value: value, - } -} - -func newBranchNode(path NibblePath, children [CHILDREN_COUNT]*Node) *Node { - return &Node{ - nType: nodeTypeBranch, - path: path, - children: children, - } -} - -// Insert inserts key and value into mpt. -// Note, key should be in the same length and inserted in order. -func (n *Node) Insert(key, value []byte) { - if len(key) == 0 { - panic("key is empty") - } - - path := NewNibblePath(key) - - n.insert(path, value) -} - -func (n *Node) insert(path NibblePath, value []byte) { - switch n.nType { - case nodeTypeBranch: - prefix, path1, path2 := n.path.CommonPrefix(&path) - if path2.Length() == 0 { - panic("key length inconsistent") - } - - if path1.Length() == 0 { - childIndex, leaf := mustNewLeafNode(path2, value) - if n.children[childIndex] == nil { - n.children[childIndex] = leaf - } else { - n.children[childIndex].insert(leaf.path, value) - } - } else { - childIndex1, path1, _ := path1.ToChild() - if path1.Length() > 0 { - panic("key not inserted in sequence") - } - child1 := newBranchNode(path1, n.children) - - childIndex2, child2 := mustNewLeafNode(path2, value) - - // update current branch node - n.path = prefix - n.children = [CHILDREN_COUNT]*Node{} - n.children[childIndex1] = child1 - n.children[childIndex2] = child2 - } - case nodeTypeLeaf: - if n.path.Length() != path.Length() { - panic("key length inconsistent") - } - - // find common prefix for branch node - prefix, path1, path2 := n.path.CommonPrefix(&path) - if path1.Length() == 0 { - panic("duplicate key inserted") - } - - // construct 2 new leaf nodes - childIndex1, leaf1 := mustNewLeafNode(path1, n.value) - childIndex2, leaf2 := mustNewLeafNode(path2, value) - - // change current leaf node to branch node - n.nType = nodeTypeBranch - n.path = prefix - n.value = nil - n.children[childIndex1] = leaf1 - n.children[childIndex2] = leaf2 - default: - panic("invalid node type") - } -} - -func (n *Node) Hash() common.Hash { - switch n.nType { - case nodeTypeBranch: - if n.children[0] == nil { - return KECCAKE_EMPTY - } - - if n.children[1] == nil { - return n.children[0].computeMerkle() - } - - return n.computeMerkle() - case nodeTypeLeaf: - panic("root should be a branch node") - default: - panic("invalid node type") - } -} - -func (n *Node) computeMerkle() common.Hash { - if merkle := n.merkle.Load(); merkle != nil { - return merkle.(common.Hash) - } - - childrenHashes := n.computeChildrenHashes() - nodeMerkle := computeNodeMerkle(childrenHashes, n.value) - merkle := n.path.ComputeMerkle(nodeMerkle) - - n.merkle.Store(merkle) - - return merkle -} - -func (n *Node) computeChildrenHashes() (childrenHashes [CHILDREN_COUNT]common.Hash) { - if n.nType == nodeTypeLeaf { - return LEAF_NODE_CHILDREN - } - - for i, v := range n.children { - if v == nil { - childrenHashes[i] = KECCAKE_EMPTY - } else { - childrenHashes[i] = v.computeMerkle() - } - } - - return -} - -func computeNodeMerkle(children [CHILDREN_COUNT]common.Hash, value []byte) common.Hash { - var buffer []byte - - buffer = append(buffer, 'n') - - for _, v := range children { - buffer = append(buffer, v.Bytes()...) - } - - if len(value) > 0 { - buffer = append(buffer, 'v') - buffer = append(buffer, value...) - } - - return crypto.Keccak256Hash(buffer) -} diff --git a/internal/conflux/mpt/proof.go b/internal/conflux/mpt/proof.go deleted file mode 100644 index e65c3e98..00000000 --- a/internal/conflux/mpt/proof.go +++ /dev/null @@ -1,189 +0,0 @@ -package mpt - -import ( - "fmt" - "math/big" - - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" -) - -type ProofNode struct { - path NibblePath - children [CHILDREN_COUNT]common.Hash // for branch node - value []byte // for leaf node -} - -func newProofNode(n *Node) *ProofNode { - return &ProofNode{ - path: n.path.Trim(), - children: n.computeChildrenHashes(), - value: n.value, - } -} - -func (n *ProofNode) ComputeMerkle() common.Hash { - nodeMerkle := computeNodeMerkle(n.children, n.value) - return n.path.ComputeMerkle(nodeMerkle) -} - -func (n ProofNode) String() string { - var children [16]string - for i, v := range n.children { - if v == KECCAKE_EMPTY { - children[i] = "NULL" - } else { - children[i] = v.Hex() - } - } - - return fmt.Sprintf("{ path = %v, children = %v, value = %v }", n.path, children, n.value) -} - -func (n *Node) Proof(key []byte) ([]*ProofNode, bool) { - if len(key) == 0 { - panic("key is empty") - } - - path := NewNibblePath(key) - - switch n.nType { - case nodeTypeBranch: - // empty - if n.children[0] == nil { - return nil, false - } - - // first branch has 2 children at least - if n.children[1] != nil { - return n.proof(path) - } - - // trim the first branch node that has only one child - childIndex, childPath, ok := path.ToChild() - if !ok || childIndex != 0 { - return nil, false - } - - return n.children[0].proof(childPath) - case nodeTypeLeaf: - panic("root should be a branch node") - default: - panic("invalid node type") - } -} - -func (n *Node) proof(path NibblePath) ([]*ProofNode, bool) { - _, path1, path2 := n.path.CommonPrefix(&path) - - // prefix mismatch - if path1.Length() != 0 { - return nil, false - } - - proofNodes := []*ProofNode{newProofNode(n)} - - switch n.nType { - case nodeTypeLeaf: - if path2.Length() != 0 { - return nil, false - } - case nodeTypeBranch: - childIndex, childPath, ok := path2.ToChild() - if !ok || n.children[childIndex] == nil { - return nil, false - } - - childrenProofs, ok := n.children[childIndex].proof(childPath) - if !ok { - return nil, false - } - - proofNodes = append(proofNodes, childrenProofs...) - default: - panic("invalid node type") - } - - return proofNodes, true -} - -func Prove(root common.Hash, key, value []byte, proofNodes []*ProofNode) bool { - if len(key) == 0 || len(proofNodes) == 0 { - return false - } - - path := NewNibblePath(key) - expectedHash := root - - var nibblesLen int - for _, v := range proofNodes { - nibblesLen += v.path.Length() - if v.children[0] != KECCAKE_EMPTY { - nibblesLen++ - } - } - - if nibblesLen%2 == 1 { - if path.nibbles[0] != 0 { - return false - } - - path.start++ - } - - for _, v := range proofNodes { - if nodeHash := v.ComputeMerkle(); nodeHash != expectedHash { - return false - } - - _, path1, path2 := v.path.CommonPrefix(&path) - if path1.Length() != 0 { - return false - } - - switch v.children[0] { - case KECCAKE_EMPTY: // leaf node - if path2.Length() != 0 { - return false - } - - return crypto.Keccak256Hash(value) == crypto.Keccak256Hash(v.value) - default: - childIndex, childPath, ok := path2.ToChild() - if !ok { - return false - } - - path = childPath - expectedHash = v.children[childIndex] - } - } - - return false -} - -func ConvertProofNode(nodes []*ProofNode) []ProofLibProofNode { - var result []ProofLibProofNode - - for _, v := range nodes { - var children [16][32]byte - for i, child := range v.children { - children[i] = child - } - - var nibbles [32]byte - copy(nibbles[:], v.path.nibbles) - - result = append(result, ProofLibProofNode{ - Path: ProofLibNibblePath{ - Nibbles: nibbles, - Start: big.NewInt(int64(v.path.start)), - End: big.NewInt(int64(v.path.end)), - }, - Children: children, - Value: v.value, - }) - } - - return result -} diff --git a/internal/conflux/mpt/struct.go b/internal/conflux/mpt/struct.go deleted file mode 100644 index 936c9134..00000000 --- a/internal/conflux/mpt/struct.go +++ /dev/null @@ -1,25 +0,0 @@ -package mpt - -import "math/big" - -type TypesReceiptProof struct { - Headers [][]byte - BlockIndex []byte - BlockProof []ProofLibProofNode - ReceiptsRoot [32]byte - Index []byte - Receipt []byte - ReceiptProof []ProofLibProofNode -} - -type ProofLibProofNode struct { - Path ProofLibNibblePath - Children [16][32]byte - Value []byte -} - -type ProofLibNibblePath struct { - Nibbles [32]byte - Start *big.Int - End *big.Int -} diff --git a/internal/conflux/primipives/bool.go b/internal/conflux/primipives/bool.go deleted file mode 100644 index 97851675..00000000 --- a/internal/conflux/primipives/bool.go +++ /dev/null @@ -1,19 +0,0 @@ -package primitives - -import ( - "io" - - "github.com/ethereum/go-ethereum/rlp" -) - -// Bool represents a bool value that could be RLP encoded in Rust version. -type Bool bool - -func (b Bool) EncodeRLP(w io.Writer) error { - if b { - // go-ethereum encoded as 0x80 - return rlp.Encode(w, "\x01") - } - - return rlp.Encode(w, "\x00") -} diff --git a/internal/conflux/primipives/receipt.go b/internal/conflux/primipives/receipt.go deleted file mode 100644 index 9e68c7d1..00000000 --- a/internal/conflux/primipives/receipt.go +++ /dev/null @@ -1,136 +0,0 @@ -package primitives - -import ( - "io" - "math/big" - - "github.com/mapprotocol/compass/internal/conflux/types" - - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/rlp" - "github.com/pkg/errors" -) - -type Receipt struct { - AccumulatedGasUsed *big.Int - GasFee *big.Int - GasSponsorPaid Bool - LogBloom []byte - Logs []TxLog - OutcomeStatus uint8 - StorageSponsorPaid Bool - StorageCollateralized []StorageChange - StorageReleased []StorageChange -} - -func MustRLPEncodeReceipt(receipt *types.TransactionReceipt) []byte { - val := ConvertReceipt(receipt) - encoded, err := rlp.EncodeToBytes(val) - if err != nil { - panic(err) - } - return encoded -} - -func ConvertReceipt(receipt *types.TransactionReceipt) Receipt { - storageCollateralized, storageReleased := constructStorageChanges(receipt) - - return Receipt{ - AccumulatedGasUsed: receipt.AccumulatedGasUsed.ToInt(), - GasFee: receipt.GasFee.ToInt(), - GasSponsorPaid: Bool(receipt.GasCoveredBySponsor), - LogBloom: hexutil.MustDecode(string(receipt.LogsBloom)), - Logs: convertLogs(receipt.Logs), - OutcomeStatus: uint8(receipt.MustGetOutcomeType()), - StorageSponsorPaid: Bool(receipt.StorageCoveredBySponsor), - StorageCollateralized: storageCollateralized, - StorageReleased: storageReleased, - } -} - -type StorageChange struct { - Account common.Address - Collaterals uint64 -} - -func constructStorageChanges(receipt *types.TransactionReceipt) (collateralized, released []StorageChange) { - for _, v := range receipt.StorageReleased { - released = append(released, StorageChange{ - Account: v.Address.MustGetCommonAddress(), - Collaterals: uint64(v.Collaterals), - }) - } - - if receipt.StorageCollateralized == 0 { - return - } - - var account types.Address - if receipt.StorageCoveredBySponsor { - account = *receipt.To - } else { - account = receipt.From - } - - collateralized = append(collateralized, StorageChange{ - Account: account.MustGetCommonAddress(), - Collaterals: uint64(receipt.StorageCollateralized), - }) - - return -} - -const ( - LogSpaceNative uint8 = 1 - LogSpaceEthereum uint8 = 2 -) - -type TxLog struct { - Addr common.Address - Topics []common.Hash - Data []byte - Space uint8 -} - -// EncodeRLP implements the rlp.Encoder interface. -func (log TxLog) EncodeRLP(w io.Writer) error { - switch log.Space { - case LogSpaceNative: - return rlp.Encode(w, []interface{}{log.Addr, log.Topics, log.Data}) - case LogSpaceEthereum: - return rlp.Encode(w, []interface{}{log.Addr, log.Topics, log.Data, log.Space}) - default: - return errors.Errorf("invalid log space %v", log.Space) - } -} - -func convertLogs(logs []types.Log) []TxLog { - var result []TxLog - - for _, v := range logs { - var topics []common.Hash - for _, t := range v.Topics { - topics = append(topics, *t.ToCommonHash()) - } - - var space uint8 - switch *v.Space { - case types.SPACE_NATIVE: - space = LogSpaceNative - case types.SPACE_EVM: - space = LogSpaceEthereum - default: - panic("invalid space in log entry") - } - - result = append(result, TxLog{ - Addr: v.Address.MustGetCommonAddress(), - Topics: topics, - Data: v.Data, - Space: space, - }) - } - - return result -} diff --git a/internal/conflux/structs.go b/internal/conflux/structs.go deleted file mode 100644 index 0283294e..00000000 --- a/internal/conflux/structs.go +++ /dev/null @@ -1,505 +0,0 @@ -package conflux - -import ( - "bytes" - "encoding/json" - "fmt" - "io" - "math/big" - "regexp" - "sort" - - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/rlp" - "github.com/mapprotocol/compass/internal/conflux/types" - "github.com/pkg/errors" -) - -type Status struct { - LatestCommitted hexutil.Uint64 `json:"latestCommitted"` - Epoch hexutil.Uint64 `json:"epoch"` - PivotDecision Decision `json:"pivotDecision"` - LatestVoted *hexutil.Uint64 `json:"latestVoted"` - LatestTxNumber hexutil.Uint64 `json:"latestTxNumber"` -} - -type Decision struct { - BlockHash common.Hash `json:"blockHash"` - Height hexutil.Uint64 `json:"height"` -} - -var ( - BlockEarliest = &BlockNumber{"earliest", 0} - BlockLatestCommitted = &BlockNumber{"latest_committed", 0} - BlockLatestVoted = &BlockNumber{"latest_voted", 0} -) - -type BlockNumber struct { - name string - number hexutil.Uint64 -} - -// String implements the fmt.Stringer interface -func (e *BlockNumber) String() string { - if e.name == "" { - return e.number.String() - } - - return e.name -} - -// MarshalText implements the encoding.TextMarshaler interface. -func (e BlockNumber) MarshalText() ([]byte, error) { - // fmt.Println("marshal text for epoch") - return []byte(e.String()), nil -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (e *BlockNumber) UnmarshalJSON(data []byte) error { - var input string - - if err := json.Unmarshal(data, &input); err != nil { - return err - } - - hexU64Pattern := `(?i)^0x[a-f0-9]*$` - if ok, _ := regexp.Match(hexU64Pattern, []byte(input)); ok { - numU64, err := hexutil.DecodeUint64(input) - if err != nil { - return errors.WithStack(err) - } - e.number = hexutil.Uint64(numU64) - return nil - } - - switch input { - case BlockEarliest.name, BlockLatestCommitted.name, BlockLatestVoted.name: - e.name = input - return nil - } - - return fmt.Errorf(`unsupported pos block number tag %v`, input) -} - -type Address = common.Hash - -type Signature struct { - Account Address `json:"account"` - Votes hexutil.Uint64 `json:"votes"` -} - -type Block struct { - Hash common.Hash `json:"hash"` - Height hexutil.Uint64 `json:"height"` - Epoch hexutil.Uint64 `json:"epoch"` - Round hexutil.Uint64 `json:"round"` - LastTxNumber hexutil.Uint64 `json:"lastTxNumber"` - Miner *Address `json:"miner"` - ParentHash common.Hash `json:"parentHash"` - Timestamp hexutil.Uint64 `json:"timestamp"` - PivotDecision *Decision `json:"pivotDecision"` - Signatures []Signature `json:"signatures"` -} - -func NewBlockNumber(number hexutil.Uint64) BlockNumber { - return BlockNumber{"", number} -} - -type LedgerInfo struct { - CommitInfo BlockInfo `json:"commitInfo"` - - /// Hash of consensus specific data that is opaque to all parts of the - /// system other than consensus. - ConsensusDataHash hexutil.Bytes `json:"consensusDataHash"` -} - -type BlockInfo struct { - Epoch hexutil.Uint64 `json:"epoch"` - Round hexutil.Uint64 `json:"round"` - Id hexutil.Bytes `json:"id"` - ExecutedStateId hexutil.Bytes `json:"executedStateId"` - Version hexutil.Uint64 `json:"version"` - TimestampUsecs hexutil.Uint64 `json:"timestampUsecs"` - NextEpochState *EpochState `json:"nextEpochState"` - Pivot *PivotBlockDecision `json:"pivot"` -} - -type PivotBlockDecision struct { - Height hexutil.Uint64 `json:"height"` - BlockHash H256 `json:"blockHash"` -} - -type H256 string - -func (h H256) ToHash() common.Hash { - return common.HexToHash(string(h)) -} - -func (h H256) String() string { - return string(h) -} - -type EpochState struct { - Epoch hexutil.Uint64 `json:"epoch"` - Verifier ValidatorVerifier `json:"verifier"` - VrfSeed hexutil.Bytes `json:"vrfSeed"` -} - -type ValidatorVerifier struct { - // An ordered map of each validator's on-chain account address to its - // pubkeys and voting power. - AddressToValidatorInfo map[common.Hash]ValidatorConsensusInfo `json:"addressToValidatorInfo"` - // The minimum voting power required to achieve a quorum - QuorumVotingPower hexutil.Uint64 `json:"quorumVotingPower"` - // Total voting power of all validators (cached from - // address_to_validator_info) - TotalVotingPower hexutil.Uint64 `json:"totalVotingPower"` -} - -type ValidatorConsensusInfo struct { - PublicKey hexutil.Bytes `json:"publicKey"` // compressed BLS public key - VrfPublicKey *hexutil.Bytes `json:"vrfPublicKey,omitempty"` // nil if VRF not needed - VotingPower hexutil.Uint64 `json:"votingPower"` -} - -type LedgerInfoWithSignatures struct { - LedgerInfo LedgerInfo `json:"ledgerInfo"` - // The validator is identified by its account address: in order to verify - // a signature one needs to retrieve the public key of the validator - // for the given epoch. - // - // BLS signature in uncompressed format - Signatures map[common.Hash]hexutil.Bytes `json:"signatures"` - // Validators with uncompressed BLS public key (in 96 bytes) if next epoch - // state available. Generally, this is used to verify BLS signatures at client side. - NextEpochValidators map[common.Hash]hexutil.Bytes `json:"nextEpochValidators"` - // Aggregated BLS signature in 192 bytes. - AggregatedSignature hexutil.Bytes `json:"aggregatedSignature"` -} - -func (info *LedgerInfoWithSignatures) ValidatorsSorted() []common.Hash { - var accounts PoSAccounts - - for k := range info.Signatures { - accounts = append(accounts, k) - } - - sort.Sort(accounts) - - return accounts -} - -func (info *LedgerInfoWithSignatures) NextEpochValidatorsSorted() []common.Hash { - if info.LedgerInfo.CommitInfo.NextEpochState == nil { - return nil - } - - var accounts PoSAccounts - - for k := range info.LedgerInfo.CommitInfo.NextEpochState.Verifier.AddressToValidatorInfo { - accounts = append(accounts, k) - } - - sort.Sort(accounts) - - return accounts -} - -type PoSAccounts []common.Hash - -func (s PoSAccounts) Len() int { return len(s) } -func (s PoSAccounts) Less(i, j int) bool { - return bytes.Compare(s[i].Bytes(), s[j].Bytes()) < 0 -} -func (s PoSAccounts) Swap(i, j int) { s[i], s[j] = s[j], s[i] } - -// ILightNodeState is an auto generated low-level Go binding around an user-defined struct. -type ILightNodeState struct { - Epoch *big.Int - Round *big.Int - EarliestBlockNumber *big.Int - FinalizedBlockNumber *big.Int - Blocks *big.Int - MaxBlocks *big.Int -} - -// LedgerInfoLibLedgerInfoWithSignatures is an auto generated low-level Go binding around an user-defined struct. -type LedgerInfoLibLedgerInfoWithSignatures struct { - Epoch uint64 - Round uint64 - Id [32]byte - ExecutedStateId [32]byte - Version uint64 - TimestampUsecs uint64 - NextEpochState LedgerInfoLibEpochState - Pivot LedgerInfoLibDecision - ConsensusDataHash [32]byte - Accounts [][32]byte - AggregatedSignature []byte - //Signatures []LedgerInfoLibAccountSignature -} - -type LedgerInfoLibEpochState struct { - Epoch uint64 - Validators []LedgerInfoLibValidatorInfo - QuorumVotingPower uint64 - TotalVotingPower uint64 - VrfSeed []byte -} - -type LedgerInfoLibDecision struct { - BlockHash [32]byte - Height uint64 -} - -type LedgerInfoLibAccountSignature struct { - Account [32]byte - ConsensusSignature []byte -} - -type LedgerInfoLibValidatorInfo struct { - Account [32]byte - CompressedPublicKey []byte - UncompressedPublicKey []byte - VrfPublicKey []byte - VotingPower uint64 -} - -// Epoch represents an epoch in Conflux. -type Epoch struct { - name string - number *hexutil.Big -} - -// Const epoch definitions -var ( - EpochEarliest *Epoch = &Epoch{"earliest", nil} - EpochLatestCheckpoint *Epoch = &Epoch{"latest_checkpoint", nil} - EpochLatestConfirmed *Epoch = &Epoch{"latest_confirmed", nil} - EpochLatestState *Epoch = &Epoch{"latest_state", nil} - EpochLatestMined *Epoch = &Epoch{"latest_mined", nil} - EpochLatestFinalized *Epoch = &Epoch{"latest_finalized", nil} -) - -// NewEpochNumber creates an instance of Epoch with specified number. -func NewEpochNumber(number *hexutil.Big) *Epoch { - return &Epoch{"", number} -} - -func (e *Epoch) String() string { - if e.number != nil { - return e.number.String() - } - - return e.name -} - -func (e *Epoch) ToInt() (result *big.Int, isSuccess bool) { - if e.number != nil { - return e.number.ToInt(), true - } - - if e.name == EpochEarliest.name { - return common.Big0, true - } - - return nil, false -} - -func (e *Epoch) Equals(target *Epoch) bool { - if e == nil { - panic("input could not be nil") - } - - if target == nil { - return false - } - - if e == target { - return true - } - - if len(e.name) > 0 || len(target.name) > 0 { - return e.name == target.name - } - - if e.number == nil || target.number == nil { - return e.number == target.number - } - - return e.number.ToInt().Cmp(target.number.ToInt()) == 0 -} - -func (e Epoch) MarshalText() ([]byte, error) { - return []byte(e.String()), nil -} - -func (e *Epoch) UnmarshalJSON(data []byte) error { - var input string - if err := json.Unmarshal(data, &input); err != nil { - return err - } - - switch input { - case EpochEarliest.name, - EpochLatestCheckpoint.name, - EpochLatestConfirmed.name, - EpochLatestState.name, - EpochLatestMined.name, - EpochLatestFinalized.name: - e.name = input - return nil - default: - if len(input) == 66 { - e.name = input - return nil - } - - epochNumber, err := hexutil.DecodeBig(input) - if err != nil { - return err - } - - e.number = NewBigIntByRaw(epochNumber) - return nil - } -} - -func NewBigIntByRaw(x *big.Int) *hexutil.Big { - if x == nil { - return nil - } - v := hexutil.Big(*x) - return &v -} - -// BlockSummary includes block header and a list of transaction hashes -type BlockSummary struct { - BlockHeader - //Transactions []Hash `json:"transactions"` -} - -// rlpEncodableBlockSummary block summary struct used for rlp encoding -type rlpEncodableBlockSummary struct { - BlockHeader BlockHeader - //Transactions []Hash -} - -// EncodeRLP implements the rlp.Encoder interface. -func (bs BlockSummary) EncodeRLP(w io.Writer) error { - rbs := rlpEncodableBlockSummary{ - bs.BlockHeader, - //bs.Transactions, - } - - return rlp.Encode(w, rbs) -} - -// DecodeRLP implements the rlp.Decoder interface. -func (bs *BlockSummary) DecodeRLP(r *rlp.Stream) error { - var rbs rlpEncodableBlockSummary - if err := r.Decode(&rbs); err != nil { - return err - } - - bs.BlockHeader = rbs.BlockHeader - //bs.Transactions = rbs.Transactions - - return nil -} - -type rlpNilableBigInt struct { - Val *big.Int -} - -type rlpEncodableBlockHeader struct { - Hash types.Hash - ParentHash types.Hash - Height *big.Int - Miner types.Address - DeferredStateRoot types.Hash - DeferredReceiptsRoot types.Hash - DeferredLogsBloomHash types.Hash - Blame hexutil.Uint64 - TransactionsRoot types.Hash - EpochNumber *big.Int - BlockNumber *rlpNilableBigInt `rlp:"nil"` - GasLimit *big.Int - GasUsed *rlpNilableBigInt `rlp:"nil"` - Timestamp *big.Int - Difficulty *big.Int - PowQuality *big.Int - RefereeHashes []types.Hash - Adaptive bool - Nonce *big.Int - Size *big.Int - Custom []Bytes - PosReference *types.Hash `rlp:"nil"` -} - -// EncodeRLP implements the rlp.Encoder interface. -func (bh BlockHeader) EncodeRLP(w io.Writer) error { - rbh := rlpEncodableBlockHeader{ - Hash: bh.Hash, - ParentHash: bh.ParentHash, - Height: bh.Height.ToInt(), - Miner: bh.Miner, - DeferredStateRoot: bh.DeferredStateRoot, - DeferredReceiptsRoot: bh.DeferredReceiptsRoot, - DeferredLogsBloomHash: bh.DeferredLogsBloomHash, - Blame: bh.Blame, - TransactionsRoot: bh.TransactionsRoot, - EpochNumber: bh.EpochNumber.ToInt(), - GasLimit: bh.GasLimit.ToInt(), - Timestamp: bh.Timestamp.ToInt(), - Difficulty: bh.Difficulty.ToInt(), - PowQuality: bh.PowQuality.ToInt(), - RefereeHashes: bh.RefereeHashes, - Adaptive: bh.Adaptive, - Nonce: bh.Nonce.ToInt(), - Size: bh.Size.ToInt(), - Custom: bh.Custom, - PosReference: bh.PosReference, - } - - if bh.BlockNumber != nil { - rbh.BlockNumber = &rlpNilableBigInt{bh.BlockNumber.ToInt()} - } - - if bh.GasUsed != nil { - rbh.GasUsed = &rlpNilableBigInt{bh.GasUsed.ToInt()} - } - - return rlp.Encode(w, rbh) -} - -// DecodeRLP implements the rlp.Decoder interface. -func (bh *BlockHeader) DecodeRLP(r *rlp.Stream) error { - var rbh rlpEncodableBlockHeader - if err := r.Decode(&rbh); err != nil { - return err - } - - bh.Hash, bh.ParentHash, bh.Height = rbh.Hash, rbh.ParentHash, (*hexutil.Big)(rbh.Height) - bh.Miner, bh.DeferredStateRoot = rbh.Miner, rbh.DeferredStateRoot - bh.DeferredReceiptsRoot, bh.DeferredLogsBloomHash = rbh.DeferredReceiptsRoot, rbh.DeferredLogsBloomHash - bh.Blame, bh.TransactionsRoot = rbh.Blame, rbh.TransactionsRoot - bh.EpochNumber = (*hexutil.Big)(rbh.EpochNumber) - bh.GasLimit = (*hexutil.Big)(rbh.GasLimit) - bh.Timestamp = (*hexutil.Big)(rbh.Timestamp) - bh.Difficulty, bh.PowQuality = (*hexutil.Big)(rbh.Difficulty), (*hexutil.Big)(rbh.PowQuality) - bh.RefereeHashes, bh.Adaptive = rbh.RefereeHashes, rbh.Adaptive - bh.Nonce, bh.Size, bh.Custom = (*hexutil.Big)(rbh.Nonce), (*hexutil.Big)(rbh.Size), rbh.Custom - bh.PosReference = rbh.PosReference - - if rbh.BlockNumber != nil { - bh.BlockNumber = (*hexutil.Big)(rbh.BlockNumber.Val) - } - - if rbh.GasUsed != nil { - bh.GasUsed = (*hexutil.Big)(rbh.GasUsed.Val) - } - - return nil -} diff --git a/internal/conflux/tx.go b/internal/conflux/tx.go deleted file mode 100644 index 76684ac2..00000000 --- a/internal/conflux/tx.go +++ /dev/null @@ -1,84 +0,0 @@ -package conflux - -import ( - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/rlp" - "github.com/mapprotocol/compass/internal/conflux/types" - "io" - "math/big" -) - -type Transaction struct { - Hash types.Hash `json:"hash"` - Nonce *hexutil.Big `json:"nonce"` - BlockHash *types.Hash `json:"blockHash"` - TransactionIndex *hexutil.Uint64 `json:"transactionIndex"` - From Address `json:"from"` - To *Address `json:"to"` - Value *hexutil.Big `json:"value"` - GasPrice *hexutil.Big `json:"gasPrice"` - Gas *hexutil.Big `json:"gas"` - ContractCreated *Address `json:"contractCreated"` - Data string `json:"data"` - StorageLimit *hexutil.Big `json:"storageLimit"` - EpochHeight *hexutil.Big `json:"epochHeight"` - ChainID *hexutil.Big `json:"chainId"` - Status *hexutil.Uint64 `json:"status"` - V *hexutil.Big `json:"v"` - R *hexutil.Big `json:"r"` - S *hexutil.Big `json:"s"` -} - -// rlpEncodableTransaction transaction struct used for rlp encoding -type rlpEncodableTransaction struct { - Hash types.Hash - Nonce *big.Int - BlockHash *types.Hash - TransactionIndex *hexutil.Uint64 - From Address - To *Address `rlp:"nil"` - Value *big.Int - GasPrice *big.Int - Gas *big.Int - ContractCreated *Address `rlp:"nil"` // nil means contract creation - Data string - StorageLimit *big.Int - EpochHeight *big.Int - ChainID *big.Int - Status *hexutil.Uint64 - - //signature - V *big.Int - R *big.Int - S *big.Int -} - -// EncodeRLP implements the rlp.Encoder interface. -func (tx Transaction) EncodeRLP(w io.Writer) error { - rtx := rlpEncodableTransaction{ - tx.Hash, tx.Nonce.ToInt(), tx.BlockHash, tx.TransactionIndex, tx.From, tx.To, - tx.Value.ToInt(), tx.GasPrice.ToInt(), tx.Gas.ToInt(), tx.ContractCreated, tx.Data, - tx.StorageLimit.ToInt(), tx.EpochHeight.ToInt(), tx.ChainID.ToInt(), tx.Status, - tx.V.ToInt(), tx.R.ToInt(), tx.S.ToInt(), - } - - return rlp.Encode(w, rtx) -} - -// DecodeRLP implements the rlp.Decoder interface. -func (tx *Transaction) DecodeRLP(r *rlp.Stream) error { - var rtx rlpEncodableTransaction - if err := r.Decode(&rtx); err != nil { - return err - } - - tx.Hash, tx.Nonce, tx.BlockHash = rtx.Hash, (*hexutil.Big)(rtx.Nonce), rtx.BlockHash - tx.TransactionIndex, tx.From, tx.To = rtx.TransactionIndex, rtx.From, rtx.To - tx.Value, tx.GasPrice = (*hexutil.Big)(rtx.Value), (*hexutil.Big)(rtx.GasPrice) - tx.Gas, tx.ContractCreated, tx.Data = (*hexutil.Big)(rtx.Gas), rtx.ContractCreated, rtx.Data - tx.StorageLimit, tx.EpochHeight = (*hexutil.Big)(rtx.StorageLimit), (*hexutil.Big)(rtx.EpochHeight) - tx.ChainID, tx.Status, tx.V = (*hexutil.Big)(rtx.ChainID), rtx.Status, (*hexutil.Big)(rtx.V) - tx.R, tx.S = (*hexutil.Big)(rtx.R), (*hexutil.Big)(rtx.S) - - return nil -} diff --git a/internal/conflux/types.go b/internal/conflux/types.go deleted file mode 100644 index 19d096f7..00000000 --- a/internal/conflux/types.go +++ /dev/null @@ -1,100 +0,0 @@ -package conflux - -import ( - "encoding/json" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/rlp" - "github.com/mapprotocol/compass/internal/conflux/types" - "io" -) - -type BlockHeader struct { - Hash types.Hash `json:"hash"` - ParentHash types.Hash `json:"parentHash"` - Height *hexutil.Big `json:"height"` - Miner types.Address `json:"miner"` - DeferredStateRoot types.Hash `json:"deferredStateRoot"` - DeferredReceiptsRoot types.Hash `json:"deferredReceiptsRoot"` - DeferredLogsBloomHash types.Hash `json:"deferredLogsBloomHash"` - Blame hexutil.Uint64 `json:"blame"` - TransactionsRoot types.Hash `json:"transactionsRoot"` - EpochNumber *hexutil.Big `json:"epochNumber"` - BlockNumber *hexutil.Big `json:"blockNumber"` - GasLimit *hexutil.Big `json:"gasLimit"` - GasUsed *hexutil.Big `json:"gasUsed"` - Timestamp *hexutil.Big `json:"timestamp"` - Difficulty *hexutil.Big `json:"difficulty"` - PowQuality *hexutil.Big `json:"powQuality"` - RefereeHashes []types.Hash `json:"refereeHashes"` - Adaptive bool `json:"adaptive"` - Nonce *hexutil.Big `json:"nonce"` - Size *hexutil.Big `json:"size"` - Custom []Bytes `json:"custom"` - PosReference *types.Hash `json:"posReference"` - BaseFeePerGas *hexutil.Big `json:"baseFeePerGas"` -} - -type Bytes []byte - -func (b Bytes) MarshalText() ([]byte, error) { - return hexutil.Bytes(b).MarshalText() -} - -func (b *Bytes) UnmarshalJSON(data []byte) error { - var hex hexutil.Bytes - if err := json.Unmarshal(data, &hex); err == nil { - *b = Bytes([]byte(hex)) - return nil - } - - nums := make([]uint, 0) - if err := json.Unmarshal(data, &nums); err != nil { - return err - } - - for _, v := range nums { - *b = append(*b, byte(v)) - } - return nil -} - -func (b *Bytes) ToBytes() []byte { - return []byte(*b) -} - -func (b *Bytes) ToHexBytes() hexutil.Bytes { - return hexutil.Bytes(*b) -} - -type CfxBlock struct { - BlockHeader - Transactions []Transaction `json:"transactions"` -} - -// rlpEncodableBlock block struct used for rlp encoding -type rlpEncodableBlock struct { - BlockHeader BlockHeader - Transactions []Transaction -} - -// EncodeRLP implements the rlp.Encoder interface. -func (block CfxBlock) EncodeRLP(w io.Writer) error { - rblock := rlpEncodableBlock{ - block.BlockHeader, block.Transactions, - } - - return rlp.Encode(w, rblock) -} - -// DecodeRLP implements the rlp.Decoder interface. -func (block *CfxBlock) DecodeRLP(r *rlp.Stream) error { - var rblock rlpEncodableBlock - if err := r.Decode(&rblock); err != nil { - return err - } - - block.BlockHeader = rblock.BlockHeader - block.Transactions = rblock.Transactions - - return nil -} diff --git a/internal/conflux/types/address.go b/internal/conflux/types/address.go deleted file mode 100644 index 8dbdf907..00000000 --- a/internal/conflux/types/address.go +++ /dev/null @@ -1,467 +0,0 @@ -package types - -import ( - "encoding/hex" - "encoding/json" - "fmt" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/rlp" - "github.com/pkg/errors" - "io" - "reflect" - "regexp" - "strings" -) - -type Address struct { - networkType NetworkType - addressType AddressType - body Body - checksum Checksum - - // cache - hex []byte - networkID uint32 -} - -// String returns verbose base32 string of address -func (a Address) String() string { - //if GetConfig().AddressStringVerbose { - // return a.MustGetVerboseBase32Address() - //} - return a.MustGetBase32Address() -} - -// Equals reports whether a and target are equal -func (a *Address) Equals(target *Address) bool { - return reflect.DeepEqual(a, target) -} - -// New create conflux address by base32 string or hex40 string, if base32OrHex is base32 and networkID is passed it will create cfx Address use networkID. -func New(base32OrHex string, networkID ...uint32) (Address, error) { - hexPattern := `(?i)^0x[a-f0-9]{40}$` - base32Pattern := `(?i)^(cfx|cfxtest|net\d+):(type\.user:|type\.builtin:|type\.contract:|type\.null:|)\w{42}$` - _networkID := uint32(0) - if len(networkID) > 0 { - _networkID = networkID[0] - } - - if ok, _ := regexp.Match(hexPattern, []byte(base32OrHex)); ok { - - addr, err := NewFromHex(base32OrHex, _networkID) - if err != nil { - return Address{}, errors.Wrapf(err, "Failed to new address from hex %v networkID %v", base32OrHex, _networkID) - } - return addr, nil - } - - if ok, _ := regexp.Match(base32Pattern, []byte(base32OrHex)); ok { - addr, err := NewFromBase32(base32OrHex) - if err != nil { - return Address{}, errors.Wrapf(err, "Failed to new address from base32 string %v", base32OrHex) - } - if _networkID != 0 && addr.GetNetworkID() != _networkID { - addr, err = NewFromHex(addr.GetHexAddress(), _networkID) - if err != nil { - return Address{}, errors.Wrapf(err, "Failed to new address from hex %v networkID %v", addr.GetHexAddress(), _networkID) - } - } - return addr, nil - } - return Address{}, errors.Errorf("Input %v need be base32 string or hex40 string,", base32OrHex) -} - -// MustNew create conflux address by base32 string or hex40 string, if base32OrHex is base32 and networkID is setted it will check if networkID match, -// it will painc if error occured. -func MustNew(base32OrHex string, networkID ...uint32) Address { - address, err := New(base32OrHex, networkID...) - if err != nil { - panic(err) - } - return address -} - -// NewFromBase32 creates address by base32 string -func NewFromBase32(base32Str string) (cfxAddress Address, err error) { - if strings.ToLower(base32Str) != base32Str && strings.ToUpper(base32Str) != base32Str { - return cfxAddress, errors.Errorf("not support base32 string with mix lowercase and uppercase %v", base32Str) - } - base32Str = strings.ToLower(base32Str) - - parts := strings.Split(base32Str, ":") - if len(parts) < 2 || len(parts) > 3 { - return cfxAddress, errors.Errorf("base32 string %v is invalid format", base32Str) - } - - cfxAddress.networkType, err = NewNetowrkType(parts[0]) - if err != nil { - return cfxAddress, errors.Wrapf(err, "failed to get network type of %v", parts[0]) - } - - bodyWithChecksum := parts[len(parts)-1] - if len(bodyWithChecksum) < 8 { - return cfxAddress, errors.Errorf("body with checksum length chould not length than 8, actual len(%v)=%v", bodyWithChecksum, len(bodyWithChecksum)) - } - bodyStr := bodyWithChecksum[0 : len(bodyWithChecksum)-8] - - cfxAddress.body, err = NewBodyByString(bodyStr) - if err != nil { - return cfxAddress, errors.Wrapf(err, "failed to create body by %v", bodyStr) - } - - _, hexAddress, err := cfxAddress.body.ToHexAddress() - if err != nil { - return cfxAddress, errors.Wrapf(err, "failed to get hex address by body %v", cfxAddress.body) - } - - cfxAddress.addressType, err = CalcAddressType(hexAddress) - if err != nil { - return cfxAddress, errors.Wrapf(err, "failed to calc address type of %x", hexAddress) - } - - if len(parts) == 3 && strings.ToLower(parts[1]) != cfxAddress.addressType.String() { - return cfxAddress, errors.Errorf("invalid address type, expect %v actual %v", cfxAddress.addressType, parts[1]) - - } - - cfxAddress.checksum, err = CalcChecksum(cfxAddress.networkType, cfxAddress.body) - if err != nil { - return cfxAddress, errors.Wrapf(err, "failed to calc checksum by network type %v and body %x", cfxAddress.networkType, cfxAddress.body) - } - - expectChk := cfxAddress.checksum.String() - actualChk := bodyWithChecksum[len(bodyWithChecksum)-8:] - if expectChk != actualChk { - err = errors.Errorf("invalid checksum, expect %v actual %v", expectChk, actualChk) - return - } - - if err = cfxAddress.setCache(); err != nil { - err = errors.Wrapf(err, "failed to set cache") - return - } - - return -} - -// NewFromHex creates address by hex address string with networkID -// If not pass networkID, it will be auto completed when it could be obtained form context. -func NewFromHex(hexAddressStr string, networkID ...uint32) (val Address, err error) { - if hexAddressStr[0:2] == "0x" { - hexAddressStr = hexAddressStr[2:] - } - - hexAddress, err := hex.DecodeString(hexAddressStr) - if err != nil { - return val, errors.Wrapf(err, "failed to decode address string %x to hex", hexAddressStr) - } - - return NewFromBytes(hexAddress, networkID...) -} - -// NewFromCommon creates an address from common.Address with networkID -func NewFromCommon(commonAddress common.Address, networkID ...uint32) (val Address, err error) { - return NewFromBytes(commonAddress.Bytes(), networkID...) -} - -// NewFromBytes creates an address from hexAddress byte slice with networkID -func NewFromBytes(hexAddress []byte, networkID ...uint32) (val Address, err error) { - val.networkType = NewNetworkTypeByID(get1stNetworkIDIfy(networkID)) - val.addressType, err = CalcAddressType(hexAddress) - - if err != nil { - return val, errors.Wrapf(err, "failed to calculate address type of %x", hexAddress) - } - - versionByte, err := CalcVersionByte(hexAddress) - if err != nil { - return val, errors.Wrapf(err, "failed to calculate version type of %x", hexAddress) - } - - val.body, err = NewBodyByHexAddress(versionByte, hexAddress) - if err != nil { - return val, errors.Wrapf(err, "failed to create body by version byte %v and hex address %x", versionByte, hexAddress) - } - - val.checksum, err = CalcChecksum(val.networkType, val.body) - if err != nil { - return val, errors.Wrapf(err, "failed to calc checksum by network type %v and body %x", val.networkType, val.body) - } - - if err = val.setCache(); err != nil { - err = errors.Wrapf(err, "failed to set cache") - return - } - - return val, nil -} - -// MustNewFromBase32 creates address by base32 string and panic if error -func MustNewFromBase32(base32Str string) (address Address) { - address, err := NewFromBase32(base32Str) - if err != nil { - panic(fmt.Errorf("input base32 string: %v, err:%v", base32Str, err)) - } - return -} - -// MustNewFromHex creates address by hex address string with networkID and panic if error -func MustNewFromHex(hexAddressStr string, networkID ...uint32) (val Address) { - addr, err := NewFromHex(hexAddressStr, get1stNetworkIDIfy(networkID)) - if err != nil { - panic(fmt.Errorf("input hex address:%v, networkID:%v, err:%v", hexAddressStr, networkID, err)) - } - return addr -} - -// MustNewFromCommon creates an address from common.Address with networkID and panic if error -func MustNewFromCommon(commonAddress common.Address, networkID ...uint32) (address Address) { - addr, err := NewFromCommon(commonAddress, get1stNetworkIDIfy(networkID)) - if err != nil { - panic(fmt.Errorf("input common address:%x, networkID:%v, err:%v", commonAddress, networkID, err)) - } - return addr -} - -// MustNewFromBytes creates an address from hexAddress byte slice with networkID and panic if error -func MustNewFromBytes(hexAddress []byte, networkID ...uint32) (address Address) { - addr, err := NewFromBytes(hexAddress, get1stNetworkIDIfy(networkID)) - if err != nil { - panic(fmt.Errorf("input common address:%x, networkID:%v, err:%v", hexAddress, networkID, err)) - } - return addr -} - -// ToHex returns hex address and networkID -func (a *Address) ToHex() (hexAddressStr string, networkID uint32) { - validAddr := a.getDefaultIfEmpty() - return "0x" + hex.EncodeToString(validAddr.hex), validAddr.networkID -} - -// ToCommon returns common.Address and networkID -func (a *Address) ToCommon() (address common.Address, networkID uint32, err error) { - validAddr := a.getDefaultIfEmpty() - if len(validAddr.hex) > 42 { - err = errors.Errorf("could not convert %v to common address which length large than 42", validAddr.hex) - return - } - address = common.BytesToAddress(validAddr.hex) - networkID = validAddr.networkID - return -} - -// MustGetBase32Address returns base32 string of address which doesn't include address type -func (a *Address) MustGetBase32Address() string { - validAddr := a.getDefaultIfEmpty() - return strings.ToLower(fmt.Sprintf("%v:%v%v", validAddr.networkType, validAddr.body, validAddr.checksum)) -} - -// MustGetVerboseBase32Address returns base32 string of address with address type -func (a *Address) MustGetVerboseBase32Address() string { - validAddr := a.getDefaultIfEmpty() - return strings.ToUpper(fmt.Sprintf("%v:%v:%v%v", validAddr.networkType, validAddr.addressType, validAddr.body, a.checksum)) -} - -// GetShortenAddress returns shorten string for display in dapp. -// When isTail4Char is 'true', the result will be like 'cfx:aat…sa4w', otherwise 'cfx:aat…5m81sa4w' -func (a *Address) GetShortenAddress(isTail4Char ...bool) string { - validAddr := a.getDefaultIfEmpty() - body := validAddr.body.String()[0:3] - - if len(isTail4Char) > 0 && isTail4Char[0] { - checksum := validAddr.checksum.String()[4:] - return strings.ToLower(fmt.Sprintf("%v:%v...%v", validAddr.networkType, body, checksum)) - } - return strings.ToLower(fmt.Sprintf("%v:%v...%v", validAddr.networkType, body, validAddr.checksum)) -} - -// GetHexAddress returns hex format address and panic if error -func (a *Address) GetHexAddress() string { - addr, _ := a.getDefaultIfEmpty().ToHex() - return addr -} - -// GetNetworkID returns networkID and panic if error -func (a *Address) GetNetworkID() uint32 { - id, err := a.getDefaultIfEmpty().networkType.ToNetworkID() - if err != nil { - panic(fmt.Errorf("failed to get networkID of %v, err:%v", a, err)) - } - return id -} - -// MustGetCommonAddress returns common address and panic if error -func (a *Address) MustGetCommonAddress() common.Address { - addr, _, err := a.ToCommon() - if err != nil { - panic(fmt.Errorf("failed to get common address of %v, err:%v", a, err)) - } - return addr -} - -// GetMappedEVMSpaceAddress calculate CFX space address's mapped EVM address, which is the last 20 bytes of cfx address's keccak256 hash -func (a *Address) GetMappedEVMSpaceAddress() common.Address { - h := crypto.Keccak256Hash(a.MustGetCommonAddress().Bytes()) - var ethAddr common.Address - copy(ethAddr[:], h[12:]) - return ethAddr -} - -// GetNetworkType returns network type -func (a *Address) GetNetworkType() NetworkType { - return a.getDefaultIfEmpty().networkType -} - -// GetAddressType returuns address type -func (a *Address) GetAddressType() AddressType { - return a.getDefaultIfEmpty().addressType -} - -// GetBody returns body -func (a *Address) GetBody() Body { - return a.getDefaultIfEmpty().body -} - -// GetChecksum returns checksum -func (a *Address) GetChecksum() Checksum { - return a.getDefaultIfEmpty().checksum -} - -// CompleteByClient will set networkID by client.GetNetworkID() if a.networkID not be 0 -func (a *Address) CompleteByClient(client networkIDGetter) error { - networkID, err := client.GetNetworkID() - if err != nil { - return errors.Wrapf(err, "failed to get networkID") - } - a.CompleteByNetworkID(networkID) - return nil -} - -// CompleteByNetworkID will set networkID if current networkID isn't 0 -func (a *Address) CompleteByNetworkID(networkID uint32) error { - if a == nil { - return nil - } - - id, err := a.networkType.ToNetworkID() - if err != nil || id == 0 { - a.networkType = NewNetworkTypeByID(networkID) - a.checksum, err = CalcChecksum(a.networkType, a.body) - if err != nil { - return errors.Wrapf(err, "failed to calc checksum by network type %v and body %v", a.networkType, a.body) - } - } - return nil -} - -// IsValid return true if address is valid -func (a *Address) IsValid() bool { - return a.addressType == AddressTypeNull || - a.addressType == AddressTypeContract || - a.addressType == AddressTypeUser || - a.addressType == AddressTypeBuiltin -} - -// rlpEncodableAddress address struct used for rlp encoding -type rlpEncodableAddress struct { - NetworkType NetworkType - AddressType AddressType - Body Body - Checksum Checksum -} - -// EncodeRLP implements the rlp.Encoder interface. -func (a Address) EncodeRLP(w io.Writer) error { - ra := rlpEncodableAddress{ - a.networkType, a.addressType, a.body, a.checksum, - } - - return rlp.Encode(w, ra) -} - -// DecodeRLP implements the rlp.Decoder interface. -func (a *Address) DecodeRLP(r *rlp.Stream) error { - var ra rlpEncodableAddress - if err := r.Decode(&ra); err != nil { - return err - } - - a.networkType, a.addressType = ra.NetworkType, ra.AddressType - a.body, a.checksum = ra.Body, ra.Checksum - - if err := a.setCache(); err != nil { - return err - } - - return nil -} - -// MarshalText implements the encoding.TextMarshaler interface. -func (a Address) MarshalText() ([]byte, error) { - // fmt.Println("marshal text for epoch") - return []byte(a.String()), nil -} - -func (a *Address) UnmarshalText(data []byte) error { - data = append([]byte("\""), data...) - data = append(data, []byte("\"")...) - return a.UnmarshalJSON(data) -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (a *Address) UnmarshalJSON(data []byte) error { - if string(data) == "null" { - return nil - } - - var str string - err := json.Unmarshal(data, &str) - if err != nil { - return errors.Wrapf(err, "failed to unmarshal %x to string", data) - } - - addr, err := NewFromBase32(str) - if err != nil { - return errors.Wrapf(err, "failed to create address from base32 string %v", str) - } - *a = addr - return nil -} - -func get1stNetworkIDIfy(networkID []uint32) uint32 { - if len(networkID) > 0 { - return networkID[0] - } - return 0 -} - -func (a *Address) setCache() error { - var hexAddress []byte - _, hexAddress, err := a.body.ToHexAddress() - if err != nil { - return errors.Wrapf(err, "failed convert %v to hex address", a.body) - } - a.hex = hexAddress - - networkID, err := a.networkType.ToNetworkID() - if err != nil { - return errors.Wrapf(err, "failed to get networkID of %v", networkID) - } - a.networkID = networkID - return nil -} - -func (a *Address) getDefaultIfEmpty() *Address { - if (reflect.DeepEqual(*a, Address{})) { - var zeroAddr common.Address - cfxaddr := MustNewFromBytes(zeroAddr.Bytes(), 0) - return &cfxaddr - } - return a -} - -// networkIDGetter is a interface for obtaining networkID -type networkIDGetter interface { - GetNetworkID() (uint32, error) -} diff --git a/internal/conflux/types/address_type.go b/internal/conflux/types/address_type.go deleted file mode 100644 index ff0f2ca9..00000000 --- a/internal/conflux/types/address_type.go +++ /dev/null @@ -1,67 +0,0 @@ -package types - -import ( - "encoding/hex" - "fmt" - "github.com/pkg/errors" - "reflect" -) - -type AddressType string - -const ( - AddressTypeBuiltin AddressType = "builtin" - AddressTypeUser AddressType = "user" - AddressTypeContract AddressType = "contract" - AddressTypeNull AddressType = "null" - AddressTypeUnknown AddressType = "unknown" -) - -// CalcAddressType calculate address type of hexAddress -func CalcAddressType(hexAddress []byte) (AddressType, error) { - if len(hexAddress) != 20 { - return "", errors.Errorf("address must be 20 bytes, but it's %x", hexAddress) - } - - nullAddr, err := hex.DecodeString("0000000000000000000000000000000000000000") - if err != nil { - return "", err - } - if reflect.DeepEqual(nullAddr, hexAddress) { - return AddressTypeNull, nil - } - - var addressType AddressType - switch hexAddress[0] & 0xf0 { - case 0x00: - addressType = AddressTypeBuiltin - case 0x10: - addressType = AddressTypeUser - case 0x80: - addressType = AddressTypeContract - default: - addressType = AddressTypeUnknown - // return "", errors.Errorf("Invalid address %x", hexAddress) - } - // fmt.Printf("calc address type of %x : %v\n", hexAddress, addressType) - return addressType, nil -} - -// ToByte returns byte represents of address type according to CIP-37 -func (a AddressType) ToByte() (byte, error) { - switch a { - case AddressTypeNull: - return 0x00, nil - case AddressTypeBuiltin: - return 0x00, nil - case AddressTypeUser: - return 0x10, nil - case AddressTypeContract: - return 0x80, nil - } - return 0, errors.Errorf("Invalid address type %v", a) -} - -func (a AddressType) String() string { - return fmt.Sprintf("type.%v", string(a)) -} diff --git a/internal/conflux/types/body.go b/internal/conflux/types/body.go deleted file mode 100644 index b42a3507..00000000 --- a/internal/conflux/types/body.go +++ /dev/null @@ -1,119 +0,0 @@ -package types - -import ( - "github.com/pkg/errors" - "strings" -) - -var ( - ErrorBodyLen = errors.New("Body length must be 34") -) - -type Body [34]byte - -// NewBodyByString creates body by base32 string which contains version byte and hex address -func NewBodyByString(base32Str string) (body Body, err error) { - if len(base32Str) != 34 { - return body, ErrorBodyLen - } - - for i, v := range base32Str { - index, ok := alphabetToIndexMap[v] - if !ok { - err = errors.New("invalid base32 string for body") - } - body[i] = index - } - - return -} - -// NewBodyByHexAddress convert concat of version type and hex address to 5 bits slice -func NewBodyByHexAddress(vrsByte VersionByte, hexAddress []byte) (b Body, err error) { - vb, err := vrsByte.ToByte() - if err != nil { - err = errors.Wrapf(err, "failed to encode version type %#v", vrsByte) - return - } - concatenate := append([]byte{vb}, hexAddress[:]...) - bits5, err := convert(concatenate, 8, 5) - if err != nil { - err = errors.Wrapf(err, "failed to convert %x from 8 to 5 bits array", concatenate) - return - } - // b = bits5 - copy(b[:], bits5[:]) - return -} - -// ToHexAddress decode bits5 array to version byte and hex address -func (b Body) ToHexAddress() (vrsType VersionByte, hexAddress []byte, err error) { - if len(b) != 34 { - err = errors.New("invalid base32 body, body need be 34 bytes") - return - } - - val, err := convert(b[:], 5, 8) - vrsType = NewVersionByte(val[0]) - hexAddress = val[1:] - return -} - -// String return base32 string -func (b Body) String() string { - return bits5sToString(b[:]) -} - -const ( - alphabet = "abcdefghjkmnprstuvwxyz0123456789" -) - -var ( - alphabetToIndexMap map[rune]byte = make(map[rune]byte) -) - -func init() { - for i, v := range alphabet { - alphabetToIndexMap[v] = byte(i) - } -} - -func convert(data []byte, inbits uint, outbits uint) ([]byte, error) { - // fmt.Printf("convert %b from %v bits to %v bits\n", data, inbits, outbits) - // only support bits length<=8 - if inbits > 8 || outbits > 8 { - return nil, errors.New("only support bits length<=8") - } - - accBits := uint(0) //accumulate bit length - acc := uint16(0) //accumulate value - var ret []byte - for _, d := range data { - acc = acc<= outbits { - val := byte(acc >> uint16(accBits-outbits)) - // fmt.Printf("5bits val:%v\n", val) - ret = append(ret, val) - // fmt.Printf("ret: %b\n", ret) - acc = acc & uint16(1<<(accBits-outbits)-1) - // fmt.Printf("acc2: %b\n", acc) - accBits -= outbits - } - } - // if acc > 0 || accBits > 0 { - if accBits > 0 && (inbits > outbits) { - ret = append(ret, byte(acc<> 35) - c = ((c & 0x07ffffffff) << 5) ^ uint64(d) - if c0&0x01 != 0 { - c ^= 0x98f2bc8e61 - } - if c0&0x02 != 0 { - c ^= 0x79b76d99e2 - } - if c0&0x04 != 0 { - c ^= 0xf33e5fb3c4 - } - if c0&0x08 != 0 { - c ^= 0xae2eabe2a8 - } - if c0&0x10 != 0 { - c ^= 0x1e4f43e470 - } - } - return c ^ 1 -} - -func uint64ToBytes(num uint64) []byte { - r := make([]byte, 8) - for i := 0; i < 8; i++ { - r[7-i] = byte(num >> uint(i*8)) - } - return r -} diff --git a/internal/conflux/types/epoch.go b/internal/conflux/types/epoch.go deleted file mode 100644 index ec71a102..00000000 --- a/internal/conflux/types/epoch.go +++ /dev/null @@ -1,257 +0,0 @@ -package types - -import ( - "encoding/json" - "errors" - "fmt" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "math/big" -) - -// WebsocketEpochResponse represents result of epoch websocket subscription -type WebsocketEpochResponse struct { - EpochHashesOrdered []Hash `json:"epochHashesOrdered"` - EpochNumber *hexutil.Big `json:"epochNumber"` -} - -// Epoch represents an epoch in Conflux. -type Epoch struct { - name string - number *hexutil.Big -} - -// Const epoch definitions -var ( - EpochEarliest *Epoch = &Epoch{"earliest", nil} - EpochLatestCheckpoint *Epoch = &Epoch{"latest_checkpoint", nil} - EpochLatestConfirmed *Epoch = &Epoch{"latest_confirmed", nil} - EpochLatestState *Epoch = &Epoch{"latest_state", nil} - EpochLatestMined *Epoch = &Epoch{"latest_mined", nil} - EpochLatestFinalized *Epoch = &Epoch{"latest_finalized", nil} -) - -// NewEpochNumber creates an instance of Epoch with specified number. -func NewEpochNumber(number *hexutil.Big) *Epoch { - return &Epoch{"", number} -} - -// NewEpochNumberBig creates an instance of Epoch with specified big number. -func NewEpochNumberBig(number *big.Int) *Epoch { - return &Epoch{"", NewBigIntByRaw(number)} -} - -// NewEpochNumberUint64 creates an instance of Epoch with specified uint64 number. -func NewEpochNumberUint64(number uint64) *Epoch { - return &Epoch{"", NewBigInt(number)} -} - -// String implements the fmt.Stringer interface -func (e *Epoch) String() string { - if e.number != nil { - return e.number.String() - } - - return e.name -} - -// ToInt returns epoch number in type big.Int -func (e *Epoch) ToInt() (result *big.Int, isSuccess bool) { - if e.number != nil { - return e.number.ToInt(), true - } - - if e.name == EpochEarliest.name { - return common.Big0, true - } - - return nil, false -} - -// Equals checks if e equals target -func (e *Epoch) Equals(target *Epoch) bool { - if e == nil { - panic("input could not be nil") - } - - if target == nil { - return false - } - - if e == target { - return true - } - - if len(e.name) > 0 || len(target.name) > 0 { - return e.name == target.name - } - - if e.number == nil || target.number == nil { - return e.number == target.number - } - - return e.number.ToInt().Cmp(target.number.ToInt()) == 0 -} - -// MarshalText implements the encoding.TextMarshaler interface. -func (e Epoch) MarshalText() ([]byte, error) { - return []byte(e.String()), nil -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (e *Epoch) UnmarshalJSON(data []byte) error { - var input string - if err := json.Unmarshal(data, &input); err != nil { - return err - } - - switch input { - case EpochEarliest.name, - EpochLatestCheckpoint.name, - EpochLatestConfirmed.name, - EpochLatestState.name, - EpochLatestMined.name, - EpochLatestFinalized.name: - e.name = input - return nil - default: - if len(input) == 66 { - e.name = input - return nil - } - - epochNumber, err := hexutil.DecodeBig(input) - if err != nil { - return err - } - - e.number = NewBigIntByRaw(epochNumber) - return nil - } -} - -type EpochOrBlockHash struct { - epoch *Epoch - epochNumber *hexutil.Big - blockHash *common.Hash - requirePivot bool -} - -// IsEpoch returns epoch if it is epoch, and the 2rd return value represents if is epoch. -func (e *EpochOrBlockHash) IsEpoch() (*Epoch, bool) { - if e.epoch != nil { - return e.epoch, true - } - if e.epochNumber != nil { - return NewEpochNumber(e.epochNumber), true - } - return nil, false -} - -// IsBlockHash returns "block hash" and "require pivot" if it is blockhash, and the 3rd return value represents if is block hash. -func (e *EpochOrBlockHash) IsBlockHash() (*common.Hash, bool, bool) { - if e.blockHash != nil { - return e.blockHash, e.requirePivot, true - } - return nil, false, false -} - -// String implements the fmt.Stringer interface -func (e *EpochOrBlockHash) String() string { - if e.epoch != nil { - return e.epoch.String() - } - - if e.epochNumber != nil { - return e.epochNumber.String() - } - - if e.blockHash != nil { - return e.blockHash.String() - } - - return "nil" -} - -// MarshalText implements the encoding.TextMarshaler interface. -func (e EpochOrBlockHash) MarshalText() ([]byte, error) { - return []byte(e.String()), nil -} - -func (e EpochOrBlockHash) MarshalJSON() ([]byte, error) { - if e.epoch != nil { - return json.Marshal(e.epoch) - } - - if e.epochNumber != nil { - return json.Marshal(struct { - EpochNumber *hexutil.Big `json:"epochNumber"` - }{ - EpochNumber: e.epochNumber, - }) - } - - if e.blockHash != nil { - return json.Marshal(struct { - BlockHash common.Hash `json:"blockHash"` - RequirePivot bool `json:"requirePivot"` - }{ - BlockHash: *e.blockHash, - RequirePivot: e.requirePivot, - }) - } - return nil, errors.New("unkown EpochOrBlockHash") -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (e *EpochOrBlockHash) UnmarshalJSON(data []byte) error { - - var epoch Epoch - err := json.Unmarshal(data, &epoch) - if err == nil { - e.epoch = &epoch - return nil - } - - type tmpEpoch struct { - EpochNumber *hexutil.Big `json:"epochNumber"` - BlockHash *common.Hash `json:"blockHash"` - RequirePivot bool `json:"requirePivot"` - } - - var val tmpEpoch - err = json.Unmarshal(data, &val) - if err != nil { - return err - } - - if val.EpochNumber != nil && val.BlockHash != nil { - return fmt.Errorf("cannot specify both BlockHash and EpochNumber, choose one or the other") - } - if val.EpochNumber != nil && val.RequirePivot { - return fmt.Errorf("cannot specify both EpochNumber and RequirePivot, choose one or the other") - } - if val.EpochNumber != nil { - e.epochNumber = val.EpochNumber - return nil - } - e.blockHash = val.BlockHash - e.requirePivot = val.RequirePivot - return nil -} - -// NewEpochOrBlockHashWithEpoch creates an instance of Epoch with specified epoch. -func NewEpochOrBlockHashWithEpoch(epoch *Epoch) *EpochOrBlockHash { - if epoch == nil { - epoch = EpochLatestState - } - return &EpochOrBlockHash{epoch: epoch} -} - -// NewEpochOrBlockHashWithBlockHash creates an instance of Epoch with specified block hash. -func NewEpochOrBlockHashWithBlockHash(blockHash Hash, requirePivot ...bool) *EpochOrBlockHash { - if len(requirePivot) == 0 { - requirePivot = append(requirePivot, false) - } - return &EpochOrBlockHash{nil, nil, blockHash.ToCommonHash(), requirePivot[0]} -} diff --git a/internal/conflux/types/eunms.go b/internal/conflux/types/eunms.go deleted file mode 100644 index d184a12e..00000000 --- a/internal/conflux/types/eunms.go +++ /dev/null @@ -1,25 +0,0 @@ -package types - -type TransactionOutcome uint8 - -const ( - TRANSACTION_OUTCOME_SUCCESS TransactionOutcome = iota - TRANSACTION_OUTCOME_FAILURE - TRANSACTION_OUTCOME_SKIPPED -) - -type NativeSpaceOutcome uint8 - -const ( - NATIVE_SPACE_SUCCESS NativeSpaceOutcome = iota - NATIVE_SPACE_EXCEPTION_WITH_NONCE_BUMPING // gas fee charged - NATIVE_SPACE_EXCEPTION_WITHOUT_NONCE_BUMPING // no gas fee charged -) - -type EvmSpaceOutcome uint8 - -const ( - EVM_SPACE_FAIL EvmSpaceOutcome = iota - EVM_SPACE_SUCCESS - EVM_SPACE_SKIPPED = 0xff -) diff --git a/internal/conflux/types/log.go b/internal/conflux/types/log.go deleted file mode 100644 index cd73f181..00000000 --- a/internal/conflux/types/log.go +++ /dev/null @@ -1,234 +0,0 @@ -package types - -import ( - "encoding/json" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/rlp" - "github.com/pkg/errors" - "io" - "math/big" - "reflect" -) - -type LogFilter struct { - FromEpoch *Epoch `json:"fromEpoch,omitempty"` - ToEpoch *Epoch `json:"toEpoch,omitempty"` - FromBlock *hexutil.Big `json:"fromBlock,omitempty"` - ToBlock *hexutil.Big `json:"toBlock,omitempty"` - BlockHashes []Hash `json:"blockHashes,omitempty"` - Address []Address `json:"address,omitempty"` - Topics [][]Hash `json:"topics,omitempty"` -} - -// Log represents the event in a smart contract -type Log struct { - Address Address `json:"address"` - Topics []Hash `json:"topics"` - Data hexutil.Bytes `json:"data"` - BlockHash *Hash `json:"blockHash,omitempty"` - EpochNumber *hexutil.Big `json:"epochNumber,omitempty"` - TransactionHash *Hash `json:"transactionHash,omitempty"` - TransactionIndex *hexutil.Big `json:"transactionIndex,omitempty"` - LogIndex *hexutil.Big `json:"logIndex,omitempty"` - TransactionLogIndex *hexutil.Big `json:"transactionLogIndex,omitempty"` - Space *SpaceType `json:"space,omitempty"` -} - -// rlpNilableBigInt nilable pointer to big int used for rlp encoding -type rlpNilableBigInt struct { - Val *big.Int -} - -// rlpEncodableLog log struct used for rlp encoding -type rlpEncodableLog struct { - Address Address - Topics []Hash - Data hexutil.Bytes - BlockHash *Hash `rlp:"nil"` - EpochNumber *rlpNilableBigInt `rlp:"nil"` - TransactionHash *Hash `rlp:"nil"` - TransactionIndex *rlpNilableBigInt `rlp:"nil"` - LogIndex *rlpNilableBigInt `rlp:"nil"` - TransactionLogIndex *rlpNilableBigInt `rlp:"nil"` -} - -func (l Log) toRlpEncodable() rlpEncodableLog { - rlog := rlpEncodableLog{ - Address: l.Address, Topics: l.Topics, Data: l.Data, - BlockHash: l.BlockHash, TransactionHash: l.TransactionHash, - } - - if l.EpochNumber != nil { - rlog.EpochNumber = &rlpNilableBigInt{l.EpochNumber.ToInt()} - } - - if l.TransactionIndex != nil { - rlog.TransactionIndex = &rlpNilableBigInt{l.TransactionIndex.ToInt()} - } - - if l.LogIndex != nil { - rlog.LogIndex = &rlpNilableBigInt{l.LogIndex.ToInt()} - } - - if l.TransactionLogIndex != nil { - rlog.TransactionLogIndex = &rlpNilableBigInt{l.TransactionLogIndex.ToInt()} - } - return rlog -} - -func (r rlpEncodableLog) toNormal() Log { - log := Log{} - - log.Address, log.Topics, log.Data = r.Address, r.Topics, r.Data - log.BlockHash, log.TransactionHash = r.BlockHash, r.TransactionHash - - if r.EpochNumber != nil { - log.EpochNumber = (*hexutil.Big)(r.EpochNumber.Val) - } - - if r.TransactionIndex != nil { - log.TransactionIndex = (*hexutil.Big)(r.TransactionIndex.Val) - } - - if r.LogIndex != nil { - log.LogIndex = (*hexutil.Big)(r.LogIndex.Val) - } - - if r.TransactionLogIndex != nil { - log.TransactionLogIndex = (*hexutil.Big)(r.TransactionLogIndex.Val) - } - return log -} - -// EncodeRLP implements the rlp.Encoder interface. -func (log Log) EncodeRLP(w io.Writer) error { - return rlp.Encode(w, log.toRlpEncodable()) -} - -// DecodeRLP implements the rlp.Decoder interface. -func (log *Log) DecodeRLP(r *rlp.Stream) error { - var rlog rlpEncodableLog - if err := r.Decode(&rlog); err != nil { - return err - } - - *log = rlog.toNormal() - return nil -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (l *LogFilter) UnmarshalJSON(data []byte) error { - type tmpLogFilter struct { - FromEpoch *Epoch `json:"fromEpoch,omitempty"` - ToEpoch *Epoch `json:"toEpoch,omitempty"` - FromBlock *hexutil.Big `json:"fromBlock,omitempty"` - ToBlock *hexutil.Big `json:"toBlock,omitempty"` - BlockHashes []Hash `json:"blockHashes,omitempty"` - Address interface{} `json:"address,omitempty"` - Topics []interface{} `json:"topics,omitempty"` - Offset *hexutil.Uint64 `json:"offset,omitempty"` - Limit *hexutil.Uint64 `json:"limit,omitempty"` - } - - t := tmpLogFilter{} - if err := json.Unmarshal(data, &t); err != nil { - return err - } - - var err error - l.FromEpoch = t.FromEpoch - l.ToEpoch = t.ToEpoch - l.FromBlock = t.FromBlock - l.ToBlock = t.ToBlock - l.BlockHashes = t.BlockHashes - if l.Address, err = resolveToAddresses(t.Address); err != nil { - return err - } - if l.Topics, err = resolveToTopicsList(t.Topics); err != nil { - return err - } - return nil -} - -func resolveToAddresses(val interface{}) ([]Address, error) { - // if val is nil, return - if val == nil { - return nil, nil - } - - // if val is string, new address and return - if addrStr, ok := val.(string); ok { - addr, err := NewFromBase32(addrStr) - if err != nil { - return nil, errors.Wrapf(err, "failed to create address by %v", addrStr) - } - return []Address{addr}, nil - } - - // if val is string slice, new every item to cfxaddress - if addrStrList, ok := val.([]interface{}); ok { - addrList := make([]Address, 0) - for _, v := range addrStrList { - vStr, ok := v.(string) - if !ok { - return nil, errors.Errorf("could not conver type %v to address", reflect.TypeOf(v)) - } - - addr, err := NewFromBase32(vStr) - if err != nil { - return nil, errors.Wrapf(err, "failed to create address by %v", v) - } - addrList = append(addrList, addr) - } - return addrList, nil - } - - return nil, errors.Errorf("failed to unmarshal %#v to address or address list", val) -} - -func resolveToTopicsList(val []interface{}) ([][]Hash, error) { - // if val is nil, return - if val == nil { - return nil, nil - } - - // otherwise, convert every item to topics - topicsList := make([][]Hash, 0) - - for _, v := range val { - hashes, err := resolveToHashes(v) - if err != nil { - return nil, err - } - topicsList = append(topicsList, hashes) - } - return topicsList, nil -} - -func resolveToHashes(val interface{}) ([]Hash, error) { - // if val is nil, return - if val == nil { - return nil, nil - } - - // if val is string, return - if hashStr, ok := val.(string); ok { - return []Hash{Hash(hashStr)}, nil - } - - // if val is string slice, append every item - if addrStrList, ok := val.([]interface{}); ok { - addrList := make([]Hash, 0) - for _, v := range addrStrList { - vStr, ok := v.(string) - if !ok { - return nil, errors.Errorf("could not conver type %v to hash", reflect.TypeOf(v)) - } - - addrList = append(addrList, Hash(vStr)) - } - return addrList, nil - } - - return nil, errors.Errorf("failed to convert %v to hash or hashes", val) -} diff --git a/internal/conflux/types/network.go b/internal/conflux/types/network.go deleted file mode 100644 index ad5c2b7e..00000000 --- a/internal/conflux/types/network.go +++ /dev/null @@ -1,75 +0,0 @@ -package types - -import ( - "fmt" - "github.com/pkg/errors" - "strconv" -) - -type NetworkType string - -func (n NetworkType) String() string { - return string(n) -} - -const ( - NetworkTypeMainnetPrefix NetworkType = "cfx" - NetworkTypeTestNetPrefix NetworkType = "cfxtest" - - NetowrkTypeMainnetID uint32 = 1029 - NetworkTypeTestnetID uint32 = 1 -) - -// NewNetowrkType creates network type by string -func NewNetowrkType(netType string) (NetworkType, error) { - if netType == NetworkTypeMainnetPrefix.String() || netType == NetworkTypeTestNetPrefix.String() { - return NetworkType(netType), nil - } - _, err := getIDWhenBeginWithNet(netType) - if err != nil { - return "", err - } - return NetworkType(netType), nil -} - -// NewNetworkTypeByID creates network type by network ID -func NewNetworkTypeByID(networkID uint32) NetworkType { - var nt NetworkType - switch networkID { - case NetowrkTypeMainnetID: - nt = NetworkTypeMainnetPrefix - case NetworkTypeTestnetID: - nt = NetworkTypeTestNetPrefix - default: - nt = NetworkType(fmt.Sprintf("net%v", networkID)) - } - return nt -} - -// ToNetworkID returns network ID -func (n NetworkType) ToNetworkID() (uint32, error) { - switch n { - case NetworkTypeMainnetPrefix: - return NetowrkTypeMainnetID, nil - case NetworkTypeTestNetPrefix: - return NetworkTypeTestnetID, nil - default: - return getIDWhenBeginWithNet(string(n)) - } -} - -func getIDWhenBeginWithNet(netIDStr string) (uint32, error) { - if len(netIDStr) < 3 { - return 0, errors.Errorf("Invalid network: %v", netIDStr) - } - - if netIDStr[0:3] != "net" { - return 0, errors.Errorf("Invalid network: %v", netIDStr) - } - - netID, err := strconv.ParseUint(string(netIDStr[3:]), 0, 32) - if err != nil { - return 0, err - } - return uint32(netID), nil -} diff --git a/internal/conflux/types/transaction.go b/internal/conflux/types/transaction.go deleted file mode 100644 index 4849e369..00000000 --- a/internal/conflux/types/transaction.go +++ /dev/null @@ -1,293 +0,0 @@ -package types - -import ( - "encoding/json" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/rlp" - "github.com/pkg/errors" - "io" - "math/big" -) - -type SpaceType string - -const ( - SPACE_EVM SpaceType = "evm" - SPACE_NATIVE SpaceType = "native" - SPACE_NONE SpaceType = "none" -) - -type Transaction struct { - // Space *string `json:"space,omitempty"` //currently it is always "nil", so comment it now and uncomment it if need later - Hash Hash `json:"hash"` - Nonce *hexutil.Big `json:"nonce"` - BlockHash *Hash `json:"blockHash"` - TransactionIndex *hexutil.Uint64 `json:"transactionIndex"` - From Address `json:"from"` - To *Address `json:"to"` - Value *hexutil.Big `json:"value"` - GasPrice *hexutil.Big `json:"gasPrice"` - Gas *hexutil.Big `json:"gas"` - ContractCreated *Address `json:"contractCreated"` - Data string `json:"data"` - StorageLimit *hexutil.Big `json:"storageLimit"` - EpochHeight *hexutil.Big `json:"epochHeight"` - ChainID *hexutil.Big `json:"chainId"` - Status *hexutil.Uint64 `json:"status"` - - //signature - V *hexutil.Big `json:"v"` - R *hexutil.Big `json:"r"` - S *hexutil.Big `json:"s"` -} - -// rlpEncodableTransaction transaction struct used for rlp encoding -type rlpEncodableTransaction struct { - Hash Hash - Nonce *big.Int - BlockHash *Hash - TransactionIndex *hexutil.Uint64 - From Address - To *Address `rlp:"nil"` - Value *big.Int - GasPrice *big.Int - Gas *big.Int - ContractCreated *Address `rlp:"nil"` // nil means contract creation - Data string - StorageLimit *big.Int - EpochHeight *big.Int - ChainID *big.Int - Status *hexutil.Uint64 - - //signature - V *big.Int - R *big.Int - S *big.Int -} - -// EncodeRLP implements the rlp.Encoder interface. -func (tx Transaction) EncodeRLP(w io.Writer) error { - rtx := rlpEncodableTransaction{ - tx.Hash, tx.Nonce.ToInt(), tx.BlockHash, tx.TransactionIndex, tx.From, tx.To, - tx.Value.ToInt(), tx.GasPrice.ToInt(), tx.Gas.ToInt(), tx.ContractCreated, tx.Data, - tx.StorageLimit.ToInt(), tx.EpochHeight.ToInt(), tx.ChainID.ToInt(), tx.Status, - tx.V.ToInt(), tx.R.ToInt(), tx.S.ToInt(), - } - - return rlp.Encode(w, rtx) -} - -// DecodeRLP implements the rlp.Decoder interface. -func (tx *Transaction) DecodeRLP(r *rlp.Stream) error { - var rtx rlpEncodableTransaction - if err := r.Decode(&rtx); err != nil { - return err - } - - tx.Hash, tx.Nonce, tx.BlockHash = rtx.Hash, (*hexutil.Big)(rtx.Nonce), rtx.BlockHash - tx.TransactionIndex, tx.From, tx.To = rtx.TransactionIndex, rtx.From, rtx.To - tx.Value, tx.GasPrice = (*hexutil.Big)(rtx.Value), (*hexutil.Big)(rtx.GasPrice) - tx.Gas, tx.ContractCreated, tx.Data = (*hexutil.Big)(rtx.Gas), rtx.ContractCreated, rtx.Data - tx.StorageLimit, tx.EpochHeight = (*hexutil.Big)(rtx.StorageLimit), (*hexutil.Big)(rtx.EpochHeight) - tx.ChainID, tx.Status, tx.V = (*hexutil.Big)(rtx.ChainID), rtx.Status, (*hexutil.Big)(rtx.V) - tx.R, tx.S = (*hexutil.Big)(rtx.R), (*hexutil.Big)(rtx.S) - - return nil -} - -// TransactionReceipt represents the transaction execution result in Conflux. -// it is the response from conflux node when sending rpc request, such as cfx_getTransactionReceipt -type TransactionReceipt struct { - TransactionHash Hash `json:"transactionHash"` - Index hexutil.Uint64 `json:"index"` - BlockHash Hash `json:"blockHash"` - EpochNumber *hexutil.Uint64 `json:"epochNumber"` - From Address `json:"from"` - To *Address `json:"to"` - GasUsed *hexutil.Big `json:"gasUsed"` - AccumulatedGasUsed *hexutil.Big `json:"accumulatedGasUsed,omitempty"` - GasFee *hexutil.Big `json:"gasFee"` - ContractCreated *Address `json:"contractCreated"` - Logs []Log `json:"logs"` - LogsBloom Bloom `json:"logsBloom"` - StateRoot Hash `json:"stateRoot"` - OutcomeStatus hexutil.Uint64 `json:"outcomeStatus"` - TxExecErrorMsg *string `json:"txExecErrorMsg"` - // Whether gas costs were covered by the sponsor. - GasCoveredBySponsor bool `json:"gasCoveredBySponsor"` - // Whether storage costs were covered by the sponsor. - StorageCoveredBySponsor bool `json:"storageCoveredBySponsor"` - // The amount of storage collateralized by the sender. - StorageCollateralized hexutil.Uint64 `json:"storageCollateralized"` - // Storage collaterals released during the execution of the transaction. - StorageReleased []StorageChange `json:"storageReleased"` - Space *SpaceType `json:"space,omitempty"` -} - -func (r *TransactionReceipt) GetOutcomeType() (TransactionOutcome, error) { - switch *r.Space { - case SPACE_NATIVE: - outcome := NativeSpaceOutcome(r.OutcomeStatus) - switch outcome { - case NATIVE_SPACE_SUCCESS: - return TRANSACTION_OUTCOME_SUCCESS, nil - case NATIVE_SPACE_EXCEPTION_WITH_NONCE_BUMPING: - return TRANSACTION_OUTCOME_FAILURE, nil - case NATIVE_SPACE_EXCEPTION_WITHOUT_NONCE_BUMPING: - return TRANSACTION_OUTCOME_SKIPPED, nil - } - case SPACE_EVM: - outcome := EvmSpaceOutcome(r.OutcomeStatus) - switch outcome { - case EVM_SPACE_SUCCESS: - return TRANSACTION_OUTCOME_SUCCESS, nil - case EVM_SPACE_FAIL: - return TRANSACTION_OUTCOME_FAILURE, nil - case EVM_SPACE_SKIPPED: - return TRANSACTION_OUTCOME_SKIPPED, nil - } - default: - return TransactionOutcome(0xff), errors.New("unknown space") - } - return TransactionOutcome(0xff), errors.New("unknown outcome status") -} - -func (r *TransactionReceipt) MustGetOutcomeType() TransactionOutcome { - result, err := r.GetOutcomeType() - if err != nil { - panic(err) - } - return result -} - -// StorageChange represents storage change information of the address -type StorageChange struct { - Address Address `json:"address"` - /// Number of storage collateral units to deposit / refund (absolute value). - Collaterals hexutil.Uint64 `json:"collaterals"` -} - -// rlpEncodableTransactionReceipt transaction receipt struct used for rlp encoding -type rlpEncodableTransactionReceipt struct { - TransactionHash Hash - Index hexutil.Uint64 - BlockHash Hash - EpochNumber *hexutil.Uint64 - From Address - To *Address `rlp:"nil"` - GasUsed *big.Int - GasFee *big.Int - ContractCreated *Address `rlp:"nil"` // nil means contract creation - Logs []Log - LogsBloom Bloom - StateRoot Hash - OutcomeStatus hexutil.Uint64 - TxExecErrorMsg *string `rlp:"nil"` - // Whether gas costs were covered by the sponsor. - GasCoveredBySponsor bool - // Whether storage costs were covered by the sponsor. - StorageCoveredBySponsor bool - // The amount of storage collateralized by the sender. - StorageCollateralized hexutil.Uint64 - // Storage collaterals released during the execution of the transaction. - StorageReleased []StorageChange -} - -// EncodeRLP implements the rlp.Encoder interface. -func (tr TransactionReceipt) EncodeRLP(w io.Writer) error { - rtx := rlpEncodableTransactionReceipt{ - tr.TransactionHash, tr.Index, tr.BlockHash, tr.EpochNumber, tr.From, tr.To, - tr.GasUsed.ToInt(), tr.GasFee.ToInt(), tr.ContractCreated, tr.Logs, tr.LogsBloom, - tr.StateRoot, tr.OutcomeStatus, tr.TxExecErrorMsg, tr.GasCoveredBySponsor, - tr.StorageCoveredBySponsor, tr.StorageCollateralized, tr.StorageReleased, - } - - return rlp.Encode(w, rtx) -} - -// DecodeRLP implements the rlp.Decoder interface. -func (tr *TransactionReceipt) DecodeRLP(r *rlp.Stream) error { - var rtr rlpEncodableTransactionReceipt - if err := r.Decode(&rtr); err != nil { - return err - } - - tr.TransactionHash, tr.Index, tr.BlockHash = rtr.TransactionHash, rtr.Index, rtr.BlockHash - tr.EpochNumber, tr.From, tr.To = rtr.EpochNumber, rtr.From, rtr.To - tr.GasUsed, tr.GasFee = (*hexutil.Big)(rtr.GasUsed), (*hexutil.Big)(rtr.GasFee) - tr.ContractCreated, tr.Logs, tr.LogsBloom = rtr.ContractCreated, rtr.Logs, rtr.LogsBloom - tr.StateRoot, tr.OutcomeStatus, tr.TxExecErrorMsg = rtr.StateRoot, rtr.OutcomeStatus, rtr.TxExecErrorMsg - tr.GasCoveredBySponsor, tr.StorageCoveredBySponsor = rtr.GasCoveredBySponsor, rtr.StorageCoveredBySponsor - tr.StorageCollateralized, tr.StorageReleased = rtr.StorageCollateralized, rtr.StorageReleased - - return nil -} - -type AccountPendingTransactions struct { - PendingTransactions []Transaction `json:"pendingTransactions"` - // type maybe string/Pending - FirstTxStatus *TransactionStatus `json:"firstTxStatus"` - PendingCount hexutil.Uint64 `json:"pendingCount"` -} - -type PendingReason string - -const ( - PENDING_REASON_FUTURE_NONCE PendingReason = "futureNonce" - PENDING_REASON_NOT_ENOUGH_CASH PendingReason = "notEnoughCash" - PENDING_REASON_OLD_EPOCH_HEIGHT PendingReason = "oldEpochHeight" - PENDING_REASON_OUTDATED_STATUS PendingReason = "outdatedStatus" -) - -type pending struct { - PendingReason PendingReason `json:"pending"` -} - -type TransactionStatus struct { - packedOrReady string - pending pending -} - -func (ts TransactionStatus) String() string { - if ts.packedOrReady != "" { - return ts.packedOrReady - } - if (ts.pending != pending{}) { - return string(ts.pending.PendingReason) - } - return "" -} - -func (ts TransactionStatus) MarshalJSON() ([]byte, error) { - if ts.packedOrReady != "" { - return json.Marshal(ts.packedOrReady) - } - if (ts.pending != pending{}) { - return json.Marshal(ts.pending) - } - return []byte{}, nil -} - -func (ts *TransactionStatus) UnmarshalJSON(data []byte) error { - if string(data) == "null" { - return nil - } - - var pendingreason pending - if err := json.Unmarshal(data, &pendingreason); err == nil { - ts.pending = pendingreason - return nil - } - - var tmp string - if err := json.Unmarshal(data, &tmp); err == nil { - ts.packedOrReady = tmp - return nil - } - - return errors.Errorf("failed to json unmarshal %v to TransactionStatus", string(data)) -} - -func (ts *TransactionStatus) IsPending() (bool, PendingReason) { - return ts.pending != pending{}, ts.pending.PendingReason -} diff --git a/internal/conflux/types/types.go b/internal/conflux/types/types.go deleted file mode 100644 index 9f58adfc..00000000 --- a/internal/conflux/types/types.go +++ /dev/null @@ -1,74 +0,0 @@ -package types - -import ( - "encoding/json" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "math/big" -) - -type Hash string - -// ToCommonHash converts hash to common.Hash -func (hash Hash) ToCommonHash() *common.Hash { - newHash := common.HexToHash(string(hash)) - return &newHash -} - -// String implements the interface stringer -func (hash Hash) String() string { - return string(hash) -} - -func (hash *Hash) UnmarshalJSON(input []byte) error { - var h common.Hash - if err := json.Unmarshal(input, &h); err != nil { - return err - } - *hash = Hash(h.String()) - return nil -} - -// Bloom is a hash type with 256 bytes. -type Bloom string - -type NonceType int - -const ( - NONCE_TYPE_AUTO NonceType = iota - NONCE_TYPE_NONCE - NONCE_TYPE_PENDING_NONCE -) - -// NewBigInt creates a big number with specified uint64 value. -func NewBigInt(x uint64) *hexutil.Big { - n1 := new(big.Int).SetUint64(x) - n2 := hexutil.Big(*n1) - return &n2 -} - -// NewBigIntByRaw creates a hexutil.big with specified big.int value. -func NewBigIntByRaw(x *big.Int) *hexutil.Big { - if x == nil { - return nil - } - v := hexutil.Big(*x) - return &v -} - -// NewUint64 creates a hexutil.Uint64 with specified uint64 value. -func NewUint64(x uint64) *hexutil.Uint64 { - n1 := hexutil.Uint64(x) - return &n1 -} - -// NewUint creates a hexutil.Uint with specified uint value. -func NewUint(x uint) *hexutil.Uint { - n1 := hexutil.Uint(x) - return &n1 -} - -// NewBytes creates a hexutil.Bytes with specified input value. -func NewBytes(input []byte) hexutil.Bytes { - return hexutil.Bytes(input) -} diff --git a/internal/conflux/types/version_bytes.go b/internal/conflux/types/version_bytes.go deleted file mode 100644 index 6958c80b..00000000 --- a/internal/conflux/types/version_bytes.go +++ /dev/null @@ -1,52 +0,0 @@ -package types - -import "github.com/pkg/errors" - -type VersionByte struct { - TypeBits uint8 - // current is constant 0, it's different with AddressType defined in address_type.go - AddressType uint8 - SizeBits uint8 -} - -var ( - hashSizeToBits map[uint]uint8 = make(map[uint]uint8) -) - -func init() { - hashSizeToBits[160] = 0 - hashSizeToBits[192] = 1 - hashSizeToBits[224] = 2 - hashSizeToBits[256] = 3 - hashSizeToBits[320] = 4 - hashSizeToBits[384] = 5 - hashSizeToBits[448] = 6 - hashSizeToBits[512] = 7 -} - -// ToByte returns byte -func (v VersionByte) ToByte() (byte, error) { - ret := v.TypeBits & 0x80 - ret = ret | v.AddressType<<3 - ret = ret | v.SizeBits - return ret, nil -} - -// NewVersionByte creates version byte by byte -func NewVersionByte(b byte) (vt VersionByte) { - vt.TypeBits = b >> 7 - vt.AddressType = (b & 0x7f) >> 3 - vt.SizeBits = b & 0x0f - return -} - -func CalcVersionByte(hexAddress []byte) (versionByte VersionByte, err error) { - versionByte.TypeBits = 0 - versionByte.AddressType = 0 - addrBitsLen := uint(len(hexAddress) * 8) - versionByte.SizeBits = hashSizeToBits[addrBitsLen] - if versionByte.SizeBits == 0 && addrBitsLen != 160 { - return versionByte, errors.Errorf("Invalid hash size %v", addrBitsLen) - } - return -} diff --git a/internal/constant/const.go b/internal/constant/const.go deleted file mode 100644 index ed6aa647..00000000 --- a/internal/constant/const.go +++ /dev/null @@ -1,168 +0,0 @@ -package constant - -import ( - "errors" - "time" - - "github.com/ethereum/go-ethereum/common" -) - -const ( - TxRetryInterval = time.Second * 5 // TxRetryInterval Time between retrying a failed tx - ThirtySecondInterval = time.Second * 30 -) - -var ( - ErrNonceTooLow = errors.New("nonce too low") - ErrUnWantedSync = errors.New("unwanted Sync") -) - -var ( - BlockRetryInterval = time.Second * 3 - QueryRetryInterval = time.Second * 5 - MaintainerInterval = time.Second * 3 - MessengerInterval = time.Second * 1 - BalanceRetryInterval = time.Second * 60 -) - -var ( - ZeroAddress = common.HexToAddress("0x0000000000000000000000000000000000000000") -) - -var IgnoreError = map[string]struct{}{ - "order exist": {}, - "Header is have": {}, - "header is have": {}, - "height error": {}, - "invalid start block": {}, - "invalid syncing block": {}, - "initialized or unknown epoch": {}, - "no need to update exe headers": {}, - "New block must have higher height": {}, - "round mismatch": {}, - "epoch mismatch": {}, - "headers size too big": {}, - "Height error": {}, - "Update height0 error": {}, - "invalid end exe header number": {}, - "the update finalized slot should be higher than the finalized slot": {}, - "previous exe block headers should be updated before update light client": {}, - "REVERT opcode executed": {}, - "Validators repetition add": {}, - "oracle: already update": {}, - "already verified": {}, - "0x6838b56d": {}, //already_meet() - "0x8bc9d07c": {}, //already_proposal() - "0x98087555": {}, // order exist - "already in use": {}, // solana order exist -} - -type BlockIdOfEth2 string - -const ( - FinalBlockIdOfEth2 BlockIdOfEth2 = "finalized" - HeadBlockIdOfEth2 BlockIdOfEth2 = "head" -) - -const ( - SlotsPerEpoch int64 = 32 - EpochsPerPeriod int64 = 256 -) - -const ( - ProofTypeOfOrigin = iota + 1 - ProofTypeOfZk - ProofTypeOfOracle - ProofTypeOfNewOracle - ProofTypeOfLogOracle -) - -const ( - LegacyTxType = iota - AccessListTxType = 0x01 - DynamicFeeTxType = 0x02 - BlobTxType = 0x03 - SetCodeTxType = 0x04 -) - -var ( - ReceiptStatusFailedRLP = []byte{} - ReceiptStatusSuccessfulRLP = []byte{0x01} -) - -const ( - ReceiptStatusFailed = uint64(0) -) - -const ( - MerlinChainId = 4200 - BscChainId = 56 - MapChainId = 22776 - CfxChainId = 1030 - ZkSyncChainId = 324 - OpChainId = 10 - BaseChainId = 8453 - BlastChainId = 81457 - ArbChainId = 421614 - ArbTestnetChainId = 42161 - MantleChainId = 5000 - ScrollChainId = 534352 - DodoChainId = 53457 - TronChainId = 728126428 - SolTestChainId = 1360108768460811 - SolMainChainId = 1360108768460801 - NearChainId = 1360100178526209 - TonChainId = 1360104473493506 - BtcChainId = 1360095883558913 -) - -const ( - ReqInterval = int64(3) -) -const ( - ProjectOfMsger = int64(1) - ProjectOfOther = int64(7) - ProjectOfOracle = int64(8) -) -const ( - FilterUrl = "v1/mos/list" - FilterBlockUrl = "v1/block" - FilterBtcLogUrl = "api/v1/logs" -) - -const ( - FeeRentType = "fee.io" -) - -const ( - Bsc = "bsc" - Conflux = "conflux" - Eth2 = "eth2" - Ethereum = "ethereum" - Klaytn = "klaytn" - Matic = "matic" - Near = "near" - Solana = "sol" - Ton = "ton" - Tron = "tron" - Btc = "btc" -) - -// 0: init,2: relay failed,3: relay finish, 4: swap failed, 5: det chain mos failed -const ( - StatusOfInit = iota - StatusOfUnKnow - StatusOfRelayFailed - StatusOfRelayFinish - StatusOfSwapFailed - StatusOfDesFailed -) - -const ( - ProofTypeOfContract = iota + 1 -) - -const ( - TokenLongAddressOfBtc = "0x0000000000000000000000000000000000425443" - TokenShortAddressOfBtc = "0x425443" -) diff --git a/internal/constant/events.go b/internal/constant/events.go deleted file mode 100644 index 87dda1cd..00000000 --- a/internal/constant/events.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2021 Compass Systems -// SPDX-License-Identifier: LGPL-3.0-only - -package constant - -import ( - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" -) - -type EventSig string - -func (es EventSig) GetTopic() common.Hash { - return crypto.Keccak256Hash([]byte(es)) -} diff --git a/internal/contract/validate.go b/internal/contract/validate.go deleted file mode 100644 index bcbc0c63..00000000 --- a/internal/contract/validate.go +++ /dev/null @@ -1,62 +0,0 @@ -package contract - -import ( - "fmt" - "github.com/ethereum/go-ethereum/common" - "github.com/mapprotocol/compass/internal/mapprotocol" - "github.com/mapprotocol/compass/pkg/contract" - "math/big" -) - -type Validator interface { - Validate(param *SwapDataValidator) (bool, error) -} - -type validator struct { - c *contract.Call -} - -func NewValidator(c *contract.Call) Validator { - return &validator{c: c} -} - -var defaultValidator Validator - -func InitDefaultValidator(c *contract.Call) { - defaultValidator = &validator{c: c} -} - -type SwapDataValidator struct { - Relay bool - DstChain *big.Int - DstToken []byte - DstReceiver []byte - DstMinAmount *big.Int - SwapData []byte -} - -func (v *validator) Validate(param *SwapDataValidator) (bool, error) { - var ret bool - err := v.c.Call(mapprotocol.MethodOfValidate, &ret, 0, param) - if err != nil { - return false, err - } - return ret, nil -} - -func Validate(relay bool, dstChain, dstMinAmount *big.Int, dstToken, dstReceiver, swapData []byte) (bool, error) { - fmt.Println("relay ", relay) - fmt.Println("dstChain ", dstChain) - fmt.Println("dstMinAmount ", dstMinAmount) - fmt.Println("dstToken ", common.Bytes2Hex(dstToken)) - fmt.Println("dstReceiver ", common.Bytes2Hex(dstReceiver)) - fmt.Println("swapData ", common.Bytes2Hex(swapData)) - return defaultValidator.Validate(&SwapDataValidator{ - Relay: relay, - DstChain: dstChain, - DstToken: dstToken, - DstReceiver: dstReceiver, - DstMinAmount: dstMinAmount, - SwapData: swapData, - }) -} diff --git a/internal/eth2/client.go b/internal/eth2/client.go deleted file mode 100644 index 65e80e6e..00000000 --- a/internal/eth2/client.go +++ /dev/null @@ -1,192 +0,0 @@ -package eth2 - -import ( - "context" - "encoding/json" - "errors" - "fmt" - "io" - "net/http" - "net/url" - "reflect" - "strconv" - "sync" - "sync/atomic" - "time" - - "github.com/mapprotocol/compass/internal/constant" -) - -const ( - contentType = "application/json" - vsn = "2.0" -) - -var ErrNoResult = errors.New("no result in JSON-RPC response") - -type Client struct { - client *http.Client - endpoint string - closeOnce sync.Once - closch chan interface{} - mu sync.Mutex // protcts headers - headers http.Header - isHttp bool - idCounter uint32 -} - -func DialHttp(endpoint string) (*Client, error) { - // Sanity chck URL so we don't end up with a client that will fail every request. - _, err := url.Parse(endpoint) - if err != nil { - return nil, err - } - - headers := make(http.Header, 2) - headers.Set("accept", contentType) - headers.Set("content-type", contentType) - client := &http.Client{ - Timeout: time.Second * 10, - } - return &Client{ - client: client, - endpoint: endpoint, - closeOnce: sync.Once{}, - closch: make(chan interface{}), - mu: sync.Mutex{}, - headers: headers, - }, nil -} - -func (c *Client) BeaconHeaders(ctx context.Context, blockId constant.BlockIdOfEth2) (*BeaconHeadersResp, error) { - urlPath := fmt.Sprintf("%s/%s/%s", c.endpoint, "eth/v1/beacon/headers", blockId) - var ret BeaconHeadersResp - err := c.CallContext(ctx, urlPath, &ret) - if err != nil { - return nil, err - } - return &ret, nil -} - -func (c *Client) LightClientUpdate(ctx context.Context, startPeriod uint64) (*LightClientUpdatesResp, error) { - urlPath := fmt.Sprintf("%s/%s?start_period=%d&count=1", c.endpoint, "eth/v1/beacon/light_client/updates", startPeriod) - respBody, err := c.doRequest(ctx, urlPath) - if err != nil { - return nil, err - } - defer respBody.Close() - var respMsg []CommonData - if err = json.NewDecoder(respBody).Decode(&respMsg); err != nil { - return nil, err - } - var ret LightClientUpdatesResp - data, _ := json.Marshal(respMsg[0]) - err = json.Unmarshal(data, &ret) - if err != nil { - return nil, err - } - return &ret, nil -} - -func (c *Client) FinallyUpdate(ctx context.Context) (*FinalityUpdateResp, error) { - urlPath := fmt.Sprintf("%s/%s", c.endpoint, "eth/v1/beacon/light_client/finality_update") - var ret FinalityUpdateResp - err := c.CallContext(ctx, urlPath, &ret) - if err != nil { - return nil, err - } - return &ret, nil -} - -func (c *Client) GetBlocks(ctx context.Context, blockId string) (*BlocksResp, error) { - urlPath := fmt.Sprintf("%s/%s/%s", c.endpoint, "eth/v2/beacon/blocks", blockId) - var ret BlocksResp - err := c.CallContext(ctx, urlPath, &ret) - if err != nil { - return nil, err - } - return &ret, nil -} - -type requestOp struct { - ids []json.RawMessage - err error - resp chan *CommonData // receives up to len(ids) responses -} - -func (op *requestOp) wait(ctx context.Context) (*CommonData, error) { - select { - case <-ctx.Done(): - return nil, ctx.Err() - case resp := <-op.resp: - return resp, op.err - } -} - -func (c *Client) CallContext(ctx context.Context, url string, result interface{}) error { - if result != nil && reflect.TypeOf(result).Kind() != reflect.Ptr { - return fmt.Errorf("call result parameter must be pointer or nil interface: %v", result) - } - - op := &requestOp{ids: []json.RawMessage{c.nextID()}, resp: make(chan *CommonData, 1)} - - err := c.sendHTTP(ctx, url, op) - if err != nil { - return err - } - - // dispatch has accepted the request and will close the channel when it quits. - switch resp, err := op.wait(ctx); { - case err != nil: - return err - case resp.StatusCode == 404: - return ErrNoResult - case resp.Error != "": - return errors.New(resp.Error) - default: - data, _ := json.Marshal(resp) - return json.Unmarshal(data, &result) - } -} - -func (c *Client) nextID() json.RawMessage { - id := atomic.AddUint32(&c.idCounter, 1) - return strconv.AppendUint(nil, uint64(id), 10) -} - -func (c *Client) sendHTTP(ctx context.Context, url string, op *requestOp) error { - respBody, err := c.doRequest(ctx, url) - if err != nil { - return err - } - defer respBody.Close() - - var respMsg CommonData - if err = json.NewDecoder(respBody).Decode(&respMsg); err != nil { - return err - } - op.resp <- &respMsg - return nil -} - -func (c *Client) doRequest(ctx context.Context, url string) (io.ReadCloser, error) { - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) - if err != nil { - return nil, err - } - - // set headers - c.mu.Lock() - req.Header = c.headers.Clone() - c.mu.Unlock() - - // do request - resp, err := c.client.Do(req) - if err != nil { - return nil, err - } - if resp.StatusCode < 200 || resp.StatusCode >= 300 { - return nil, fmt.Errorf("eth2 doRequest failed, code %v", resp.StatusCode) - } - return resp.Body, nil -} diff --git a/internal/eth2/eth.go b/internal/eth2/eth.go deleted file mode 100644 index 01387272..00000000 --- a/internal/eth2/eth.go +++ /dev/null @@ -1,42 +0,0 @@ -package eth2 - -import ( - "bytes" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/rlp" - "github.com/mapprotocol/compass/internal/constant" - "github.com/mapprotocol/compass/internal/proof" -) - -type Receipt struct { - *types.Receipt -} - -func (r *Receipt) statusEncoding() []byte { - if len(r.PostState) == 0 { - if r.Status == constant.ReceiptStatusFailed { - return constant.ReceiptStatusFailedRLP - } - return constant.ReceiptStatusSuccessfulRLP - } - return r.PostState -} - -type Receipts []*Receipt - -func (rs Receipts) Len() int { return len(rs) } - -func (rs Receipts) EncodeIndex(i int, w *bytes.Buffer) { - r := rs[i] - data := &proof.ReceiptRLP{PostStateOrStatus: r.statusEncoding(), CumulativeGasUsed: r.CumulativeGasUsed, Bloom: r.Bloom, Logs: r.Logs} - if r.Type == constant.LegacyTxType { - rlp.Encode(w, data) - return - } - w.WriteByte(r.Type) - switch r.Type { - case constant.AccessListTxType, constant.DynamicFeeTxType, constant.BlobTxType, constant.SetCodeTxType: - rlp.Encode(w, data) - default: - } -} diff --git a/internal/eth2/proof.go b/internal/eth2/proof.go deleted file mode 100644 index 9fb13884..00000000 --- a/internal/eth2/proof.go +++ /dev/null @@ -1,126 +0,0 @@ -package eth2 - -import ( - "github.com/mapprotocol/compass/internal/mapprotocol" - "github.com/mapprotocol/compass/pkg/msg" - "math/big" - "os" - "os/exec" - "path/filepath" - "strings" - - log "github.com/ChainSafe/log15" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/rlp" - maptypes "github.com/mapprotocol/atlas/core/types" - "github.com/mapprotocol/compass/internal/constant" - "github.com/mapprotocol/compass/internal/mapo" - "github.com/mapprotocol/compass/internal/proof" - "github.com/pkg/errors" -) - -var execPath = "./eth2-proof" - -func init() { - if filepath.Dir(os.Args[0]) == "." { - return - } - execPath = filepath.Join(filepath.Dir(os.Args[0]), "eth2-proof") -} - -func Generate(slot, endpoint string) ([][32]byte, string, string, error) { - c := exec.Command(execPath, "generate", "--slot", slot, "--endpoint", endpoint) - log.Info("eth exec", "path", execPath, "cmd", c.String()) - subOutPut, err := c.CombinedOutput() - if err != nil { - return nil, "", "", errors.Wrap(err, "command exec failed") - } - - outPuts := strings.Split(string(subOutPut), "\n") - ret := make([][32]byte, 0, len(outPuts)) - var txRoot, wdRoot string - for _, op := range outPuts { - if strings.HasPrefix(op, "0x") { - ret = append(ret, common.HexToHash(op)) - } else if strings.HasPrefix(op, "txRoot") { - txRoot = strings.TrimSpace(strings.TrimPrefix(op, "txRoot")) - } else if strings.HasPrefix(op, "wdRoot") { - wdRoot = strings.TrimSpace(strings.TrimPrefix(op, "wdRoot")) - } - } - - return ret, txRoot, wdRoot, nil -} - -func GenerateByApi(slot []string) [][32]byte { - ret := make([][32]byte, 0, len(slot)) - for _, op := range slot { - ret = append(ret, common.HexToHash(op)) - } - - return ret -} - -type ReceiptProof struct { - Header BlockHeader - TxReceipt mapprotocol.TxReceipt - KeyIndex []byte - Proof [][]byte -} - -func AssembleProof(header BlockHeader, log *types.Log, receipts []*types.Receipt, method string, fId msg.ChainId, - proofType int64, sign [][]byte, orderId [32]byte) ([]byte, error) { - txIndex := log.TxIndex - receipt, err := mapprotocol.GetTxReceipt(receipts[txIndex]) - if err != nil { - return nil, err - } - pr := Receipts{} - for _, r := range receipts { - pr = append(pr, &Receipt{Receipt: r}) - } - prf, err := proof.Get(pr, txIndex) - if err != nil { - return nil, err - } - var key []byte - key = rlp.AppendUint64(key[:0], uint64(txIndex)) - - idx := 0 - for i, ele := range receipts[txIndex].Logs { - if ele.Index != log.Index { - continue - } - idx = i - } - - var pack []byte - switch proofType { - case constant.ProofTypeOfOrigin: - ek := mapo.Key2Hex(key, len(prf)) - pd := ReceiptProof{ - Header: header, - TxReceipt: *receipt, - KeyIndex: ek, - Proof: prf, - } - pack, err = proof.V3Pack(fId, method, mapprotocol.Eth2, idx, orderId, false, pd) - case constant.ProofTypeOfZk: - case constant.ProofTypeOfOracle: - pack, err = proof.Oracle(header.Number.Uint64(), receipt, key, prf, fId, method, idx, - mapprotocol.ProofAbi, orderId, false) - case constant.ProofTypeOfNewOracle: - fallthrough - case constant.ProofTypeOfLogOracle: - pack, err = proof.SignOracle(&maptypes.Header{ - ReceiptHash: header.ReceiptsRoot, - Number: big.NewInt(int64(log.BlockNumber)), - }, receipt, key, prf, fId, idx, method, sign, orderId, log, proofType) - } - - if err != nil { - return nil, err - } - return pack, nil -} diff --git a/internal/eth2/resp.go b/internal/eth2/resp.go deleted file mode 100644 index b0e2983f..00000000 --- a/internal/eth2/resp.go +++ /dev/null @@ -1,187 +0,0 @@ -package eth2 - -type CommonData struct { - StatusCode int `json:"statusCode"` - Error string `json:"error"` - Message string `json:"message"` - Data interface{} `json:"data"` - ExecutionOptimistic bool `json:"execution_optimistic"` - Version string `json:"version"` -} - -type CommonDataArray struct { - data []CommonData -} - -type BeaconHeadersResp struct { - Data BeaconHeadersData `json:"data"` - ExecutionOptimistic bool `json:"execution_optimistic"` -} - -type FinalityUpdateResp struct { - Data FinalityUpdateData `json:"data"` - Version string `json:"version"` -} - -type BlocksResp struct { - Data BlockData `json:"data"` - ExecutionOptimistic bool `json:"execution_optimistic"` -} - -type LightClientUpdatesResp struct { - Data LightClientUpdatesData `json:"data"` - Version string `json:"version"` -} - -type Message struct { - Slot string `json:"slot"` - ProposerIndex string `json:"proposer_index"` - ParentRoot string `json:"parent_root"` - StateRoot string `json:"state_root"` - BodyRoot string `json:"body_root"` -} - -type Header struct { - Message Message `json:"message"` - Signature string `json:"signature"` -} - -type BeaconHeadersData struct { - Root string `json:"root"` - Canonical bool `json:"canonical"` - Header Header `json:"header"` -} - -type AttestedHeader struct { - Beacon Beacon `json:"beacon"` - Execution Execution `json:"execution"` - ExecutionBranch []string `json:"execution_branch"` -} - -type FinalizedHeader struct { - Beacon Beacon `json:"beacon"` - Execution Execution `json:"execution"` - ExecutionBranch []string `json:"execution_branch"` -} - -type SyncAggregate struct { - SyncCommitteeBits string `json:"sync_committee_bits"` - SyncCommitteeSignature string `json:"sync_committee_signature"` -} - -type FinalityUpdateData struct { - AttestedHeader NewAttestedHeader `json:"attested_header"` - FinalizedHeader NewFinalizedHeader `json:"finalized_header"` - FinalityBranch []string `json:"finality_branch"` - SyncAggregate SyncAggregate `json:"sync_aggregate"` - SignatureSlot string `json:"signature_slot"` -} - -type Eth1Data struct { - DepositRoot string `json:"deposit_root"` - DepositCount string `json:"deposit_count"` - BlockHash string `json:"block_hash"` -} - -type Source struct { - Epoch string `json:"epoch"` - Root string `json:"root"` -} - -type Target struct { - Epoch string `json:"epoch"` - Root string `json:"root"` -} - -type Attestations struct { - AggregationBits string `json:"aggregation_bits"` - Data AttestationData `json:"data"` - Signature string `json:"signature"` -} - -type Body struct { - RandaoReveal string `json:"randao_reveal"` - Eth1Data Eth1Data `json:"eth1_data"` - Graffiti string `json:"graffiti"` - ProposerSlashings []interface{} `json:"proposer_slashings"` - AttesterSlashings []interface{} `json:"attester_slashings"` - Attestations []Attestations `json:"attestations"` - Deposits []interface{} `json:"deposits"` - VoluntaryExits []interface{} `json:"voluntary_exits"` - SyncAggregate SyncAggregate `json:"sync_aggregate"` - ExecutionPayload Execution `json:"execution_payload"` -} - -type BlocksMessage struct { - Slot string `json:"slot"` - ProposerIndex string `json:"proposer_index"` - ParentRoot string `json:"parent_root"` - StateRoot string `json:"state_root"` - Body Body `json:"body"` -} - -type BlockData struct { - Message BlocksMessage `json:"message"` - Signature string `json:"signature"` -} - -type NextSyncCommittee struct { - Pubkeys []string `json:"pubkeys"` - AggregatePubkey string `json:"aggregate_pubkey"` -} - -type LightClientUpdatesData struct { - AttestedHeader NewAttestedHeader `json:"attested_header"` - NextSyncCommittee NextSyncCommittee `json:"next_sync_committee"` - NextSyncCommitteeBranch []string `json:"next_sync_committee_branch"` - FinalizedHeader NewFinalizedHeader `json:"finalized_header"` - FinalityBranch []string `json:"finality_branch"` - SyncAggregate SyncAggregate `json:"sync_aggregate"` - SignatureSlot string `json:"signature_slot"` -} - -type NewAttestedHeader struct { - Beacon Beacon `json:"beacon"` - Execution Execution `json:"execution"` - ExecutionBranch []string `json:"execution_branch"` -} - -type Beacon struct { - Slot string `json:"slot"` - ProposerIndex string `json:"proposer_index"` - ParentRoot string `json:"parent_root"` - StateRoot string `json:"state_root"` - BodyRoot string `json:"body_root"` -} - -type Execution struct { - ParentHash string `json:"parent_hash"` - FeeRecipient string `json:"fee_recipient"` - StateRoot string `json:"state_root"` - ReceiptsRoot string `json:"receipts_root"` - LogsBloom string `json:"logs_bloom"` - PrevRandao string `json:"prev_randao"` - BlockNumber string `json:"block_number"` - GasLimit string `json:"gas_limit"` - GasUsed string `json:"gas_used"` - Timestamp string `json:"timestamp"` - ExtraData string `json:"extra_data"` - BaseFeePerGas string `json:"base_fee_per_gas"` - BlockHash string `json:"block_hash"` - TransactionsRoot string `json:"transactions_root"` - WithdrawalsRoot string `json:"withdrawals_root"` -} - -type NewFinalizedHeader struct { - Beacon Beacon `json:"beacon"` - Execution Execution `json:"execution"` - ExecutionBranch []string `json:"execution_branch"` -} - -type AttestationData struct { - BeaconBlockRoot string `json:"beacon_block_root"` - Index string `json:"index"` - Slot string `json:"slot"` - Source Source `json:"source"` - Target Target `json:"target"` -} diff --git a/internal/eth2/struct.go b/internal/eth2/struct.go deleted file mode 100644 index 6275ad0b..00000000 --- a/internal/eth2/struct.go +++ /dev/null @@ -1,146 +0,0 @@ -package eth2 - -import ( - "math/big" - "strings" - - "github.com/mapprotocol/compass/pkg/ethclient" - - "github.com/pkg/errors" - - "github.com/ethereum/go-ethereum/common" -) - -type LightClientUpdate struct { - AttestedHeader BeaconBlockHeader `json:"attested_header"` - SignatureSlot uint64 `json:"signature_slot"` - SyncAggregate ContractSyncAggregate `json:"sync_aggregate"` - NextSyncCommittee ContractSyncCommittee `json:"nextSyncCommittee"` - NextSyncCommitteeBranch [][32]byte `json:"nextSyncCommitteeBranch"` - FinalizedHeader BeaconBlockHeader - FinalityBranch [][32]byte - ExecutionBranch [][32]byte - FinalizedExecution *ContractExecution -} - -type BeaconBlockHeader struct { - Slot uint64 `json:"slot"` - ProposerIndex uint64 `json:"proposer_index"` - ParentRoot [32]byte `json:"parent_root"` // bytes32 - StateRoot [32]byte `json:"state_root"` // bytes32 - BodyRoot [32]byte `json:"body_root"` -} - -type ContractSyncAggregate struct { - SyncCommitteeBits []byte `json:"sync_committee_bits"` - SyncCommitteeSignature []byte `json:"sync_committee_signature"` -} - -type ContractSyncCommittee struct { - Pubkeys []byte // 48 * 512 - AggregatePubkey []byte // 48 -} - -type BlockHeader struct { - ParentHash [32]byte `json:"parent_hash"` - Sha3Uncles [32]byte `json:"sha_3_uncles"` - Miner common.Address `json:"miner"` - StateRoot [32]byte `json:"stateRoot"` - TransactionsRoot [32]byte `json:"transactionsRoot"` - ReceiptsRoot [32]byte `json:"receiptsRoot"` - LogsBloom []byte `json:"logsBloom"` - Difficulty *big.Int `json:"difficulty"` - Number *big.Int `json:"number"` - GasLimit *big.Int `json:"gasLimit"` - GasUsed *big.Int `json:"gasUsed"` - Timestamp *big.Int `json:"timestamp"` - ExtraData []byte `json:"extraData"` - MixHash [32]byte `json:"mixHash"` - Nonce []byte `json:"nonce"` - BaseFeePerGas *big.Int `json:"baseFeePerGas"` - WithdrawalsRoot [32]byte `json:"withdrawalsRoot"` -} - -func ConvertHeader(header *ethclient.Header) *BlockHeader { - withdrawalsRoot := common.HexToHash("0x0000000000000000000000000000000000000000000000000000000000000000") - if header.WithdrawalsHash != "" { - withdrawalsRoot = common.HexToHash(header.WithdrawalsHash) - } - return &BlockHeader{ - ParentHash: header.ParentHash, - Sha3Uncles: header.UncleHash, - Miner: header.Coinbase, - StateRoot: header.Root, - TransactionsRoot: header.TxHash, - ReceiptsRoot: header.ReceiptHash, - LogsBloom: header.Bloom.Bytes(), - Difficulty: header.Difficulty, - Number: header.Number, - GasLimit: new(big.Int).SetUint64(header.GasLimit), - GasUsed: new(big.Int).SetUint64(header.GasUsed), - Timestamp: new(big.Int).SetUint64(header.Time), - ExtraData: header.Extra, - MixHash: header.MixDigest, - Nonce: header.Nonce[:], - BaseFeePerGas: header.BaseFee, - WithdrawalsRoot: withdrawalsRoot, - } -} - -type ContractExecution struct { - ParentHash [32]byte `json:"parent_hash"` - FeeRecipient common.Address `json:"fee_recipient"` - StateRoot [32]byte `json:"state_root"` - ReceiptsRoot [32]byte `json:"receipts_root"` - LogsBloom []byte `json:"logs_bloom"` - PrevRandao [32]byte `json:"prev_randao"` - BlockNumber *big.Int `json:"block_number"` - GasLimit *big.Int `json:"gas_limit"` - GasUsed *big.Int `json:"gas_used"` - Timestamp *big.Int `json:"timestamp"` - ExtraData []byte `json:"extra_data"` - BaseFeePerGas *big.Int `json:"base_fee_per_gas"` - BlockHash [32]byte `json:"block_hash"` - TransactionsRoot [32]byte `json:"transactions_root"` - WithdrawalsRoot [32]byte `json:"withdrawals_root"` -} - -func ConvertExecution(execution *Execution) (*ContractExecution, error) { - blockNumber, ok := big.NewInt(0).SetString(execution.BlockNumber, 10) - if !ok { - return nil, errors.New("execution blockNumber error") - } - gasLimit, ok := big.NewInt(0).SetString(execution.GasLimit, 10) - if !ok { - return nil, errors.New("execution gasLimit error") - } - gasUsed, ok := big.NewInt(0).SetString(execution.GasUsed, 10) - if !ok { - return nil, errors.New("execution gasUsed error") - } - timestamp, ok := big.NewInt(0).SetString(execution.Timestamp, 10) - if !ok { - return nil, errors.New("execution timestamp error") - } - baseFeePerGas, ok := big.NewInt(0).SetString(execution.BaseFeePerGas, 10) - if !ok { - return nil, errors.New("execution baseFeePerGas error") - } - return &ContractExecution{ - ParentHash: common.HexToHash(execution.ParentHash), - FeeRecipient: common.HexToAddress(execution.FeeRecipient), - StateRoot: common.HexToHash(execution.StateRoot), - ReceiptsRoot: common.HexToHash(execution.ReceiptsRoot), - LogsBloom: common.Hex2Bytes(strings.TrimPrefix(execution.LogsBloom, "0x")), - PrevRandao: common.HexToHash(execution.PrevRandao), - BlockNumber: blockNumber, - GasLimit: gasLimit, - GasUsed: gasUsed, - Timestamp: timestamp, - ExtraData: common.Hex2Bytes(strings.TrimPrefix(execution.ExtraData, "0x")), - BaseFeePerGas: baseFeePerGas, - BlockHash: common.HexToHash(execution.BlockHash), - TransactionsRoot: common.HexToHash(execution.TransactionsRoot), - WithdrawalsRoot: common.HexToHash(execution.WithdrawalsRoot), - }, nil -} diff --git a/internal/expose/config.go b/internal/expose/config.go deleted file mode 100644 index be34a9d2..00000000 --- a/internal/expose/config.go +++ /dev/null @@ -1,95 +0,0 @@ -package expose - -import ( - "encoding/json" - "fmt" - "github.com/mapprotocol/compass/config" - "github.com/mapprotocol/compass/internal/constant" - "github.com/urfave/cli/v2" - "os" - "path/filepath" -) - -const ( - DefaultConfigPath = "./config.json" -) - -type Config struct { - Chains []RawChainConfig `json:"chains"` - Other Construction `json:"other,omitempty"` -} - -type RawChainConfig struct { - Name string `json:"name"` - Type string `json:"type"` - Id string `json:"id"` // ChainID - Endpoint string `json:"endpoint"` // url for rpc endpoint - Mcs string `json:"mcs,omitempty"` - OracleNode string `json:"oracleNode,omitempty"` - LightNode string `json:"lightNode,omitempty"` -} - -type Construction struct { - MonitorUrl string `json:"monitor_url,omitempty"` - Env string `json:"env,omitempty"` - Port string `json:"port,omitempty"` - Butter string `json:"butter,omitempty"` - Key string `json:"key,omitempty"` -} - -func (c *Config) validate() error { - for idx, chain := range c.Chains { - if chain.Id == "" { - return fmt.Errorf("required field chain.Id empty for chain %s", chain.Id) - } - if chain.Type == "" { - c.Chains[idx].Type = constant.Ethereum - } - if chain.Name == "" { - return fmt.Errorf("required field chain.Name empty for chain %s", chain.Id) - } - } - return nil -} - -func Local(ctx *cli.Context) (*Config, error) { - var fig Config - path := DefaultConfigPath - if ctx.String(config.ConfigFileFlag.Name) != "" { - path = ctx.String(config.ConfigFileFlag.Name) - } - - err := loadConfig(path, &fig) - if err != nil { - return &fig, err - } - - err = fig.validate() - if err != nil { - return nil, err - } - return &fig, nil -} - -func loadConfig(file string, config *Config) error { - ext := filepath.Ext(file) - fp, err := filepath.Abs(file) - if err != nil { - return err - } - - f, err := os.Open(filepath.Clean(fp)) - if err != nil { - return err - } - - if ext == ".json" { - if err = json.NewDecoder(f).Decode(&config); err != nil { - return err - } - } else { - return fmt.Errorf("unrecognized extention: %s", ext) - } - - return nil -} diff --git a/internal/expose/handler/proof.go b/internal/expose/handler/proof.go deleted file mode 100644 index 84a47598..00000000 --- a/internal/expose/handler/proof.go +++ /dev/null @@ -1,52 +0,0 @@ -package handler - -import ( - "crypto/ecdsa" - "github.com/gin-gonic/gin" - "github.com/mapprotocol/compass/internal/expose" - "github.com/mapprotocol/compass/internal/expose/service" - "github.com/mapprotocol/compass/internal/stream" - "net/http" -) - -type Expose struct { - cfg *expose.Config - proofSrv *service.ProofSrv -} - -func New(cfg *expose.Config, pri *ecdsa.PrivateKey) *Expose { - return &Expose{proofSrv: service.NewProof(cfg, pri), cfg: cfg} -} - -func (e *Expose) TxExec(c *gin.Context) { - var req stream.TxExecOfRequest - if err := c.Bind(&req); err != nil { - c.JSON(http.StatusOK, Error2Response(err)) - return - } - - ret, err := e.proofSrv.TxExec(&req) - if err != nil { - c.JSON(http.StatusOK, Error2Response(err)) - return - } - - c.JSON(http.StatusOK, Success(map[string]interface{}{ - "data": ret, - })) -} - -func Error2Response(err error) interface{} { - return map[string]interface{}{ - "code": 500, - "msg": err.Error(), - } -} - -func Success(data interface{}) interface{} { - return map[string]interface{}{ - "code": 0, - "msg": "success", - "data": data, - } -} diff --git a/internal/expose/service/proof.go b/internal/expose/service/proof.go deleted file mode 100644 index 7ef71088..00000000 --- a/internal/expose/service/proof.go +++ /dev/null @@ -1,246 +0,0 @@ -package service - -import ( - "context" - "crypto/ecdsa" - "encoding/json" - "fmt" - "github.com/ethereum/go-ethereum/common" - "github.com/mapprotocol/compass/pkg/ethclient" - "math/big" - "strconv" - - "github.com/mapprotocol/compass/chains" - "github.com/mapprotocol/compass/internal/butter" - "github.com/mapprotocol/compass/internal/chain" - "github.com/mapprotocol/compass/internal/constant" - "github.com/mapprotocol/compass/internal/expose" - "github.com/mapprotocol/compass/internal/stream" - - "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/core/types" - "github.com/pkg/errors" -) - -type ProofSrv struct { - cfg *expose.Config - pri *ecdsa.PrivateKey -} - -func NewProof(cfg *expose.Config, pri *ecdsa.PrivateKey) *ProofSrv { - return &ProofSrv{cfg: cfg, pri: pri} -} - -func (s *ProofSrv) TxExec(req *stream.TxExecOfRequest) (map[string]interface{}, error) { - switch req.Status { - case constant.StatusOfRelayFailed: - return s.RouterRetryMessageIn(s.cfg.Other.Butter, req.RelayChain, req.RelayTxHash) - case constant.StatusOfSwapFailed, constant.StatusOfDesFailed: - if req.Slippage == "" { - req.Slippage = "100" - } - return s.RouterExecSwap(s.cfg.Other.Butter, req.DesChain, req.DesTxHash, req.Slippage) - case constant.StatusOfInit: - desChain := req.DesChain - desChainInt, _ := strconv.ParseInt(desChain, 10, 64) - srcChainInt, _ := strconv.ParseInt(req.SrcChain, 10, 64) - if srcChainInt != constant.MapChainId && desChainInt != constant.MapChainId { - desChain = string(rune(constant.MapChainId)) - } - return s.SuccessProof(req.SrcChain, desChain, req.SrcBlockNumber, req.SrcLogIndex) - case constant.StatusOfRelayFinish: - return s.SuccessProof(req.RelayChain, req.DesChain, req.RelayBlockNumber, req.RelayLogIndex) - default: - } - - return nil, nil -} - -func (s *ProofSrv) RouterExecSwap(butterHost, toChain, txHash, slippage string) (map[string]interface{}, error) { - data, err := butter.ExecSwap(butterHost, fmt.Sprintf("toChainId=%s&txHash=%s&slippage=%s", toChain, txHash, slippage)) - if err != nil { - return nil, err - } - - var desTo string - for _, ele := range s.cfg.Chains { - if ele.Id == toChain { - desTo = ele.Mcs - break - } - } - - resp := butter.ExecSwapResp{} - err = json.Unmarshal(data, &resp) - if err != nil { - return nil, err - } - if resp.Errno != 0 { - return nil, fmt.Errorf("swap failed with errno: %s", resp.Message) - } - - return map[string]interface{}{ - "userRouter": true, - "exec_chain": toChain, - "exec_to": desTo, - "exec_data": "0x", - "exec_desc": "failed tx retry exec", - "exec_route": resp, - }, nil -} - -func (s *ProofSrv) RouterRetryMessageIn(butterHost, toChain, txHash string) (map[string]interface{}, error) { - data, err := butter.RetryMessageIn(butterHost, fmt.Sprintf("txHash=%s", txHash)) - if err != nil { - return nil, err - } - - var desTo string - for _, ele := range s.cfg.Chains { - if ele.Id == toChain { - desTo = ele.Mcs - break - } - } - - resp := butter.RetryMessageInData{} - err = json.Unmarshal(data, &resp) - if err != nil { - return nil, err - } - if resp.Errno != 0 { - return nil, fmt.Errorf("swap failed with errno: %s", resp.Message) - } - - return map[string]interface{}{ - "userRouter": true, - "exec_relay": true, - "exec_chain": toChain, - "exec_to": desTo, - "exec_data": "0x", - "exec_desc": "exec failed relay tx retry", - "exec_route": resp, - }, nil -} - -func (s *ProofSrv) SuccessProof(srcChain, desChain string, srcBlockNumber int64, logIndex uint) (map[string]interface{}, error) { - var ( - err error - proofType = int64(0) - src, des chains.Proffer - srcClient *ethclient.Client - srcEndpoint, srcOracleNode, srcMcs, srcLightNode, desTo, desLight, desOracle string - srcChainId, _ = strconv.ParseUint(srcChain, 10, 64) - desChainId, _ = strconv.ParseUint(desChain, 10, 64) - ) - for _, ele := range s.cfg.Chains { - if ele.Id == srcChain { - creator, _ := chains.CreateProffer(ele.Type) - src = creator - srcEndpoint = ele.Endpoint - srcOracleNode = ele.OracleNode - srcMcs = ele.Mcs - srcLightNode = ele.LightNode - srcClient, err = src.Connect(srcChain, srcEndpoint, srcMcs, srcLightNode, srcOracleNode) - if err != nil { - return nil, err - } - } - if ele.Id == desChain { - creator, _ := chains.CreateProffer(ele.Type) - des = creator - desTo = ele.Mcs - desOracle = ele.OracleNode - desLight = ele.LightNode - _, err = des.Connect(desChain, ele.Endpoint, ele.Mcs, ele.LightNode, ele.OracleNode) - if err != nil { - return nil, err - } - if ele.Name == constant.Tron || ele.Name == constant.Ton || ele.Name == constant.Solana { - proofType = constant.ProofTypeOfLogOracle - } - } - } - if src == nil { - return nil, errors.New("srcChain unrecognized Chain Type") - } - - if des == nil { - return nil, errors.New("desChain unrecognized Chain Type") - } - - // get log - logs, err := srcClient.FilterLogs(context.Background(), ethereum.FilterQuery{ - FromBlock: big.NewInt(srcBlockNumber), - ToBlock: big.NewInt(srcBlockNumber), - Addresses: nil, - Topics: nil, - }) - if err != nil { - return nil, err - } - targetLog := types.Log{} - for _, ele := range logs { - if ele.Index != logIndex { - continue - } - tmp := ele - targetLog = tmp - } - if proofType == 0 { - orderId := targetLog.Topics[1] - proofType, err = chain.PreSendTx(0, srcChainId, desChainId, big.NewInt(srcBlockNumber), orderId.Bytes()) - if errors.Is(err, chain.NotVerifyAble) { // maintainer - updateHeader, err := src.Maintainer(srcClient, srcChainId, desChainId, srcEndpoint) - if err != nil { - return nil, errors.Wrap(err, "Assemble maintainer failed") - } - return map[string]interface{}{ - "userRouter": false, - "exec_chain": desChain, - "exec_to": desLight, - "exec_data": "0x" + common.Bytes2Hex(updateHeader), - "exec_desc": "Execute maintainer transaction", - "exec_route": struct{}{}, - }, nil - } - if err != nil { - return nil, err - } - } - var sign [][]byte - if proofType == constant.ProofTypeOfNewOracle || proofType == constant.ProofTypeOfLogOracle { - ret, err := chain.Signer(srcClient, srcChainId, constant.MapChainId, &targetLog, proofType) - if errors.Is(err, chain.NotVerifyAble) { - oracle, err := chain.DefaultOracle(int64(srcChainId), proofType, &targetLog, srcClient, s.pri) // private - if err != nil { - return nil, err - } - return map[string]interface{}{ - "userRouter": false, - "exec_chain": desChain, - "exec_to": desOracle, - "exec_data": "0x" + common.Bytes2Hex(oracle), - "exec_desc": "Execute oracle transaction", - "exec_route": struct{}{}, - }, nil - } - if err != nil { - return nil, err - } - sign = ret.Signatures - } - // proof - ret, err := src.Proof(srcClient, &targetLog, srcEndpoint, proofType, srcChainId, desChainId, sign) - if err != nil { - return nil, err - } - return map[string]interface{}{ - "userRouter": false, - "exec_chain": desChain, - "exec_to": desTo, - "exec_data": "0x" + common.Bytes2Hex(ret), - "exec_desc": "Execute mos transaction", - "exec_route": struct{}{}, - }, nil -} diff --git a/internal/klaytn/client.go b/internal/klaytn/client.go deleted file mode 100644 index 59e1ae7a..00000000 --- a/internal/klaytn/client.go +++ /dev/null @@ -1,259 +0,0 @@ -package klaytn - -import ( - "bytes" - "context" - "encoding/json" - "errors" - "fmt" - "io" - "io/ioutil" - "math/big" - "net/http" - "net/url" - "reflect" - "strconv" - "sync" - "sync/atomic" - - "github.com/ethereum/go-ethereum/common" - - "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/common/hexutil" -) - -const ( - contentType = "application/json" - vsn = "2.0" -) - -var ErrNoResult = errors.New("no result in JSON-RPC response") - -type Client struct { - client *http.Client - url string - closeOnce sync.Once - closch chan interface{} - mu sync.Mutex // protcts headers - headers http.Header - isHttp bool - idCounter uint32 -} - -func DialHttp(endpoint string, isHttp bool) (*Client, error) { - // Sanity chck URL so we don't end up with a client that will fail every request. - _, err := url.Parse(endpoint) - if err != nil { - return nil, err - } - - headers := make(http.Header, 2) - headers.Set("accept", contentType) - headers.Set("content-type", contentType) - return &Client{ - client: new(http.Client), - url: endpoint, - closeOnce: sync.Once{}, - closch: make(chan interface{}), - mu: sync.Mutex{}, - headers: headers, - }, nil -} - -func (c *Client) BlockByNumber(ctx context.Context, number *big.Int) (*RpcHeader, error) { - return c.getBlock(ctx, "klay_getBlockByNumber", toBlockNumArg(number), true) -} - -func (c *Client) TransactionReceiptRpcOutput(ctx context.Context, txHash common.Hash) (map[string]interface{}, error) { - return c.getReceipt(ctx, "klay_getTransactionReceipt", txHash) -} - -func toBlockNumArg(number *big.Int) string { - if number == nil { - return "latest" - } - pending := big.NewInt(-1) - if number.Cmp(pending) == 0 { - return "pending" - } - return hexutil.EncodeBig(number) -} - -func (c *Client) getBlock(ctx context.Context, method string, args ...interface{}) (*RpcHeader, error) { - var raw json.RawMessage - err := c.CallContext(ctx, &raw, method, args...) - if err != nil { - return nil, err - } else if len(raw) == 0 { - return nil, ethereum.NotFound - } - - data, err := raw.MarshalJSON() - if err != nil { - return nil, err - } - - var ret RpcHeader - err = json.Unmarshal(data, &ret) - if err != nil { - return nil, err - } - return &ret, nil -} - -func (c *Client) getReceipt(ctx context.Context, method string, args ...interface{}) (map[string]interface{}, error) { - var raw json.RawMessage - err := c.CallContext(ctx, &raw, method, args...) - if err != nil { - return nil, err - } else if len(raw) == 0 { - return nil, ethereum.NotFound - } - - data, err := raw.MarshalJSON() - if err != nil { - return nil, err - } - - var ret map[string]interface{} - err = json.Unmarshal(data, &ret) - if err != nil { - return nil, err - } - return ret, nil -} - -type jsonrpcMessage struct { - Version string `json:"jsonrpc,omitempty"` - ID json.RawMessage `json:"id,omitempty"` - Method string `json:"method,omitempty"` - Params json.RawMessage `json:"params,omitempty"` - Error *jsonError `json:"error,omitempty"` - Result json.RawMessage `json:"result,omitempty"` -} - -type jsonError struct { - Code int `json:"code"` - Message string `json:"message"` - Data interface{} `json:"data,omitempty"` -} - -func (err *jsonError) Error() string { - if err.Message == "" { - return fmt.Sprintf("json-rpc error %d", err.Code) - } - return err.Message -} - -type requestOp struct { - ids []json.RawMessage - err error - resp chan *jsonrpcMessage // receives up to len(ids) responses -} - -func (op *requestOp) wait(ctx context.Context) (*jsonrpcMessage, error) { - select { - case <-ctx.Done(): - return nil, ctx.Err() - case resp := <-op.resp: - return resp, op.err - } -} - -func (c *Client) CallContext(ctx context.Context, result interface{}, method string, args ...interface{}) error { - if result != nil && reflect.TypeOf(result).Kind() != reflect.Ptr { - return fmt.Errorf("call result parameter must be pointer or nil interface: %v", result) - } - msg, err := c.newMessage(method, args...) - if err != nil { - return err - } - op := &requestOp{ids: []json.RawMessage{msg.ID}, resp: make(chan *jsonrpcMessage, 1)} - - err = c.sendHTTP(ctx, op, msg) - if err != nil { - return err - } - - // dispatch has accepted the request and will close the channel when it quits. - switch resp, err := op.wait(ctx); { - case err != nil: - return err - case resp.Error != nil: - return resp.Error - case len(resp.Result) == 0: - return ErrNoResult - default: - return json.Unmarshal(resp.Result, &result) - } -} - -func (c *Client) nextID() json.RawMessage { - id := atomic.AddUint32(&c.idCounter, 1) - return strconv.AppendUint(nil, uint64(id), 10) -} - -func (c *Client) newMessage(method string, paramsIn ...interface{}) (*jsonrpcMessage, error) { - msg := &jsonrpcMessage{Version: vsn, ID: c.nextID(), Method: method} - if paramsIn != nil { // prevent sending "params":null - var err error - if msg.Params, err = json.Marshal(paramsIn); err != nil { - return nil, err - } - } - return msg, nil -} - -func (c *Client) sendHTTP(ctx context.Context, op *requestOp, msg interface{}) error { - respBody, err := c.doRequest(ctx, msg) - if err != nil { - return err - } - defer respBody.Close() - - var respmsg jsonrpcMessage - if err := json.NewDecoder(respBody).Decode(&respmsg); err != nil { - return err - } - op.resp <- &respmsg - return nil -} - -func (c *Client) doRequest(ctx context.Context, msg interface{}) (io.ReadCloser, error) { - body, err := json.Marshal(msg) - if err != nil { - return nil, err - } - req, err := http.NewRequestWithContext(ctx, "POST", c.url, ioutil.NopCloser(bytes.NewReader(body))) - if err != nil { - return nil, err - } - req.ContentLength = int64(len(body)) - - // set headers - c.mu.Lock() - req.Header = c.headers.Clone() - c.mu.Unlock() - - // do request - resp, err := c.client.Do(req) - if err != nil { - return nil, err - } - if resp.StatusCode < 200 || resp.StatusCode >= 300 { - //var buf bytes.Buffer - //var body []byte - //if _, err := buf.ReadFrom(resp.Body); err == nil { - // body = buf.Bytes() - //} - - //return nil, nil - return nil, fmt.Errorf("klaytn request code is(%d)", resp.StatusCode) - //HTTPError{ - // Status: resp.Status, - // StatusCode: resp.StatusCode, - // Body: body, - //} - } - return resp.Body, nil -} diff --git a/internal/klaytn/klaytn.go b/internal/klaytn/klaytn.go deleted file mode 100644 index e902b972..00000000 --- a/internal/klaytn/klaytn.go +++ /dev/null @@ -1,353 +0,0 @@ -package klaytn - -import ( - "bytes" - "context" - maptypes "github.com/mapprotocol/atlas/core/types" - "github.com/mapprotocol/compass/internal/constant" - "github.com/mapprotocol/compass/internal/mapprotocol" - "github.com/mapprotocol/compass/internal/proof" - "github.com/mapprotocol/compass/pkg/msg" - "github.com/mapprotocol/compass/pkg/util" - "math/big" - "strings" - - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/rlp" - "github.com/pkg/errors" -) - -type Header struct { - ParentHash []byte `json:"parentHash"` - Reward common.Address `json:"reward"` - StateRoot []byte `json:"stateRoot"` - TransactionsRoot []byte `json:"transactionsRoot"` - ReceiptsRoot []byte `json:"receiptsRoot"` - LogsBloom []byte `json:"logsBloom"` - BlockScore *big.Int `json:"blockScore"` - Number *big.Int `json:"number"` - GasUsed *big.Int `json:"gasUsed"` - Timestamp *big.Int `json:"timestamp"` - TimestampFoS *big.Int `json:"timestampFoS"` - ExtraData []byte `json:"extraData"` - GovernanceData []byte `json:"governanceData"` - VoteData []byte `json:"voteData"` - BaseFee *big.Int `json:"baseFee"` -} - -const ( - PrefixOfHex = "0x" -) - -type RpcHeader struct { - BaseFeePerGas string `json:"baseFeePerGas"` - BlockScore string `json:"blockscore"` - ExtraData string `json:"extraData"` - GasUsed string `json:"gasUsed"` - GovernanceData string `json:"governanceData"` - Hash common.Hash `json:"hash"` - LogsBloom string `json:"logsBloom"` - Number string `json:"number"` - ParentHash common.Hash `json:"parentHash"` - ReceiptsRoot common.Hash `json:"receiptsRoot"` - Reward common.Address `json:"reward"` - Size string `json:"size"` - StateRoot common.Hash `json:"stateRoot"` - Timestamp string `json:"timestamp"` - TimestampFoS string `json:"timestampFoS"` - TotalBlockScore string `json:"totalBlockScore"` - TransactionsRoot common.Hash `json:"transactionsRoot"` - Transactions []Transactions `json:"transactions"` - VoteData string `json:"voteData"` -} - -type Transactions struct { - AccessList []interface{} `json:"accessList,omitempty"` - BlockHash string `json:"blockHash"` - BlockNumber string `json:"blockNumber"` - ChainID string `json:"chainId,omitempty"` - From string `json:"from"` - Gas string `json:"gas"` - GasPrice string `json:"gasPrice"` - Hash string `json:"hash"` - Input string `json:"input"` - MaxFeePerGas string `json:"maxFeePerGas,omitempty"` - MaxPriorityFeePerGas string `json:"maxPriorityFeePerGas,omitempty"` - Nonce string `json:"nonce"` - R string `json:"r"` - S string `json:"s"` - To string `json:"to"` - TransactionIndex string `json:"transactionIndex"` - Type string `json:"type"` - V string `json:"v"` - Value string `json:"value"` -} - -type GovernanceVote struct { - Validator common.Address `json:"validator"` - Key string `json:"key"` - Value interface{} `json:"value"` -} - -func ConvertContractHeader(ethHeader *types.Header, rh *RpcHeader) Header { - bloom := make([]byte, 0, len(ethHeader.Bloom)) - for _, b := range ethHeader.Bloom { - bloom = append(bloom, b) - } - blockScore := new(big.Int) - blockScore.SetString(strings.TrimPrefix(rh.BlockScore, PrefixOfHex), 16) - baseFeePerGas := new(big.Int) - baseFeePerGas.SetString(strings.TrimPrefix(rh.BaseFeePerGas, PrefixOfHex), 16) - timestamp := new(big.Int) - timestamp.SetString(strings.TrimPrefix(rh.Timestamp, PrefixOfHex), 16) - timestampFos := new(big.Int) - timestampFos.SetString(strings.TrimPrefix(rh.TimestampFoS, PrefixOfHex), 16) - return Header{ - ParentHash: hashToByte(ethHeader.ParentHash), - Reward: rh.Reward, - StateRoot: hashToByte(ethHeader.Root), - TransactionsRoot: hashToByte(ethHeader.TxHash), - ReceiptsRoot: hashToByte(ethHeader.ReceiptHash), - LogsBloom: bloom, - BlockScore: blockScore, - BaseFee: baseFeePerGas, - Number: ethHeader.Number, - GasUsed: new(big.Int).SetUint64(ethHeader.GasUsed), - Timestamp: timestamp, - TimestampFoS: timestampFos, - ExtraData: common.Hex2Bytes(strings.TrimPrefix(rh.ExtraData, PrefixOfHex)), - GovernanceData: common.Hex2Bytes(strings.TrimPrefix(rh.GovernanceData, PrefixOfHex)), - VoteData: common.Hex2Bytes(strings.TrimPrefix(rh.VoteData, PrefixOfHex)), - } -} - -func hashToByte(h common.Hash) []byte { - ret := make([]byte, 0, len(h)) - for _, b := range h { - ret = append(ret, b) - } - return ret -} - -func GetTxsHashByBlockNumber(conn *Client, number *big.Int) ([]common.Hash, error) { - block, err := conn.BlockByNumber(context.Background(), number) - if err != nil { - return nil, err - } - - txs := make([]common.Hash, 0, len(block.Transactions)) - for _, tx := range block.Transactions { - txs = append(txs, common.HexToHash(tx.Hash)) - } - return txs, nil -} - -type ReceiptProofOriginal struct { - Header Header - Proof [][]byte - TxReceipt []byte - KeyIndex []byte -} - -type ReceiptProof struct { - Proof []byte - DeriveSha DeriveShaOriginal -} - -type DeriveShaOriginal uint8 - -const ( - DeriveShaOrigin DeriveShaOriginal = iota - DeriveShaSimple - DeriveShaConcat -) - -type ReceiptRLP struct { - Status uint - GasUsed uint64 - Bloom types.Bloom - Logs []*types.Log -} - -// ReceiptRlps implements DerivableList for receipts. -type ReceiptRlps []*ReceiptRLP - -// Len returns the number of receipts in this list. -func (rs ReceiptRlps) Len() int { return len(rs) } - -// EncodeIndex encodes the i'th receipt to w. -func (rs ReceiptRlps) EncodeIndex(i int, w *bytes.Buffer) { - rlp.Encode(w, rs[i]) -} - -type TxLog struct { - Addr common.Address - Topics [][]byte - Data []byte -} - -func AssembleProof(cli *Client, header Header, log *types.Log, fId msg.ChainId, receipts []*types.Receipt, - method string, proofType int64, orderId [32]byte, sign [][]byte) ([]byte, error) { - GetReceiptsByTxsHash(cli, receipts) - - var ( - err error - pack []byte - ) - - receiptRlps := make(ReceiptRlps, 0, len(receipts)) - for _, receipt := range receipts { - logs := make([]TxLog, 0, len(receipt.Logs)) - for _, lg := range receipt.Logs { - topics := make([][]byte, len(lg.Topics)) - for i := range lg.Topics { - topics[i] = lg.Topics[i][:] - } - logs = append(logs, TxLog{ - Addr: lg.Address, - Topics: topics, - Data: lg.Data, - }) - } - receiptRlps = append(receiptRlps, &ReceiptRLP{ - Status: uint(receipt.Status), - GasUsed: receipt.GasUsed, - Bloom: receipt.Bloom, - Logs: receipt.Logs, - }) - } - - prf, err := proof.Get(receiptRlps, log.TxIndex) - if err != nil { - return nil, err - } - var key []byte - key = rlp.AppendUint64(key[:0], uint64(log.TxIndex)) - ek := util.Key2Hex(key, len(prf)) - receipt, err := mapprotocol.GetTxReceipt(receipts[log.TxIndex]) - if err != nil { - return nil, err - } - - idx := 0 - for i, ele := range receipts[log.TxIndex].Logs { - if ele.Index != log.Index { - continue - } - idx = i - } - - switch proofType { - case constant.ProofTypeOfNewOracle: - fallthrough - case constant.ProofTypeOfLogOracle: - pack, err = KlaytnSignOracle(&maptypes.Header{ - ReceiptHash: common.BytesToHash(header.ReceiptsRoot), - Number: big.NewInt(int64(log.BlockNumber)), - }, receiptRlps[log.TxIndex], big.NewInt(0), key, prf, fId, idx, method, sign, orderId, log, proofType) - default: - data, err := rlp.EncodeToBytes(receipt) - if err != nil { - return nil, err - } - - pd := ReceiptProofOriginal{ - Header: header, - Proof: prf, - TxReceipt: data, - KeyIndex: ek, - } - - input, err := mapprotocol.Klaytn.Methods[mapprotocol.MethodOfGetBytes].Inputs.Pack(pd) - if err != nil { - return nil, errors.Wrap(err, "getBytes pack") - } - finpd := ReceiptProof{ - Proof: input, - DeriveSha: DeriveShaOrigin, - } - input, err = mapprotocol.Klaytn.Methods[mapprotocol.MethodOfGetFinalBytes].Inputs.Pack(finpd) - if err != nil { - return nil, errors.Wrap(err, "getFinalBytes pack") - } - - pack, err = mapprotocol.PackInput(mapprotocol.Mcs, method, new(big.Int).SetUint64(uint64(fId)), input) - } - if err != nil { - return nil, err - } - - return pack, nil -} - -func GetReceiptsByTxsHash(cli *Client, receipts []*types.Receipt) { - for idx, receipt := range receipts { - if receipt.Status != 0 { - continue - } - kr, err := cli.TransactionReceiptRpcOutput(context.Background(), receipt.TxHash) - if err != nil { - return - } - txError, _ := big.NewInt(0).SetString(strings.TrimPrefix(kr["txError"].(string), "0x"), 16) - receipts[idx].Status = txError.Uint64() - } -} - -func KlaytnSignOracle(header *maptypes.Header, rr *ReceiptRLP, receiptType *big.Int, key []byte, prf [][]byte, fId msg.ChainId, - idx int, method string, sign [][]byte, orderId [32]byte, log *types.Log, proofType int64) ([]byte, error) { - pt := uint8(0) - var fixedHash [32]byte - newPrf := make([]byte, 0) - switch proofType { - case constant.ProofTypeOfNewOracle: - nrRlp, err := rlp.EncodeToBytes(rr) - if err != nil { - return nil, err - } - - for i, v := range header.ReceiptHash { - fixedHash[i] = v - } - - rpf := proof.NewReceiptProof{ - TxReceipt: nrRlp, - ReceiptType: receiptType, - KeyIndex: util.Key2Hex(key, len(prf)), - Proof: prf, - } - - newPrf, err = mapprotocol.PackAbi.Methods[mapprotocol.MethodOfMptPack].Inputs.Pack(rpf) - if err != nil { - return nil, err - } - case constant.ProofTypeOfLogOracle: - pt = 1 - //newPrf = log2Proof(log) - //fixedHash = common.BytesToHash(crypto.Keccak256(newPrf)) - default: - return nil, errors.New("invalid proof type") - } - - pd := proof.SignLogData{ - ProofType: pt, - BlockNum: big.NewInt(0).SetUint64(log.BlockNumber), - ReceiptRoot: fixedHash, - Signatures: sign, - Proof: newPrf, - } - - input, err := mapprotocol.GetAbi.Methods[mapprotocol.MethodOfGetBytes].Inputs.Pack(pd) - if err != nil { - return nil, errors.Wrap(err, "pack getBytes failed") - } - - ret, err := mapprotocol.PackInput(mapprotocol.Mcs, method, big.NewInt(0).SetUint64(uint64(fId)), - big.NewInt(int64(idx)), orderId, input) - if err != nil { - return nil, errors.Wrap(err, "pack mcs input failed") - } - - return ret, nil -} diff --git a/internal/mapo/callcontract.go b/internal/mapo/callcontract.go deleted file mode 100644 index b7bac99e..00000000 --- a/internal/mapo/callcontract.go +++ /dev/null @@ -1,304 +0,0 @@ -// Copyright 2021 Compass Systems -// SPDX-License-Identifier: LGPL-3.0-only - -package mapo - -import ( - "bytes" - "context" - "encoding/binary" - "encoding/json" - "fmt" - "github.com/mapprotocol/compass/internal/mapprotocol" - "github.com/mapprotocol/compass/pkg/msg" - "math/big" - "strings" - - "github.com/ethereum/go-ethereum/ethdb/memorydb" - "github.com/mapprotocol/compass/internal/arb" - "github.com/mapprotocol/compass/internal/constant" - "github.com/mapprotocol/compass/internal/op" - "github.com/mapprotocol/compass/internal/scroll" - "github.com/mapprotocol/compass/pkg/util" - - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/trie" - maptypes "github.com/mapprotocol/atlas/core/types" - "github.com/mapprotocol/compass/internal/proof" - "github.com/mapprotocol/compass/pkg/ethclient" - "github.com/pkg/errors" -) - -func AssembleEthProof(conn *ethclient.Client, log *types.Log, receipts []*types.Receipt, header *maptypes.Header, - method string, fId msg.ChainId, proofType int64, sign [][]byte, orderId [32]byte) ([]byte, error) { - var ( - pack []byte - err error - ) - idx := 0 - for i, ele := range receipts[log.TxIndex].Logs { - if ele.Index != log.Index { - continue - } - idx = i - } - receipt, err := mapprotocol.GetTxReceipt(receipts[log.TxIndex]) - if err != nil { - return nil, err - } - prf, receiptHash, err := ethProof(conn, fId, log.TxIndex, receipts) - if err != nil { - return nil, err - } - if receiptHash != header.ReceiptHash && fId != constant.ZkSyncChainId && fId != constant.MerlinChainId { - fmt.Println("Matic generate", receiptHash, "oracle", header.ReceiptHash, " not same") - return nil, errors.New("receipt not same") - } - - var key []byte - key = rlp.AppendUint64(key[:0], uint64(log.TxIndex)) - - switch proofType { - case constant.ProofTypeOfOrigin: - case constant.ProofTypeOfZk: - case constant.ProofTypeOfOracle: - pack, err = proof.Oracle(log.BlockNumber, receipt, key, prf, fId, method, idx, - mapprotocol.ProofAbi, orderId, false) - case constant.ProofTypeOfNewOracle: - fallthrough - case constant.ProofTypeOfLogOracle: - pack, err = proof.SignOracle(&maptypes.Header{ - ReceiptHash: receiptHash, - Number: big.NewInt(int64(log.BlockNumber)), - }, receipt, key, prf, fId, idx, method, sign, orderId, log, proofType) - } - if err != nil { - return nil, err - } - - return pack, nil -} - -func ethProof(conn *ethclient.Client, fId msg.ChainId, txIdx uint, receipts []*types.Receipt) ([][]byte, common.Hash, error) { - var dls proof.DerivableList - switch fId { - case constant.ArbChainId, constant.ArbTestnetChainId, constant.MantleChainId, constant.DodoChainId: - pr := arb.Receipts{} - for _, r := range receipts { - pr = append(pr, &arb.Receipt{Receipt: r}) - } - dls = pr - case constant.ScrollChainId: - pr := scroll.Receipts{} - for _, r := range receipts { - pr = append(pr, &scroll.Receipt{Receipt: r}) - } - dls = pr - case constant.OpChainId, constant.BaseChainId, constant.BlastChainId: - pr := op.Receipts{} - for _, r := range receipts { - tmp, err := conn.OpReceipt(context.Background(), r.TxHash) - if err != nil { - continue - } - vptr := uint64(0) - nptr := uint64(0) - if tmp.DepositReceiptVersion != "" { - version, _ := big.NewInt(0).SetString(strings.TrimPrefix(tmp.DepositReceiptVersion, "0x"), 16) - vptr = version.Uint64() - } - if tmp.DepositNonce != "" { - nonce, _ := big.NewInt(0).SetString(strings.TrimPrefix(tmp.DepositNonce, "0x"), 16) - nptr = nonce.Uint64() - } - pr = append(pr, &op.Receipt{Receipt: r, DepositReceiptVersion: &vptr, DepositNonce: &nptr}) - } - dls = pr - default: - dls = types.Receipts(receipts) - } - ret, err := proof.Get(dls, txIdx) - if err != nil { - return nil, constant.ZeroAddress.Hash(), err - } - - tr, _ := trie.New(common.Hash{}, trie.NewDatabase(memorydb.New())) - tr = proof.DeriveTire(dls, tr) - - return ret, tr.Hash(), nil -} - -func AssembleMapProof(cli *ethclient.Client, log *types.Log, receipts []*types.Receipt, - header *maptypes.Header, fId msg.ChainId, method, zkUrl string, proofType int64, sign [][]byte, orderId [32]byte) (uint64, []byte, error) { - uToChainID := big.NewInt(0).SetBytes(log.Topics[2].Bytes()[8:16]).Uint64() - txIndex := log.TxIndex - aggPK, ist, aggPKBytes, err := mapprotocol.GetAggPK(cli, new(big.Int).Sub(header.Number, big.NewInt(1)), header.Extra) - if err != nil { - return 0, nil, err - } - - receipt, err := mapprotocol.GetTxReceipt(receipts[txIndex]) - prf, err := proof.Get(types.Receipts(receipts), txIndex) - if err != nil { - return 0, nil, err - } - - var key []byte - key = rlp.AppendUint64(key[:0], uint64(txIndex)) - ek := util.Key2Hex(key, len(prf)) - - var payloads []byte - name, _ := mapprotocol.OnlineChaId[msg.ChainId(uToChainID)] - switch name { - case "near": - bytesBuffer := bytes.NewBuffer([]byte{}) - err = binary.Write(bytesBuffer, binary.LittleEndian, uint64(txIndex)) - if err != nil { - return 0, nil, err - } - - nProof := make([]string, 0, len(prf)) - for _, p := range prf { - nProof = append(nProof, "0x"+common.Bytes2Hex(p)) - } - m := map[string]interface{}{ - "header": mapprotocol.ConvertNearNeedHeader(header), - "agg_pk": map[string]interface{}{ - "xr": "0x" + common.Bytes2Hex(aggPKBytes[32:64]), - "xi": "0x" + common.Bytes2Hex(aggPKBytes[:32]), - "yi": "0x" + common.Bytes2Hex(aggPKBytes[64:96]), - "yr": "0x" + common.Bytes2Hex(aggPKBytes[96:128]), - }, - "key_index": "0x" + common.Bytes2Hex(key), - "receipt": ConvertNearReceipt(receipt), - "proof": nProof, - } - - idx := 0 - match := false - for lIdx, l := range receipt.Logs { - for _, topic := range l.Topics { - if common.BytesToHash(topic) == log.Topics[0] { - idx = lIdx - match = true - break - } - } - if match { - break - } - } - data, _ := json.Marshal(map[string]interface{}{ - "receipt_proof": m, - "index": idx, - }) - return uToChainID, data, nil - case "ton": // todo ton 自己构建proof,找合约 - default: - istanbulExtra := mapprotocol.ConvertIstanbulExtra(ist) - nr := mapprotocol.MapTxReceipt{ - PostStateOrStatus: receipt.PostStateOrStatus, - CumulativeGasUsed: receipt.CumulativeGasUsed, - Bloom: receipt.Bloom, - Logs: receipt.Logs, - } - - nrRlp, err := rlp.EncodeToBytes(nr) - if err != nil { - return 0, nil, err - } - rp := mapprotocol.NewMapReceiptProof{ - Header: mapprotocol.ConvertHeader(header), - AggPk: aggPK, - KeyIndex: ek, - Proof: prf, - Ist: *istanbulExtra, - TxReceiptRlp: mapprotocol.TxReceiptRlp{ - ReceiptType: receipt.ReceiptType, - ReceiptRlp: nrRlp, - }, - } - - idx := 0 - for i, ele := range receipts[txIndex].Logs { - if ele.Index != log.Index { - continue - } - idx = i - } - - switch proofType { - case constant.ProofTypeOfZk: - zkProof, err := mapprotocol.GetZkProof(zkUrl, fId, header.Number.Uint64()) - if err != nil { - return 0, nil, errors.Wrap(err, "GetZkProof failed") - } - payloads, err = proof.Pack(fId, method, mapprotocol.Mcs, rp, zkProof) - case constant.ProofTypeOfOracle: - payloads, err = proof.Oracle(header.Number.Uint64(), receipt, key, prf, fId, - method, idx, mapprotocol.ProofAbi, orderId, false) - case constant.ProofTypeOfNewOracle: - fallthrough - case constant.ProofTypeOfLogOracle: - payloads, err = proof.SignOracle(header, receipt, key, prf, fId, idx, method, sign, orderId, log, proofType) - default: - payloads, err = proof.V3Pack(fId, method, mapprotocol.Map2Other, idx, orderId, true, rp) - } - if err != nil { - return 0, nil, err - } - - } - return uToChainID, payloads, nil -} - -func Key2Hex(str []byte, proofLength int) []byte { - ret := make([]byte, 0) - if len(ret)+1 == proofLength { - ret = append(ret, str...) - } else { - for _, b := range str { - ret = append(ret, b/16) - ret = append(ret, b%16) - } - } - return ret -} - -type TxReceipt struct { - ReceiptType string `json:"receipt_type"` - PostStateOrStatus string `json:"post_state_or_status"` - CumulativeGasUsed string `json:"cumulative_gas_used"` - Bloom string `json:"bloom"` - Logs []TxLog `json:"logs"` -} - -type TxLog struct { - Address common.Address `json:"address"` - Topics []string `json:"topics"` - Data string `json:"data"` -} - -func ConvertNearReceipt(h *mapprotocol.TxReceipt) *TxReceipt { - logs := make([]TxLog, 0, len(h.Logs)) - for _, log := range h.Logs { - topics := make([]string, 0, len(log.Topics)) - for _, t := range log.Topics { - topics = append(topics, "0x"+common.Bytes2Hex(t)) - } - logs = append(logs, TxLog{ - Address: log.Addr, - Topics: topics, - Data: "0x" + common.Bytes2Hex(log.Data), - }) - } - return &TxReceipt{ - ReceiptType: h.ReceiptType.String(), - PostStateOrStatus: "0x" + common.Bytes2Hex(h.PostStateOrStatus), - CumulativeGasUsed: h.CumulativeGasUsed.String(), - Bloom: "0x" + common.Bytes2Hex(h.Bloom), - Logs: logs, - } -} diff --git a/internal/mapprotocol/abi_json.go b/internal/mapprotocol/abi_json.go deleted file mode 100644 index 419b5ea0..00000000 --- a/internal/mapprotocol/abi_json.go +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2021 Compass Systems -// SPDX-License-Identifier: LGPL-3.0-only - -package mapprotocol - -const ( - NearAbiJson = `[{"inputs":[{"internalType":"bytes","name":"head","type":"bytes"},{"internalType":"bytes","name":"proof","type":"bytes"}],"name":"getBytes","outputs":[{"internalType":"bytes","name":"_receiptProof","type":"bytes"}],"stateMutability":"view","type":"function"}]` - McsAbi = `[{"inputs":[{"internalType":"address[]","name":"_tokens","type":"address[]"}],"name":"addMintableToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"butterRouter","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_admin","type":"address"}],"name":"changeAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"}],"name":"depositNative","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"depositToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getImplementation","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"_blockNum","type":"uint256"},{"internalType":"bytes32","name":"_orderId","type":"bytes32"}],"name":"getOrderStatus","outputs":[{"internalType":"bool","name":"exists","type":"bool"},{"internalType":"bool","name":"verifiable","type":"bool"},{"internalType":"uint256","name":"nodeType","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_wToken","type":"address"},{"internalType":"address","name":"_lightNode","type":"address"},{"internalType":"address","name":"_owner","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_toChain","type":"uint256"}],"name":"isBridgeable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"isMintable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lightNode","outputs":[{"internalType":"contract ILightNode","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"mintableTokens","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nonce","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"orderList","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_toChain","type":"uint256"},{"internalType":"bool","name":"_enable","type":"bool"}],"name":"registerToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256[]","name":"_toChains","type":"uint256[]"},{"internalType":"bool","name":"_enable","type":"bool"}],"name":"registerTokenChains","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"relayChainId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"relayContract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_tokens","type":"address[]"}],"name":"removeMintableToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"selfChainId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_lightNode","type":"address"}],"name":"setLightClient","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"setPause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_chainId","type":"uint256"},{"internalType":"address","name":"_relay","type":"address"}],"name":"setRelayContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"setUnpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_wToken","type":"address"}],"name":"setWrappedToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"storedOrderId","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_chainId","type":"uint256"},{"internalType":"uint256","name":"_logIndex","type":"uint256"},{"internalType":"bytes32","name":"_orderId","type":"bytes32"},{"internalType":"bytes","name":"_receiptProof","type":"bytes"}],"name":"swapIn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"_logArray","type":"bytes"},{"internalType":"uint256","name":"_logIndex","type":"uint256"},{"internalType":"bytes32","name":"_orderId","type":"bytes32"}],"name":"swapInVerified","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"_logArray","type":"bytes"},{"internalType":"uint256","name":"_logIndex","type":"uint256"}],"name":"swapInVerifiedWithIndex","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_chainId","type":"uint256"},{"internalType":"bytes","name":"_receiptProof","type":"bytes"}],"name":"swapInVerify","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_chainId","type":"uint256"},{"internalType":"uint256","name":"_logIndex","type":"uint256"},{"internalType":"bytes32","name":"_orderId","type":"bytes32"},{"internalType":"bytes","name":"_receiptProof","type":"bytes"}],"name":"messageIn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_chainId","type":"uint256"},{"internalType":"uint256","name":"_logIndex","type":"uint256"},{"internalType":"bytes","name":"_receiptProof","type":"bytes"}],"name":"swapInWithIndex","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_initiatorAddress","type":"address"},{"internalType":"bytes","name":"_to","type":"bytes"},{"internalType":"uint256","name":"_toChain","type":"uint256"},{"internalType":"bytes","name":"_swapData","type":"bytes"}],"name":"swapOutNative","outputs":[{"internalType":"bytes32","name":"orderId","type":"bytes32"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_initiatorAddress","type":"address"},{"internalType":"address","name":"_token","type":"address"},{"internalType":"bytes","name":"_to","type":"bytes"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256","name":"_toChain","type":"uint256"},{"internalType":"bytes","name":"_swapData","type":"bytes"}],"name":"swapOutToken","outputs":[{"internalType":"bytes32","name":"orderId","type":"bytes32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"tokenMappingList","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"name":"upgradeTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"wToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"receiptProof","type":"bytes"}],"name":"transferInWithIndex","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"receiptProof","type":"bytes"}],"name":"swapInWithIndex","outputs":[],"stateMutability":"nonpayable","type":"function"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes","name":"logs","type":"bytes"}],"name":"mapSwapInVerified","type":"event"}]` - LightMangerAbi = `[{"inputs":[{"internalType":"uint256","name":"_chainId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"finalizedState","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_chainId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"updateLightClient","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_chainId","type":"uint256"}],"name":"clientState","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_chainId","type":"uint256"},{"internalType":"bytes","name":"_blockHeader","type":"bytes"}],"name":"updateBlockHeader","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_chainId","type":"uint256"}],"name":"headerHeight","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_chainId","type":"uint256"},{"internalType":"bytes","name":"_receiptProof","type":"bytes"}],"name":"verifyProofData","outputs":[{"internalType":"bool","name":"success","type":"bool"},{"internalType":"string","name":"message","type":"string"},{"internalType":"bytes","name":"logs","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_chainId","type":"uint256"}],"name":"verifiableHeaderRange","outputs":[{"internalType":"uint256","name":"left","type":"uint256"},{"internalType":"uint256","name":"right","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"nodeType","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]` - BscAbiJson = `[{"inputs":[{"components":[{"internalType":"bytes","name":"parentHash","type":"bytes"},{"internalType":"bytes","name":"sha3Uncles","type":"bytes"},{"internalType":"address","name":"miner","type":"address"},{"internalType":"bytes","name":"stateRoot","type":"bytes"},{"internalType":"bytes","name":"transactionsRoot","type":"bytes"},{"internalType":"bytes","name":"receiptsRoot","type":"bytes"},{"internalType":"bytes","name":"logsBloom","type":"bytes"},{"internalType":"uint256","name":"difficulty","type":"uint256"},{"internalType":"uint256","name":"number","type":"uint256"},{"internalType":"uint256","name":"gasLimit","type":"uint256"},{"internalType":"uint256","name":"gasUsed","type":"uint256"},{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"bytes","name":"extraData","type":"bytes"},{"internalType":"bytes","name":"mixHash","type":"bytes"},{"internalType":"bytes","name":"nonce","type":"bytes"},{"internalType":"uint256","name":"baseFeePerGas","type":"uint256"},{"internalType":"bytes","name":"withdrawalsRoot","type":"bytes"},{"internalType":"uint256","name":"blobGasUsed","type":"uint256"},{"internalType":"uint256","name":"excessBlobGas","type":"uint256"},{"internalType":"bytes","name":"parentBeaconBlockRoot","type":"bytes"}],"internalType":"struct Verify.BlockHeader[]","name":"_blockHeaders","type":"tuple[]"}],"name":"getHeadersBytes","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"pure","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"bytes","name":"parentHash","type":"bytes"},{"internalType":"bytes","name":"sha3Uncles","type":"bytes"},{"internalType":"address","name":"miner","type":"address"},{"internalType":"bytes","name":"stateRoot","type":"bytes"},{"internalType":"bytes","name":"transactionsRoot","type":"bytes"},{"internalType":"bytes","name":"receiptsRoot","type":"bytes"},{"internalType":"bytes","name":"logsBloom","type":"bytes"},{"internalType":"uint256","name":"difficulty","type":"uint256"},{"internalType":"uint256","name":"number","type":"uint256"},{"internalType":"uint256","name":"gasLimit","type":"uint256"},{"internalType":"uint256","name":"gasUsed","type":"uint256"},{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"bytes","name":"extraData","type":"bytes"},{"internalType":"bytes","name":"mixHash","type":"bytes"},{"internalType":"bytes","name":"nonce","type":"bytes"},{"internalType":"uint256","name":"baseFeePerGas","type":"uint256"},{"internalType":"bytes","name":"withdrawalsRoot","type":"bytes"},{"internalType":"uint256","name":"blobGasUsed","type":"uint256"},{"internalType":"uint256","name":"excessBlobGas","type":"uint256"},{"internalType":"bytes","name":"parentBeaconBlockRoot","type":"bytes"}],"internalType":"struct Verify.BlockHeader[]","name":"headers","type":"tuple[]"},{"components":[{"components":[{"internalType":"uint256","name":"receiptType","type":"uint256"},{"internalType":"bytes","name":"postStateOrStatus","type":"bytes"},{"internalType":"uint256","name":"cumulativeGasUsed","type":"uint256"},{"internalType":"bytes","name":"bloom","type":"bytes"},{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"bytes[]","name":"topics","type":"bytes[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct Verify.TxLog[]","name":"logs","type":"tuple[]"}],"internalType":"struct Verify.TxReceipt","name":"txReceipt","type":"tuple"},{"internalType":"bytes","name":"keyIndex","type":"bytes"},{"internalType":"bytes[]","name":"proof","type":"bytes[]"}],"internalType":"struct Verify.ReceiptProof","name":"receiptProof","type":"tuple"}],"internalType":"struct LightNode.ProofData","name":"_proof","type":"tuple"}],"name":"getBytes","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"_chainId","type":"uint256"},{"internalType":"uint256","name":"_logIndex","type":"uint256"},{"internalType":"bytes32","name":"_orderId","type":"bytes32"},{"internalType":"bytes","name":"_receiptProof","type":"bytes"}],"name":"messageIn","outputs":[],"stateMutability":"nonpayable","type":"function"}]` - KlaytnAbiJson = `[{"inputs":[{"components":[{"internalType":"bytes","name":"parentHash","type":"bytes"},{"internalType":"address","name":"reward","type":"address"},{"internalType":"bytes","name":"stateRoot","type":"bytes"},{"internalType":"bytes","name":"transactionsRoot","type":"bytes"},{"internalType":"bytes","name":"receiptsRoot","type":"bytes"},{"internalType":"bytes","name":"logsBloom","type":"bytes"},{"internalType":"uint256","name":"blockScore","type":"uint256"},{"internalType":"uint256","name":"number","type":"uint256"},{"internalType":"uint256","name":"gasUsed","type":"uint256"},{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"uint256","name":"timestampFoS","type":"uint256"},{"internalType":"bytes","name":"extraData","type":"bytes"},{"internalType":"bytes","name":"governanceData","type":"bytes"},{"internalType":"bytes","name":"voteData","type":"bytes"},{"internalType":"uint256","name":"baseFee","type":"uint256"}],"internalType":"struct ILightNodePoint.BlockHeader[]","name":"_blockHeaders","type":"tuple[]"}],"name":"getHeadersBytes","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"pure","type":"function"},{"inputs":[{"components":[{"internalType":"bytes","name":"proof","type":"bytes"},{"internalType":"enum ILightNodePoint.DeriveShaOriginal","name":"deriveSha","type":"uint8"}],"internalType":"struct ILightNodePoint.ReceiptProof","name":"_proof","type":"tuple"}],"name":"getFinalBytes","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"pure","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"bytes","name":"parentHash","type":"bytes"},{"internalType":"address","name":"reward","type":"address"},{"internalType":"bytes","name":"stateRoot","type":"bytes"},{"internalType":"bytes","name":"transactionsRoot","type":"bytes"},{"internalType":"bytes","name":"receiptsRoot","type":"bytes"},{"internalType":"bytes","name":"logsBloom","type":"bytes"},{"internalType":"uint256","name":"blockScore","type":"uint256"},{"internalType":"uint256","name":"number","type":"uint256"},{"internalType":"uint256","name":"gasUsed","type":"uint256"},{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"uint256","name":"timestampFoS","type":"uint256"},{"internalType":"bytes","name":"extraData","type":"bytes"},{"internalType":"bytes","name":"governanceData","type":"bytes"},{"internalType":"bytes","name":"voteData","type":"bytes"},{"internalType":"uint256","name":"baseFee","type":"uint256"}],"internalType":"struct IKlaytn.BlockHeader","name":"header","type":"tuple"},{"internalType":"bytes[]","name":"proof","type":"bytes[]"},{"internalType":"bytes","name":"txReceipt","type":"bytes"},{"internalType":"bytes","name":"keyIndex","type":"bytes"}],"internalType":"struct IKlaytn.ReceiptProofOriginal","name":"_proof","type":"tuple"}],"name":"getBytes","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"_chainId","type":"uint256"},{"internalType":"uint256","name":"_logIndex","type":"uint256"},{"internalType":"bytes32","name":"_orderId","type":"bytes32"},{"internalType":"bytes","name":"_receiptProof","type":"bytes"}],"name":"messageIn","outputs":[],"stateMutability":"nonpayable","type":"function"}]` - HeightAbiJson = `[{"inputs":[],"name":"headerHeight","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]` - Map2OtherAbi = `[{"inputs":[{"components":[{"internalType":"bytes","name":"parentHash","type":"bytes"},{"internalType":"address","name":"coinbase","type":"address"},{"internalType":"bytes","name":"root","type":"bytes"},{"internalType":"bytes","name":"txHash","type":"bytes"},{"internalType":"bytes","name":"receiptHash","type":"bytes"},{"internalType":"bytes","name":"bloom","type":"bytes"},{"internalType":"uint256","name":"number","type":"uint256"},{"internalType":"uint256","name":"gasLimit","type":"uint256"},{"internalType":"uint256","name":"gasUsed","type":"uint256"},{"internalType":"uint256","name":"time","type":"uint256"},{"internalType":"bytes","name":"extraData","type":"bytes"},{"internalType":"bytes","name":"mixDigest","type":"bytes"},{"internalType":"bytes","name":"nonce","type":"bytes"},{"internalType":"uint256","name":"baseFee","type":"uint256"}],"internalType":"struct ILightNodePoint.blockHeader","name":"bh","type":"tuple"},{"components":[{"internalType":"address[]","name":"validators","type":"address[]"},{"internalType":"bytes[]","name":"addedPubKey","type":"bytes[]"},{"internalType":"bytes[]","name":"addedG1PubKey","type":"bytes[]"},{"internalType":"uint256","name":"removeList","type":"uint256"},{"internalType":"bytes","name":"seal","type":"bytes"},{"components":[{"internalType":"uint256","name":"bitmap","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"uint256","name":"round","type":"uint256"}],"internalType":"struct ILightNodePoint.istanbulAggregatedSeal","name":"aggregatedSeal","type":"tuple"},{"components":[{"internalType":"uint256","name":"bitmap","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"uint256","name":"round","type":"uint256"}],"internalType":"struct ILightNodePoint.istanbulAggregatedSeal","name":"parentAggregatedSeal","type":"tuple"}],"internalType":"struct ILightNodePoint.istanbulExtra","name":"ist","type":"tuple"},{"components":[{"internalType":"uint256","name":"xr","type":"uint256"},{"internalType":"uint256","name":"xi","type":"uint256"},{"internalType":"uint256","name":"yr","type":"uint256"},{"internalType":"uint256","name":"yi","type":"uint256"}],"internalType":"struct IBLSPoint.G2","name":"aggPk","type":"tuple"}],"name":"updateBlockHeader","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"bytes","name":"parentHash","type":"bytes"},{"internalType":"address","name":"coinbase","type":"address"},{"internalType":"bytes","name":"root","type":"bytes"},{"internalType":"bytes","name":"txHash","type":"bytes"},{"internalType":"bytes","name":"receiptHash","type":"bytes"},{"internalType":"bytes","name":"bloom","type":"bytes"},{"internalType":"uint256","name":"number","type":"uint256"},{"internalType":"uint256","name":"gasLimit","type":"uint256"},{"internalType":"uint256","name":"gasUsed","type":"uint256"},{"internalType":"uint256","name":"time","type":"uint256"},{"internalType":"bytes","name":"extraData","type":"bytes"},{"internalType":"bytes","name":"mixDigest","type":"bytes"},{"internalType":"bytes","name":"nonce","type":"bytes"},{"internalType":"uint256","name":"baseFee","type":"uint256"}],"internalType":"struct ILightNodePoint.blockHeader","name":"header","type":"tuple"},{"components":[{"internalType":"address[]","name":"validators","type":"address[]"},{"internalType":"bytes[]","name":"addedPubKey","type":"bytes[]"},{"internalType":"bytes[]","name":"addedG1PubKey","type":"bytes[]"},{"internalType":"uint256","name":"removeList","type":"uint256"},{"internalType":"bytes","name":"seal","type":"bytes"},{"components":[{"internalType":"uint256","name":"bitmap","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"uint256","name":"round","type":"uint256"}],"internalType":"struct ILightNodePoint.istanbulAggregatedSeal","name":"aggregatedSeal","type":"tuple"},{"components":[{"internalType":"uint256","name":"bitmap","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"uint256","name":"round","type":"uint256"}],"internalType":"struct ILightNodePoint.istanbulAggregatedSeal","name":"parentAggregatedSeal","type":"tuple"}],"internalType":"struct ILightNodePoint.istanbulExtra","name":"ist","type":"tuple"},{"components":[{"internalType":"uint256","name":"xr","type":"uint256"},{"internalType":"uint256","name":"xi","type":"uint256"},{"internalType":"uint256","name":"yr","type":"uint256"},{"internalType":"uint256","name":"yi","type":"uint256"}],"internalType":"struct IBLSPoint.G2","name":"aggPk","type":"tuple"},{"components":[{"internalType":"uint256","name":"receiptType","type":"uint256"},{"internalType":"bytes","name":"receiptRlp","type":"bytes"}],"internalType":"struct ILightNodePoint.TxReceiptRlp","name":"txReceiptRlp","type":"tuple"},{"internalType":"bytes","name":"keyIndex","type":"bytes"},{"internalType":"bytes[]","name":"proof","type":"bytes[]"}],"internalType":"struct ILightNodePoint.receiptProof","name":"_receiptProof","type":"tuple"}],"name":"getBytes","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"pure","type":"function"}]` - MaticAbiJson = `[{"inputs":[{"components":[{"internalType":"bytes","name":"parentHash","type":"bytes"},{"internalType":"bytes","name":"sha3Uncles","type":"bytes"},{"internalType":"address","name":"miner","type":"address"},{"internalType":"bytes","name":"stateRoot","type":"bytes"},{"internalType":"bytes","name":"transactionsRoot","type":"bytes"},{"internalType":"bytes","name":"receiptsRoot","type":"bytes"},{"internalType":"bytes","name":"logsBloom","type":"bytes"},{"internalType":"uint256","name":"difficulty","type":"uint256"},{"internalType":"uint256","name":"number","type":"uint256"},{"internalType":"uint256","name":"gasLimit","type":"uint256"},{"internalType":"uint256","name":"gasUsed","type":"uint256"},{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"bytes","name":"extraData","type":"bytes"},{"internalType":"bytes","name":"mixHash","type":"bytes"},{"internalType":"bytes","name":"nonce","type":"bytes"},{"internalType":"uint256","name":"baseFeePerGas","type":"uint256"}],"internalType":"struct Verify.BlockHeader[]","name":"_blockHeaders","type":"tuple[]"}],"name":"getHeadersBytes","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"pure","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"bytes","name":"parentHash","type":"bytes"},{"internalType":"bytes","name":"sha3Uncles","type":"bytes"},{"internalType":"address","name":"miner","type":"address"},{"internalType":"bytes","name":"stateRoot","type":"bytes"},{"internalType":"bytes","name":"transactionsRoot","type":"bytes"},{"internalType":"bytes","name":"receiptsRoot","type":"bytes"},{"internalType":"bytes","name":"logsBloom","type":"bytes"},{"internalType":"uint256","name":"difficulty","type":"uint256"},{"internalType":"uint256","name":"number","type":"uint256"},{"internalType":"uint256","name":"gasLimit","type":"uint256"},{"internalType":"uint256","name":"gasUsed","type":"uint256"},{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"bytes","name":"extraData","type":"bytes"},{"internalType":"bytes","name":"mixHash","type":"bytes"},{"internalType":"bytes","name":"nonce","type":"bytes"},{"internalType":"uint256","name":"baseFeePerGas","type":"uint256"}],"internalType":"struct Verify.BlockHeader[]","name":"headers","type":"tuple[]"},{"components":[{"internalType":"bytes","name":"txReceipt","type":"bytes"},{"internalType":"uint256","name":"receiptType","type":"uint256"},{"internalType":"bytes","name":"keyIndex","type":"bytes"},{"internalType":"bytes[]","name":"proof","type":"bytes[]"}],"internalType":"struct Verify.ReceiptProof","name":"receiptProof","type":"tuple"}],"internalType":"struct LightNode.ProofData","name":"_proof","type":"tuple"}],"name":"getBytes","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"_chainId","type":"uint256"},{"internalType":"uint256","name":"_logIndex","type":"uint256"},{"internalType":"bytes32","name":"_orderId","type":"bytes32"},{"internalType":"bytes","name":"_receiptProof","type":"bytes"}],"name":"messageIn","outputs":[],"stateMutability":"nonpayable","type":"function"}]` - Eth2AbiJson = `[{"inputs":[],"name":"clientStateAnalysis","outputs":[{"internalType":"uint256","name":"startNumber","type":"uint256"},{"internalType":"uint256","name":"endNumber","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"uint64","name":"slot","type":"uint64"},{"internalType":"uint64","name":"proposerIndex","type":"uint64"},{"internalType":"bytes32","name":"parentRoot","type":"bytes32"},{"internalType":"bytes32","name":"stateRoot","type":"bytes32"},{"internalType":"bytes32","name":"bodyRoot","type":"bytes32"}],"internalType":"struct Types.BeaconBlockHeader","name":"attestedHeader","type":"tuple"},{"components":[{"internalType":"bytes","name":"pubkeys","type":"bytes"},{"internalType":"bytes","name":"aggregatePubkey","type":"bytes"}],"internalType":"struct Types.SyncCommittee","name":"nextSyncCommittee","type":"tuple"},{"internalType":"bytes32[]","name":"nextSyncCommitteeBranch","type":"bytes32[]"},{"components":[{"internalType":"uint64","name":"slot","type":"uint64"},{"internalType":"uint64","name":"proposerIndex","type":"uint64"},{"internalType":"bytes32","name":"parentRoot","type":"bytes32"},{"internalType":"bytes32","name":"stateRoot","type":"bytes32"},{"internalType":"bytes32","name":"bodyRoot","type":"bytes32"}],"internalType":"struct Types.BeaconBlockHeader","name":"finalizedHeader","type":"tuple"},{"internalType":"bytes32[]","name":"finalityBranch","type":"bytes32[]"},{"components":[{"internalType":"bytes32","name":"parentHash","type":"bytes32"},{"internalType":"address","name":"feeRecipient","type":"address"},{"internalType":"bytes32","name":"stateRoot","type":"bytes32"},{"internalType":"bytes32","name":"receiptsRoot","type":"bytes32"},{"internalType":"bytes","name":"logsBloom","type":"bytes"},{"internalType":"bytes32","name":"prevRandao","type":"bytes32"},{"internalType":"uint256","name":"blockNumber","type":"uint256"},{"internalType":"uint256","name":"gasLimit","type":"uint256"},{"internalType":"uint256","name":"gasUsed","type":"uint256"},{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"bytes","name":"extraData","type":"bytes"},{"internalType":"uint256","name":"baseFeePerGas","type":"uint256"},{"internalType":"bytes32","name":"blockHash","type":"bytes32"},{"internalType":"bytes32","name":"transactionsRoot","type":"bytes32"},{"internalType":"bytes32","name":"withdrawalsRoot","type":"bytes32"}],"internalType":"struct Types.Execution","name":"finalizedExecution","type":"tuple"},{"internalType":"bytes32[]","name":"executionBranch","type":"bytes32[]"},{"components":[{"internalType":"bytes","name":"syncCommitteeBits","type":"bytes"},{"internalType":"bytes","name":"syncCommitteeSignature","type":"bytes"}],"internalType":"struct Types.SyncAggregate","name":"syncAggregate","type":"tuple"},{"internalType":"uint64","name":"signatureSlot","type":"uint64"}],"internalType":"struct Types.LightClientUpdate","name":"_update","type":"tuple"}],"name":"getUpdateBytes","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"pure","type":"function"},{"inputs":[{"components":[{"internalType":"bytes32","name":"parentHash","type":"bytes32"},{"internalType":"bytes32","name":"sha3Uncles","type":"bytes32"},{"internalType":"address","name":"miner","type":"address"},{"internalType":"bytes32","name":"stateRoot","type":"bytes32"},{"internalType":"bytes32","name":"transactionsRoot","type":"bytes32"},{"internalType":"bytes32","name":"receiptsRoot","type":"bytes32"},{"internalType":"bytes","name":"logsBloom","type":"bytes"},{"internalType":"uint256","name":"difficulty","type":"uint256"},{"internalType":"uint256","name":"number","type":"uint256"},{"internalType":"uint256","name":"gasLimit","type":"uint256"},{"internalType":"uint256","name":"gasUsed","type":"uint256"},{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"bytes","name":"extraData","type":"bytes"},{"internalType":"bytes32","name":"mixHash","type":"bytes32"},{"internalType":"bytes","name":"nonce","type":"bytes"},{"internalType":"uint256","name":"baseFeePerGas","type":"uint256"},{"internalType":"bytes32","name":"withdrawalsRoot","type":"bytes32"}],"internalType":"struct Types.BlockHeader[]","name":"_headers","type":"tuple[]"}],"name":"getHeadersBytes","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"pure","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"bytes32","name":"parentHash","type":"bytes32"},{"internalType":"bytes32","name":"sha3Uncles","type":"bytes32"},{"internalType":"address","name":"miner","type":"address"},{"internalType":"bytes32","name":"stateRoot","type":"bytes32"},{"internalType":"bytes32","name":"transactionsRoot","type":"bytes32"},{"internalType":"bytes32","name":"receiptsRoot","type":"bytes32"},{"internalType":"bytes","name":"logsBloom","type":"bytes"},{"internalType":"uint256","name":"difficulty","type":"uint256"},{"internalType":"uint256","name":"number","type":"uint256"},{"internalType":"uint256","name":"gasLimit","type":"uint256"},{"internalType":"uint256","name":"gasUsed","type":"uint256"},{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"bytes","name":"extraData","type":"bytes"},{"internalType":"bytes32","name":"mixHash","type":"bytes32"},{"internalType":"bytes","name":"nonce","type":"bytes"},{"internalType":"uint256","name":"baseFeePerGas","type":"uint256"},{"internalType":"bytes32","name":"withdrawalsRoot","type":"bytes32"}],"internalType":"struct Types.BlockHeader","name":"header","type":"tuple"},{"components":[{"internalType":"uint256","name":"receiptType","type":"uint256"},{"internalType":"bytes","name":"postStateOrStatus","type":"bytes"},{"internalType":"uint256","name":"cumulativeGasUsed","type":"uint256"},{"internalType":"bytes","name":"bloom","type":"bytes"},{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"bytes[]","name":"topics","type":"bytes[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct Types.TxLog[]","name":"logs","type":"tuple[]"}],"internalType":"struct Types.TxReceipt","name":"txReceipt","type":"tuple"},{"internalType":"bytes","name":"keyIndex","type":"bytes"},{"internalType":"bytes[]","name":"proof","type":"bytes[]"}],"internalType":"struct Types.ReceiptProof","name":"receiptProof","type":"tuple"}],"name":"getBytes","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"_chainId","type":"uint256"},{"internalType":"uint256","name":"_logIndex","type":"uint256"},{"internalType":"bytes32","name":"_orderId","type":"bytes32"},{"internalType":"bytes","name":"_receiptProof","type":"bytes"}],"name":"messageIn","outputs":[],"stateMutability":"nonpayable","type":"function"}]` - ConfluxAbiJson = `[{"inputs":[{"internalType":"uint256","name":"height","type":"uint256"}],"name":"nearestPivot","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"headers","type":"bytes[]"}],"name":"getBlockHeaderBytes","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"pure","type":"function"},{"inputs":[{"components":[{"internalType":"bytes[]","name":"headers","type":"bytes[]"},{"internalType":"bytes","name":"blockIndex","type":"bytes"},{"components":[{"components":[{"internalType":"bytes32","name":"nibbles","type":"bytes32"},{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"end","type":"uint256"}],"internalType":"struct ProofLib.NibblePath","name":"path","type":"tuple"},{"internalType":"bytes32[16]","name":"children","type":"bytes32[16]"},{"internalType":"bytes","name":"value","type":"bytes"}],"internalType":"struct ProofLib.ProofNode[]","name":"blockProof","type":"tuple[]"},{"internalType":"bytes32","name":"receiptsRoot","type":"bytes32"},{"internalType":"bytes","name":"index","type":"bytes"},{"internalType":"bytes","name":"receipt","type":"bytes"},{"components":[{"components":[{"internalType":"bytes32","name":"nibbles","type":"bytes32"},{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"end","type":"uint256"}],"internalType":"struct ProofLib.NibblePath","name":"path","type":"tuple"},{"internalType":"bytes32[16]","name":"children","type":"bytes32[16]"},{"internalType":"bytes","name":"value","type":"bytes"}],"internalType":"struct ProofLib.ProofNode[]","name":"receiptProof","type":"tuple[]"}],"internalType":"struct Types.ReceiptProof","name":"proof","type":"tuple"}],"name":"verifyReceiptProof","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint64","name":"epoch","type":"uint64"},{"internalType":"uint64","name":"round","type":"uint64"},{"internalType":"bytes32","name":"id","type":"bytes32"},{"internalType":"bytes32","name":"executedStateId","type":"bytes32"},{"internalType":"uint64","name":"version","type":"uint64"},{"internalType":"uint64","name":"timestampUsecs","type":"uint64"},{"components":[{"internalType":"uint64","name":"epoch","type":"uint64"},{"components":[{"internalType":"bytes32","name":"account","type":"bytes32"},{"internalType":"bytes","name":"uncompressedPublicKey","type":"bytes"},{"internalType":"bytes","name":"vrfPublicKey","type":"bytes"},{"internalType":"uint64","name":"votingPower","type":"uint64"}],"internalType":"struct LedgerInfoLib.ValidatorInfo[]","name":"validators","type":"tuple[]"},{"internalType":"uint64","name":"quorumVotingPower","type":"uint64"},{"internalType":"uint64","name":"totalVotingPower","type":"uint64"},{"internalType":"bytes","name":"vrfSeed","type":"bytes"}],"internalType":"struct LedgerInfoLib.EpochState","name":"nextEpochState","type":"tuple"},{"components":[{"internalType":"bytes32","name":"blockHash","type":"bytes32"},{"internalType":"uint64","name":"height","type":"uint64"}],"internalType":"struct LedgerInfoLib.Decision","name":"pivot","type":"tuple"},{"internalType":"bytes32","name":"consensusDataHash","type":"bytes32"},{"internalType":"bytes32[]","name":"accounts","type":"bytes32[]"},{"internalType":"bytes","name":"aggregatedSignature","type":"bytes"}],"internalType":"struct LedgerInfoLib.LedgerInfoWithSignatures","name":"ledgerInfo","type":"tuple"}],"name":"relayPOS","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_chainId","type":"uint256"},{"internalType":"uint256","name":"_logIndex","type":"uint256"},{"internalType":"bytes32","name":"_orderId","type":"bytes32"},{"internalType":"bytes","name":"_receiptProof","type":"bytes"}],"name":"messageIn","outputs":[],"stateMutability":"nonpayable","type":"function"}]` - OtherAbi = `[{"inputs":[],"name":"state","outputs":[{"components":[{"internalType":"uint256","name":"epoch","type":"uint256"},{"internalType":"uint256","name":"round","type":"uint256"},{"internalType":"uint256","name":"earliestBlockNumber","type":"uint256"},{"internalType":"uint256","name":"finalizedBlockNumber","type":"uint256"},{"internalType":"uint256","name":"blocks","type":"uint256"},{"internalType":"uint256","name":"maxBlocks","type":"uint256"}],"internalType":"struct ILightNode.GetStatus","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_chainId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"finalizedState","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"curValiditors","type":"bytes"},{"components":[{"internalType":"bytes","name":"parentHash","type":"bytes"},{"internalType":"address","name":"coinbase","type":"address"},{"internalType":"bytes","name":"root","type":"bytes"},{"internalType":"bytes","name":"txHash","type":"bytes"},{"internalType":"bytes","name":"receiptHash","type":"bytes"},{"internalType":"bytes","name":"bloom","type":"bytes"},{"internalType":"uint256","name":"number","type":"uint256"},{"internalType":"uint256","name":"gasLimit","type":"uint256"},{"internalType":"uint256","name":"gasUsed","type":"uint256"},{"internalType":"uint256","name":"time","type":"uint256"},{"internalType":"bytes","name":"extraData","type":"bytes"},{"internalType":"bytes","name":"mixDigest","type":"bytes"},{"internalType":"bytes","name":"nonce","type":"bytes"},{"internalType":"uint256","name":"baseFee","type":"uint256"}],"internalType":"struct ILightNodePoint.blockHeader","name":"bh","type":"tuple"},{"components":[{"internalType":"address[]","name":"validators","type":"address[]"},{"internalType":"bytes[]","name":"addedPubKey","type":"bytes[]"},{"internalType":"bytes[]","name":"addedG1PubKey","type":"bytes[]"},{"internalType":"uint256","name":"removeList","type":"uint256"},{"internalType":"bytes","name":"seal","type":"bytes"},{"components":[{"internalType":"uint256","name":"bitmap","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"uint256","name":"round","type":"uint256"}],"internalType":"struct ILightNodePoint.istanbulAggregatedSeal","name":"aggregatedSeal","type":"tuple"},{"components":[{"internalType":"uint256","name":"bitmap","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"uint256","name":"round","type":"uint256"}],"internalType":"struct ILightNodePoint.istanbulAggregatedSeal","name":"parentAggregatedSeal","type":"tuple"}],"internalType":"struct ILightNodePoint.istanbulExtra","name":"ist","type":"tuple"},{"internalType":"uint256[8]","name":"zkProofs","type":"uint256[8]"}],"name":"updateBlockHeader","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"nodeType","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"_receiptProof","type":"bytes"}],"name":"verifyProofData","outputs":[{"internalType":"bool","name":"success","type":"bool"},{"internalType":"string","name":"message","type":"string"},{"internalType":"bytes","name":"logs","type":"bytes"}],"stateMutability":"view","type":"function"}]` - OracleAbiJson = `[{"inputs":[{"internalType":"uint256","name":"_chainId","type":"uint256"},{"internalType":"bytes32","name":"_hash","type":"bytes32"}],"name":"updateBlockHeader","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_chainId","type":"uint256"},{"internalType":"uint256","name":"_blockNum","type":"uint256"},{"internalType":"bytes32","name":"_orderId","type":"bytes32"}],"name":"getOrderStatus","outputs":[{"internalType":"bool","name":"exists","type":"bool"},{"internalType":"bool","name":"verifiable","type":"bool"},{"internalType":"uint256","name":"nodeType","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"blockNum","type":"uint256"},{"internalType":"bytes32","name":"receiptRoot","type":"bytes32"}],"name":"propose","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"blockNum","type":"uint256"},{"components":[{"components":[{"internalType":"uint256","name":"receiptType","type":"uint256"},{"internalType":"bytes","name":"postStateOrStatus","type":"bytes"},{"internalType":"uint256","name":"cumulativeGasUsed","type":"uint256"},{"internalType":"bytes","name":"bloom","type":"bytes"},{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"bytes[]","name":"topics","type":"bytes[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"structVerify.TxLog[]","name":"logs","type":"tuple[]"}],"internalType":"structVerify.TxReceipt","name":"txReceipt","type":"tuple"},{"internalType":"bytes","name":"keyIndex","type":"bytes"},{"internalType":"bytes[]","name":"proof","type":"bytes[]"}],"internalType":"structVerify.ReceiptProof","name":"receiptProof","type":"tuple"}],"internalType":"structLightNode.ProofData","name":"_proof","type":"tuple"}],"name":"getBytes","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"pure","type":"function"}]` - ProofAbiJson = `[{"inputs":[{"components":[{"internalType":"uint256","name":"blockNum","type":"uint256"},{"components":[{"internalType":"bytes","name":"txReceipt","type":"bytes"},{"internalType":"uint256","name":"receiptType","type":"uint256"},{"internalType":"bytes","name":"keyIndex","type":"bytes"},{"internalType":"bytes[]","name":"proof","type":"bytes[]"}],"internalType":"struct Verify.ReceiptProof","name":"receiptProof","type":"tuple"}],"internalType":"struct LightNode.ProofData","name":"_proof","type":"tuple"}],"name":"getBytes","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"pure","type":"function"}]` - TronAbiJson = `[{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"resourceType","type":"uint256"}],"name":"rentResource","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"resourceType","type":"uint256"}],"name":"returnResource","outputs":[{"internalType":"uint256","name":"_","type":"uint256"}],"stateMutability":"payable","type":"function"}]` - SignerJson = `[{"inputs":[],"name":"multisigInfo","outputs":[{"internalType":"bytes32","name":"version","type":"bytes32"},{"internalType":"uint256","name":"quorum","type":"uint256"},{"internalType":"address[]","name":"singers","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"uint256","name":"blockNum","type":"uint256"},{"internalType":"bytes32","name":"rootHash","type":"bytes32"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"propose","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"uint256","name":"blockNum","type":"uint256"},{"internalType":"bytes32","name":"rootHash","type":"bytes32"},{"internalType":"bytes32","name":"version","type":"bytes32"}],"name":"proposalInfo","outputs":[{"internalType":"address[]","name":"singers","type":"address[]"},{"internalType":"bytes[]","name":"signatures","type":"bytes[]"},{"internalType":"bool","name":"canVerify","type":"bool"}],"stateMutability":"view","type":"function"}]` - PackJson = `[{"inputs":[{"internalType":"bytes32","name":"rootHash","type":"bytes32"},{"internalType":"bytes32","name":"version","type":"bytes32"},{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"uint256","name":"blockNum","type":"uint256"}],"name":"soliditypack","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"bytes","name":"txReceipt","type":"bytes"},{"internalType":"uint256","name":"receiptType","type":"uint256"},{"internalType":"bytes","name":"keyIndex","type":"bytes"},{"internalType":"bytes[]","name":"proof","type":"bytes[]"}],"internalType":"struct Verify.ReceiptProof","name":"receiptProof","type":"tuple"}],"name":"mptPack","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"pure","type":"function"}]` - GetJson = `[{"inputs":[{"components":[{"internalType":"enum LightNodeV2.ProofType","name":"proofType","type":"uint8"},{"internalType":"uint256","name":"blockNum","type":"uint256"},{"internalType":"bytes32","name":"receiptRoot","type":"bytes32"},{"internalType":"bytes[]","name":"signatures","type":"bytes[]"},{"internalType":"bytes","name":"proof","type":"bytes"}],"internalType":"struct LightNodeV2.ProofData","name":"_proof","type":"tuple"}],"name":"getBytes","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"pure","type":"function"}]` - SolJson = `[{"inputs":[{"components":[{"internalType":"bool","name":"relay","type":"bool"},{"internalType":"uint8","name":"messageType","type":"uint8"},{"internalType":"uint256","name":"fromChain","type":"uint256"},{"internalType":"uint256","name":"toChain","type":"uint256"},{"internalType":"bytes32","name":"orderId","type":"bytes32"},{"internalType":"bytes","name":"mos","type":"bytes"},{"internalType":"bytes","name":"token","type":"bytes"},{"internalType":"bytes","name":"initiator","type":"bytes"},{"internalType":"bytes","name":"from","type":"bytes"},{"internalType":"bytes","name":"to","type":"bytes"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"gasLimit","type":"uint256"},{"internalType":"bytes","name":"swapData","type":"bytes"}],"internalType":"struct MessageOutEvent","name":"log","type":"tuple"}],"name":"solEventEncode","outputs":[{"internalType":"bytes","name":"addr","type":"bytes"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes","name":"addr","type":"bytes"},{"internalType":"bytes","name":"topic","type":"bytes"},{"internalType":"bytes","name":"event","type":"bytes"}],"name":"solPackReceipt","outputs":[{"internalType":"bytes","name":"addr","type":"bytes"}],"stateMutability":"pure","type":"function"}]` - ValidateJson = `[{"inputs":[{"internalType":"contract ITokenRegister","name":"_register","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"selfChainId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"bool","name":"relay","type":"bool"},{"internalType":"uint256","name":"dstChain","type":"uint256"},{"internalType":"bytes","name":"dstToken","type":"bytes"},{"internalType":"bytes","name":"dstReceiver","type":"bytes"},{"internalType":"uint256","name":"dstMinAmount","type":"uint256"},{"internalType":"bytes","name":"swapData","type":"bytes"}],"internalType":"struct SwapDataValidator.Param","name":"param","type":"tuple"}],"name":"validate","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]` -) diff --git a/internal/mapprotocol/client.go b/internal/mapprotocol/client.go deleted file mode 100644 index ed365b3e..00000000 --- a/internal/mapprotocol/client.go +++ /dev/null @@ -1,214 +0,0 @@ -package mapprotocol - -import ( - "context" - "encoding/json" - "fmt" - "github.com/mapprotocol/compass/pkg/msg" - "io" - "math/big" - "net/http" - "time" - - log "github.com/ChainSafe/log15" - eth "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - maptypes "github.com/mapprotocol/atlas/core/types" - "github.com/mapprotocol/compass/internal/constant" - "github.com/mapprotocol/compass/pkg/ethclient" - "github.com/mapprotocol/compass/pkg/util" -) - -func GetTxsByBn(conn *ethclient.Client, number *big.Int) ([]common.Hash, error) { - block, err := conn.MAPBlockByNumber(context.Background(), number) - if err != nil { - return nil, err - } - - txs := make([]common.Hash, 0, len(block.Transactions)) - for _, tx := range block.Transactions { - ele := common.HexToHash(tx.Hash) - txs = append(txs, ele) - } - return txs, nil -} - -func GetLastReceipt(conn *ethclient.Client, latestBlock *big.Int) (*types.Receipt, error) { - query := eth.FilterQuery{ - FromBlock: latestBlock, - ToBlock: latestBlock, - } - lastLog, err := conn.FilterLogs(context.Background(), query) - if err != nil { - return nil, err - } - receipt := maptypes.NewReceipt(nil, false, 0) - rl := make([]*maptypes.Log, 0, len(lastLog)) - el := make([]*types.Log, 0, len(lastLog)) - for idx, ll := range lastLog { - if idx == 0 { - continue - } - if ll.TxHash != ll.BlockHash { - continue - } - rl = append(rl, &maptypes.Log{ - Address: ll.Address, - Topics: ll.Topics, - Data: ll.Data, - BlockNumber: ll.BlockNumber, - TxHash: ll.TxHash, - TxIndex: ll.TxIndex, - BlockHash: ll.BlockHash, - Index: ll.Index, - Removed: ll.Removed, - }) - tl := ll - el = append(el, &tl) - } - receipt.Logs = rl - receipt.Bloom = maptypes.CreateBloom(maptypes.Receipts{receipt}) - return &types.Receipt{ - Type: receipt.Type, - PostState: receipt.PostState, - Status: receipt.Status, - CumulativeGasUsed: receipt.CumulativeGasUsed, - Bloom: types.BytesToBloom(receipt.Bloom.Bytes()), - Logs: el, - TxHash: receipt.TxHash, - ContractAddress: receipt.ContractAddress, - GasUsed: receipt.GasUsed, - BlockHash: receipt.BlockHash, - BlockNumber: receipt.BlockNumber, - TransactionIndex: receipt.TransactionIndex, - }, nil -} - -type Zk struct { - Code int `json:"code"` - Msg string `json:"msg"` - Data struct { - Height string `json:"height"` - Status int `json:"status"` - Result struct { - Proof struct { - PiA []string `json:"pi_a"` - PiB [][]string `json:"pi_b"` - PiC []string `json:"pi_c"` - Protocol string `json:"protocol"` - } `json:"proof"` - PublicInput []string `json:"public_input"` - } `json:"result"` - ErrorMsg string `json:"error_msg"` - } `json:"data"` -} - -func GetZkProof(endpoint string, cid msg.ChainId, height uint64) ([]*big.Int, error) { - ret := make([]*big.Int, 0, 8) - for { - resp, err := http.Get(fmt.Sprintf("%s/proof?chain_id=%d&height=%d", endpoint, cid, height)) - if err != nil { - util.Alarm(context.Background(), fmt.Sprintf("GetZkProof cid(%d) request failed, err is %v", height, err)) - log.Error("GetZkProof request failed", "err", err, "height", height, "cid", cid) - time.Sleep(constant.BlockRetryInterval) - continue - } - body, err := io.ReadAll(resp.Body) - if err != nil { - log.Error("GetZkProof read body failed", "err", err) - time.Sleep(constant.BlockRetryInterval) - continue - } - _ = resp.Body.Close() - zk := &Zk{} - err = json.Unmarshal(body, zk) - if err != nil { - util.Alarm(context.Background(), fmt.Sprintf("GetZkProof cid(%d) Unmarshal failed, err is %v", height, err)) - log.Error("GetZkProof Unmarshal failed", "err", err, "data", string(body)) - time.Sleep(constant.BlockRetryInterval) - continue - } - // check status - if zk.Data.Status != 3 { - //util.Alarm(context.Background(), fmt.Sprintf("GetZkProof cid(%d) height(%d) Proof Not Ready", cid, height)) - log.Info("GetZkProof Proof Not Read", "cid", cid, "height", height) - time.Sleep(constant.BalanceRetryInterval) - continue - } - ret = append(ret, getId(zk.Data.Result.Proof.PiA)...) - for _, bs := range zk.Data.Result.Proof.PiB { - ret = append(ret, getId(bs)...) - } - ret = append(ret, getId(zk.Data.Result.Proof.PiC)...) - break - } - return ret, nil -} - -func GetCurValidators(cli *ethclient.Client, number *big.Int) ([]byte, error) { - snapshot, err := cli.GetValidatorsBLSPublicKeys(context.Background(), number) - if err != nil { - return nil, err - } - - ret := make([][]byte, 0) - for _, v := range snapshot { - ele := make([]byte, 0) - for _, k := range v { - ele = append(ele, k) - } - ret = append(ret, ele) - } - - return makeValidatorInfo(ret), nil -} - -func getId(ss []string) []*big.Int { - ret := make([]*big.Int, 0, len(ss)) - for _, s := range ss { - if s == "0" || s == "1" || len(s) <= 1 { - continue - } - setString, ok := big.NewInt(0).SetString(s, 10) - if !ok { - continue - } - ret = append(ret, setString) - } - return ret -} - -var ( - PUBLENGTH = 128 -) - -func makeValidatorInfo(blsPubkeys [][]byte) []byte { - data := make([]byte, 0) - count := len(blsPubkeys) - left := 0 - if PUBLENGTH > count { - left = PUBLENGTH - count - } - length := left * 160 - data1 := make([]byte, length) - // info: pubkey+weight - for i := 0; i < count; i++ { - data = append(data, blsPubkeys[i]...) - weight := []byte{0x01} - weight = padTo32Bytes(weight) - data = append(data, weight...) - } - data = append(data, data1...) - return data -} - -func padTo32Bytes(data []byte) []byte { - paddingSize := 32 - len(data) - if paddingSize <= 0 { - return data - } - paddedData := make([]byte, 32) - copy(paddedData[paddingSize:], data) - return paddedData -} diff --git a/internal/mapprotocol/mapprotocol.go b/internal/mapprotocol/mapprotocol.go deleted file mode 100644 index ee9e7042..00000000 --- a/internal/mapprotocol/mapprotocol.go +++ /dev/null @@ -1,233 +0,0 @@ -// Copyright 2021 Compass Systems -// SPDX-License-Identifier: LGPL-3.0-only - -package mapprotocol - -import ( - "context" - "encoding/json" - "fmt" - "github.com/mapprotocol/compass/internal/constant" - "github.com/mapprotocol/compass/pkg/contract" - "github.com/mapprotocol/compass/pkg/msg" - nearclient "github.com/mapprotocol/near-api-go/pkg/client" - "math/big" - - "github.com/mapprotocol/near-api-go/pkg/client/block" - - "github.com/ethereum/go-ethereum" - goeth "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/common" - "github.com/mapprotocol/compass/pkg/ethclient" - "github.com/pkg/errors" -) - -type GetHeight func() (*big.Int, error) -type GetVerifyRange func() (*big.Int, *big.Int, error) - -var ( - MapId string - GlobalMapConn *ethclient.Client - SyncOtherMap = make(map[msg.ChainId]*big.Int) // map to other chain init height - Map2OtherHeight = make(map[msg.ChainId]GetHeight) // get map to other height function collect - ContractMapping = make(map[msg.ChainId]*contract.Call) - LightNodeMapping = make(map[msg.ChainId]*contract.Call) - SingMapping = make(map[msg.ChainId]*contract.Call) - MosMapping = make(map[msg.ChainId]string) - Get2MapHeight = func(chainId msg.ChainId) (*big.Int, error) { return nil, nil } // get other chain to map height - GetEth22MapNumber = func(chainId msg.ChainId) (*big.Int, *big.Int, error) { return nil, nil, nil } // can reform, return data is []byte - GetDataByManager = func(string, ...interface{}) ([]byte, error) { return nil, nil } - GetNodeTypeByManager = func(string, ...interface{}) (*big.Int, error) { return nil, nil } -) - -func InitLightManager(lightNode common.Address) { - GetDataByManager = func(method string, params ...interface{}) ([]byte, error) { - input, err := PackInput(LightManger, method, params...) - if err != nil { - return nil, errors.Wrap(err, "get other2map packInput failed") - } - output, err := GlobalMapConn.CallContract( - context.Background(), - goeth.CallMsg{From: constant.ZeroAddress, To: &lightNode, Data: input}, - nil, - ) - if err != nil { - return nil, err - } - outputs := LightManger.Methods[method].Outputs - unpack, err := outputs.Unpack(output) - if err != nil { - return nil, err - } - ret := make([]byte, 0) - if err = outputs.Copy(&ret, unpack); err != nil { - return nil, err - } - - return ret, nil - } -} - -func Init2GetEth22MapNumber(lightNode common.Address) { - GetEth22MapNumber = func(chainId msg.ChainId) (*big.Int, *big.Int, error) { - input, err := PackInput(LightManger, MethodClientState, big.NewInt(int64(chainId))) - if err != nil { - return nil, nil, errors.Wrap(err, "get eth22map packInput failed") - } - - output, err := GlobalMapConn.CallContract(context.Background(), - goeth.CallMsg{From: constant.ZeroAddress, To: &lightNode, Data: input}, nil) - if err != nil { - return nil, nil, err - } - - outputs := LightManger.Methods[MethodClientState].Outputs - unpack, err := outputs.Unpack(output) - if err != nil { - return nil, nil, err - } - - back := make([]byte, 0) - if err = outputs.Copy(&back, unpack); err != nil { - return nil, nil, err - } - - ret := struct { - StartNumber *big.Int - EndNumber *big.Int - }{} - analysis, err := Eth2.Methods[MethodClientStateAnalysis].Outputs.Unpack(back) - if err != nil { - return nil, nil, errors.Wrap(err, "analysis") - } - if err = Eth2.Methods[MethodClientStateAnalysis].Outputs.Copy(&ret, analysis); err != nil { - return nil, nil, errors.Wrap(err, "analysis copy") - } - - return ret.StartNumber, ret.EndNumber, nil - } -} - -func InitOtherChain2MapHeight(lightManager common.Address) { - Get2MapHeight = func(chainId msg.ChainId) (*big.Int, error) { - input, err := PackInput(LightManger, MethodOfHeaderHeight, big.NewInt(int64(chainId))) - if err != nil { - return nil, errors.Wrap(err, "get other2map by manager packInput failed") - } - - height, err := HeaderHeight(lightManager, input) - if err != nil { - return nil, errors.Wrap(err, "get other2map headerHeight by lightManager failed") - } - return height, nil - } -} - -func Map2EthHeight(fromUser string, lightNode common.Address, client *ethclient.Client) GetHeight { - return func() (*big.Int, error) { - from := common.HexToAddress(fromUser) - input, err := PackInput(Height, MethodOfHeaderHeight) - if err != nil { - return nil, fmt.Errorf("pack lightNode headerHeight Input failed, err is %v", err.Error()) - } - output, err := client.CallContract(context.Background(), - ethereum.CallMsg{ - From: from, - To: &lightNode, - Data: input, - }, - nil, - ) - if err != nil { - return nil, fmt.Errorf("headerHeight callContract failed, err is %v", err.Error()) - } - - return UnpackHeaderHeightOutput(output) - } -} - -func Map2NearHeight(lightNode string, client *nearclient.Client) GetHeight { - return func() (*big.Int, error) { - res, err := client.ContractViewCallFunction(context.Background(), lightNode, NearHeaderHeight, - "e30=", block.FinalityFinal()) - if err != nil { - return nil, errors.Wrap(err, "call near lightNode to headerHeight failed") - } - - if res.Error != nil { - return nil, fmt.Errorf("call near lightNode to get headerHeight resp exist error(%v)", *res.Error) - } - - result := "" // use string return - err = json.Unmarshal(res.Result, &result) - if err != nil { - return nil, errors.Wrap(err, "near lightNode headerHeight resp json marshal failed") - } - ret := new(big.Int) - ret.SetString(result, 10) - return ret, nil - } -} - -func PackInput(commonAbi abi.ABI, abiMethod string, params ...interface{}) ([]byte, error) { - input, err := commonAbi.Pack(abiMethod, params...) - if err != nil { - return nil, err - } - return input, nil -} - -func UnpackHeaderHeightOutput(output []byte) (*big.Int, error) { - outputs := Height.Methods[MethodOfHeaderHeight].Outputs - unpack, err := outputs.Unpack(output) - if err != nil { - return big.NewInt(0), err - } - - height := new(big.Int) - if err = outputs.Copy(&height, unpack); err != nil { - return big.NewInt(0), err - } - return height, nil -} - -func HeaderHeight(to common.Address, input []byte) (*big.Int, error) { - output, err := GlobalMapConn.CallContract(context.Background(), goeth.CallMsg{From: constant.ZeroAddress, To: &to, Data: input}, nil) - if err != nil { - return nil, err - } - height, err := UnpackHeaderHeightOutput(output) - if err != nil { - return nil, err - } - return height, nil -} - -func LightManagerNodeType(lightNode common.Address) { - GetNodeTypeByManager = func(method string, params ...interface{}) (*big.Int, error) { - input, err := PackInput(LightManger, method, params...) - if err != nil { - return nil, errors.Wrap(err, "get other2map packInput failed") - } - output, err := GlobalMapConn.CallContract( - context.Background(), - goeth.CallMsg{From: constant.ZeroAddress, To: &lightNode, Data: input}, - nil, - ) - if err != nil { - return nil, err - } - outputs := LightManger.Methods[method].Outputs - unpack, err := outputs.Unpack(output) - if err != nil { - return nil, err - } - ret := new(big.Int) - if err = outputs.Copy(&ret, unpack); err != nil { - return nil, err - } - - return ret, nil - } -} diff --git a/internal/mapprotocol/message_out.go b/internal/mapprotocol/message_out.go deleted file mode 100644 index fc57a6f9..00000000 --- a/internal/mapprotocol/message_out.go +++ /dev/null @@ -1,19 +0,0 @@ -package mapprotocol - -import "math/big" - -type MessageOutEvent struct { - Relay bool - MessageType uint8 - FromChain *big.Int - ToChain *big.Int - OrderId [32]byte - Mos []byte - Token []byte - Initiator []byte - From []byte - To []byte - Amount *big.Int - GasLimit *big.Int - SwapData []byte -} diff --git a/internal/mapprotocol/near.go b/internal/mapprotocol/near.go deleted file mode 100644 index 8401beb0..00000000 --- a/internal/mapprotocol/near.go +++ /dev/null @@ -1,135 +0,0 @@ -package mapprotocol - -import ( - "math/big" - - "github.com/mapprotocol/near-api-go/pkg/client" - "github.com/mapprotocol/near-api-go/pkg/types" - "github.com/mapprotocol/near-api-go/pkg/types/hash" - "github.com/mapprotocol/near-api-go/pkg/types/key" - "github.com/mapprotocol/near-api-go/pkg/types/signature" -) - -type StreamerMessage struct { - Block client.BlockView `json:"block"` - Shards []IndexerShard `json:"shards"` -} - -type IndexerShard struct { - Chunk *IndexerChunkView `json:"chunk"` - ReceiptExecutionOutcomes []IndexerExecutionOutcomeWithReceipt `json:"receipt_execution_outcomes"` - ShardID types.ShardID `json:"shard_id"` - StateChanges StateChangesView `json:"state_changes"` -} - -type IndexerChunkView struct { - Author types.AccountID `json:"author"` - Header client.ChunkHeaderView `json:"header"` - Receipts []ReceiptView `json:"receipts"` - //Transactions []IndexerTransactionWithOutcome `json:"transactions"` -} - -type ReceiptView struct { - PredecessorId types.AccountID `json:"predecessor_id"` - ReceiverID types.AccountID `json:"receiver_id"` - ReceiptID hash.CryptoHash `jsom:"receipt_id"` - Receipt Receipt `json:"receipt"` -} - -type Receipt struct { - Action Action `json:"Action"` -} - -type Action struct { - Actions []interface{} `json:"actions"` // - //Actions []map[string]interface{} `json:"actions"` // - GasPrice string `json:"gas_price"` - InputDataIds []interface{} `json:"input_data_ids"` - OutputDataReceivers []interface{} `json:"output_data_receivers"` - SignerID string `json:"signer_id"` - SignerPublicKey string `json:"signer_public_key"` -} - -type IndexerTransactionWithOutcome struct { - Outcome IndexerExecutionOutcomeWithOptionalReceipt `json:"outcome"` - Transaction SignedTransactionView `json:"transaction"` -} - -type SignedTransactionView struct { - SignerID types.AccountID `json:"signer_id"` - PublicKey key.Base58PublicKey `json:"public_key"` - Nonce types.Nonce `json:"nonce"` - ReceiverID types.AccountID `json:"receiver_id"` - Actions []interface{} `json:"actions"` - Signature signature.Base58Signature `json:"signature"` - Hash hash.CryptoHash `json:"hash"` -} - -type IndexerExecutionOutcomeWithReceipt struct { - ExecutionOutcome ExecutionOutcomeWithIdView `json:"execution_outcome"` - Receipt ReceiptView `json:"receipt"` -} - -type ExecutionOutcomeWithIdView struct { - BlockHash hash.CryptoHash `json:"block_hash"` - ID hash.CryptoHash `json:"id"` - Outcome ExecutionOutcomeView `json:"outcome"` - Proof MerklePath `json:"proof"` -} - -type ExecutionOutcomeView struct { - ExecutorID types.AccountID `json:"executor_id"` - GasBurnt types.Gas `json:"gas_burnt"` - Logs []string `json:"logs"` - Metadata Metadata `json:"metadata"` - ReceiptIDs []hash.CryptoHash `json:"receipt_ids"` - Status client.TransactionStatus `json:"status"` - TokensBurnt string `json:"tokens_burnt"` // "242953087248000000000" -} - -type MerklePathItem struct { - Hash hash.CryptoHash `json:"hash"` - Direction string `json:"direction"` -} - -type MerklePath = []MerklePathItem - -type IndexerExecutionOutcomeWithOptionalReceipt struct { - ExecutionOutcome ExecutionOutcomeWithIdView `json:"execution_outcome"` - Receipt *client.ReceiptView `json:"receipt"` -} - -type StateChangesView []StateChangeWithCauseView - -type StateChangeWithCauseView struct { - Type TypeOfStateChange `json:"type"` - Cause StateChangeCauseView `json:"cause"` - Change StateChangeView `json:"change"` - // Value StateChangeValueView `json:"value"` -} - -type StateChangeCauseView struct { - ReceiptHash string `json:"receipt_hash"` - Type string `json:"type"` -} - -type StateChangeView struct { - AccountId types.AccountID `json:"account_id"` - Amount string `json:"amount"` - CodeHash string `json:"code_hash"` - Locked string `json:"locked"` - StoragePaidAt int64 `json:"storage_paid_at"` - StorageUsage int64 `json:"storage_usage"` - CodeBase64 string `json:"code_base_64"` -} - -type AccessKey struct { - Nonce *big.Int - Permission string -} - -// type StateChangeValueView json.RawMessage - -type ( - TypeOfStateChange string -) diff --git a/internal/mapprotocol/params.go b/internal/mapprotocol/params.go deleted file mode 100644 index 07a148bf..00000000 --- a/internal/mapprotocol/params.go +++ /dev/null @@ -1,107 +0,0 @@ -package mapprotocol - -import ( - "github.com/mapprotocol/compass/pkg/msg" - "math/big" - "strings" - - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/common" -) - -const ( - MethodVerifyProofData = "verifyProofData" - MethodUpdateBlockHeader = "updateBlockHeader" - MethodOfHeaderHeight = "headerHeight" - MethodOfTransferIn = "transferIn" - MethodOfDepositIn = "depositIn" - MethodOfSwapIn = "swapIn" - MethodOfOrderList = "orderList" - MethodOfIsUsedEvent = "is_used_event" - MethodOfGetBytes = "getBytes" - MethodOfGetFinalBytes = "getFinalBytes" - MethodOfGetHeadersBytes = "getHeadersBytes" - MethodOfGetBlockHeadersBytes = "getBlockHeaderBytes" - MethodOfGetUpdatesBytes = "getUpdateBytes" - MethodUpdateLightClient = "updateLightClient" - MethodClientState = "clientState" - MethodClientStateAnalysis = "clientStateAnalysis" - MethodOfState = "state" - MethodOfNearestPivot = "nearestPivot" - MethodOFinalizedState = "finalizedState" - MethodOfVerifyReceiptProof = "verifyReceiptProof" - MethodOfOrderStatus = "getOrderStatus" - MethodOfPropose = "propose" - MethodOfMessageIn = "messageIn" - MethodOfMulSignInfo = "multisigInfo" - MethodOfProposalInfo = "proposalInfo" - MethodOfSolidityPack = "soliditypack" - MethodOfNodeType = "nodeType" - MethodOfMptPack = "mptPack" - MethodOfSolEventEncode = "solEventEncode" - MethodOfSolPackReceipt = "solPackReceipt" - MethodOfValidate = "validate" -) - -const ( - NearHeaderHeight = "get_header_height" -) - -const ( - EpochOfMap = 50000 - EpochOfBsc = 200 - HeaderCountOfBsc = 12 - HeaderCountOfMatic = 16 - EpochOfKlaytn = 3600 - HeaderOneCount = 1 -) - -var ( - Big0 = big.NewInt(0) -) - -var ( - TopicOfClientNotify = common.HexToHash("0x7063ee7ac21ca792eb7d62d3a65598a5c986c4b0f7bd701aa453eb8a1387c956") - TopicOfManagerNotifySend = common.HexToHash("0x6644f11ec136e82ae3a252660a2fea9e5d412868cd38474ba2ba564b8f19cb73") - NearOfDepositIn = "150bd848adaf4e3e699dcac82d75f111c078ce893375373593cc1b9208998377" - NearOfSwapIn = "ca1cf8cebf88499429cca8f87cbca15ab8dafd06702259a5344ddce89ef3f3a5" -) - -var ( - Mcs, _ = abi.JSON(strings.NewReader(McsAbi)) - Bsc, _ = abi.JSON(strings.NewReader(BscAbiJson)) - Conflux, _ = abi.JSON(strings.NewReader(ConfluxAbiJson)) - Klaytn, _ = abi.JSON(strings.NewReader(KlaytnAbiJson)) - Near, _ = abi.JSON(strings.NewReader(NearAbiJson)) - LightManger, _ = abi.JSON(strings.NewReader(LightMangerAbi)) - Map2Other, _ = abi.JSON(strings.NewReader(Map2OtherAbi)) - Height, _ = abi.JSON(strings.NewReader(HeightAbiJson)) - Matic, _ = abi.JSON(strings.NewReader(MaticAbiJson)) - Eth2, _ = abi.JSON(strings.NewReader(Eth2AbiJson)) - Other, _ = abi.JSON(strings.NewReader(OtherAbi)) - OracleAbi, _ = abi.JSON(strings.NewReader(OracleAbiJson)) - ProofAbi, _ = abi.JSON(strings.NewReader(ProofAbiJson)) - TronAbi, _ = abi.JSON(strings.NewReader(TronAbiJson)) - SignerAbi, _ = abi.JSON(strings.NewReader(SignerJson)) - PackAbi, _ = abi.JSON(strings.NewReader(PackJson)) - GetAbi, _ = abi.JSON(strings.NewReader(GetJson)) - SolAbi, _ = abi.JSON(strings.NewReader(SolJson)) -) - -type Role string - -var ( - RoleOfMaintainer Role = "maintainer" - RoleOfMessenger Role = "messenger" - RoleOfOracle Role = "oracle" -) - -var ( - OnlineChaId = map[msg.ChainId]string{} -) - -var ( - ConfirmsOfMatic = big.NewInt(10) - HeaderLengthOfEth2 = 20 - HeaderLengthOfConflux = 20 -) diff --git a/internal/mapprotocol/types.go b/internal/mapprotocol/types.go deleted file mode 100644 index 210e9a18..00000000 --- a/internal/mapprotocol/types.go +++ /dev/null @@ -1,363 +0,0 @@ -package mapprotocol - -import ( - "context" - "math/big" - - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - ethtypes "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/light" - "github.com/ethereum/go-ethereum/rlp" - "github.com/mapprotocol/atlas/consensus/istanbul/validator" - "github.com/mapprotocol/atlas/core/types" - "github.com/mapprotocol/atlas/helper/bls" - "github.com/mapprotocol/compass/pkg/ethclient" -) - -var ( - receiptStatusFailedRLP = []byte{} - receiptStatusSuccessfulRLP = []byte{0x01} -) - -type G2 struct { - Xr *big.Int - Xi *big.Int - Yr *big.Int - Yi *big.Int -} - -type BlockHeader struct { - ParentHash []byte - Coinbase common.Address - Root []byte - TxHash []byte - ReceiptHash []byte - Bloom []byte - Number *big.Int - GasLimit *big.Int - GasUsed *big.Int - Time *big.Int - ExtraData []byte - MixDigest []byte - Nonce []byte - BaseFee *big.Int -} - -type TxLog struct { - Addr common.Address - Topics [][]byte - Data []byte -} - -type TxReceipt struct { - ReceiptType *big.Int - PostStateOrStatus []byte - CumulativeGasUsed *big.Int - Bloom []byte - Logs []TxLog -} - -type ReceiptProof struct { - Header *BlockHeader - AggPk *G2 - Receipt *TxReceipt - KeyIndex []byte - Proof [][]byte -} - -type NewMapReceiptProof struct { - Header *BlockHeader - AggPk *G2 - KeyIndex []byte - Proof [][]byte - Ist IstanbulExtra - TxReceiptRlp TxReceiptRlp -} - -type IstanbulExtra struct { - // Validators are the validators that have been added in the block - Validators []common.Address - // AddedPubKey are the BLS public keys for the validators added in the block - AddedPubKey [][]byte - // AddedG1PubKey are the BLS public keys for the validators added in the block - AddedG1PubKey [][]byte - // RemoveList is a bitmap having an active bit for each removed validator in the block - RemoveList *big.Int - // Seal is an ECDSA signature by the proposer - Seal []byte - // AggregatedSeal contains the aggregated BLS signature created via IBFT consensus. - AggregatedSeal IstanbulAggregatedSeal - // ParentAggregatedSeal contains and aggregated BLS signature for the previous block. - ParentAggregatedSeal IstanbulAggregatedSeal -} - -type IstanbulAggregatedSeal struct { - Bitmap *big.Int - Signature []byte - Round *big.Int -} - -func ConvertIstanbulExtra(istanbulExtra *types.IstanbulExtra) *IstanbulExtra { - addedPubKey := make([][]byte, 0, len(istanbulExtra.AddedValidatorsPublicKeys)) - for _, avpk := range istanbulExtra.AddedValidatorsPublicKeys { - data := make([]byte, 0, len(avpk)) - for _, v := range avpk { - data = append(data, v) - } - addedPubKey = append(addedPubKey, data) - } - addedValidatorsG1PublicKeys := make([][]byte, 0, len(istanbulExtra.AddedValidatorsG1PublicKeys)) - for _, avgpk := range istanbulExtra.AddedValidatorsG1PublicKeys { - data := make([]byte, 0, len(avgpk)) - for _, v := range avgpk { - data = append(data, v) - } - addedValidatorsG1PublicKeys = append(addedValidatorsG1PublicKeys, data) - } - - return &IstanbulExtra{ - Validators: istanbulExtra.AddedValidators, - AddedPubKey: addedPubKey, - AddedG1PubKey: addedValidatorsG1PublicKeys, - RemoveList: istanbulExtra.RemovedValidators, - Seal: istanbulExtra.Seal, - AggregatedSeal: IstanbulAggregatedSeal{ - Bitmap: istanbulExtra.AggregatedSeal.Bitmap, - Signature: istanbulExtra.AggregatedSeal.Signature, - Round: istanbulExtra.AggregatedSeal.Round, - }, - ParentAggregatedSeal: IstanbulAggregatedSeal{ - Bitmap: istanbulExtra.ParentAggregatedSeal.Bitmap, - Signature: istanbulExtra.ParentAggregatedSeal.Signature, - Round: istanbulExtra.ParentAggregatedSeal.Round, - }, - } -} - -type TxReceiptRlp struct { - ReceiptType *big.Int - ReceiptRlp []byte -} - -type MapTxReceipt struct { - PostStateOrStatus []byte - CumulativeGasUsed *big.Int - Bloom []byte - Logs []TxLog -} - -type NewReceiptProof struct { - Router common.Address - Coin common.Address - SrcChain *big.Int - DstChain *big.Int - TxProve []byte -} - -type TxProve struct { - Receipt *ethtypes.Receipt - Prove light.NodeList - BlockNumber uint64 - TxIndex uint -} - -func ConvertHeader(header *types.Header) *BlockHeader { - h := &BlockHeader{ - ParentHash: header.ParentHash[:], - Coinbase: header.Coinbase, - Root: header.Root[:], - TxHash: header.TxHash[:], - ReceiptHash: header.ReceiptHash[:], - Bloom: header.Bloom[:], - Number: header.Number, - GasLimit: new(big.Int).SetUint64(header.GasLimit), - GasUsed: new(big.Int).SetUint64(header.GasUsed), - Time: new(big.Int).SetUint64(header.Time), - ExtraData: header.Extra, - MixDigest: header.MixDigest[:], - Nonce: header.Nonce[:], - BaseFee: header.BaseFee, - } - return h -} - -func GetAggPK(cli *ethclient.Client, number *big.Int, extra []byte) (*G2, *types.IstanbulExtra, []byte, error) { - var istanbulExtra *types.IstanbulExtra - if err := rlp.DecodeBytes(extra[32:], &istanbulExtra); err != nil { - return nil, nil, nil, err - } - - snapshot, err := cli.GetSnapshot(context.Background(), number) - if err != nil { - return nil, nil, nil, err - } - - validators := validator.MapValidatorsToDataWithBLSKeyCache(snapshot.ValSet.List()) - publicKeys := make([]bls.SerializedPublicKey, 0) - for i, v := range validators { - if istanbulExtra.AggregatedSeal.Bitmap.Bit(i) == 1 { - publicKeys = append(publicKeys, v.BLSPublicKey) - } - } - - var pks []*bls.PublicKey - for _, v := range publicKeys { - pk, err := bls.UnmarshalPk(v[:]) - if err != nil { - return nil, nil, nil, err - } - pks = append(pks, pk) - } - - aggPKBytes := bls.AggregatePK(pks).Marshal() - return &G2{ - Xi: new(big.Int).SetBytes(aggPKBytes[:32]), - Xr: new(big.Int).SetBytes(aggPKBytes[32:64]), - Yi: new(big.Int).SetBytes(aggPKBytes[64:96]), - Yr: new(big.Int).SetBytes(aggPKBytes[96:128]), - }, istanbulExtra, aggPKBytes, nil -} - -func GetTxReceipt(receipt *ethtypes.Receipt) (*TxReceipt, error) { - logs := make([]TxLog, 0, len(receipt.Logs)) - for _, lg := range receipt.Logs { - topics := make([][]byte, len(lg.Topics)) - for i := range lg.Topics { - topics[i] = lg.Topics[i][:] - } - logs = append(logs, TxLog{ - Addr: lg.Address, - Topics: topics, - Data: lg.Data, - }) - } - - return &TxReceipt{ - ReceiptType: new(big.Int).SetUint64(uint64(receipt.Type)), - PostStateOrStatus: StatusEncoding(receipt), - CumulativeGasUsed: new(big.Int).SetUint64(receipt.CumulativeGasUsed), - Bloom: receipt.Bloom[:], - Logs: logs, - }, nil -} - -func StatusEncoding(r *ethtypes.Receipt) []byte { - if len(r.PostState) == 0 { - if r.Status == types.ReceiptStatusFailed { - return receiptStatusFailedRLP - } - return receiptStatusSuccessfulRLP - } - return r.PostState -} - -type NearNeedHeader struct { - ParentHash common.Hash `json:"parentHash" gencodec:"required"` - Coinbase common.Address `json:"coinbase" gencodec:"required"` - Root common.Hash `json:"root" gencodec:"required"` - TxHash common.Hash `json:"txHash" gencodec:"required"` - ReceiptHash common.Hash `json:"receiptHash" gencodec:"required"` - Bloom types.Bloom `json:"bloom" gencodec:"required"` - Number *hexutil.Big `json:"number" gencodec:"required"` - GasLimit hexutil.Uint64 `json:"gasLimit" gencodec:"required"` - GasUsed hexutil.Uint64 `json:"gasUsed" gencodec:"required"` - Time hexutil.Uint64 `json:"time" gencodec:"required"` - Extra hexutil.Bytes `json:"extra" gencodec:"required"` - MixDigest common.Hash `json:"mixDigest"` - Nonce types.BlockNonce `json:"nonce"` - BaseFee *hexutil.Big `json:"baseFee" rlp:"optional"` - Hash common.Hash `json:"hash"` -} - -func ConvertNearNeedHeader(h *types.Header) *NearNeedHeader { - var enc NearNeedHeader - enc.ParentHash = h.ParentHash - enc.Coinbase = h.Coinbase - enc.Root = h.Root - enc.TxHash = h.TxHash - enc.ReceiptHash = h.ReceiptHash - enc.Bloom = h.Bloom - enc.Number = (*hexutil.Big)(h.Number) - enc.GasLimit = hexutil.Uint64(h.GasLimit) - enc.GasUsed = hexutil.Uint64(h.GasUsed) - enc.Time = hexutil.Uint64(h.Time) - enc.Extra = h.Extra - enc.MixDigest = h.MixDigest - enc.Nonce = h.Nonce - enc.BaseFee = (*hexutil.Big)(h.BaseFee) - enc.Hash = h.Hash() - return &enc -} - -type NearReceiptProof struct { - BlockHeaderLite BlockHeaderLite `json:"block_header_lite"` - BlockProof []BlockProof `json:"block_proof"` - OutcomeProof OutcomeProof `json:"outcome_proof"` - OutcomeRootProof []OutcomeRootProof `json:"outcome_root_proof"` -} - -type InnerLite struct { - BlockMerkleRoot string `json:"block_merkle_root"` - EpochID string `json:"epoch_id"` - Height int `json:"height"` - NextBpHash string `json:"next_bp_hash"` - NextEpochID string `json:"next_epoch_id"` - OutcomeRoot string `json:"outcome_root"` - PrevStateRoot string `json:"prev_state_root"` - Timestamp int64 `json:"timestamp"` - TimestampNanosec string `json:"timestamp_nanosec"` -} - -type BlockHeaderLite struct { - InnerLite InnerLite `json:"inner_lite"` - InnerRestHash string `json:"inner_rest_hash"` - PrevBlockHash string `json:"prev_block_hash"` -} - -type BlockProof struct { - Direction string `json:"direction"` - Hash string `json:"hash"` -} - -type GasProfile struct { - Cost string `json:"cost"` - CostCategory string `json:"cost_category"` - GasUsed string `json:"gas_used"` -} - -type Metadata struct { - GasProfile []GasProfile `json:"gas_profile"` - Version int `json:"version"` -} - -type Status struct { - SuccessValue string `json:"SuccessValue"` -} - -type Outcome struct { - ExecutorID string `json:"executor_id"` - GasBurnt int64 `json:"gas_burnt"` - Logs []interface{} `json:"logs"` - Metadata Metadata `json:"metadata"` - ReceiptIds []string `json:"receipt_ids"` - Status Status `json:"status"` - TokensBurnt string `json:"tokens_burnt"` -} - -type Proof struct { - Direction string `json:"direction"` - Hash string `json:"hash"` -} - -type OutcomeProof struct { - BlockHash string `json:"block_hash"` - ID string `json:"id"` - Outcome Outcome `json:"outcome"` - Proof []Proof `json:"proof"` -} - -type OutcomeRootProof struct { - Direction string `json:"direction"` - Hash string `json:"hash"` -} diff --git a/internal/matic/matic.go b/internal/matic/matic.go deleted file mode 100644 index 9ee089db..00000000 --- a/internal/matic/matic.go +++ /dev/null @@ -1,199 +0,0 @@ -package matic - -import ( - "bytes" - "fmt" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/ethdb/memorydb" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/trie" - "github.com/mapprotocol/compass/internal/constant" - "github.com/mapprotocol/compass/internal/mapprotocol" - "github.com/mapprotocol/compass/internal/proof" - "github.com/mapprotocol/compass/pkg/msg" - "github.com/mapprotocol/compass/pkg/util" - "math/big" -) - -type BlockHeader struct { - ParentHash []byte `json:"parentHash"` - Sha3Uncles []byte `json:"sha3Uncles"` - Miner common.Address `json:"miner"` - StateRoot []byte `json:"stateRoot"` - TransactionsRoot []byte `json:"transactionsRoot"` - ReceiptsRoot []byte `json:"receiptsRoot"` - LogsBloom []byte `json:"logsBloom"` - Difficulty *big.Int `json:"difficulty"` - Number *big.Int `json:"number"` - GasLimit *big.Int `json:"gasLimit"` - GasUsed *big.Int `json:"gasUsed"` - Timestamp *big.Int `json:"timestamp"` - ExtraData []byte `json:"extraData"` - MixHash []byte `json:"mixHash"` - Nonce []byte `json:"nonce"` - BaseFeePerGas *big.Int `json:"baseFeePerGas"` -} - -func ConvertHeader(header *types.Header) BlockHeader { - bloom := make([]byte, 0, len(header.Bloom)) - for _, b := range header.Bloom { - bloom = append(bloom, b) - } - nonce := make([]byte, 0, len(header.Nonce)) - for _, b := range header.Nonce { - nonce = append(nonce, b) - } - return BlockHeader{ - ParentHash: hashToByte(header.ParentHash), - Sha3Uncles: hashToByte(header.UncleHash), - Miner: constant.ZeroAddress, - StateRoot: hashToByte(header.Root), - TransactionsRoot: hashToByte(header.TxHash), - ReceiptsRoot: hashToByte(header.ReceiptHash), - LogsBloom: bloom, - Difficulty: header.Difficulty, - Number: header.Number, - GasLimit: new(big.Int).SetUint64(header.GasLimit), - GasUsed: new(big.Int).SetUint64(header.GasUsed), - Timestamp: new(big.Int).SetUint64(header.Time), - ExtraData: header.Extra, - MixHash: hashToByte(header.MixDigest), - Nonce: nonce, - BaseFeePerGas: header.BaseFee, - } -} - -func hashToByte(h common.Hash) []byte { - ret := make([]byte, 0, len(h)) - for _, b := range h { - ret = append(ret, b) - } - return ret -} - -type ProofData struct { - Headers []BlockHeader - ReceiptProof proof.NewReceiptProof -} - -func AssembleProof(headers []BlockHeader, log *types.Log, fId msg.ChainId, receipts []*types.Receipt, - method string, proofType int64, orderId [32]byte) ([]byte, error) { - txIndex := log.TxIndex - receipt, err := mapprotocol.GetTxReceipt(receipts[txIndex]) - if err != nil { - return nil, err - } - - prf, err := proof.Get(Receipts(receipts), txIndex) - if err != nil { - return nil, err - } - - tr, _ := trie.New(common.Hash{}, trie.NewDatabase(memorydb.New())) - tr = proof.DeriveTire(Receipts(receipts), tr) - ret := tr.Hash() - if ret != common.BytesToHash(headers[0].ReceiptsRoot) { - fmt.Println("Matic generate", ret, "oracle", common.BytesToHash(headers[0].ReceiptsRoot), " not same") - } - - var key []byte - key = rlp.AppendUint64(key[:0], uint64(txIndex)) - //ek := mapo.Key2Hex(key, len(prf)) - - idx := 0 - for i, ele := range receipts[txIndex].Logs { - if ele.Index != log.Index { - continue - } - idx = i - } - - nr := mapprotocol.MapTxReceipt{ - PostStateOrStatus: receipt.PostStateOrStatus, - CumulativeGasUsed: receipt.CumulativeGasUsed, - Bloom: receipt.Bloom, - Logs: receipt.Logs, - } - nrRlp, err := rlp.EncodeToBytes(nr) - if err != nil { - return nil, err - } - - if receipt.ReceiptType.Int64() != 0 { - n := make([]byte, 0) - n = append(n, receipt.ReceiptType.Bytes()...) - n = append(n, nrRlp...) - nrRlp = n - } - - var pack []byte - switch proofType { - case constant.ProofTypeOfOrigin: - pd := ProofData{ - Headers: headers, - ReceiptProof: proof.NewReceiptProof{ - TxReceipt: nrRlp, - ReceiptType: receipt.ReceiptType, - KeyIndex: util.Key2Hex(key, len(prf)), - Proof: prf, - }, - } - - pack, err = proof.V3Pack(fId, method, mapprotocol.Matic, idx, orderId, false, pd) - case constant.ProofTypeOfZk: - case constant.ProofTypeOfOracle: - pd := proof.Data{ - BlockNum: big.NewInt(int64(log.BlockNumber)), - ReceiptProof: proof.ReceiptProof{ - TxReceipt: *receipt, - KeyIndex: util.Key2Hex(key, len(prf)), - Proof: prf, - }, - } - - pack, err = proof.Pack(fId, method, mapprotocol.OracleAbi, pd) - } - - if err != nil { - return nil, err - } - - return pack, nil -} - -type receiptRLP struct { - PostStateOrStatus []byte - CumulativeGasUsed uint64 - Bloom types.Bloom - Logs []*types.Log -} - -type Receipts []*types.Receipt - -// Len returns the number of receipts in this list. -func (rs Receipts) Len() int { return len(rs) } - -// EncodeIndex encodes the i'th receipt to w. -func (rs Receipts) EncodeIndex(i int, w *bytes.Buffer) { - r := rs[i] - data := &receiptRLP{statusEncoding(r), r.CumulativeGasUsed, r.Bloom, r.Logs} - switch r.Type { - case constant.LegacyTxType: - rlp.Encode(w, data) - case constant.AccessListTxType, constant.BlobTxType, constant.SetCodeTxType, constant.DynamicFeeTxType: - w.WriteByte(r.Type) - rlp.Encode(w, data) - default: - } -} - -func statusEncoding(r *types.Receipt) []byte { - if len(r.PostState) == 0 { - if r.Status == constant.ReceiptStatusFailed { - return constant.ReceiptStatusFailedRLP - } - return constant.ReceiptStatusSuccessfulRLP - } - return r.PostState -} diff --git a/internal/near/borsh.go b/internal/near/borsh.go deleted file mode 100644 index cdc260fc..00000000 --- a/internal/near/borsh.go +++ /dev/null @@ -1,308 +0,0 @@ -package near - -import ( - "bytes" - "encoding/base64" - "encoding/binary" - "encoding/json" - "errors" - "fmt" - "io" - "math/big" - - "github.com/mr-tron/base58" - - "github.com/mapprotocol/near-api-go/pkg/client" - "github.com/mapprotocol/near-api-go/pkg/types/key" - "github.com/mapprotocol/near-api-go/pkg/types/signature" -) - -const ( - Version2 = "V2" - ValidatorStakeV1 = 0 - ValidatorStakeV2 = 1 -) - -const ( - ProofDirectionRight = "Right" - ProofDirectionLeft = "Left" -) - -func Borshify(block client.LightClientBlockView) []byte { - var ( - buf bytes.Buffer - innerLite bytes.Buffer - nextBps bytes.Buffer - littleEndian bytes.Buffer - approvalsAfterNext bytes.Buffer - ) - - buf.Write(MustBase58Decode(block.PrevBlockHash.String())) - buf.Write(MustBase58Decode(block.NextBlockInnerHash.String())) - - MustToLittleEndian(&littleEndian, block.InnerLite.Height) - innerLite.Write(littleEndian.Bytes()) - - innerLite.Write(MustBase58Decode(block.InnerLite.EpochID.String())) - innerLite.Write(MustBase58Decode(block.InnerLite.NextEpochId.String())) - innerLite.Write(MustBase58Decode(block.InnerLite.PrevStateRoot.String())) - innerLite.Write(MustBase58Decode(block.InnerLite.OutcomeRoot.String())) - - littleEndian.Reset() - MustToLittleEndian(&littleEndian, block.InnerLite.Timestamp) - innerLite.Write(littleEndian.Bytes()) - - innerLite.Write(MustBase58Decode(block.InnerLite.NextBpHash.String())) - innerLite.Write(MustBase58Decode(block.InnerLite.BlockMerkleRoot.String())) - buf.Write(innerLite.Bytes()) - - buf.Write(MustBase58Decode(block.InnerRestHash.String())) - buf.Write([]byte{1}) - - littleEndian.Reset() - MustToLittleEndian(&littleEndian, int64(len(block.NextBps))) - buf.Write(littleEndian.Next(4)) - - for _, bp := range block.NextBps { - var nextBp bytes.Buffer - if bp.ValidatorStakeStructVersion == Version2 { - nextBp.Write([]byte{ValidatorStakeV2}) - } else { - nextBp.Write([]byte{ValidatorStakeV1}) - } - - littleEndian.Reset() - MustToLittleEndian(&littleEndian, int64(len(bp.AccountID))) - nextBp.Write(littleEndian.Next(4)) - - nextBp.Write([]byte(bp.AccountID)) - if bp.PublicKey.Type == key.KeyTypeED25519 { - nextBp.Write([]byte{0}) - } else { - nextBp.Write([]byte{1}) - } - nextBp.Write(MustBase58Decode(bp.PublicKey.Value)) - - stake, ok := new(big.Int).SetString(bp.Stake.String(), 10) - if !ok { - panic(fmt.Sprintf("stake convert to big.Int failed, stake: %s", bp.Stake.String())) - } - nextBp.Write(reverse16(stake.Bytes())) - nextBps.Write(nextBp.Bytes()) - } - buf.Write(nextBps.Bytes()) - - littleEndian.Reset() - MustToLittleEndian(&littleEndian, int64(len(block.ApprovalsAfterNext))) - buf.Write(littleEndian.Next(4)) - for _, sign := range block.ApprovalsAfterNext { - var aan bytes.Buffer - if sign == nil { - aan.Write([]byte{0}) - } else { - aan.Write([]byte{1}) - if sign.Type == signature.SignatureTypeED25519 { - aan.Write([]byte{0}) - } else { - aan.Write([]byte{1}) - } - aan.Write(MustBase58Decode(sign.Value)) - } - approvalsAfterNext.Write(aan.Bytes()) - } - buf.Write(approvalsAfterNext.Bytes()) - - return buf.Bytes() -} - -func BorshifyOutcomeProof(proof client.RpcLightClientExecutionProofResponse) ([]byte, error) { - var ( - buf bytes.Buffer - tmp bytes.Buffer - outcomeProof bytes.Buffer - outcomeProof2 bytes.Buffer - ) - - // Step1:outComeProof.proof length - MustToLittleEndian(&tmp, int64(len(proof.OutcomeProof.Proof))) - outcomeProof.Write(tmp.Next(4)) - tmp.Reset() - // Step2:outComeProof.proof - for _, p := range proof.OutcomeProof.Proof { - tmp.Write(MustBase58Decode(p.Hash.String())) - if p.Direction == ProofDirectionRight { - tmp.Write([]byte{1}) - } else { - tmp.Write([]byte{0}) - } - outcomeProof.Write(tmp.Bytes()) - tmp.Reset() - } - buf.Write(outcomeProof.Bytes()) - buf.Write(MustBase58Decode(proof.OutcomeProof.BlockHash.String())) - buf.Write(MustBase58Decode(proof.OutcomeProof.ID.String())) - // step3: outComeProof.outCome.logs - // 3.1 length - MustToLittleEndian(&tmp, int64(len(proof.OutcomeProof.Outcome.Logs))) - outcomeProof2.Write(tmp.Next(4)) - tmp.Reset() - // 3.2 logs - logBuf := bytes.Buffer{} - for _, l := range proof.OutcomeProof.Outcome.Logs { - var lb bytes.Buffer - MustToLittleEndian(&tmp, int64(len(l))) - lb.Write(tmp.Next(4)) - tmp.Reset() - lb.Write([]byte(l)) - logBuf.Write(lb.Bytes()) - } - outcomeProof2.Write(logBuf.Bytes()) - // step4: outComeProof.outCome.receiptIDs - MustToLittleEndian(&tmp, int64(len(proof.OutcomeProof.Outcome.ReceiptIDs))) - outcomeProof2.Write(tmp.Next(4)) - tmp.Reset() - // step:4.1 - receiptIDs := bytes.Buffer{} - for _, rId := range proof.OutcomeProof.Outcome.ReceiptIDs { - var rIdBuf bytes.Buffer - rIdBuf.Write(MustBase58Decode(rId.String())) - receiptIDs.Write(rIdBuf.Bytes()) - } - outcomeProof2.Write(receiptIDs.Bytes()) - // step:4.2 - MustToLittleEndian(&tmp, proof.OutcomeProof.Outcome.GasBurnt) - outcomeProof2.Write(tmp.Next(8)) - // step:4.3 - MustToLittleEndian(&tmp, proof.OutcomeProof.Outcome.TokensBurnt) - outcomeProof2.Write(tmp.Next(16)) - tmp.Reset() - // step:4.4 - MustToLittleEndian(&tmp, int64(len(proof.OutcomeProof.Outcome.ExecutorID))) - outcomeProof2.Write(tmp.Next(4)) - tmp.Reset() - // step:4.5 - outcomeProof2.Write([]byte(proof.OutcomeProof.Outcome.ExecutorID)) - // step:4.6 - statusByte, err := resolveStatus(&proof.OutcomeProof.Outcome.Status) - if err != nil { - return nil, err - } - outcomeProof2.Write(statusByte) - // step5 outcomeRootProof - MustToLittleEndian(&tmp, int64(len(proof.OutcomeRootProof))) - outcomeProof2.Write(tmp.Next(4)) - tmp.Reset() - // step5.1 outcome_root_proof - rootProof := bytes.Buffer{} - for _, p := range proof.OutcomeRootProof { - var pt bytes.Buffer - pt.Write(MustBase58Decode(p.Hash.String())) - if p.Direction == ProofDirectionRight { - pt.Write([]byte{1}) - } else { - pt.Write([]byte{0}) - } - rootProof.Write(pt.Bytes()) - } - outcomeProof2.Write(rootProof.Bytes()) - // step6 block_header_lite - outcomeProof2.Write(MustBase58Decode(proof.BlockHeaderLite.PrevBlockHash.String())) - outcomeProof2.Write(MustBase58Decode(proof.BlockHeaderLite.InnerRestHash.String())) - MustToLittleEndian(&tmp, proof.BlockHeaderLite.InnerLite.Height) - outcomeProof2.Write(tmp.Next(8)) - tmp.Reset() - outcomeProof2.Write(MustBase58Decode(proof.BlockHeaderLite.InnerLite.EpochID.String())) - outcomeProof2.Write(MustBase58Decode(proof.BlockHeaderLite.InnerLite.NextEpochId.String())) - outcomeProof2.Write(MustBase58Decode(proof.BlockHeaderLite.InnerLite.PrevStateRoot.String())) - outcomeProof2.Write(MustBase58Decode(proof.BlockHeaderLite.InnerLite.OutcomeRoot.String())) - MustToLittleEndian(&tmp, proof.BlockHeaderLite.InnerLite.Timestamp) - outcomeProof2.Write(tmp.Next(8)) - tmp.Reset() - outcomeProof2.Write(MustBase58Decode(proof.BlockHeaderLite.InnerLite.NextBpHash.String())) - outcomeProof2.Write(MustBase58Decode(proof.BlockHeaderLite.InnerLite.BlockMerkleRoot.String())) - // step7 blockProof - MustToLittleEndian(&tmp, int64(len(proof.BlockProof))) - outcomeProof2.Write(tmp.Next(4)) - tmp.Reset() - var bpBuf bytes.Buffer - for _, bp := range proof.BlockProof { - var bpb bytes.Buffer - bpb.Write(MustBase58Decode(bp.Hash.String())) - if bp.Direction == ProofDirectionRight { - bpb.Write([]byte{1}) - } else { - bpb.Write([]byte{0}) - } - bpBuf.Write(bpb.Bytes()) - } - outcomeProof2.Write(bpBuf.Bytes()) - buf.Write(outcomeProof2.Bytes()) - return buf.Bytes(), nil -} - -func resolveStatus(status *client.TransactionStatus) ([]byte, error) { - data, err := json.Marshal(status) - if err != nil { - return nil, err - } - m := make(map[string]interface{}) - err = json.Unmarshal(data, &m) - if err != nil { - return nil, err - } - - var ret bytes.Buffer - if v, ok := m["SuccessValue"]; ok { - // step1 - ret.Write([]byte{2}) - // step2 - res, err := base64.StdEncoding.DecodeString(v.(string)) - if err != nil { - return nil, err - } - var tmp bytes.Buffer - MustToLittleEndian(&tmp, int64(len(res))) - ret.Write(tmp.Next(4)) - // step3 - ret.Write(res) - } else if v, ok := m["SuccessReceiptId"]; ok { - ret.Write([]byte{3}) - ret.Write(MustBase58Decode(v.(string))) - } else { - return nil, errors.New("transaction status not supported") - } - - return ret.Bytes(), nil -} - -func reverse16(bs []byte) []byte { - length := len(bs) - wbs := make([]byte, length) - copy(wbs, bs) - - for i := 0; i < len(wbs)/2; i++ { - wbs[i], wbs[len(wbs)-i-1] = wbs[len(wbs)-i-1], wbs[i] - } - - fillSize := 16 - length - if fillSize > 0 { - for i := 0; i < fillSize; i++ { - wbs = append(wbs, 0) - } - } - return wbs -} - -func MustBase58Decode(str string) []byte { - dec, err := base58.Decode(str) - if err != nil { - panic(err) - } - return dec -} - -func MustToLittleEndian(w io.Writer, data interface{}) { - if err := binary.Write(w, binary.LittleEndian, data); err != nil { - panic(err) - } -} diff --git a/internal/near/protocol.go b/internal/near/protocol.go deleted file mode 100644 index e0c31af0..00000000 --- a/internal/near/protocol.go +++ /dev/null @@ -1,23 +0,0 @@ -package near - -import ( - "github.com/mapprotocol/near-api-go/pkg/types" -) - -var ( - NewFunctionCallGas types.Gas = 30 * 10000000000000 - Deposit = "0.3" -) - -type Result struct { - BlockHash string `json:"block_hash"` - BlockHeight int `json:"block_height"` - Logs []interface{} `json:"logs"` - Result []byte `json:"result"` -} - -type TransferOut struct { - FromChain string `json:"from_chain"` - ToChain string `json:"to_chain"` - OrderId string `json:"order_id"` -} diff --git a/internal/op/op.go b/internal/op/op.go deleted file mode 100644 index 45de2b9f..00000000 --- a/internal/op/op.go +++ /dev/null @@ -1,73 +0,0 @@ -package op - -import ( - "bytes" - "fmt" - - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/rlp" - "github.com/mapprotocol/compass/internal/constant" - "github.com/mapprotocol/compass/internal/proof" -) - -const ( - LegacyTxType = 0x00 - AccessListTxType = 0x01 - DynamicFeeTxType = 0x02 - BlobTxType = 0x03 -) - -const DepositTxType = 0x7E - -type Receipt struct { - *types.Receipt - DepositNonce *uint64 `json:"depositNonce,omitempty"` - DepositReceiptVersion *uint64 `json:"depositReceiptVersion,omitempty"` -} - -func (r *Receipt) statusEncoding() []byte { - if len(r.PostState) == 0 { - if r.Status == constant.ReceiptStatusFailed { - return constant.ReceiptStatusFailedRLP - } - return constant.ReceiptStatusSuccessfulRLP - } - return r.PostState -} - -type depositReceiptRLP struct { - PostStateOrStatus []byte - CumulativeGasUsed uint64 - Bloom types.Bloom - Logs []*types.Log - DepositNonce *uint64 `rlp:"optional"` - DepositReceiptVersion *uint64 `rlp:"optional"` -} - -type Receipts []*Receipt - -func (rs Receipts) Len() int { return len(rs) } - -func (rs Receipts) EncodeIndex(i int, w *bytes.Buffer) { - r := rs[i] - data := &proof.ReceiptRLP{PostStateOrStatus: r.statusEncoding(), CumulativeGasUsed: r.CumulativeGasUsed, Bloom: r.Bloom, Logs: r.Logs} - if r.Type == constant.LegacyTxType { - rlp.Encode(w, data) - return - } - w.WriteByte(r.Type) - switch r.Type { - case AccessListTxType, DynamicFeeTxType, BlobTxType, constant.SetCodeTxType: - rlp.Encode(w, data) - case DepositTxType: - if r.DepositReceiptVersion != nil { - // post-canyon receipt hash computation update - depositData := &depositReceiptRLP{data.PostStateOrStatus, data.CumulativeGasUsed, r.Bloom, r.Logs, r.DepositNonce, r.DepositReceiptVersion} - rlp.Encode(w, depositData) - } else { - rlp.Encode(w, data) - } - default: - fmt.Println(" r.Type ", r.Type) - } -} diff --git a/internal/proof/proof.go b/internal/proof/proof.go deleted file mode 100644 index c84839b0..00000000 --- a/internal/proof/proof.go +++ /dev/null @@ -1,310 +0,0 @@ -package proof - -import ( - "bytes" - "github.com/golang/groupcache/lru" - "math/big" - "sync" - - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/ethdb/memorydb" - "github.com/ethereum/go-ethereum/light" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/trie" - maptypes "github.com/mapprotocol/atlas/core/types" - "github.com/mapprotocol/compass/internal/constant" - "github.com/mapprotocol/compass/internal/mapprotocol" - "github.com/mapprotocol/compass/pkg/msg" - "github.com/mapprotocol/compass/pkg/util" - "github.com/pkg/errors" -) - -var ( - CacheReceipt = lru.New(30) -) - -type ReceiptRLP struct { - PostStateOrStatus []byte - CumulativeGasUsed uint64 - Bloom types.Bloom - Logs []*types.Log -} - -type Data struct { - BlockNum *big.Int - ReceiptProof ReceiptProof -} - -type ReceiptProof struct { - TxReceipt mapprotocol.TxReceipt - KeyIndex []byte - Proof [][]byte -} - -type NewData struct { - BlockNum *big.Int - ReceiptProof NewReceiptProof -} - -type SignData struct { - BlockNum *big.Int - ReceiptRoot [32]byte - Signatures [][]byte - ReceiptProof NewReceiptProof -} - -type SignLogData struct { - ProofType uint8 - BlockNum *big.Int - ReceiptRoot [32]byte - Signatures [][]byte - Proof []byte -} - -type NewReceiptProof struct { - TxReceipt []byte - ReceiptType *big.Int - KeyIndex []byte - Proof [][]byte -} - -var encodeBufferPool = sync.Pool{ - New: func() interface{} { return new(bytes.Buffer) }, -} - -func Get(receipts DerivableList, txIndex uint) ([][]byte, error) { - tr, err := trie.New(common.Hash{}, trie.NewDatabase(memorydb.New())) - if err != nil { - return nil, err - } - - tr = DeriveTire(receipts, tr) - ns := light.NewNodeSet() - key, err := rlp.EncodeToBytes(txIndex) - if err != nil { - return nil, err - } - if err = tr.Prove(key, 0, ns); err != nil { - return nil, err - } - - proof := make([][]byte, 0, len(ns.NodeList())) - for _, v := range ns.NodeList() { - proof = append(proof, v) - } - - return proof, nil -} - -func DeriveTire(rs DerivableList, tr *trie.Trie) *trie.Trie { - valueBuf := encodeBufferPool.Get().(*bytes.Buffer) - defer encodeBufferPool.Put(valueBuf) - - var indexBuf []byte - for i := 1; i < rs.Len() && i <= 0x7f; i++ { - indexBuf = rlp.AppendUint64(indexBuf[:0], uint64(i)) - value := encodeForDerive(rs, i, valueBuf) - tr.Update(indexBuf, value) - } - if rs.Len() > 0 { - indexBuf = rlp.AppendUint64(indexBuf[:0], 0) - value := encodeForDerive(rs, 0, valueBuf) - tr.Update(indexBuf, value) - } - for i := 0x80; i < rs.Len(); i++ { - indexBuf = rlp.AppendUint64(indexBuf[:0], uint64(i)) - value := encodeForDerive(rs, i, valueBuf) - tr.Update(indexBuf, value) - } - return tr -} - -type DerivableList interface { - Len() int - EncodeIndex(int, *bytes.Buffer) -} - -func encodeForDerive(list DerivableList, i int, buf *bytes.Buffer) []byte { - buf.Reset() - list.EncodeIndex(i, buf) - return common.CopyBytes(buf.Bytes()) -} - -func Pack(fId msg.ChainId, method string, abi abi.ABI, params ...interface{}) ([]byte, error) { - input, err := abi.Methods[mapprotocol.MethodOfGetBytes].Inputs.Pack(params...) - if err != nil { - return nil, errors.Wrap(err, "pack getBytes failed") - } - - ret, err := mapprotocol.PackInput(mapprotocol.Mcs, method, big.NewInt(0).SetUint64(uint64(fId)), input) - if err != nil { - return nil, errors.Wrap(err, "pack mcs input failed") - } - - return ret, nil -} - -func Oracle(blockNumber uint64, receipt *mapprotocol.TxReceipt, key []byte, prf [][]byte, fId msg.ChainId, method string, idx int, - abi abi.ABI, orderId [32]byte, map2other bool) ([]byte, error) { - nr := mapprotocol.MapTxReceipt{ - PostStateOrStatus: receipt.PostStateOrStatus, - CumulativeGasUsed: receipt.CumulativeGasUsed, - Bloom: receipt.Bloom, - Logs: receipt.Logs, - } - nrRlp, err := rlp.EncodeToBytes(nr) - if err != nil { - return nil, err - } - - pd := NewData{ - BlockNum: big.NewInt(int64(blockNumber)), - ReceiptProof: NewReceiptProof{ - TxReceipt: nrRlp, - ReceiptType: receipt.ReceiptType, - KeyIndex: util.Key2Hex(key, len(prf)), - Proof: prf, - }, - } - - input, err := abi.Methods[mapprotocol.MethodOfGetBytes].Inputs.Pack(pd) - if err != nil { - return nil, errors.Wrap(err, "pack getBytes failed") - } - - var ret []byte - ret, err = mapprotocol.PackInput(mapprotocol.Mcs, method, big.NewInt(0).SetUint64(uint64(fId)), big.NewInt(int64(idx)), - orderId, input) - - if err != nil { - return nil, errors.Wrap(err, "pack mcs input failed") - } - - return ret, nil -} - -func Completion(bytes []byte, number int) []byte { - ret := make([]byte, 0, number) - for i := 0; i < number-len(bytes); i++ { - ret = append(ret, byte(0)) - } - ret = append(ret, bytes...) - return ret -} - -func log2Proof(log *types.Log) []byte { - ret := make([]byte, 0) - ret = append(ret, log.Address.Bytes()...) - ret = append(ret, []byte{0, 0, 0, 0}...) - ret = append(ret, Completion(big.NewInt(int64(len(log.Topics))).Bytes(), 4)...) - ret = append(ret, Completion(big.NewInt(int64(len(log.Data))).Bytes(), 4)...) - for _, tp := range log.Topics { - ret = append(ret, tp.Bytes()...) - } - ret = append(ret, log.Data...) - return ret -} - -func SignOracle(header *maptypes.Header, receipt *mapprotocol.TxReceipt, key []byte, prf [][]byte, fId msg.ChainId, - idx int, method string, sign [][]byte, orderId [32]byte, log *types.Log, proofType int64) ([]byte, error) { - var ( - fixedHash [32]byte - pt = uint8(0) - newPrf = make([]byte, 0) - blockNumber = big.NewInt(0).SetUint64(log.BlockNumber) - ) - switch proofType { - case constant.ProofTypeOfNewOracle: - nr := mapprotocol.MapTxReceipt{ - PostStateOrStatus: receipt.PostStateOrStatus, - CumulativeGasUsed: receipt.CumulativeGasUsed, - Bloom: receipt.Bloom, - Logs: receipt.Logs, - } - nrRlp, err := rlp.EncodeToBytes(nr) - if err != nil { - return nil, err - } - - for i, v := range header.ReceiptHash { - fixedHash[i] = v - } - if receipt.ReceiptType.Int64() != 0 { - n := make([]byte, 0) - n = append(n, receipt.ReceiptType.Bytes()...) - n = append(n, nrRlp...) - nrRlp = n - } - - rpf := NewReceiptProof{ - TxReceipt: nrRlp, - ReceiptType: receipt.ReceiptType, - KeyIndex: util.Key2Hex(key, len(prf)), - Proof: prf, - } - - newPrf, err = mapprotocol.PackAbi.Methods[mapprotocol.MethodOfMptPack].Inputs.Pack(rpf) - if err != nil { - return nil, err - } - case constant.ProofTypeOfLogOracle: - pt = 1 - newPrf = log2Proof(log) - logIdx := log.Index - if fId != constant.CfxChainId && fId != constant.MapChainId && fId != constant.BscChainId { - logIdx = 0 - } - blockNumber = GenLogBlockNumber(blockNumber, logIdx) - fixedHash = common.BytesToHash(crypto.Keccak256(newPrf)) - default: - return nil, errors.New("invalid proof type") - } - - pd := SignLogData{ - ProofType: pt, - BlockNum: blockNumber, - ReceiptRoot: fixedHash, - Signatures: sign, - Proof: newPrf, - } - - input, err := mapprotocol.GetAbi.Methods[mapprotocol.MethodOfGetBytes].Inputs.Pack(pd) - if err != nil { - return nil, errors.Wrap(err, "pack getBytes failed") - } - - ret, err := mapprotocol.PackInput(mapprotocol.Mcs, method, big.NewInt(0).SetUint64(uint64(fId)), - big.NewInt(int64(idx)), orderId, input) - if err != nil { - return nil, errors.Wrap(err, "pack mcs input failed") - } - - return ret, nil -} - -func V3Pack(fId msg.ChainId, method string, abi abi.ABI, idx int, orderId [32]byte, map2other bool, params ...interface{}) ([]byte, error) { - input, err := abi.Methods[mapprotocol.MethodOfGetBytes].Inputs.Pack(params...) - if err != nil { - return nil, errors.Wrap(err, "pack getBytes failed") - } - - var ret []byte - ret, err = mapprotocol.PackInput(mapprotocol.Mcs, method, big.NewInt(0).SetUint64(uint64(fId)), - big.NewInt(int64(idx)), orderId, input) - - if err != nil { - return nil, errors.Wrap(err, "pack mcs input failed") - } - - return ret, nil -} - -func GenLogBlockNumber(bn *big.Int, idx uint) *big.Int { - ret := make([]byte, 0, 28) - ret = append(ret, Completion(big.NewInt(int64(idx)).Bytes(), 4)...) - ret = append(ret, Completion(bn.Bytes(), 8)...) - return big.NewInt(0).SetBytes(ret) -} diff --git a/internal/scroll/receipt.go b/internal/scroll/receipt.go deleted file mode 100644 index ebb4278b..00000000 --- a/internal/scroll/receipt.go +++ /dev/null @@ -1,41 +0,0 @@ -package scroll - -import ( - "bytes" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/rlp" - "github.com/mapprotocol/compass/internal/constant" - "github.com/mapprotocol/compass/internal/proof" -) - -type Receipts []*Receipt - -type Receipt struct { - *types.Receipt -} - -func (r *Receipt) statusEncoding() []byte { - if len(r.PostState) == 0 { - if r.Status == constant.ReceiptStatusFailed { - return constant.ReceiptStatusFailedRLP - } - return constant.ReceiptStatusSuccessfulRLP - } - return r.PostState -} - -// Len returns the number of receipts in this list. -func (rs Receipts) Len() int { return len(rs) } - -// EncodeIndex encodes the i'th receipt to w. -func (rs Receipts) EncodeIndex(i int, w *bytes.Buffer) { - r := rs[i] - data := &proof.ReceiptRLP{PostStateOrStatus: r.statusEncoding(), CumulativeGasUsed: r.CumulativeGasUsed, Bloom: r.Bloom, Logs: r.Logs} - switch r.Type { - case constant.LegacyTxType: - rlp.Encode(w, data) - default: - w.WriteByte(r.Type) - rlp.Encode(w, data) - } -} diff --git a/internal/stream/butter.go b/internal/stream/butter.go deleted file mode 100644 index 11541cc2..00000000 --- a/internal/stream/butter.go +++ /dev/null @@ -1 +0,0 @@ -package stream diff --git a/internal/stream/stream.go b/internal/stream/stream.go deleted file mode 100644 index bbf1c0b3..00000000 --- a/internal/stream/stream.go +++ /dev/null @@ -1,71 +0,0 @@ -package stream - -type CommonResp struct { - Code int `json:"code"` - Message string `json:"message"` - Msg string `json:"msg"` - Data interface{} `json:"data"` -} - -type MosListResp struct { - Total int64 `json:"total"` - List []*GetMosResp `json:"list"` -} - -type GetMosResp struct { - Id int64 `json:"id"` - ProjectId int64 `json:"project_id"` - ChainId int64 `json:"chain_id"` - EventId int64 `json:"event_id"` - TxHash string `json:"tx_hash"` - ContractAddress string `json:"contract_address"` - Topic string `json:"topic"` - BlockNumber uint64 `json:"block_number"` - BlockHash string `json:"block_hash"` - LogIndex uint `json:"log_index"` - LogData string `json:"log_data"` - TxIndex uint `json:"tx_index"` - TxTimestamp uint64 `json:"tx_timestamp"` -} - -type FailedTxOfRequest struct { - ToChain string `json:"to_chain"` - Hash string `json:"hash"` -} - -type ProofOfRequest struct { - SrcChain string `json:"src_chain"` - SrcTxHash string `json:"src_tx_hash"` - SrcLogIndex uint `json:"src_log_index"` - BlockNumber int64 `json:"block_number"` - DesChain string `json:"des_chain"` -} - -type TxExecOfRequest struct { - SrcChain string `json:"src_chain"` - SrcTxHash string `json:"src_tx_hash"` - SrcLogIndex uint `json:"src_log_index"` - SrcBlockNumber int64 `json:"src_block_number"` - RelayChain string `json:"relay_chain"` - RelayTxHash string `json:"relay_tx_hash"` - RelayLogIndex uint `json:"relay_log_index"` - RelayBlockNumber int64 `json:"relay_block_number"` - Status int64 `json:"status"` - DesChain string `json:"des_chain"` - DesTxHash string `json:"des_tx_hash"` - DesLogIndex uint `json:"des_log_index"` - Slippage string `json:"slippage"` -} - -type BtcLogListResp struct { - Total int64 `json:"total"` - Items []*struct { - Id int64 `json:"id"` - ChainId string `json:"chain_id"` - Topic string `json:"topic"` - LogData string `json:"log_data"` - TxHash string `json:"tx_hash"` - TxTimestamp int `json:"tx_timestamp"` - BlockNumber int64 `json:"block_number"` - } `json:"items"` -} diff --git a/internal/tx/eth_client.go b/internal/tx/eth_client.go deleted file mode 100644 index e24907ae..00000000 --- a/internal/tx/eth_client.go +++ /dev/null @@ -1,146 +0,0 @@ -package tx - -import ( - "context" - "errors" - "math/big" - "time" - - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/mapprotocol/compass/pkg/ethclient" -) - -func GetTxsHashByBlockNumber(conn *ethclient.Client, number *big.Int) ([]common.Hash, error) { - block, err := conn.BlockByNumber(context.Background(), number) - if err != nil { - return nil, err - } - - txs := make([]common.Hash, 0, len(block.Transactions())) - for _, tx := range block.Transactions() { - txs = append(txs, tx.Hash()) - } - return txs, nil -} - -func GetReceiptsByTxsHash(conn *ethclient.Client, txsHash []common.Hash) ([]*types.Receipt, error) { - type ele struct { - r *types.Receipt - idx int - } - var ( - count = len(txsHash) - errReceive = make(chan error) - receive = make(chan *ele, len(txsHash)) - rs = make([]*types.Receipt, len(txsHash)) - ) - go func() { - for idx, h := range txsHash { - tmpIdx := idx - tmpHash := h - go func(i int, tx common.Hash) { - for { - r, err := conn.TransactionReceipt(context.Background(), tx) - if err != nil { - if err.Error() == "not found" { - time.Sleep(time.Millisecond * 100) - continue - } - errReceive <- err - return - } - receive <- &ele{ - r: r, - idx: i, - } - break - } - }(tmpIdx, tmpHash) - - if idx%30 == 0 { - time.Sleep(time.Millisecond * 500) - } - } - }() - - for { - select { - case v, ok := <-receive: - if !ok { - return nil, errors.New("receive chan is closed") - } - if v != nil { - rs[v.idx] = v.r - } - count-- - if count == 0 { - return rs, nil - } - case err := <-errReceive: - return nil, err - } - } -} - -func GetMaticReceiptsByTxsHash(conn *ethclient.Client, txsHash []common.Hash) ([]*types.Receipt, error) { - type ele struct { - r *types.Receipt - idx int - } - var ( - count = len(txsHash) - errReceive = make(chan error) - receive = make(chan *ele, len(txsHash)) - rs = make([]*types.Receipt, len(txsHash)) - ) - go func() { - for idx, h := range txsHash { - tmpIdx := idx - tmpHash := h - go func(i int, tx common.Hash) { - for { - r, err := conn.TransactionReceipt(context.Background(), tx) - if err != nil { - if err.Error() == "not found" { - receive <- &ele{ - r: nil, - idx: i, - } - break - } - errReceive <- err - return - } - receive <- &ele{ - r: r, - idx: i, - } - break - } - }(tmpIdx, tmpHash) - - if idx%30 == 0 { - time.Sleep(time.Millisecond * 500) - } - } - }() - - for { - select { - case v, ok := <-receive: - if !ok { - return nil, errors.New("receive chan is closed") - } - if v != nil { - rs[v.idx] = v.r - } - count-- - if count == 0 { - return rs, nil - } - case err := <-errReceive: - return nil, err - } - } -} diff --git a/near-lake-s3/Cargo.toml b/near-lake-s3/Cargo.toml deleted file mode 100644 index 34d1f942..00000000 --- a/near-lake-s3/Cargo.toml +++ /dev/null @@ -1,31 +0,0 @@ -[package] -name = "near-lake-s3" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -futures = "0.3.5" -#tokio = { version = "1.1", features = ["sync", "time", "macros", "rt-multi-thread"] } -tokio-stream = { version = "0.1" } -tracing = "0.1.36" -tracing-subscriber = "0.3.15" -serde = { version = "1", features = ["derive"] } -serde_json = "1.0.55" -dotenv = "0.15.0" -anyhow = "1.0" -once_cell = { version = "^1" } -tokio = { version = "1.19.2", features = ["rt-multi-thread", "macros"] } -redis = {version = "0.21.5", features = ["connection-manager", "tokio-comp"]} -tracing-appender = "0.2.2" - -near-lake-framework = "0.7.1" - -[profile.release] -codegen-units = 1 -opt-level = "s" -lto = true -debug = false -panic = "abort" -overflow-checks = true \ No newline at end of file diff --git a/near-lake-s3/README.md b/near-lake-s3/README.md deleted file mode 100644 index 0fb8c476..00000000 --- a/near-lake-s3/README.md +++ /dev/null @@ -1,62 +0,0 @@ -# near-lake-s3 -near-lake-s3 is used to sync the certain blocks from AWS S3 buckets to redis server. The block must contain transactions/receipts related to specified account. - -## How to build? - -```shell -cargo build --release -``` - -The binary file "near-lake-s3" will be generated in ./target/release. - -## How to Run - -### AWS S3 Credentials - -In order to be able to get objects from the AWS S3 bucket you need to provide the AWS credentials. - -AWS default profile configuration with aws configure looks similar to the following: - -`~/.aws/credentials` -``` -[default] -aws_access_key_id= -aws_secret_access_key= -``` - -[AWS docs: Configuration and credential file settings](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) - -### Env Config - -You can copy env.example to .env, modify it and put it in the same directory with near-lake-s3 (or it's parent directory). - -maybe you can install the [redis](https://redis.io/docs/getting-started/installation/) for the following configuration. - -``` -// Get the start block height from cache if true, if no record is found, use START_BLOCK_HEIGHT -START_BLOCK_HEIGHT_FROM_CACHE=true -START_BLOCK_HEIGHT=10000 - -// The URL of the redis -REDIS_URL="redis://127.0.0.1:6379" -// Redis list name where the block will push to -PUB_LIST="blocks" - -// The account name to watch -MCS="mcs.testnet" - -// True for NEAR tesnet, false for NEAR mainnet -TEST=true - -// Log file -LOG_FILE="./near-lake.log" - -// Log level -LOG_LEVEL="INFO" -``` - - -### Run -```shell -./target/release/near-lake-s3 -``` \ No newline at end of file diff --git a/near-lake-s3/env.example b/near-lake-s3/env.example deleted file mode 100644 index 17de81de..00000000 --- a/near-lake-s3/env.example +++ /dev/null @@ -1,10 +0,0 @@ -START_BLOCK_HEIGHT_FROM_CACHE=false -START_BLOCK_HEIGHT=42376888 -ENABLE_REDIS=true -REDIS_URL="redis://127.0.0.1:6379" -PUB_LIST="blocks" -ACCOUNTS="mcs.testnet,client.testnet" -PARSE_TX_HASH=false -TEST=true -LOG_FILE="./near-lake.log" -LOG_LEVEL="INFO" diff --git a/near-lake-s3/src/config.rs b/near-lake-s3/src/config.rs deleted file mode 100644 index 63f017cd..00000000 --- a/near-lake-s3/src/config.rs +++ /dev/null @@ -1,122 +0,0 @@ -use near_lake_framework::{LakeConfig, LakeConfigBuilder}; -use std::env; -use std::mem::MaybeUninit; -use std::sync::{Mutex, MutexGuard}; -use once_cell::sync::Lazy; -use crate::pusher::redis::RedisPusher; - -pub const INDEXER: &str = "map-near-indexer-s3"; -pub const REDIS: &str = "redis"; -pub static PROJECT_CONFIG: Lazy = Lazy::new(init_env_config); -static mut REDIS_PUSHER: MaybeUninit> = MaybeUninit::uninit(); -static BLOCK_HEIGHT: &str = "block_height"; - -pub struct Env { - pub(crate) start_block_height_from_cache: bool, - pub(crate) start_block_height: u64, - pub(crate) redis_url: String, - pub(crate) pub_list: String, - pub(crate) accounts: Vec, - pub(crate) parse_tx_hash: bool, - pub(crate) test: bool, - pub(crate) log_file: String, - pub(crate) log_level: String, -} - -pub async fn init_lake_config() -> LakeConfig { - let mut current_height = PROJECT_CONFIG.start_block_height; - if PROJECT_CONFIG.start_block_height_from_cache { - if let Some(height) = get_synced_block_height().await { - current_height = height + 1; - } - } - - tracing::info!(target: INDEXER, "start stream from block {}", current_height); - if PROJECT_CONFIG.test { - LakeConfigBuilder::default() - .testnet() - .start_block_height(current_height) - .build() - .expect("failed to start block height") - } else { - LakeConfigBuilder::default() - .mainnet() - .start_block_height(current_height) - .build() - .expect("failed to start block height") - } -} - -pub fn init_env_config() -> Env { - for (key, value) in env::vars() { - println!("{}: {}", key, value); - } - let env = Env { - start_block_height_from_cache: env::var("START_BLOCK_HEIGHT_FROM_CACHE") - .unwrap() - .parse::() - .unwrap(), - start_block_height: env::var("START_BLOCK_HEIGHT") - .unwrap() - .parse::() - .unwrap(), - redis_url: env::var("REDIS_URL").unwrap(), - pub_list: env::var("PUB_LIST").unwrap(), - accounts: env::var("ACCOUNTS") - .unwrap() - .split(",") - .into_iter() - .map(|s| s.trim().to_string()) - .collect(), - parse_tx_hash: env::var("PARSE_TX_HASH") - .unwrap_or_else(|_| "false".to_string()) - .parse::() - .unwrap(), - test: env::var("TEST") - .unwrap_or_else(|_| "true".to_string()) - .parse::() - .unwrap(), - log_file: env::var("LOG_FILE").unwrap(), - log_level: env::var("LOG_LEVEL") - .unwrap_or_else(|_| "info".to_string()) - }; - - println!("test: {:?}", env.test); - println!("log_level: {:?}", env.log_level); - println!("parse_tx_hash: {:?}", env.parse_tx_hash); - - env -} - -pub async fn init_redis_pusher() { - // Make it - let pusher = RedisPusher::new(&PROJECT_CONFIG.redis_url, &PROJECT_CONFIG.pub_list) - .await.expect("New redis pusher fail"); - // Store it to the static var, i.e. initialize it - unsafe { - REDIS_PUSHER.write(Mutex::new(pusher)); - } -} - -pub fn redis_publisher() -> MutexGuard<'static, RedisPusher> { - unsafe { - - // Now we give out a shared reference to the data, which is safe to use - // concurrently. - REDIS_PUSHER.assume_init_ref().lock().unwrap() - } -} - -pub async fn get_synced_block_height() -> Option { - let value = redis_publisher().get(BLOCK_HEIGHT).await; - if value.is_some() { - let height: u64 = serde_json::from_str(value.unwrap().as_str()).unwrap(); - Some(height) - } else { - None - } -} - -pub async fn update_synced_block_height(height: u64) { - redis_publisher().set(BLOCK_HEIGHT, serde_json::to_string(&height).unwrap()).await; -} diff --git a/near-lake-s3/src/indexer/mod.rs b/near-lake-s3/src/indexer/mod.rs deleted file mode 100644 index baf29e06..00000000 --- a/near-lake-s3/src/indexer/mod.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod stream; diff --git a/near-lake-s3/src/indexer/stream.rs b/near-lake-s3/src/indexer/stream.rs deleted file mode 100644 index 2f2c0b2b..00000000 --- a/near-lake-s3/src/indexer/stream.rs +++ /dev/null @@ -1,96 +0,0 @@ -use std::collections::HashMap; -use std::process::id; -use crate::config::{init_lake_config, PROJECT_CONFIG, update_synced_block_height, redis_publisher, INDEXER, REDIS}; -use futures::StreamExt; -use serde_json::json; -use near_lake_framework::near_indexer_primitives::views::{ExecutionOutcomeWithIdView, ExecutionStatusView}; - -pub async fn indexer_stream_from_s3() { - let config = init_lake_config().await; - - let (_, stream) = near_lake_framework::streamer(config); - - let mut handlers = tokio_stream::wrappers::ReceiverStream::new(stream) - .map(handle_streamer_message) - .buffer_unordered(1usize); - - while let Some(_handle_message) = handlers.next().await {} -} - -pub async fn handle_streamer_message( - streamer_message: near_lake_framework::near_indexer_primitives::StreamerMessage, -) { - tracing::info!("Block height {}", streamer_message.block.header.height); - - let mut publish = false; - let mut receipt_id2tx_id: HashMap = HashMap::new(); - - 'outer: for shard in &streamer_message.shards { - for tx_res in &shard.receipt_execution_outcomes { - if is_valid_receipt(&tx_res.execution_outcome) { - publish = true; - - let tx_id_opt = redis_publisher().get(tx_res.execution_outcome.id.to_string().as_str()).await; - if let Some(tx_id) = tx_id_opt { - for receipt_id in &tx_res.execution_outcome.outcome.receipt_ids { - receipt_id2tx_id.insert(receipt_id.to_string(), tx_id.clone()); - } - } - } - } - } - - for shard in &streamer_message.shards { - if let Some(chunk) = &shard.chunk { - for tx in &chunk.transactions { - if PROJECT_CONFIG.accounts.contains(&tx.transaction.receiver_id.to_string()) { - if let ExecutionStatusView::SuccessReceiptId(successReceiptId) = tx.outcome.execution_outcome.outcome.status { - receipt_id2tx_id.insert(successReceiptId.to_string(), tx.transaction.hash.to_string()); - } - } - } - } - } - - for (receipt_id, tx_id) in receipt_id2tx_id { - redis_publisher().set(receipt_id.clone().as_str(), tx_id.clone()).await; - tracing::info!( - target: INDEXER, - "Save Receipt ID {} / TX ID {} on block {}", - receipt_id, - tx_id, - streamer_message.block.header.height - ); - } - - if publish { - let json = json!(streamer_message).to_string(); - redis_publisher().lpush(json).await; - update_synced_block_height(streamer_message.block.header.height).await; - - tracing::info!( - target: INDEXER, - "Save {} / shards {}", - streamer_message.block.header.height, - streamer_message.shards.len() - ); - } else { - if streamer_message.block.header.height % 100 == 0 { - update_synced_block_height(streamer_message.block.header.height).await; - tracing::info!( - target: REDIS, - "Update synced block height {}", - streamer_message.block.header.height - ) - } - } -} - -pub fn is_valid_receipt(execution_outcome: &ExecutionOutcomeWithIdView) -> bool { - match &execution_outcome.outcome.status { - ExecutionStatusView::Unknown => return false, - _ => () - } - - PROJECT_CONFIG.accounts.contains(&execution_outcome.outcome.executor_id.to_string()) -} diff --git a/near-lake-s3/src/main.rs b/near-lake-s3/src/main.rs deleted file mode 100644 index 27bbedbe..00000000 --- a/near-lake-s3/src/main.rs +++ /dev/null @@ -1,35 +0,0 @@ -use std::path::PathBuf; -use std::str::FromStr; -use anyhow::Result; -use dotenv::dotenv; -use tracing::Level; -use tracing_appender::rolling::RollingFileAppender; -use crate::config::{init_redis_pusher, PROJECT_CONFIG}; -use crate::indexer::stream::indexer_stream_from_s3; - -pub mod indexer; -pub mod pusher; -pub mod config; - - -#[tokio::main] -async fn main() -> Result<(), tokio::io::Error> { - dotenv().ok(); - - let path = PathBuf::from_str(&PROJECT_CONFIG.log_file).unwrap(); - let file_appender : RollingFileAppender = tracing_appender::rolling::daily(path.parent().unwrap(), path.file_name().unwrap()); - let (non_blocking, _guard) = tracing_appender::non_blocking(file_appender); - tracing_subscriber::fmt() - .with_ansi(false) - .with_max_level(Level::from_str(&PROJECT_CONFIG.log_level).unwrap()) - .with_writer(non_blocking.clone()) - .init(); - tracing::info!(".tracing is initialized"); - - init_redis_pusher().await; - tracing::info!(".redis pusher is initialized"); - - indexer_stream_from_s3().await; - - Ok(()) -} \ No newline at end of file diff --git a/near-lake-s3/src/pusher/mod.rs b/near-lake-s3/src/pusher/mod.rs deleted file mode 100644 index 027fbef5..00000000 --- a/near-lake-s3/src/pusher/mod.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod redis; diff --git a/near-lake-s3/src/pusher/redis.rs b/near-lake-s3/src/pusher/redis.rs deleted file mode 100644 index ed6db116..00000000 --- a/near-lake-s3/src/pusher/redis.rs +++ /dev/null @@ -1,65 +0,0 @@ -use std::thread::sleep; -use anyhow::Result; -use std::time::Duration; -use redis::{Client, AsyncCommands}; -use redis::aio::ConnectionManager; - -pub struct RedisPusher { - pub(crate) url: String, - pub(crate) list_key: String, - pub(crate) conn: ConnectionManager, -} - -impl RedisPusher { - pub async fn new(url: &String, list_key: &String) -> Result { - let client = Client::open(url.clone())?; - - Ok(Self { - url: url.clone(), - list_key: list_key.clone(), - conn: client.get_tokio_connection_manager().await? - }) - } - - pub async fn lpush(&mut self, msg: String) { - loop { - let result = self.conn.lpush::<&str, &String, i32>(&self.list_key, &msg).await; - if result.is_ok() { - break; - } else { - tracing::warn!("push msg {} to list {} failed with error {}, retry...", msg, &self.list_key, result.err().unwrap()); - sleep(Duration::from_secs(3)) - } - } - } - - pub async fn set(&mut self, key: &str, value: String) { - loop { - let result = self.conn.set::<&str, &String, String>(key, &value).await; - if result.is_ok() { - break; - } else { - tracing::warn!("set key {} to value {} failed with error {}, retry...", key, value, result.err().unwrap()); - sleep(Duration::from_secs(3)) - } - } - } - - pub async fn get(&mut self, key: &str) -> Option { - loop { - let result = self.conn.get::<&str, String>(key).await; - if result.is_ok() { - return Some(result.unwrap()); - } else { - if let Ok(ret) = self.conn.exists::<&str, i32>(key).await { - tracing::info!(" check if key {} exists: {}...", key, ret); - if ret == 0 { - return None; - } - } - tracing::warn!("get value of key {} failed with error {}, retry...", key, result.err().unwrap()); - sleep(Duration::from_secs(3)) - } - } - } -} \ No newline at end of file diff --git a/pkg/abi/abi.go b/pkg/abi/abi.go deleted file mode 100644 index cd233d3d..00000000 --- a/pkg/abi/abi.go +++ /dev/null @@ -1,45 +0,0 @@ -package abi - -import ( - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/pkg/errors" - "strings" -) - -type Abi struct { - bridgeAbi abi.ABI -} - -func New(abiStr string) (*Abi, error) { - a, err := abi.JSON(strings.NewReader(abiStr)) - if err != nil { - return nil, err - } - - return &Abi{bridgeAbi: a}, nil -} - -func (a *Abi) PackInput(abiMethod string, params ...interface{}) ([]byte, error) { - input, err := a.bridgeAbi.Pack(abiMethod, params...) - if err != nil { - return nil, err - } - return input, nil -} - -func (a *Abi) UnpackValues(method string, data []byte) ([]interface{}, error) { - return a.bridgeAbi.Events[method].Inputs.UnpackValues(data) -} - -func (a *Abi) UnpackOutput(method string, ret interface{}, output []byte) error { - outputs := a.bridgeAbi.Methods[method].Outputs - unpack, err := outputs.Unpack(output) - if err != nil { - return errors.Wrap(err, "unpack output") - } - - if err = outputs.Copy(ret, unpack); err != nil { - return errors.Wrap(err, "copy output") - } - return nil -} diff --git a/pkg/blockstore/blockstore.go b/pkg/blockstore/blockstore.go deleted file mode 100644 index 235c4083..00000000 --- a/pkg/blockstore/blockstore.go +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright 2021 Compass Systems -// SPDX-License-Identifier: LGPL-3.0-only - -package blockstore - -import ( - "fmt" - "github.com/mapprotocol/compass/internal/mapprotocol" - "github.com/mapprotocol/compass/pkg/msg" - "math/big" - "os" - "path/filepath" -) - -const PathPostfix = ".compass/blockstore" - -type Blockstorer interface { - StoreBlock(*big.Int) error -} - -var _ Blockstorer = &EmptyStore{} -var _ Blockstorer = &Blockstore{} - -// Dummy store for testing only -type EmptyStore struct{} - -func (s *EmptyStore) StoreBlock(_ *big.Int) error { return nil } - -// Blockstore implements Blockstorer. -type Blockstore struct { - path string // Path excluding filename - fullPath string - chain msg.ChainId - relayer string -} - -func NewBlockstore(path string, chain msg.ChainId, relayer string, role mapprotocol.Role) (*Blockstore, error) { - fileName := getFileName(chain, relayer, role) - if path == "" { - def, err := getDefaultPath() - if err != nil { - return nil, err - } - path = def - } - return &Blockstore{ - path: path, - fullPath: filepath.Join(path, fileName), - chain: chain, - relayer: relayer, - }, nil -} - -// StoreBlock writes the block number to disk. -func (b *Blockstore) StoreBlock(block *big.Int) error { - // Create dir if it does not exist - if _, err := os.Stat(b.path); os.IsNotExist(err) { - errr := os.MkdirAll(b.path, os.ModePerm) - if errr != nil { - return errr - } - } - - // Write bytes to file - data := []byte(block.String()) - err := os.WriteFile(b.fullPath, data, 0600) - if err != nil { - return err - } - return nil -} - -// TryLoadLatestBlock will attempt to load the latest block for the chain/relayer pair, returning 0 if not found. -// Passing an empty string for path will cause it to use the home directory. -func (b *Blockstore) TryLoadLatestBlock() (*big.Int, error) { - // If it exists, load and return - exists, err := fileExists(b.fullPath) - if err != nil { - return nil, err - } - if exists { - dat, err := os.ReadFile(b.fullPath) - if err != nil { - return nil, err - } - block, _ := big.NewInt(0).SetString(string(dat), 10) - return block, nil - } - // Otherwise just return 0 - return big.NewInt(0), nil -} - -func getFileName(chain msg.ChainId, relayer string, role mapprotocol.Role) string { - return fmt.Sprintf("%s-%d-%s.block", relayer, chain, role) -} - -// getHomePath returns the home directory joined with PathPostfix -func getDefaultPath() (string, error) { - home, err := os.UserHomeDir() - if err != nil { - return "", err - } - - return filepath.Join(home, PathPostfix), nil -} - -func fileExists(fileName string) (bool, error) { - _, err := os.Stat(fileName) - if os.IsNotExist(err) { - return false, nil - } else if err != nil { - return false, err - } - return true, nil -} diff --git a/pkg/blockstore/blockstore_test.go b/pkg/blockstore/blockstore_test.go deleted file mode 100644 index 5797589e..00000000 --- a/pkg/blockstore/blockstore_test.go +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2021 Compass Systems -// SPDX-License-Identifier: LGPL-3.0-only - -package blockstore - -import ( - "github.com/mapprotocol/compass/internal/constant" - "github.com/mapprotocol/compass/internal/mapprotocol" - "github.com/mapprotocol/compass/pkg/msg" - "io/ioutil" - "math/big" - "os" - "testing" -) - -func TestSaveAndLoad(t *testing.T) { - dir, err := ioutil.TempDir(os.TempDir(), "blockstore") - if err != nil { - t.Fatal(err) - } - defer os.RemoveAll(dir) - - chain := msg.ChainId(10) - - bs, err := NewBlockstore(dir, chain, constant.ZeroAddress.String(), mapprotocol.RoleOfMaintainer) - if err != nil { - t.Fatal(err) - } - // Load non-existent dir/file - block, err := bs.TryLoadLatestBlock() - if err != nil { - t.Fatal(err) - } - - if block.Uint64() != uint64(0) { - t.Fatalf("Expected: %d got: %d", 0, block.Uint64()) - } - - // Save block number - block = big.NewInt(999) - err = bs.StoreBlock(block) - if err != nil { - t.Fatal(err) - } - - // Load block number - latest, err := bs.TryLoadLatestBlock() - if err != nil { - t.Fatal(err) - } - - if block.Uint64() != latest.Uint64() { - t.Fatalf("Expected: %d got: %d", block.Uint64(), latest.Uint64()) - } - - // Save block number again - block = big.NewInt(1234) - err = bs.StoreBlock(block) - if err != nil { - t.Fatal(err) - } - - // Load block number - latest, err = bs.TryLoadLatestBlock() - if err != nil { - t.Fatal(err) - } - - if block.Uint64() != latest.Uint64() { - t.Fatalf("Expected: %d got: %d", block.Uint64(), latest.Uint64()) - } -} diff --git a/pkg/contract/constrct.go b/pkg/contract/constrct.go deleted file mode 100644 index f1d5849a..00000000 --- a/pkg/contract/constrct.go +++ /dev/null @@ -1,49 +0,0 @@ -package contract - -import ( - "context" - "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/common" - "github.com/mapprotocol/compass/internal/constant" - "github.com/mapprotocol/compass/pkg/abi" - "github.com/mapprotocol/compass/pkg/ethclient" -) - -type Connection interface { - Client() *ethclient.Client -} - -type Call struct { - abi *abi.Abi - toC []common.Address - conn Connection -} - -func New(conn Connection, addr []common.Address, abi *abi.Abi) *Call { - return &Call{ - conn: conn, - toC: addr, - abi: abi, - } -} - -func (c *Call) Call(method string, ret interface{}, idx int, params ...interface{}) error { - input, err := c.abi.PackInput(method, params...) - if err != nil { - return err - } - - outPut, err := c.conn.Client().CallContract(context.Background(), - ethereum.CallMsg{ - From: constant.ZeroAddress, - To: &c.toC[idx], - Data: input, - }, - nil, - ) - if err != nil { - return err - } - - return c.abi.UnpackOutput(method, ret, outPut) -} diff --git a/pkg/ethclient/block.go b/pkg/ethclient/block.go deleted file mode 100644 index f9b9fc00..00000000 --- a/pkg/ethclient/block.go +++ /dev/null @@ -1,46 +0,0 @@ -package ethclient - -type Block struct { - BaseFeePerGas string `json:"baseFeePerGas"` - Difficulty string `json:"difficulty"` - ExtraData string `json:"extraData"` - GasLimit string `json:"gasLimit"` - GasUsed string `json:"gasUsed"` - Hash string `json:"hash"` - L1BlockNumber string `json:"l1BlockNumber"` - LogsBloom string `json:"logsBloom"` - Miner string `json:"miner"` - MixHash string `json:"mixHash"` - Nonce string `json:"nonce"` - Number string `json:"number"` - ParentHash string `json:"parentHash"` - ReceiptsRoot string `json:"receiptsRoot"` - SendCount string `json:"sendCount"` - SendRoot string `json:"sendRoot"` - Sha3Uncles string `json:"sha3Uncles"` - Size string `json:"size"` - StateRoot string `json:"stateRoot"` - Timestamp string `json:"timestamp"` - TotalDifficulty string `json:"totalDifficulty"` - Transactions []struct { - BlockHash string `json:"blockHash"` - BlockNumber string `json:"blockNumber"` - From string `json:"from"` - Gas string `json:"gas"` - GasPrice string `json:"gasPrice"` - Hash string `json:"hash"` - Input string `json:"input"` - Nonce string `json:"nonce"` - To string `json:"to"` - TransactionIndex string `json:"transactionIndex"` - Value string `json:"value"` - Type string `json:"type"` - ChainID string `json:"chainId"` - MaxFeePerGas string `json:"maxFeePerGas,omitempty"` - MaxPriorityFeePerGas string `json:"maxPriorityFeePerGas,omitempty"` - AccessList []interface{} `json:"accessList,omitempty"` - YParity string `json:"yParity,omitempty"` - } `json:"transactions"` - TransactionsRoot string `json:"transactionsRoot"` - Uncles []interface{} `json:"uncles"` -} diff --git a/pkg/ethclient/ethclient.go b/pkg/ethclient/ethclient.go deleted file mode 100644 index c7ea16ec..00000000 --- a/pkg/ethclient/ethclient.go +++ /dev/null @@ -1,745 +0,0 @@ -package ethclient - -import ( - "context" - "encoding/json" - "errors" - "fmt" - "math/big" - "net/http" - "strings" - - "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/rpc" -) - -// Client defines typed wrappers for the Ethereum RPC API. -type Client struct { - c *rpc.Client - url string -} - -// Dial connects a client to the given URL. -func Dial(rawurl string) (*Client, error) { - return DialContext(context.Background(), rawurl) -} - -func DialContext(ctx context.Context, rawurl string) (*Client, error) { - c, err := rpc.DialContext(ctx, rawurl) - if err != nil { - return nil, err - } - return NewClient(c, rawurl), nil -} - -// NewClient creates a client that uses the given RPC client. -func NewClient(c *rpc.Client, url string) *Client { - return &Client{c, url} -} - -func (ec *Client) Close() { - ec.c.Close() -} - -// Blockchain Access - -// ChainId retrieves the current chain ID for transaction replay protection. -func (ec *Client) ChainID(ctx context.Context) (*big.Int, error) { - var result hexutil.Big - err := ec.c.CallContext(ctx, &result, "eth_chainId") - if err != nil { - return nil, err - } - return (*big.Int)(&result), err -} - -// BlockByHash returns the given full block. -// -// Note that loading full blocks requires two requests. Use HeaderByHash -// if you don't need all transactions or uncle headers. -func (ec *Client) BlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error) { - return ec.getBlock(ctx, "eth_getBlockByHash", hash, true) -} - -// BlockByNumber returns a block from the current canonical chain. If number is nil, the -// latest known block is returned. -// -// Note that loading full blocks requires two requests. Use HeaderByNumber -// if you don't need all transactions or uncle headers. -func (ec *Client) BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error) { - return ec.getBlock(ctx, "eth_getBlockByNumber", toBlockNumArg(number), true) -} - -// BlockNumber returns the most recent block number -func (ec *Client) BlockNumber(ctx context.Context) (uint64, error) { - var result hexutil.Uint64 - err := ec.c.CallContext(ctx, &result, "eth_blockNumber") - return uint64(result), err -} - -type rpcBlock struct { - Hash common.Hash `json:"hash"` - Transactions []rpcTransaction `json:"transactions"` - UncleHashes []common.Hash `json:"uncles"` -} - -func (ec *Client) getBlock(ctx context.Context, method string, args ...interface{}) (*types.Block, error) { - var raw json.RawMessage - err := ec.c.CallContext(ctx, &raw, method, args...) - if err != nil { - return nil, err - } else if len(raw) == 0 { - return nil, ethereum.NotFound - } - // Decode header and transactions. - var head *types.Header - var body rpcBlock - if err := json.Unmarshal(raw, &head); err != nil { - return nil, err - } - if err := json.Unmarshal(raw, &body); err != nil { - return nil, err - } - // Quick-verify transaction and uncle lists. This mostly helps with debugging the server. - if head.UncleHash == types.EmptyUncleHash && len(body.UncleHashes) > 0 { - return nil, fmt.Errorf("server returned non-empty uncle list but block header indicates no uncles") - } - if head.UncleHash != types.EmptyUncleHash && len(body.UncleHashes) == 0 { - return nil, fmt.Errorf("server returned empty uncle list but block header indicates uncles") - } - if head.TxHash == types.EmptyRootHash && len(body.Transactions) > 0 { - return nil, fmt.Errorf("server returned non-empty transaction list but block header indicates no transactions") - } - if head.TxHash != types.EmptyRootHash && len(body.Transactions) == 0 { - return nil, fmt.Errorf("server returned empty transaction list but block header indicates transactions") - } - // Load uncles because they are not included in the block response. - var uncles []*types.Header - if len(body.UncleHashes) > 0 { - uncles = make([]*types.Header, len(body.UncleHashes)) - reqs := make([]rpc.BatchElem, len(body.UncleHashes)) - for i := range reqs { - reqs[i] = rpc.BatchElem{ - Method: "eth_getUncleByBlockHashAndIndex", - Args: []interface{}{body.Hash, hexutil.EncodeUint64(uint64(i))}, - Result: &uncles[i], - } - } - if err := ec.c.BatchCallContext(ctx, reqs); err != nil { - return nil, err - } - for i := range reqs { - if reqs[i].Error != nil { - return nil, reqs[i].Error - } - if uncles[i] == nil { - return nil, fmt.Errorf("got null header for uncle %d of block %x", i, body.Hash[:]) - } - } - } - // Fill the sender cache of transactions in the block. - txs := make([]*types.Transaction, len(body.Transactions)) - for i, tx := range body.Transactions { - if tx.From != nil { - setSenderFromServer(tx.tx, *tx.From, body.Hash) - } - txs[i] = tx.tx - } - return types.NewBlockWithHeader(head).WithBody(txs, uncles), nil -} - -// HeaderByHash returns the block header with the given hash. -func (ec *Client) HeaderByHash(ctx context.Context, hash common.Hash) (*types.Header, error) { - var head *types.Header - err := ec.c.CallContext(ctx, &head, "eth_getBlockByHash", hash, false) - if err == nil && head == nil { - err = ethereum.NotFound - } - return head, err -} - -// HeaderByNumber returns a block header from the current canonical chain. If number is -// nil, the latest known header is returned. -func (ec *Client) HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error) { - var head *types.Header - err := ec.c.CallContext(ctx, &head, "eth_getBlockByNumber", toBlockNumArg(number), false) - if err == nil && head == nil { - err = ethereum.NotFound - } - return head, err -} - -type rpcTransaction struct { - tx *types.Transaction - txExtraInfo -} - -type txExtraInfo struct { - BlockNumber *string `json:"blockNumber,omitempty"` - BlockHash *common.Hash `json:"blockHash,omitempty"` - From *common.Address `json:"from,omitempty"` -} - -func (tx *rpcTransaction) UnmarshalJSON(msg []byte) error { - if err := json.Unmarshal(msg, &tx.tx); err != nil { - return err - } - return json.Unmarshal(msg, &tx.txExtraInfo) -} - -// TransactionByHash returns the transaction with the given hash. -func (ec *Client) TransactionByHash(ctx context.Context, hash common.Hash) (tx *types.Transaction, isPending bool, err error) { - var json *rpcTransaction - err = ec.c.CallContext(ctx, &json, "eth_getTransactionByHash", hash) - if err != nil { - return nil, false, err - } else if json == nil { - return nil, false, ethereum.NotFound - } else if _, r, _ := json.tx.RawSignatureValues(); r == nil { - return nil, false, fmt.Errorf("server returned transaction without signature") - } - if json.From != nil && json.BlockHash != nil { - setSenderFromServer(json.tx, *json.From, *json.BlockHash) - } - return json.tx, json.BlockNumber == nil, nil -} - -type pendingTransaction struct { - //tx *types.Transaction - txExtraInfo -} - -func (ec *Client) IsPendingByTxHash(ctx context.Context, hash common.Hash) (isPending bool, err error) { - var json *pendingTransaction - err = ec.c.CallContext(ctx, &json, "eth_getTransactionByHash", hash) - if err != nil { - return false, err - } else if json == nil { - return false, ethereum.NotFound - } - return json.BlockNumber == nil, nil -} - -// TransactionSender returns the sender address of the given transaction. The transaction -// must be known to the remote node and included in the blockchain at the given block and -// index. The sender is the one derived by the protocol at the time of inclusion. -// -// There is a fast-path for transactions retrieved by TransactionByHash and -// TransactionInBlock. Getting their sender address can be done without an RPC interaction. -func (ec *Client) TransactionSender(ctx context.Context, tx *types.Transaction, block common.Hash, index uint) (common.Address, error) { - // Try to load the address from the cache. - sender, err := types.Sender(&senderFromServer{blockhash: block}, tx) - if err == nil { - return sender, nil - } - var meta struct { - Hash common.Hash - From common.Address - } - if err = ec.c.CallContext(ctx, &meta, "eth_getTransactionByBlockHashAndIndex", block, hexutil.Uint64(index)); err != nil { - return common.Address{}, err - } - if meta.Hash == (common.Hash{}) || meta.Hash != tx.Hash() { - return common.Address{}, errors.New("wrong inclusion block/index") - } - return meta.From, nil -} - -// TransactionCount returns the total number of transactions in the given block. -func (ec *Client) TransactionCount(ctx context.Context, blockHash common.Hash) (uint, error) { - var num hexutil.Uint - err := ec.c.CallContext(ctx, &num, "eth_getBlockTransactionCountByHash", blockHash) - return uint(num), err -} - -// TransactionInBlock returns a single transaction at index in the given block. -func (ec *Client) TransactionInBlock(ctx context.Context, blockHash common.Hash, index uint) (*types.Transaction, error) { - var json *rpcTransaction - err := ec.c.CallContext(ctx, &json, "eth_getTransactionByBlockHashAndIndex", blockHash, hexutil.Uint64(index)) - if err != nil { - return nil, err - } - if json == nil { - return nil, ethereum.NotFound - } else if _, r, _ := json.tx.RawSignatureValues(); r == nil { - return nil, fmt.Errorf("server returned transaction without signature") - } - if json.From != nil && json.BlockHash != nil { - setSenderFromServer(json.tx, *json.From, *json.BlockHash) - } - return json.tx, err -} - -// TransactionReceipt returns the receipt of a transaction by transaction hash. -// Note that the receipt is not available for pending transactions. -func (ec *Client) TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error) { - var r *types.Receipt - err := ec.c.CallContext(ctx, &r, "eth_getTransactionReceipt", txHash) - if err == nil { - if r == nil { - return nil, ethereum.NotFound - } - } - return r, err -} - -type rpcProgress struct { - StartingBlock hexutil.Uint64 - CurrentBlock hexutil.Uint64 - HighestBlock hexutil.Uint64 - PulledStates hexutil.Uint64 - KnownStates hexutil.Uint64 -} - -// SyncProgress retrieves the current progress of the sync algorithm. If there's -// no sync currently running, it returns nil. -func (ec *Client) SyncProgress(ctx context.Context) (*ethereum.SyncProgress, error) { - var raw json.RawMessage - if err := ec.c.CallContext(ctx, &raw, "eth_syncing"); err != nil { - return nil, err - } - // Handle the possible response types - var syncing bool - if err := json.Unmarshal(raw, &syncing); err == nil { - return nil, nil // Not syncing (always false) - } - var progress *rpcProgress - if err := json.Unmarshal(raw, &progress); err != nil { - return nil, err - } - return ðereum.SyncProgress{ - StartingBlock: uint64(progress.StartingBlock), - CurrentBlock: uint64(progress.CurrentBlock), - HighestBlock: uint64(progress.HighestBlock), - PulledStates: uint64(progress.PulledStates), - KnownStates: uint64(progress.KnownStates), - }, nil -} - -// SubscribeNewHead subscribes to notifications about the current blockchain head -// on the given channel. -func (ec *Client) SubscribeNewHead(ctx context.Context, ch chan<- *types.Header) (ethereum.Subscription, error) { - return ec.c.EthSubscribe(ctx, ch, "newHeads") -} - -// State Access - -// NetworkID returns the network ID (also known as the chain ID) for this chain. -func (ec *Client) NetworkID(ctx context.Context) (*big.Int, error) { - version := new(big.Int) - var ver string - if err := ec.c.CallContext(ctx, &ver, "net_version"); err != nil { - return nil, err - } - if _, ok := version.SetString(ver, 10); !ok { - return nil, fmt.Errorf("invalid net_version result %q", ver) - } - return version, nil -} - -// BalanceAt returns the wei balance of the given account. -// The block number can be nil, in which case the balance is taken from the latest known block. -func (ec *Client) BalanceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (*big.Int, error) { - var result hexutil.Big - err := ec.c.CallContext(ctx, &result, "eth_getBalance", account, toBlockNumArg(blockNumber)) - return (*big.Int)(&result), err -} - -// StorageAt returns the value of key in the contract storage of the given account. -// The block number can be nil, in which case the value is taken from the latest known block. -func (ec *Client) StorageAt(ctx context.Context, account common.Address, key common.Hash, blockNumber *big.Int) ([]byte, error) { - var result hexutil.Bytes - err := ec.c.CallContext(ctx, &result, "eth_getStorageAt", account, key, toBlockNumArg(blockNumber)) - return result, err -} - -// CodeAt returns the contract code of the given account. -// The block number can be nil, in which case the code is taken from the latest known block. -func (ec *Client) CodeAt(ctx context.Context, account common.Address, blockNumber *big.Int) ([]byte, error) { - var result hexutil.Bytes - err := ec.c.CallContext(ctx, &result, "eth_getCode", account, toBlockNumArg(blockNumber)) - return result, err -} - -// NonceAt returns the account nonce of the given account. -// The block number can be nil, in which case the nonce is taken from the latest known block. -func (ec *Client) NonceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (uint64, error) { - var result hexutil.Uint64 - err := ec.c.CallContext(ctx, &result, "eth_getTransactionCount", account, toBlockNumArg(blockNumber)) - return uint64(result), err -} - -// Filters - -// FilterLogs executes a filter query. -func (ec *Client) FilterLogs(ctx context.Context, q ethereum.FilterQuery) ([]types.Log, error) { - var result []types.Log - arg, err := toFilterArg(q) - if err != nil { - return nil, err - } - err = ec.c.CallContext(ctx, &result, "eth_getLogs", arg) - return result, err -} - -// SubscribeFilterLogs subscribes to the results of a streaming filter query. -func (ec *Client) SubscribeFilterLogs(ctx context.Context, q ethereum.FilterQuery, ch chan<- types.Log) (ethereum.Subscription, error) { - arg, err := toFilterArg(q) - if err != nil { - return nil, err - } - return ec.c.EthSubscribe(ctx, ch, "logs", arg) -} - -func toFilterArg(q ethereum.FilterQuery) (interface{}, error) { - arg := map[string]interface{}{ - "address": q.Addresses, - "topics": q.Topics, - } - if q.BlockHash != nil { - arg["blockHash"] = *q.BlockHash - if q.FromBlock != nil || q.ToBlock != nil { - return nil, fmt.Errorf("cannot specify both BlockHash and FromBlock/ToBlock") - } - } else { - if q.FromBlock == nil { - arg["fromBlock"] = "0x0" - } else { - arg["fromBlock"] = toBlockNumArg(q.FromBlock) - } - arg["toBlock"] = toBlockNumArg(q.ToBlock) - } - return arg, nil -} - -// Pending State - -// PendingBalanceAt returns the wei balance of the given account in the pending state. -func (ec *Client) PendingBalanceAt(ctx context.Context, account common.Address) (*big.Int, error) { - var result hexutil.Big - err := ec.c.CallContext(ctx, &result, "eth_getBalance", account, "pending") - return (*big.Int)(&result), err -} - -// PendingStorageAt returns the value of key in the contract storage of the given account in the pending state. -func (ec *Client) PendingStorageAt(ctx context.Context, account common.Address, key common.Hash) ([]byte, error) { - var result hexutil.Bytes - err := ec.c.CallContext(ctx, &result, "eth_getStorageAt", account, key, "pending") - return result, err -} - -// PendingCodeAt returns the contract code of the given account in the pending state. -func (ec *Client) PendingCodeAt(ctx context.Context, account common.Address) ([]byte, error) { - var result hexutil.Bytes - err := ec.c.CallContext(ctx, &result, "eth_getCode", account, "pending") - return result, err -} - -// PendingNonceAt returns the account nonce of the given account in the pending state. -// This is the nonce that should be used for the next transaction. -func (ec *Client) PendingNonceAt(ctx context.Context, account common.Address) (uint64, error) { - var result hexutil.Uint64 - err := ec.c.CallContext(ctx, &result, "eth_getTransactionCount", account, "pending") - return uint64(result), err -} - -// PendingTransactionCount returns the total number of transactions in the pending state. -func (ec *Client) PendingTransactionCount(ctx context.Context) (uint, error) { - var num hexutil.Uint - err := ec.c.CallContext(ctx, &num, "eth_getBlockTransactionCountByNumber", "pending") - return uint(num), err -} - -// Contract Calling - -// CallContract executes a message call transaction, which is directly executed in the VM -// of the node, but never mined into the blockchain. -// -// blockNumber selects the block height at which the call runs. It can be nil, in which -// case the code is taken from the latest known block. Note that state from very old -// blocks might not be available. -func (ec *Client) CallContract(ctx context.Context, msg ethereum.CallMsg, blockNumber *big.Int) ([]byte, error) { - var hex hexutil.Bytes - err := ec.c.CallContext(ctx, &hex, "eth_call", toCallArg(msg), toBlockNumArg(blockNumber)) - if err != nil { - return nil, err - } - return hex, nil -} - -// PendingCallContract executes a message call transaction using the EVM. -// The state seen by the contract call is the pending state. -func (ec *Client) PendingCallContract(ctx context.Context, msg ethereum.CallMsg) ([]byte, error) { - var hex hexutil.Bytes - err := ec.c.CallContext(ctx, &hex, "eth_call", toCallArg(msg), "pending") - if err != nil { - return nil, err - } - return hex, nil -} - -// SuggestGasPrice retrieves the currently suggested gas price to allow a timely -// execution of a transaction. -func (ec *Client) SuggestGasPrice(ctx context.Context) (*big.Int, error) { - var hex hexutil.Big - if err := ec.c.CallContext(ctx, &hex, "eth_gasPrice"); err != nil { - return nil, err - } - return (*big.Int)(&hex), nil -} - -// SuggestGasTipCap retrieves the currently suggested gas tip cap after 1559 to -// allow a timely execution of a transaction. -func (ec *Client) SuggestGasTipCap(ctx context.Context) (*big.Int, error) { - var hex hexutil.Big - if err := ec.c.CallContext(ctx, &hex, "eth_maxPriorityFeePerGas"); err != nil { - return nil, err - } - return (*big.Int)(&hex), nil -} - -// EstimateGas tries to estimate the gas needed to execute a specific transaction based on -// the current pending state of the backend blockchain. There is no guarantee that this is -// the true gas limit requirement as other transactions may be added or removed by miners, -// but it should provide a basis for setting a reasonable default. -func (ec *Client) EstimateGas(ctx context.Context, msg ethereum.CallMsg) (uint64, error) { - var hex hexutil.Uint64 - err := ec.c.CallContext(ctx, &hex, "eth_estimateGas", toCallArg(msg)) - if err != nil { - return 0, err - } - return uint64(hex), nil -} - -// SendTransaction injects a signed transaction into the pending pool for execution. -// -// If the transaction was a contract creation use the TransactionReceipt method to get the -// contract address after the transaction has been mined. -func (ec *Client) SendTransaction(ctx context.Context, tx *types.Transaction) error { - data, err := tx.MarshalBinary() - if err != nil { - return err - } - return ec.c.CallContext(ctx, nil, "eth_sendRawTransaction", hexutil.Encode(data)) -} - -func toBlockNumArg(number *big.Int) string { - if number == nil { - return "latest" - } - pending := big.NewInt(-1) - if number.Cmp(pending) == 0 { - return "pending" - } - return hexutil.EncodeBig(number) -} - -func toCallArg(msg ethereum.CallMsg) interface{} { - arg := map[string]interface{}{ - "from": msg.From, - "to": msg.To, - } - if len(msg.Data) > 0 { - arg["data"] = hexutil.Bytes(msg.Data) - } - if msg.Value != nil { - arg["value"] = (*hexutil.Big)(msg.Value) - } - if msg.Gas != 0 { - arg["gas"] = hexutil.Uint64(msg.Gas) - } - if msg.GasPrice != nil { - arg["gasPrice"] = (*hexutil.Big)(msg.GasPrice) - } - return arg -} - -type Validator struct { - Address string - NodeId string - BlsPubKey string -} - -type QuorumCert struct { - Epoch int64 `json:"epoch"` - ViewNumber int64 `json:"viewNumber"` - BlockHash string `json:"blockHash"` - BlockIndex int64 `json:"blockIndex"` - BlockNumber int64 `json:"blockNumber"` - Signature string `json:"signature"` - ValidatorSet string `json:"validatorSet"` -} - -type Header struct { - types.Header - WithdrawalsHash string `json:"withdrawalsRoot" rlp:"optional"` -} - -type jsonrpcMessage struct { - Version string `json:"jsonrpc,omitempty"` - ID json.RawMessage `json:"id,omitempty"` - Method string `json:"method,omitempty"` - Params json.RawMessage `json:"params,omitempty"` - Result json.RawMessage `json:"result,omitempty"` - Error json.RawMessage `json:"error,omitempty"` -} - -// EthLatestHeaderByNumber returns a block header from the current canonical chain. If number is -// nil, the latest known header is returned. -func (ec *Client) EthLatestHeaderByNumber(endpoint string, number *big.Int) (*Header, error) { - s := fmt.Sprintf("{\"jsonrpc\": \"2.0\",\"method\": \"eth_getBlockByNumber\",\"params\": [\"%s\",true],\"id\": 1\n}", toBlockNumArg(number)) - body := strings.NewReader(s) - resp, err := http.Post(endpoint, "application/json", body) - if err != nil { - return nil, err - } - - var respmsg jsonrpcMessage - if err := json.NewDecoder(resp.Body).Decode(&respmsg); err != nil { - return nil, err - } - - data := make([]byte, 0, len(respmsg.Result)) - for _, res := range respmsg.Result { - data = append(data, res) - } - var head Header - err = json.Unmarshal(data, &head) - if err != nil { - return nil, err - } - - type Tmp struct { - WithdrawalsHash string `json:"withdrawalsRoot" rlp:"optional"` - } - var tmp Tmp - err = json.Unmarshal(data, &tmp) - if err != nil { - return nil, err - } - - head.WithdrawalsHash = tmp.WithdrawalsHash - return &head, err -} - -type OpReceipt struct { - DepositNonce string `json:"depositNonce,omitempty"` - DepositReceiptVersion string `json:"depositReceiptVersion,omitempty"` -} - -func (ec *Client) OpReceipt(ctx context.Context, txHash common.Hash) (*OpReceipt, error) { - s := fmt.Sprintf("{\"jsonrpc\": \"2.0\",\"method\": \"eth_getTransactionReceipt\",\"params\": [\"%s\"],\"id\": 1}", txHash.Hex()) - body := strings.NewReader(s) - resp, err := http.Post(ec.url, "application/json", body) - if err != nil { - return nil, err - } - - var respmsg jsonrpcMessage - if err := json.NewDecoder(resp.Body).Decode(&respmsg); err != nil { - return nil, err - } - - data := make([]byte, 0, len(respmsg.Result)) - for _, res := range respmsg.Result { - data = append(data, res) - } - var ret *OpReceipt - err = json.Unmarshal(data, &ret) - if err != nil { - return nil, err - } - - return ret, err -} - -type Error struct { - Code int `json:"code"` - Message string `json:"message"` - Data string `json:"data"` -} - -func (ec *Client) SelfEstimateGas(ctx context.Context, endpoint, from, to, param string) (uint64, error) { - s := fmt.Sprintf("{\"jsonrpc\": \"2.0\",\"method\": \"eth_estimateGas\",\"params\": [{\"from\":\"%s\",\"to\":\"%s\",\"data\":\"%s\"}],\"id\": 1}", - from, to, param) - body := strings.NewReader(s) - resp, err := http.Post(endpoint, "application/json", body) - if err != nil { - return 0, err - } - var respmsg jsonrpcMessage - if err := json.NewDecoder(resp.Body).Decode(&respmsg); err != nil { - return 0, err - } - ret := uint64(0) - customErr := Error{} - err = json.Unmarshal(respmsg.Error, &customErr) - if err != nil { - return ret, err - } - if customErr.Message != "" { - return ret, fmt.Errorf("%s:%s", customErr.Message, customErr.Data) - } - if len(respmsg.Result) != 0 { - tmp, ok := big.NewInt(0).SetString(strings.TrimPrefix(string(respmsg.Result), "0x"), 16) - if !ok { - return ret, fmt.Errorf("result convert int failed, result:%s", string(respmsg.Result)) - } - ret = tmp.Uint64() - } - - return ret, nil -} - -type BscHeader struct { - types.Header - WithdrawalsRoot string `json:"withdrawalsRoot" rlp:"optional"` - BlobGasUsed string `json:"blobGasUsed" rlp:"optional"` - ExcessBlobGas string `json:"excessBlobGas" rlp:"optional"` - ParentBeaconBlockRoot string `json:"parentBeaconBlockRoot" rlp:"optional"` -} - -func (ec *Client) BscHeaderByNumber(endpoint string, number *big.Int) (*BscHeader, error) { - s := fmt.Sprintf("{\"jsonrpc\": \"2.0\",\"method\": \"eth_getBlockByNumber\",\"params\": [\"%s\",true],\"id\": 1\n}", toBlockNumArg(number)) - body := strings.NewReader(s) - resp, err := http.Post(endpoint, "application/json", body) - if err != nil { - return nil, err - } - - var respmsg jsonrpcMessage - if err := json.NewDecoder(resp.Body).Decode(&respmsg); err != nil { - return nil, err - } - - data := make([]byte, 0, len(respmsg.Result)) - for _, res := range respmsg.Result { - data = append(data, res) - } - var head BscHeader - err = json.Unmarshal(data, &head) - if err != nil { - return nil, err - } - - type Tmp struct { - WithdrawalsRoot string `json:"withdrawalsRoot" rlp:"optional"` - BlobGasUsed string `json:"blobGasUsed" rlp:"optional"` - ExcessBlobGas string `json:"excessBlobGas" rlp:"optional"` - ParentBeaconBlockRoot string `json:"parentBeaconBlockRoot" rlp:"optional"` - } - var tmp Tmp - err = json.Unmarshal(data, &tmp) - if err != nil { - return nil, err - } - - head.WithdrawalsRoot = tmp.WithdrawalsRoot - head.BlobGasUsed = tmp.BlobGasUsed - head.ExcessBlobGas = tmp.ExcessBlobGas - head.ParentBeaconBlockRoot = tmp.ParentBeaconBlockRoot - return &head, err -} diff --git a/pkg/ethclient/map_signer.go b/pkg/ethclient/map_signer.go deleted file mode 100644 index 2bc03c33..00000000 --- a/pkg/ethclient/map_signer.go +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright 2017 The go-ethereum Authors -// This file is part of the go-ethereum library. -// -// The go-ethereum library is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// The go-ethereum library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with the go-ethereum library. If not, see . - -package ethclient - -import ( - "math/big" - - "github.com/ethereum/go-ethereum/common" - "github.com/mapprotocol/atlas/core/types" -) - -// mapSenderFromServer is a types.Signer that remembers the sender address returned by the RPC -// server. It is stored in the transaction's sender address cache to avoid an additional -// request in TransactionSender. -type mapSenderFromServer struct { - addr common.Address - blockhash common.Hash -} - -func setMAPSenderFromServer(tx *types.Transaction, addr common.Address, block common.Hash) { - // Use types.Sender for side-effect to store our signer into the cache. - types.Sender(&mapSenderFromServer{addr, block}, tx) -} - -func (s *mapSenderFromServer) Equal(other types.Signer) bool { - os, ok := other.(*mapSenderFromServer) - return ok && os.blockhash == s.blockhash -} - -func (s *mapSenderFromServer) Sender(tx *types.Transaction) (common.Address, error) { - if s.blockhash == (common.Hash{}) { - return common.Address{}, errNotCached - } - return s.addr, nil -} - -func (s *mapSenderFromServer) ChainID() *big.Int { - panic("can't sign with senderFromServer") -} -func (s *mapSenderFromServer) Hash(tx *types.Transaction) common.Hash { - panic("can't sign with senderFromServer") -} -func (s *mapSenderFromServer) SignatureValues(tx *types.Transaction, sig []byte) (R, S, V *big.Int, err error) { - panic("can't sign with senderFromServer") -} diff --git a/pkg/ethclient/mapclient.go b/pkg/ethclient/mapclient.go deleted file mode 100644 index 0245f4e9..00000000 --- a/pkg/ethclient/mapclient.go +++ /dev/null @@ -1,136 +0,0 @@ -package ethclient - -import ( - "context" - "encoding/json" - "fmt" - "github.com/mapprotocol/atlas/helper/bls" - "math/big" - - "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/common" - "github.com/mapprotocol/atlas/consensus/istanbul/backend" - "github.com/mapprotocol/atlas/core/types" -) - -type rpcMAPBlock struct { - Hash common.Hash `json:"hash"` - Transactions []rpcMAPTransaction `json:"transactions"` - Randomness *types.Randomness `json:"randomness"` - EpochSnarkData *EpochSnarkData `json:"epochSnarkData"` -} - -type EpochSnarkData struct { - Bitmap string - Signature string -} - -type rpcMAPTransaction struct { - tx *types.Transaction - txExtraInfo -} - -func (tx *rpcMAPTransaction) UnmarshalJSON(msg []byte) error { - if err := json.Unmarshal(msg, &tx.tx); err != nil { - return err - } - return json.Unmarshal(msg, &tx.txExtraInfo) -} - -func (ec *Client) getMAPBlock(ctx context.Context, method string, args ...interface{}) (*Block, error) { - var raw json.RawMessage - err := ec.c.CallContext(ctx, &raw, method, args...) - if err != nil { - return nil, err - } else if len(raw) == 0 { - return nil, ethereum.NotFound - } - // Decode header and transactions. - var head *types.Header - var body Block - if err := json.Unmarshal(raw, &head); err != nil { - return nil, err - } - if err := json.Unmarshal(raw, &body); err != nil { - return nil, err - } - if head.TxHash == types.EmptyRootHash && len(body.Transactions) > 0 { - return nil, fmt.Errorf("server returned non-empty transaction list but block header indicates no transactions") - } - if head.TxHash != types.EmptyRootHash && len(body.Transactions) == 0 { - return nil, fmt.Errorf("server returned empty transaction list but block header indicates transactions") - } - return &body, nil -} - -func (ec *Client) getTronBlock(ctx context.Context, method string, args ...interface{}) (*Block, error) { - var raw json.RawMessage - err := ec.c.CallContext(ctx, &raw, method, args...) - if err != nil { - return nil, err - } else if len(raw) == 0 { - return nil, ethereum.NotFound - } - // Decode header and transactions. - var body Block - if err := json.Unmarshal(raw, &body); err != nil { - return nil, err - } - if common.HexToHash(body.TransactionsRoot) == types.EmptyRootHash && len(body.Transactions) > 0 { - return nil, fmt.Errorf("server returned non-empty transaction list but block header indicates no transactions") - } - if common.HexToHash(body.TransactionsRoot) != types.EmptyRootHash && len(body.Transactions) == 0 { - return nil, fmt.Errorf("server returned empty transaction list but block header indicates transactions") - } - return &body, nil -} - -// MAPBlockByHash returns the given full block. -// -// Note that loading full blocks requires two requests. Use HeaderByHash -// if you don't need all transactions or uncle headers. -func (ec *Client) MAPBlockByHash(ctx context.Context, hash common.Hash) (*Block, error) { - return ec.getMAPBlock(ctx, "eth_getBlockByHash", hash, true) -} - -// MAPBlockByNumber returns a block from the current canonical chain. If number is nil, the -// latest known block is returned. -// -// Note that loading full blocks requires two requests. Use HeaderByNumber -// if you don't need all transactions or uncle headers. -func (ec *Client) MAPBlockByNumber(ctx context.Context, number *big.Int) (*Block, error) { - return ec.getMAPBlock(ctx, "eth_getBlockByNumber", toBlockNumArg(number), true) -} - -func (ec *Client) TronBlockByNumber(ctx context.Context, number *big.Int) (*Block, error) { - return ec.getTronBlock(ctx, "eth_getBlockByNumber", toBlockNumArg(number), true) -} - -// MAPHeaderByNumber returns a block header from the current canonical chain. If number is -// nil, the latest known header is returned. -func (ec *Client) MAPHeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error) { - var head *types.Header - err := ec.c.CallContext(ctx, &head, "eth_getBlockByNumber", toBlockNumArg(number), false) - if err == nil && head == nil { - err = ethereum.NotFound - } - return head, err -} - -func (ec *Client) GetSnapshot(ctx context.Context, number *big.Int) (*backend.Snapshot, error) { - var snap *backend.Snapshot - err := ec.c.CallContext(ctx, &snap, "istanbul_getSnapshot", toBlockNumArg(number)) - if err != nil { - return nil, err - } - return snap, err -} - -func (ec *Client) GetValidatorsBLSPublicKeys(ctx context.Context, number *big.Int) ([]bls.SerializedPublicKey, error) { - var snap []bls.SerializedPublicKey - err := ec.c.CallContext(ctx, &snap, "istanbul_getValidatorsBLSPublicKeys", toBlockNumArg(number)) - if err != nil { - return nil, err - } - return snap, err -} diff --git a/pkg/ethclient/signer.go b/pkg/ethclient/signer.go deleted file mode 100644 index 9de020b3..00000000 --- a/pkg/ethclient/signer.go +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2017 The go-ethereum Authors -// This file is part of the go-ethereum library. -// -// The go-ethereum library is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// The go-ethereum library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with the go-ethereum library. If not, see . - -package ethclient - -import ( - "errors" - "math/big" - - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" -) - -// senderFromServer is a types.Signer that remembers the sender address returned by the RPC -// server. It is stored in the transaction's sender address cache to avoid an additional -// request in TransactionSender. -type senderFromServer struct { - addr common.Address - blockhash common.Hash -} - -var errNotCached = errors.New("sender not cached") - -func setSenderFromServer(tx *types.Transaction, addr common.Address, block common.Hash) { - // Use types.Sender for side-effect to store our signer into the cache. - types.Sender(&senderFromServer{addr, block}, tx) -} - -func (s *senderFromServer) Equal(other types.Signer) bool { - os, ok := other.(*senderFromServer) - return ok && os.blockhash == s.blockhash -} - -func (s *senderFromServer) Sender(tx *types.Transaction) (common.Address, error) { - if s.blockhash == (common.Hash{}) { - return common.Address{}, errNotCached - } - return s.addr, nil -} - -func (s *senderFromServer) ChainID() *big.Int { - panic("can't sign with senderFromServer") -} -func (s *senderFromServer) Hash(tx *types.Transaction) common.Hash { - panic("can't sign with senderFromServer") -} -func (s *senderFromServer) SignatureValues(tx *types.Transaction, sig []byte) (R, S, V *big.Int, err error) { - panic("can't sign with senderFromServer") -} diff --git a/pkg/keystore/encrypt.go b/pkg/keystore/encrypt.go deleted file mode 100644 index ae993ce6..00000000 --- a/pkg/keystore/encrypt.go +++ /dev/null @@ -1,23 +0,0 @@ -package keystore - -import ( - "fmt" - "syscall" - - terminal "golang.org/x/term" -) - -// GetPassword prompt user to enter password for encrypted keystore -func GetPassword(msg string) []byte { - for { - fmt.Println(msg) - fmt.Print("> ") - password, err := terminal.ReadPassword(int(syscall.Stdin)) - if err != nil { - fmt.Printf("invalid input: %s\n", err) - } else { - fmt.Printf("\n") - return password - } - } -} diff --git a/pkg/keystore/keystore.go b/pkg/keystore/keystore.go deleted file mode 100644 index 53aeeaa5..00000000 --- a/pkg/keystore/keystore.go +++ /dev/null @@ -1,78 +0,0 @@ -package keystore - -import ( - "encoding/json" - "fmt" - "os" - "path/filepath" - - "github.com/ethereum/go-ethereum/accounts/keystore" - "github.com/mapprotocol/near-api-go/pkg/types" - "github.com/mapprotocol/near-api-go/pkg/types/key" -) - -const ( - EnvPassword = "KEYSTORE_PASSWORD" -) - -var pswCache = make(map[string][]byte) - -func KeypairFromEth(path string) (*keystore.Key, error) { - // Make sure key exists before prompting password - if _, err := os.Stat(path); os.IsNotExist(err) { - return nil, fmt.Errorf("key file not found: %s", path) - } - - var pswd = pswCache[path] - if len(pswd) == 0 { - pswd = GetPassword(fmt.Sprintf("Enter password for key %s:", path)) - } - - file, err := os.ReadFile(path) - if err != nil { - return nil, fmt.Errorf("read keyFile failed, err:%s", err) - } - ret, err := keystore.DecryptKey(file, string(pswd)) - if err != nil { - return nil, fmt.Errorf("DecryptKey failed, err:%s", err) - } - pswCache[path] = pswd - - return ret, nil -} - -func NearKeyPairFrom(networkName, path string, id types.AccountID) (kp key.KeyPair, err error) { - var creds struct { - AccountID types.AccountID `json:"account_id"` - PublicKey key.Base58PublicKey `json:"public_key"` - PrivateKey key.KeyPair `json:"private_key"` - } - - home := path - if home == "" { - home, err = os.UserHomeDir() - if err != nil { - return - } - } - - credsFile := filepath.Join(home, ".near-credentials", networkName, fmt.Sprintf("%s.json", id)) - - var cf *os.File - if cf, err = os.Open(credsFile); err != nil { - return - } - defer cf.Close() - - if err = json.NewDecoder(cf).Decode(&creds); err != nil { - return - } - - if creds.PublicKey.String() != creds.PrivateKey.PublicKey.String() { - err = fmt.Errorf("inconsistent public key, %s != %s", creds.PublicKey.String(), creds.PrivateKey.PublicKey.String()) - return - } - kp = creds.PrivateKey - - return -} diff --git a/pkg/msg/message.go b/pkg/msg/message.go deleted file mode 100644 index a82ed3a0..00000000 --- a/pkg/msg/message.go +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright 2021 Compass Systems -// SPDX-License-Identifier: LGPL-3.0-only - -package msg - -type ChainId uint64 -type TransferType string - -var ( - SyncToMap TransferType = "SyncToMap" - SyncFromMap TransferType = "SyncFromMap" - SwapWithProof TransferType = "SwapWithProof" - SwapWithMapProof TransferType = "SwapWithMapProof" - SwapWithMerlin TransferType = "SwapWithMerlin" - Proposal TransferType = "Proposal" - SwapSolProof TransferType = "SwapSolProof" -) - -// Message is used as a generic format to communicate between chains -type Message struct { - Idx int - Source ChainId // Source where message was initiated - Destination ChainId // Destination chain of message - Type TransferType // type of bridge transfer - Payload []interface{} // data associated with event sequence - DoneCh chan<- struct{} // notify message is handled -} - -func NewSyncToMap(fromChainID, toChainID ChainId, payloads []interface{}, ch chan<- struct{}) Message { - return Message{ - Source: fromChainID, - Destination: toChainID, - Type: SyncToMap, - Payload: payloads, - DoneCh: ch, - } -} - -func NewSwapWithProof(fromChainID, toChainID ChainId, payloads []interface{}, ch chan<- struct{}) Message { - return Message{ - Source: fromChainID, - Destination: toChainID, - Type: SwapWithProof, - Payload: payloads, - DoneCh: ch, - } -} - -func NewSyncFromMap(mapChainID, toChainID ChainId, payloads []interface{}, ch chan<- struct{}) Message { - return Message{ - Source: mapChainID, - Destination: toChainID, - Type: SyncFromMap, - Payload: payloads, - DoneCh: ch, - } -} - -func NewSwapWithMapProof(fromChainID, toChainID ChainId, payloads []interface{}, ch chan<- struct{}) Message { - return Message{ - Source: fromChainID, - Destination: toChainID, - Type: SwapWithMapProof, - Payload: payloads, - DoneCh: ch, - } -} - -func NewSolProof(fromChainID, toChainID ChainId, payloads []interface{}, ch chan<- struct{}) Message { - return Message{ - Source: fromChainID, - Destination: toChainID, - Type: SwapSolProof, - Payload: payloads, - DoneCh: ch, - } -} - -func NewSwapWithMerlin(fromChainID, toChainID ChainId, payloads []interface{}, ch chan<- struct{}) Message { - return Message{ - Source: fromChainID, - Destination: toChainID, - Type: SwapWithMerlin, - Payload: payloads, - DoneCh: ch, - } -} - -func NewProposal(fromChainID, toChainID ChainId, payloads []interface{}, ch chan<- struct{}) Message { - return Message{ - Source: fromChainID, - Destination: toChainID, - Type: Proposal, - Payload: payloads, - DoneCh: ch, - } -} diff --git a/pkg/redis/redis.go b/pkg/redis/redis.go deleted file mode 100644 index 74bd7471..00000000 --- a/pkg/redis/redis.go +++ /dev/null @@ -1,32 +0,0 @@ -package redis - -import ( - "sync" - - "github.com/go-redis/redis/v8" -) - -var ( - ListKey = "near_messsage_log" - BlockHeight = "block_height" - redisClient *redis.Client - once = &sync.Once{} -) - -func Init(url string) { - if url == "" { - panic("messenger redisUrl is empty") - } - once.Do(func() { - opt, err := redis.ParseURL(url) - if err != nil { - panic(err) - } - rdb := redis.NewClient(opt) - redisClient = rdb - }) -} - -func GetClient() *redis.Client { - return redisClient -} diff --git a/pkg/util/alarm.go b/pkg/util/alarm.go deleted file mode 100644 index c83524e5..00000000 --- a/pkg/util/alarm.go +++ /dev/null @@ -1,63 +0,0 @@ -package util - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "io" - "net/http" - "time" - - "github.com/ethereum/go-ethereum/log" -) - -var ( - prefix, hooksUrl = "", "" - m = NewRWMap() -) - -func Init(env, hooks string) { - prefix = env - hooksUrl = hooks -} - -func Alarm(ctx context.Context, msg string) { - if hooksUrl == "" { - log.Info("hooks is empty") - return - } - fmt.Println("send alarm in") - v, ok := m.Get(msg) - if ok { - if time.Now().Unix()-v < 300 { // ignore same alarm in five minute - return - } - } - - m.Set(msg, time.Now().Unix()) - body, err := json.Marshal(map[string]interface{}{ - "text": fmt.Sprintf("%s %s", prefix, msg), - }) - if err != nil { - return - } - - req, err := http.NewRequestWithContext(ctx, "POST", hooksUrl, io.NopCloser(bytes.NewReader(body))) - if err != nil { - return - } - req.Header.Set("Content-type", "application/json") - - resp, err := http.DefaultClient.Do(req) - if err != nil { - return - } - - data, err := io.ReadAll(resp.Body) - if err != nil { - log.Warn("read resp failed", "err", err) - return - } - fmt.Println("send alarm message", "resp", string(data)) -} diff --git a/pkg/util/bytes.go b/pkg/util/bytes.go deleted file mode 100644 index 1d44f0bf..00000000 --- a/pkg/util/bytes.go +++ /dev/null @@ -1,74 +0,0 @@ -package util - -import ( - "encoding/hex" - "math/bits" - "strings" - - "github.com/ethereum/go-ethereum/common" -) - -func Key2Hex(str []byte, proofLength int) []byte { - ret := make([]byte, 0) - for _, b := range str { - ret = append(ret, b/16) - ret = append(ret, b%16) - } - return ret -} - -// FromHexString returns a byte array given a hex string -func FromHexString(data string) []byte { - data = strings.TrimPrefix(data, "0x") - if len(data)%2 == 1 { - // Odd number of characters; even it up - data = "0" + data - } - ret, err := hex.DecodeString(data) - if err != nil { - panic(err) - } - return ret -} - -type Bitvector512 []byte - -const bitvector512ByteSize = 64 -const bitvector512BitSize = bitvector512ByteSize * 8 - -func NewBitvector512(data []byte) Bitvector512 { - if len(data) != bitvector512ByteSize { - return nil - } - byteArray := make([]byte, 0, bitvector512ByteSize) - byteArray = append(byteArray, data...) - return byteArray[:] -} - -// Len returns the number of bits in the bitvector. -func (b Bitvector512) Len() uint64 { - return bitvector512BitSize -} - -// Count returns the number of 1s in the bitvector. -func (b Bitvector512) Count() uint64 { - if len(b) == 0 { - return 0 - } - c := 0 - for i, bt := range b { - if i >= bitvector512ByteSize { - break - } - c += bits.OnesCount8(bt) - } - return uint64(c) -} - -func HashToByte(h common.Hash) []byte { - ret := make([]byte, 0, len(h)) - for _, b := range h { - ret = append(ret, b) - } - return ret -} diff --git a/pkg/util/rwmap.go b/pkg/util/rwmap.go deleted file mode 100644 index 8c599df7..00000000 --- a/pkg/util/rwmap.go +++ /dev/null @@ -1,49 +0,0 @@ -package util - -import "sync" - -type RWMap struct { - sync.RWMutex - m map[string]int64 -} - -func NewRWMap() *RWMap { - return &RWMap{ - m: make(map[string]int64, 0), - } -} -func (m *RWMap) Get(k string) (int64, bool) { - m.RLock() - defer m.RUnlock() - v, existed := m.m[k] - return v, existed -} - -func (m *RWMap) Set(k string, v int64) { - m.Lock() - defer m.Unlock() - m.m[k] = v -} - -func (m *RWMap) Delete(k string) { - m.Lock() - defer m.Unlock() - delete(m.m, k) -} - -func (m *RWMap) Len() int { - m.RLock() - defer m.RUnlock() - return len(m.m) -} - -func (m *RWMap) Each(f func(k string, v int64) bool) { - m.RLock() - defer m.RUnlock() - - for k, v := range m.m { - if !f(k, v) { - return - } - } -} diff --git a/rly/map-rly.go b/rly/map-rly.go new file mode 100644 index 00000000..6ab8b6ae --- /dev/null +++ b/rly/map-rly.go @@ -0,0 +1,9 @@ +package main + +import ( + "github.com/mapprotocol/compass/cmd" +) + +func main() { + cmd.Run() +} diff --git a/scripts/build.sh b/scripts/build.sh new file mode 100755 index 00000000..3d3e11a6 --- /dev/null +++ b/scripts/build.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +pushd `dirname $0` >/dev/null +cmdDir=$(pwd) +popd >/dev/null +((l=0)) +while getopts "l:" arg +do + case $arg in + l) + ((l=OPTARG)) + ;; + ?) + echo "Unknown option" + exit 1 + ;; + esac +done +targets=( + darwin,arm64 + darwin,amd64 + windows,amd64 + linux,amd64 +) +targetDir=$cmdDir/../target/ +mkdir -p "$targetDir" +((num=0)) +for i in "${targets[@]}" +do + if [ "$l" -ne 0 ] ; then + ((num+=1)) + if [ "$num" -ne "$l" ] ; then + continue + fi + fi + pair=($(echo "$i" | tr ',' "\n")) + GOOS=$pair + GOARCH=${pair[1]} + env GOOS="$GOOS" GOARCH="$GOARCH" go build -o "$targetDir"/map-rly_"$GOOS"_"$GOARCH".exe "$cmdDir"/../rly/ +done \ No newline at end of file diff --git a/tests/update_near_header_map_test.go b/tests/update_near_header_map_test.go deleted file mode 100644 index 3b97eede..00000000 --- a/tests/update_near_header_map_test.go +++ /dev/null @@ -1,21 +0,0 @@ -package tests - -import ( - "github.com/lbtsm/gotron-sdk/pkg/client" - "github.com/stretchr/testify/require" - "google.golang.org/grpc" - "testing" -) - -func Test_grpc(t *testing.T) { - conn := client.NewGrpcClient("grpc.trongrid.io:50051") - err := conn.Start(grpc.WithInsecure()) - require.Nil(t, err) - - // `[{"bytes32":"1eee75d90926c3470877c4da9c21d52c6e762225fec1386f7a526bf3f1ce440e"}]` - tx, err := conn.TriggerConstantContract("TNoZuAuL83PSh8TG4W92AvLqkA4E2dKSNm", - "TYMpgB8Q9vSoGtkyE3hXsvUrpte3KCDGj6", - "orderList(bytes32)", `[{"bytes32":"[30 238 117 217 9 38 195 71 8 119 196 218 156 33 213 44 110 118 34 37 254 193 56 111 122 82 107 243 241 206 68 14]"}]`) - t.Log("err", err) - t.Log("tx", tx.ConstantResult[0]) -} diff --git a/types/chain.go b/types/chain.go new file mode 100644 index 00000000..2c6082f7 --- /dev/null +++ b/types/chain.go @@ -0,0 +1,3 @@ +package types + +type ChainId int diff --git a/types/error.go b/types/error.go new file mode 100644 index 00000000..38ff361f --- /dev/null +++ b/types/error.go @@ -0,0 +1,8 @@ +package types + +import "time" + +type WaitTimeAndMessage struct { + Time time.Duration + Message string +} diff --git a/types/events.go b/types/events.go new file mode 100644 index 00000000..1230c096 --- /dev/null +++ b/types/events.go @@ -0,0 +1,10 @@ +package types + +import "math/big" + +type EventLogSwapOutResponse struct { + OrderId *big.Int `json:"orderId"` + Amount *big.Int `json:"amount"` + FromChainID *big.Int `json:"fromChainID"` + ToChainID *big.Int `json:"toChainID"` +} diff --git a/types/http_request.go b/types/http_request.go new file mode 100644 index 00000000..71a00368 --- /dev/null +++ b/types/http_request.go @@ -0,0 +1,8 @@ +package types + +type Request struct { + Method string `json:"method"` + Params interface{} `json:"params"` + JsonRpc string `json:"jsonrpc"` + Id string `json:"id"` +} diff --git a/types/http_response.go b/types/http_response.go new file mode 100644 index 00000000..a5582142 --- /dev/null +++ b/types/http_response.go @@ -0,0 +1,7 @@ +package types + +type GetAccountInfoResponse struct { + EpochID string `json:"epochID"` + RegisterStatus bool `json:"registerStatus"` + RelayerStatus bool `json:"relayerStatus"` +} diff --git a/types/rpc_response.go b/types/rpc_response.go new file mode 100644 index 00000000..91d20a18 --- /dev/null +++ b/types/rpc_response.go @@ -0,0 +1,19 @@ +package types + +import "math/big" + +type GetRelayerBalanceResponse struct { + Registered *big.Int + Unregistering *big.Int + Unregistered *big.Int +} +type GetRelayerResponse struct { + Relayer bool + Register bool + Epoch *big.Int +} +type GetPeriodHeightResponse struct { + Start *big.Int + End *big.Int + Relayer bool +} diff --git a/types/toml.go b/types/toml.go new file mode 100644 index 00000000..288af650 --- /dev/null +++ b/types/toml.go @@ -0,0 +1,19 @@ +package types + +type GlobalConfig struct { + Keystore string `toml:"keystore"` + Password string `toml:"password"` + BlockNumberByEstimation bool `toml:"block_number_by_estimation"` + StartWithBlock int64 `toml:"start_with_block"` + BlockNumberLimitOnce uint64 `toml:"block_number_limit_once"` +} +type ChainConfig struct { + Name string `toml:"name"` + ChainId ChainId `toml:"chain_id"` + BlockCreatingTime int `toml:"block_creating_seconds"` + RpcUrl string `toml:"rpc_url"` + StableBlock uint64 `toml:"stable_block"` + RelayerContractAddress string `toml:"relayer_contract_address"` + HeaderStoreContractAddress string `toml:"header_store_contract_address"` + RouterContractAddress string `toml:"router_contract_address"` +} diff --git a/utils/aes.go b/utils/aes.go new file mode 100644 index 00000000..ab53416d --- /dev/null +++ b/utils/aes.go @@ -0,0 +1,94 @@ +package utils + +import ( + "bytes" + "crypto/aes" + "crypto/cipher" + "encoding/base64" + "github.com/denisbrodbeck/machineid" + log "github.com/sirupsen/logrus" + "runtime" +) + +var ( + aesKey = func() []byte { + id, err := machineid.ProtectedID("map_rly") + if err != nil { + log.Fatal(" machine id unknown error") + } + var keyLen int + if len(id) < 32 { + keyLen = 16 + } else { + keyLen = 32 + } + ret := make([]byte, keyLen) + for i := 0; i < keyLen; i++ { + ret[i] = id[i] + } + return ret + }() + aesIv = []byte("zxqzxqzxqzxqzxqz") +) + +func AesCbcEncrypt(plainText []byte) string { + if len(aesKey) != 16 && len(aesKey) != 24 && len(aesKey) != 32 { + return "" + } + block, err := aes.NewCipher(aesKey) + if err != nil { + return "" + } + paddingText := pkCS5Padding(plainText, block.BlockSize()) + + blockMode := cipher.NewCBCEncrypter(block, aesIv) + cipherText := make([]byte, len(paddingText)) + blockMode.CryptBlocks(cipherText, paddingText) + return base64.StdEncoding.EncodeToString(cipherText) +} + +func AesCbcDecrypt(b64Str string) []byte { + if len(aesKey) != 16 && len(aesKey) != 24 && len(aesKey) != 32 { + return nil + } + block, err := aes.NewCipher(aesKey) + if err != nil { + return nil + } + cipherText, err := base64.StdEncoding.DecodeString(b64Str) + if err != nil { + log.Fatal("AesCbcDecrypt error ", err) + } + defer func() { + if err := recover(); err != nil { + switch err.(type) { + case runtime.Error: + log.Println("runtime err:", err, "Check that the aesKey or text is correct") + default: + log.Println("error:", err) + } + } + }() + + blockMode := cipher.NewCBCDecrypter(block, aesIv) + paddingText := make([]byte, len(cipherText)) + blockMode.CryptBlocks(paddingText, cipherText) + + plainText := pkCS5UnPadding(paddingText) + + return plainText +} +func pkCS5Padding(plainText []byte, blockSize int) []byte { + padding := blockSize - (len(plainText) % blockSize) + padText := bytes.Repeat([]byte{byte(padding)}, padding) + newText := append(plainText, padText...) + return newText +} +func pkCS5UnPadding(plainText []byte) []byte { + length := len(plainText) + number := int(plainText[length-1]) + if number > length { + return nil + } + return plainText[:length-number] +} diff --git a/utils/http.go b/utils/http.go new file mode 100644 index 00000000..d31799ab --- /dev/null +++ b/utils/http.go @@ -0,0 +1,25 @@ +package utils + +import ( + "bytes" + "io/ioutil" + "net/http" +) + +func RpcToolFromRequestByte2ResponseByte(url *string, requestByte *[]byte) *[]byte { + requestBodyBytes := bytes.NewBuffer(*requestByte) + resp, err := http.Post(*url, "application/json", requestBodyBytes) + var nilResp, body []byte + if err != nil { + return &nilResp + } + body, err = ioutil.ReadAll(resp.Body) + if err != nil { + return &nilResp + } + err = resp.Body.Close() + if err != nil { + return &nilResp + } + return &body +} diff --git a/utils/leveldb.go b/utils/leveldb.go new file mode 100644 index 00000000..255bd950 --- /dev/null +++ b/utils/leveldb.go @@ -0,0 +1,21 @@ +package utils + +import ( + log "github.com/sirupsen/logrus" + "github.com/syndtr/goleveldb/leveldb" +) + +func Get(db *leveldb.DB, key string) string { + value, err := db.Get([]byte(key), nil) + if err != nil { + return "" + } + return string(value) +} + +func Put(db *leveldb.DB, key, value string) { + err := db.Put([]byte(key), []byte(value), nil) + if err != nil { + log.Warnln(err) + } +} diff --git a/utils/utils.go b/utils/utils.go new file mode 100644 index 00000000..8e46fcc5 --- /dev/null +++ b/utils/utils.go @@ -0,0 +1,44 @@ +package utils + +import ( + "fmt" + "github.com/ethereum/go-ethereum/params" + log "github.com/sirupsen/logrus" + "math/big" +) + +func ReadString() string { + var input string + _, err := fmt.Scanln(&input) + if err != nil { + log.Fatal(err) + } + return input +} + +func WeiToEther(wei *big.Int) *big.Float { + return new(big.Float).Quo(new(big.Float).SetInt(wei), big.NewFloat(params.Ether)) +} +func EthToWei(Value *big.Int) *big.Int { + baseUnit := new(big.Int).Exp(big.NewInt(10), big.NewInt(18), nil) + value := new(big.Int).Mul(Value, baseUnit) + return value +} +func ByteArray2Byte32Array(input *[]byte) *[][32]byte { + var output = make([][32]byte, 0) + var cur = 0 + var byteLen = len(*input) + for { + if cur+32 >= byteLen { + break + } + curByte := [32]byte{} + copy(curByte[:], (*input)[cur:cur+32]) + output = append(output, curByte) + cur += 32 + } + curByte := [32]byte{} + copy(curByte[:], (*input)[cur:]) + output = append(output, curByte) + return &output +}